submit advanced

This commit is contained in:
jb-alvarado 2024-06-17 18:35:53 +02:00
parent 18c5b3c742
commit 7900ad5e09
6 changed files with 24 additions and 3 deletions

View File

@ -65,11 +65,11 @@ function setTitle(input: string): string {
} }
async function onSubmitAdvanced() { async function onSubmitAdvanced() {
const update = await configStore.setPlayoutConfig(configStore.playout) const update = await configStore.setAdvancedConfig()
configStore.onetimeInfo = true configStore.onetimeInfo = true
if (update.status === 200) { 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 const channel = configStore.configChannel[configStore.configID].id
@ -83,7 +83,7 @@ async function onSubmitAdvanced() {
} }
}) })
} else { } else {
indexStore.msgAlert('error', t('config.updatePlayoutFailed'), 2) indexStore.msgAlert('error', t('advanced.updateFailed'), 2)
} }
} }

View File

@ -143,6 +143,8 @@ export default {
encoder: 'Encoder', encoder: 'Encoder',
filter: 'Filter', filter: 'Filter',
ingest: 'Ingest', ingest: 'Ingest',
updateSuccess: 'Update advanced config success!',
updateFailed: 'Update advanced config failed!',
}, },
config: { config: {
channel: 'Kanal', channel: 'Kanal',

View File

@ -143,6 +143,8 @@ export default {
encoder: 'Encoder', encoder: 'Encoder',
filter: 'Filter', filter: 'Filter',
ingest: 'Ingest', ingest: 'Ingest',
updateSuccess: 'Update advanced config success!',
updateFailed: 'Update advanced config failed!',
}, },
config: { config: {
channel: 'Channel', channel: 'Channel',

View File

@ -143,6 +143,8 @@ export default {
encoder: 'Encoder', encoder: 'Encoder',
filter: 'Filter', filter: 'Filter',
ingest: 'Ingest', ingest: 'Ingest',
updateSuccess: 'Update advanced config success!',
updateFailed: 'Update advanced config failed!',
}, },
config: { config: {
channel: 'Canal', channel: 'Canal',

View File

@ -143,6 +143,8 @@ export default {
encoder: 'Encoder', encoder: 'Encoder',
filter: 'Filter', filter: 'Filter',
ingest: 'Ingest', ingest: 'Ingest',
updateSuccess: 'Update advanced config success!',
updateFailed: 'Update advanced config failed!',
}, },
config: { config: {
channel: 'Канал', channel: 'Канал',

View File

@ -187,6 +187,19 @@ export const useConfig = defineStore('config', {
return update 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() { async getUserConfig() {
const authStore = useAuth() const authStore = useAuth()