diff --git a/app/components/broadcasting-info.ts b/app/components/broadcasting-info.ts new file mode 100644 index 0000000..85f2183 --- /dev/null +++ b/app/components/broadcasting-info.ts @@ -0,0 +1,8 @@ +import Component from '@glimmer/component'; +import { inject as service } from '@ember/service'; + +interface BroadcastingInfoArgs {} + +export default class BroadcastingInfo extends Component { + @service declare currentRadio: any; +} diff --git a/app/components/current-scheduled-show.hbs b/app/components/current-scheduled-show.hbs new file mode 100644 index 0000000..42b4254 --- /dev/null +++ b/app/components/current-scheduled-show.hbs @@ -0,0 +1,24 @@ +

Current Scheduled Show

+ + + Loading... + + +
+ Current show: + {{result.current_show}} +
+
+ The current show's playlist should be queued automatically, but if it's not working try this button. + +
+
+ + Something went wrong :( + +
diff --git a/app/components/current-scheduled-show.ts b/app/components/current-scheduled-show.ts new file mode 100644 index 0000000..1a17d3d --- /dev/null +++ b/app/components/current-scheduled-show.ts @@ -0,0 +1,37 @@ +import Component from '@glimmer/component'; +import { action } from '@ember/object'; +import { inject as service } from '@ember/service'; +import ENV from 'streampusher-frontend/config/environment'; + +interface CurrentScheduledShowArgs {} + +export default class CurrentScheduledShow extends Component { + @service declare session: any; + @service declare flashMessages: any; + + @action queueCurrentShowPlaylist() { + try { + fetch(`${ENV.API_HOST}/queue_current_show`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${this.session.data.authenticated.token}`, + }, + }).then((response) => { + if (response.status === 200) { + this.flashMessages.success('Queue current show playlist!'); + } else { + this.flashMessages.danger('Something went wrong!'); + } + }) + } catch(error) { + this.flashMessages.error('Error queueing current show playlist!'); + console.log('error queuing current show playlist'); + console.log(error); + } + } + + @action + fetchCurrentScheduledShow() { + } +} diff --git a/app/templates/authenticated/dashboard.hbs b/app/templates/authenticated/dashboard.hbs index 5db7a1c..b12d33c 100644 --- a/app/templates/authenticated/dashboard.hbs +++ b/app/templates/authenticated/dashboard.hbs @@ -1,7 +1,9 @@
under construction 90s! + +
diff --git a/app/templates/components/broadcasting-info.hbs b/app/templates/components/broadcasting-info.hbs new file mode 100644 index 0000000..1bc3c3e --- /dev/null +++ b/app/templates/components/broadcasting-info.hbs @@ -0,0 +1,8 @@ +Host: +
+  {{this.currentRadio.host}}
+
+Port: +
+  {{this.currentRadio.port}}
+