From 7900ad5e09e522a7d8f07c1e71ecd0fc316f718a Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Mon, 17 Jun 2024 18:35:53 +0200 Subject: [PATCH] submit advanced --- components/ConfigAdvanced.vue | 6 +++--- lang/de-DE.js | 2 ++ lang/en-US.js | 2 ++ lang/pt-BR.js | 2 ++ lang/ru-RU.js | 2 ++ stores/config.ts | 13 +++++++++++++ 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/components/ConfigAdvanced.vue b/components/ConfigAdvanced.vue index cc87f33a..6d5679ea 100644 --- a/components/ConfigAdvanced.vue +++ b/components/ConfigAdvanced.vue @@ -65,11 +65,11 @@ function setTitle(input: string): string { } async function onSubmitAdvanced() { - const update = await configStore.setPlayoutConfig(configStore.playout) + const update = await configStore.setAdvancedConfig() configStore.onetimeInfo = true if (update.status === 200) { - indexStore.msgAlert('success', t('config.updatePlayoutSuccess'), 2) + indexStore.msgAlert('success', t('advanced.updateSuccess'), 2) const channel = configStore.configChannel[configStore.configID].id @@ -83,7 +83,7 @@ async function onSubmitAdvanced() { } }) } else { - indexStore.msgAlert('error', t('config.updatePlayoutFailed'), 2) + indexStore.msgAlert('error', t('advanced.updateFailed'), 2) } } diff --git a/lang/de-DE.js b/lang/de-DE.js index 8ddb117f..8f28ee28 100644 --- a/lang/de-DE.js +++ b/lang/de-DE.js @@ -143,6 +143,8 @@ export default { encoder: 'Encoder', filter: 'Filter', ingest: 'Ingest', + updateSuccess: 'Update advanced config success!', + updateFailed: 'Update advanced config failed!', }, config: { channel: 'Kanal', diff --git a/lang/en-US.js b/lang/en-US.js index 7a2200a6..14f1df2c 100644 --- a/lang/en-US.js +++ b/lang/en-US.js @@ -143,6 +143,8 @@ export default { encoder: 'Encoder', filter: 'Filter', ingest: 'Ingest', + updateSuccess: 'Update advanced config success!', + updateFailed: 'Update advanced config failed!', }, config: { channel: 'Channel', diff --git a/lang/pt-BR.js b/lang/pt-BR.js index 75802157..c1b58f90 100644 --- a/lang/pt-BR.js +++ b/lang/pt-BR.js @@ -143,6 +143,8 @@ export default { encoder: 'Encoder', filter: 'Filter', ingest: 'Ingest', + updateSuccess: 'Update advanced config success!', + updateFailed: 'Update advanced config failed!', }, config: { channel: 'Canal', diff --git a/lang/ru-RU.js b/lang/ru-RU.js index 3c20743b..1eaa4052 100644 --- a/lang/ru-RU.js +++ b/lang/ru-RU.js @@ -143,6 +143,8 @@ export default { encoder: 'Encoder', filter: 'Filter', ingest: 'Ingest', + updateSuccess: 'Update advanced config success!', + updateFailed: 'Update advanced config failed!', }, config: { channel: 'Канал', diff --git a/stores/config.ts b/stores/config.ts index 2589bc50..2fe175b3 100644 --- a/stores/config.ts +++ b/stores/config.ts @@ -187,6 +187,19 @@ export const useConfig = defineStore('config', { return update }, + async setAdvancedConfig() { + const authStore = useAuth() + const channel = this.configChannel[this.configID].id + + const update = await fetch(`/api/playout/advanced/${channel}`, { + method: 'PUT', + headers: { ...this.contentType, ...authStore.authHeader }, + body: JSON.stringify(this.advanced), + }) + + return update + }, + async getUserConfig() { const authStore = useAuth()