cleanup unused fields, update packages
This commit is contained in:
parent
f9edcc9a74
commit
e8532ba8d0
@ -5,7 +5,7 @@
|
||||
<button class="btn btn-sm btn-primary" @click="addChannel()">{{ $t('config.addChannel') }}</button>
|
||||
</div>
|
||||
<form
|
||||
v-if="configStore.configGui && configStore.configGui[configStore.configID]"
|
||||
v-if="configStore.configChannel && configStore.configChannel[configStore.configID]"
|
||||
class="w-full"
|
||||
@submit.prevent="onSubmitGui"
|
||||
>
|
||||
@ -14,7 +14,7 @@
|
||||
<span class="label-text">{{ $t('config.name') }}</span>
|
||||
</div>
|
||||
<input
|
||||
v-model="configStore.configGui[configStore.configID].name"
|
||||
v-model="configStore.configChannel[configStore.configID].name"
|
||||
type="text"
|
||||
placeholder="Type here"
|
||||
class="input input-bordered w-full"
|
||||
@ -26,18 +26,7 @@
|
||||
<span class="label-text">{{ $t('config.previewUrl') }}</span>
|
||||
</div>
|
||||
<input
|
||||
v-model="configStore.configGui[configStore.configID].preview_url"
|
||||
type="text"
|
||||
class="input input-bordered w-full"
|
||||
/>
|
||||
</label>
|
||||
|
||||
<label class="form-control w-full mt-5">
|
||||
<div class="label">
|
||||
<span class="label-text">{{ $t('config.configPath') }}</span>
|
||||
</div>
|
||||
<input
|
||||
v-model="configStore.configGui[configStore.configID].config_path"
|
||||
v-model="configStore.configChannel[configStore.configID].preview_url"
|
||||
type="text"
|
||||
class="input input-bordered w-full"
|
||||
/>
|
||||
@ -48,28 +37,16 @@
|
||||
<span class="label-text">{{ $t('config.extensions') }}</span>
|
||||
</div>
|
||||
<input
|
||||
v-model="configStore.configGui[configStore.configID].extra_extensions"
|
||||
v-model="configStore.configChannel[configStore.configID].extra_extensions"
|
||||
type="text"
|
||||
class="input input-bordered w-full"
|
||||
/>
|
||||
</label>
|
||||
|
||||
<label class="form-control w-full mt-5">
|
||||
<div class="label">
|
||||
<span class="label-text">{{ $t('config.service') }}</span>
|
||||
</div>
|
||||
<input
|
||||
v-model="configStore.configGui[configStore.configID].service"
|
||||
type="text"
|
||||
class="input input-bordered w-full !bg-base-100"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
|
||||
<div class="join my-4">
|
||||
<button class="join-item btn btn-primary" type="submit">{{ $t('config.save') }}</button>
|
||||
<button
|
||||
v-if="configStore.configGui.length > 1 && configStore.configGui[configStore.configID].id > 1"
|
||||
v-if="configStore.configChannel.length > 1 && configStore.configChannel[configStore.configID].id > 1"
|
||||
class="join-item btn btn-primary"
|
||||
@click="deleteChannel()"
|
||||
>
|
||||
@ -89,27 +66,22 @@ const configStore = useConfig()
|
||||
const indexStore = useIndex()
|
||||
|
||||
async function addChannel() {
|
||||
const channels = $_.cloneDeep(configStore.configGui)
|
||||
const newChannel = $_.cloneDeep(configStore.configGui[configStore.configGui.length - 1])
|
||||
|
||||
const playoutConfigPath = newChannel.config_path.match(/.*\//)
|
||||
const confName = `channel${String(channels.length + 1).padStart(3, '0')}`
|
||||
const channels = $_.cloneDeep(configStore.configChannel)
|
||||
const newChannel = $_.cloneDeep(configStore.configChannel[configStore.configChannel.length - 1])
|
||||
|
||||
newChannel.id = channels.length + 1
|
||||
newChannel.name = `Channel ${Math.random().toString(36).substring(7)}`
|
||||
newChannel.config_path = `${playoutConfigPath}${confName}.toml`
|
||||
newChannel.service = `ffplayout@${confName}.service`
|
||||
|
||||
channels.push(newChannel)
|
||||
configStore.configGui = channels
|
||||
configStore.configID = configStore.configGui.length - 1
|
||||
configStore.configChannel = channels
|
||||
configStore.configID = configStore.configChannel.length - 1
|
||||
}
|
||||
|
||||
async function onSubmitGui() {
|
||||
/*
|
||||
Save GUI settings.
|
||||
*/
|
||||
const update = await configStore.setGuiConfig(configStore.configGui[configStore.configID])
|
||||
const update = await configStore.setGuiConfig(configStore.configChannel[configStore.configID])
|
||||
|
||||
if (update.status) {
|
||||
indexStore.msgAlert('success', t('config.updateChannelSuccess'), 2)
|
||||
@ -119,7 +91,7 @@ async function onSubmitGui() {
|
||||
}
|
||||
|
||||
async function deleteChannel() {
|
||||
const config = $_.cloneDeep(configStore.configGui)
|
||||
const config = $_.cloneDeep(configStore.configChannel)
|
||||
const id = config[configStore.configID].id
|
||||
|
||||
if (id === 1) {
|
||||
@ -133,8 +105,8 @@ async function deleteChannel() {
|
||||
})
|
||||
|
||||
config.splice(configStore.configID, 1)
|
||||
configStore.configGui = config
|
||||
configStore.configID = configStore.configGui.length - 1
|
||||
configStore.configChannel = config
|
||||
configStore.configID = configStore.configChannel.length - 1
|
||||
await configStore.getPlayoutConfig()
|
||||
|
||||
if (response.status === 200) {
|
@ -170,7 +170,7 @@ async function onSubmitPlayout() {
|
||||
if (update.status === 200) {
|
||||
indexStore.msgAlert('success', t('config.updatePlayoutSuccess'), 2)
|
||||
|
||||
const channel = configStore.configGui[configStore.configID].id
|
||||
const channel = configStore.configChannel[configStore.configID].id
|
||||
|
||||
await $fetch(`/api/control/${channel}/process/`, {
|
||||
method: 'POST',
|
||||
@ -188,7 +188,7 @@ async function onSubmitPlayout() {
|
||||
|
||||
async function restart(res: boolean) {
|
||||
if (res) {
|
||||
const channel = configStore.configGui[configStore.configID].id
|
||||
const channel = configStore.configChannel[configStore.configID].id
|
||||
|
||||
await $fetch(`/api/control/${channel}/process/`, {
|
||||
method: 'POST',
|
||||
|
@ -22,15 +22,15 @@
|
||||
</span>
|
||||
</NuxtLink>
|
||||
</li>
|
||||
<li v-if="configStore.configGui.length > 1">
|
||||
<li v-if="configStore.configChannel.length > 1">
|
||||
<details tabindex="0" @focusout="closeDropdown">
|
||||
<summary>
|
||||
<div class="h-[19px] text-base">
|
||||
<span> {{ configStore.configGui[configStore.configID].name }} </span>
|
||||
<span> {{ configStore.configChannel[configStore.configID].name }} </span>
|
||||
</div>
|
||||
</summary>
|
||||
<ul class="p-2">
|
||||
<li v-for="(channel, index) in configStore.configGui" :key="index">
|
||||
<li v-for="(channel, index) in configStore.configChannel" :key="index">
|
||||
<span>
|
||||
<a class="dropdown-item" @click="selectChannel(index)">{{ channel.name }}</a>
|
||||
</span>
|
||||
@ -59,15 +59,15 @@
|
||||
</span>
|
||||
</NuxtLink>
|
||||
</li>
|
||||
<li v-if="configStore.configGui.length > 1">
|
||||
<li v-if="configStore.configChannel.length > 1">
|
||||
<details tabindex="0" @focusout="closeDropdown">
|
||||
<summary>
|
||||
<div class="h-[19px] text-base">
|
||||
<span> {{ configStore.configGui[configStore.configID].name }} </span>
|
||||
<span> {{ configStore.configChannel[configStore.configID].name }} </span>
|
||||
</div>
|
||||
</summary>
|
||||
<ul class="p-2 bg-base-100 rounded-md !mt-1 w-36" tabindex="0">
|
||||
<li v-for="(channel, index) in configStore.configGui" :key="index">
|
||||
<li v-for="(channel, index) in configStore.configChannel" :key="index">
|
||||
<a class="dropdown-item" @click="selectChannel(index)">
|
||||
{{ channel.name }}
|
||||
</a>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<div class="w-full aspect-video">
|
||||
<video v-if="streamExtension === 'flv'" ref="httpStreamFlv" controls />
|
||||
<VideoPlayer
|
||||
v-else-if="configStore.configGui[configStore.configID]"
|
||||
v-else-if="configStore.configChannel[configStore.configID]"
|
||||
:key="configStore.configID"
|
||||
class="live-player"
|
||||
reference="httpStream"
|
||||
@ -19,7 +19,7 @@
|
||||
sources: [
|
||||
{
|
||||
type: 'application/x-mpegURL',
|
||||
src: configStore.configGui[configStore.configID].preview_url,
|
||||
src: configStore.configChannel[configStore.configID].preview_url,
|
||||
},
|
||||
],
|
||||
}"
|
||||
@ -180,12 +180,12 @@ playlistStore.currentClip = t('control.noClip')
|
||||
const timeStr = ref('00:00:00')
|
||||
const timer = ref()
|
||||
const errorCounter = ref(0)
|
||||
const streamExtension = ref(configStore.configGui[configStore.configID].preview_url.split('.').pop())
|
||||
const streamExtension = ref(configStore.configChannel[configStore.configID].preview_url.split('.').pop())
|
||||
const httpStreamFlv = ref(null)
|
||||
const httpFlvSource = ref({
|
||||
type: 'flv',
|
||||
isLive: true,
|
||||
url: configStore.configGui[configStore.configID].preview_url,
|
||||
url: configStore.configChannel[configStore.configID].preview_url,
|
||||
})
|
||||
const mpegtsOptions = ref({
|
||||
lazyLoadMaxDuration: 3 * 60,
|
||||
@ -193,7 +193,7 @@ const mpegtsOptions = ref({
|
||||
})
|
||||
|
||||
const streamUrl = ref(
|
||||
`/data/event/${configStore.configGui[configStore.configID].id}?endpoint=playout&uuid=${authStore.uuid}`
|
||||
`/data/event/${configStore.configChannel[configStore.configID].id}?endpoint=playout&uuid=${authStore.uuid}`
|
||||
)
|
||||
|
||||
// 'http://127.0.0.1:8787/data/event/1?endpoint=playout&uuid=f2f8c29b-712a-48c5-8919-b535d3a05a3a'
|
||||
@ -245,7 +245,7 @@ watch([status, error], async () => {
|
||||
|
||||
if (errorCounter.value > 15) {
|
||||
await authStore.obtainUuid()
|
||||
streamUrl.value = `/data/event/${configStore.configGui[configStore.configID].id}?endpoint=playout&uuid=${
|
||||
streamUrl.value = `/data/event/${configStore.configChannel[configStore.configID].id}?endpoint=playout&uuid=${
|
||||
authStore.uuid
|
||||
}`
|
||||
errorCounter.value = 0
|
||||
@ -268,7 +268,7 @@ watch([data], () => {
|
||||
watch([configID], () => {
|
||||
resetStatus()
|
||||
|
||||
streamUrl.value = `/data/event/${configStore.configGui[configStore.configID].id}?endpoint=playout&uuid=${
|
||||
streamUrl.value = `/data/event/${configStore.configChannel[configStore.configID].id}?endpoint=playout&uuid=${
|
||||
authStore.uuid
|
||||
}`
|
||||
|
||||
@ -311,7 +311,7 @@ async function controlProcess(state: string) {
|
||||
/*
|
||||
Control playout systemd service (start, stop, restart)
|
||||
*/
|
||||
const channel = configStore.configGui[configStore.configID].id
|
||||
const channel = configStore.configChannel[configStore.configID].id
|
||||
|
||||
await $fetch(`/api/control/${channel}/process/`, {
|
||||
method: 'POST',
|
||||
@ -327,7 +327,7 @@ async function controlPlayout(state: string) {
|
||||
- jump to last clip
|
||||
- reset playout state
|
||||
*/
|
||||
const channel = configStore.configGui[configStore.configID].id
|
||||
const channel = configStore.configChannel[configStore.configID].id
|
||||
|
||||
await $fetch(`/api/control/${channel}/playout/`, {
|
||||
method: 'POST',
|
||||
|
@ -402,7 +402,7 @@ async function generatePlaylist() {
|
||||
}
|
||||
}
|
||||
|
||||
await $fetch(`/api/playlist/${configStore.configGui[configStore.configID].id}/generate/${playlistStore.listDate}`, {
|
||||
await $fetch(`/api/playlist/${configStore.configChannel[configStore.configID].id}/generate/${playlistStore.listDate}`, {
|
||||
method: 'POST',
|
||||
headers: { ...configStore.contentType, ...authStore.authHeader },
|
||||
body,
|
||||
|
@ -96,7 +96,7 @@ const configStore = useConfig()
|
||||
const indexStore = useIndex()
|
||||
|
||||
const streamUrl = ref(
|
||||
`/data/event/${configStore.configGui[configStore.configID].id}?endpoint=system&uuid=${authStore.uuid}`
|
||||
`/data/event/${configStore.configChannel[configStore.configID].id}?endpoint=system&uuid=${authStore.uuid}`
|
||||
)
|
||||
|
||||
// 'http://127.0.0.1:8787/data/event/1?endpoint=system&uuid=f2f8c29b-712a-48c5-8919-b535d3a05a3a'
|
||||
@ -139,7 +139,7 @@ watch([status, error], async () => {
|
||||
|
||||
if (errorCounter.value > 15) {
|
||||
await authStore.obtainUuid()
|
||||
streamUrl.value = `/data/event/${configStore.configGui[configStore.configID].id}?endpoint=system&uuid=${
|
||||
streamUrl.value = `/data/event/${configStore.configChannel[configStore.configID].id}?endpoint=system&uuid=${
|
||||
authStore.uuid
|
||||
}`
|
||||
errorCounter.value = 0
|
||||
|
@ -144,9 +144,7 @@ export default {
|
||||
addChannel: 'Neuen Kanal hinzufügen',
|
||||
name: 'Name',
|
||||
previewUrl: 'Vorschau-URL',
|
||||
configPath: 'Konfigurationspfad',
|
||||
extensions: 'Zusätzliche Erweiterungen',
|
||||
service: 'Dienst',
|
||||
save: 'Speichern',
|
||||
delete: 'Löschen',
|
||||
updateChannelSuccess: 'Kanal-Konfiguration erfolgreich aktualisiert!',
|
||||
|
@ -144,9 +144,7 @@ export default {
|
||||
addChannel: 'Add new Channel',
|
||||
name: 'Name',
|
||||
previewUrl: 'Preview URL',
|
||||
configPath: 'Config Path',
|
||||
extensions: 'Extra Extensions',
|
||||
service: 'Service',
|
||||
save: 'Save',
|
||||
delete: 'Delete',
|
||||
updateChannelSuccess: 'Update channel config success!',
|
||||
|
@ -144,9 +144,7 @@ export default {
|
||||
addChannel: 'Adicionar novo Canal',
|
||||
name: 'Nome',
|
||||
previewUrl: 'URL de Visualização',
|
||||
configPath: 'Caminho de Configuração',
|
||||
extensions: 'Extensões Extras',
|
||||
service: 'Serviço',
|
||||
save: 'Salvar',
|
||||
delete: 'Deletar',
|
||||
updateChannelSuccess: 'Atualização da configuração do canal bem-sucedida!',
|
||||
|
@ -144,9 +144,7 @@ export default {
|
||||
addChannel: 'Сделать новый канал',
|
||||
name: 'Название канала',
|
||||
previewUrl: 'Предварительный просмотр эфира канала по URL',
|
||||
configPath: 'Путь к конфигурации',
|
||||
extensions: 'Дополнительные расширения',
|
||||
service: 'Сервис',
|
||||
save: 'Сохранить',
|
||||
delete: 'Удалить',
|
||||
updateChannelSuccess: 'Обновление конфигурации канала успешно!',
|
||||
|
4719
package-lock.json
generated
4719
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ffplayout-frontend",
|
||||
"version": "0.10.0",
|
||||
"version": "0.11.0",
|
||||
"description": "Web GUI for ffplayout",
|
||||
"author": "Jonathan Baecker",
|
||||
"private": true,
|
||||
@ -15,14 +15,14 @@
|
||||
"dependencies": {
|
||||
"@nuxtjs/color-mode": "^3.4.1",
|
||||
"@pinia/nuxt": "^0.5.1",
|
||||
"@vuepic/vue-datepicker": "^8.7.0",
|
||||
"@vueuse/nuxt": "^10.9.0",
|
||||
"@vuepic/vue-datepicker": "^8.8.0",
|
||||
"@vueuse/nuxt": "^10.10.1",
|
||||
"bootstrap-icons": "^1.11.3",
|
||||
"dayjs": "^1.11.11",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"lodash": "^4.17.21",
|
||||
"mpegts.js": "^1.7.3",
|
||||
"nuxt": "3.11.2",
|
||||
"nuxt": "3.12.1",
|
||||
"pinia": "^2.1.7",
|
||||
"sortablejs-vue3": "^1.2.11",
|
||||
"splitpanes": "^3.1.5",
|
||||
@ -32,14 +32,14 @@
|
||||
"@nuxt/eslint": "^0.3.13",
|
||||
"@nuxtjs/i18n": "^8.3.1",
|
||||
"@nuxtjs/tailwindcss": "^6.12.0",
|
||||
"@types/lodash": "^4.17.4",
|
||||
"@types/lodash": "^4.17.5",
|
||||
"@types/video.js": "^7.3.58",
|
||||
"daisyui": "^4.11.1",
|
||||
"daisyui": "^4.12.2",
|
||||
"postcss": "^8.4.38",
|
||||
"postcss-loader": "^8.1.1",
|
||||
"sass": "^1.77.2",
|
||||
"sass": "^1.77.5",
|
||||
"sass-loader": "^14.2.1",
|
||||
"vue": "^3.4.27",
|
||||
"vue-router": "^4.3.2"
|
||||
"vue-router": "^4.3.3"
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
</div>
|
||||
<div class="w-[calc(100%-70px)] mt-10 px-6">
|
||||
<div v-if="activeConf === 1" class="w-full flex justify-center">
|
||||
<ConfigGui />
|
||||
<ConfigChannel />
|
||||
</div>
|
||||
|
||||
<div v-else-if="activeConf === 2" class="w-full flex justify-center">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="absolute top-4 left-1">
|
||||
<EventStatus />
|
||||
</div>
|
||||
<SystemStats v-if="configStore.configGui.length > 0" />
|
||||
<SystemStats v-if="configStore.configChannel.length > 0" />
|
||||
<div class="flex flex-wrap justify-center gap-1 md:gap-0 md:join mt-5">
|
||||
<NuxtLink :to="localePath({ name: 'player' })" class="btn join-item btn-primary px-2">
|
||||
{{ $t('button.player') }}
|
||||
|
@ -68,7 +68,7 @@ async function getLog() {
|
||||
date = ''
|
||||
}
|
||||
|
||||
await fetch(`/api/log/${configStore.configGui[configStore.configID].id}?date=${date}`, {
|
||||
await fetch(`/api/log/${configStore.configChannel[configStore.configID].id}?date=${date}`, {
|
||||
method: 'GET',
|
||||
headers: authStore.authHeader,
|
||||
})
|
||||
|
@ -352,7 +352,7 @@ const xhr = ref(new XMLHttpRequest())
|
||||
|
||||
onMounted(async () => {
|
||||
let config_extensions = configStore.playout.storage.extensions
|
||||
let extra_extensions = configStore.configGui[configStore.configID].extra_extensions
|
||||
let extra_extensions = configStore.configChannel[configStore.configID].extra_extensions
|
||||
|
||||
if (typeof config_extensions === 'string') {
|
||||
config_extensions = config_extensions.split(',')
|
||||
@ -425,7 +425,7 @@ async function handleDrop(event: any, targetFolder: any, isParent: boolean | nul
|
||||
}
|
||||
|
||||
if (source !== target) {
|
||||
await fetch(`/api/file/${configStore.configGui[configStore.configID].id}/rename/`, {
|
||||
await fetch(`/api/file/${configStore.configChannel[configStore.configID].id}/rename/`, {
|
||||
method: 'POST',
|
||||
headers: { ...configStore.contentType, ...authStore.authHeader },
|
||||
body: JSON.stringify({ source, target }),
|
||||
@ -453,7 +453,7 @@ function setPreviewData(path: string) {
|
||||
}
|
||||
|
||||
previewName.value = fullPath.split('/').slice(-1)[0]
|
||||
previewUrl.value = encodeURIComponent(`/file/${configStore.configGui[configStore.configID].id}${fullPath}`).replace(
|
||||
previewUrl.value = encodeURIComponent(`/file/${configStore.configChannel[configStore.configID].id}${fullPath}`).replace(
|
||||
/%2F/g,
|
||||
'/'
|
||||
)
|
||||
@ -493,7 +493,7 @@ async function deleteFileOrFolder(del: boolean) {
|
||||
showDeleteModal.value = false
|
||||
|
||||
if (del) {
|
||||
await fetch(`/api/file/${configStore.configGui[configStore.configID].id}/remove/`, {
|
||||
await fetch(`/api/file/${configStore.configChannel[configStore.configID].id}/remove/`, {
|
||||
method: 'POST',
|
||||
headers: { ...configStore.contentType, ...authStore.authHeader },
|
||||
body: JSON.stringify({ source: deleteName.value }),
|
||||
@ -524,7 +524,7 @@ async function renameFile(ren: boolean) {
|
||||
showRenameModal.value = false
|
||||
|
||||
if (ren && renameOldName.value !== renameNewName.value) {
|
||||
await fetch(`/api/file/${configStore.configGui[configStore.configID].id}/rename/`, {
|
||||
await fetch(`/api/file/${configStore.configChannel[configStore.configID].id}/rename/`, {
|
||||
method: 'POST',
|
||||
headers: { ...configStore.contentType, ...authStore.authHeader },
|
||||
body: JSON.stringify({ source: renameOldName.value, target: renameNewName.value }),
|
||||
@ -563,7 +563,7 @@ async function createFolder(create: boolean) {
|
||||
return
|
||||
}
|
||||
|
||||
await $fetch(`/api/file/${configStore.configGui[configStore.configID].id}/create-folder/`, {
|
||||
await $fetch(`/api/file/${configStore.configChannel[configStore.configID].id}/create-folder/`, {
|
||||
method: 'POST',
|
||||
headers: { ...configStore.contentType, ...authStore.authHeader },
|
||||
body: JSON.stringify({ source: path }),
|
||||
@ -600,7 +600,7 @@ async function upload(file: any): Promise<null | undefined> {
|
||||
return new Promise((resolve) => {
|
||||
xhr.value.open(
|
||||
'PUT',
|
||||
`/api/file/${configStore.configGui[configStore.configID].id}/upload/?path=${encodeURIComponent(
|
||||
`/api/file/${configStore.configChannel[configStore.configID].id}/upload/?path=${encodeURIComponent(
|
||||
mediaStore.crumbs[mediaStore.crumbs.length - 1].path
|
||||
)}`
|
||||
)
|
||||
|
@ -266,7 +266,7 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
async function getPreset(index: number) {
|
||||
fetch(`/api/presets/${configStore.configGui[configStore.configID].id}`, {
|
||||
fetch(`/api/presets/${configStore.configChannel[configStore.configID].id}`, {
|
||||
method: 'GET',
|
||||
headers: authStore.authHeader,
|
||||
})
|
||||
@ -347,7 +347,7 @@ async function savePreset() {
|
||||
: form.value.boxColor + '@' + numberToHex(form.value.boxAlpha),
|
||||
boxborderw: form.value.border,
|
||||
alpha: form.value.overallAlpha,
|
||||
channel_id: configStore.configGui[configStore.configID].id,
|
||||
channel_id: configStore.configChannel[configStore.configID].id,
|
||||
}
|
||||
|
||||
const response = await fetch(`/api/presets/${form.value.id}`, {
|
||||
@ -386,7 +386,7 @@ async function createNewPreset(create: boolean) {
|
||||
: form.value.boxColor + '@' + numberToHex(form.value.boxAlpha),
|
||||
boxborderw: form.value.border.toString(),
|
||||
alpha: form.value.overallAlpha.toString(),
|
||||
channel_id: configStore.configGui[configStore.configID].id,
|
||||
channel_id: configStore.configChannel[configStore.configID].id,
|
||||
}
|
||||
|
||||
const response = await fetch('/api/presets/', {
|
||||
@ -433,7 +433,7 @@ async function submitMessage() {
|
||||
boxborderw: form.value.border.toString(),
|
||||
}
|
||||
|
||||
const response = await fetch(`/api/control/${configStore.configGui[configStore.configID].id}/text/`, {
|
||||
const response = await fetch(`/api/control/${configStore.configChannel[configStore.configID].id}/text/`, {
|
||||
method: 'POST',
|
||||
headers: { ...configStore.contentType, ...authStore.authHeader },
|
||||
body: JSON.stringify(obj),
|
||||
|
@ -305,7 +305,7 @@ function setPreviewData(path: string) {
|
||||
previewUrl.value = path
|
||||
} else {
|
||||
previewUrl.value = encodeURIComponent(
|
||||
`/file/${configStore.configGui[configStore.configID].id}${fullPath}`
|
||||
`/file/${configStore.configChannel[configStore.configID].id}${fullPath}`
|
||||
).replace(/%2F/g, '/')
|
||||
}
|
||||
|
||||
@ -435,7 +435,7 @@ async function importPlaylist(imp: boolean) {
|
||||
|
||||
playlistStore.isLoading = true
|
||||
await $fetch(
|
||||
`/api/file/${configStore.configGui[configStore.configID].id}/import/?file=${textFile.value[0].name}&date=${
|
||||
`/api/file/${configStore.configChannel[configStore.configID].id}/import/?file=${textFile.value[0].name}&date=${
|
||||
listDate.value
|
||||
}`,
|
||||
{
|
||||
@ -468,11 +468,11 @@ async function savePlaylist(save: boolean) {
|
||||
|
||||
const saveList = processPlaylist(listDate.value, $_.cloneDeep(playlistStore.playlist), true)
|
||||
|
||||
await $fetch(`/api/playlist/${configStore.configGui[configStore.configID].id}/`, {
|
||||
await $fetch(`/api/playlist/${configStore.configChannel[configStore.configID].id}/`, {
|
||||
method: 'POST',
|
||||
headers: { ...configStore.contentType, ...authStore.authHeader },
|
||||
body: JSON.stringify({
|
||||
channel: configStore.configGui[configStore.configID].name,
|
||||
channel: configStore.configChannel[configStore.configID].name,
|
||||
date: targetDate.value,
|
||||
program: saveList,
|
||||
}),
|
||||
@ -495,7 +495,7 @@ async function deletePlaylist(del: boolean) {
|
||||
showDeleteModal.value = false
|
||||
|
||||
if (del) {
|
||||
await $fetch(`/api/playlist/${configStore.configGui[configStore.configID].id}/${listDate.value}`, {
|
||||
await $fetch(`/api/playlist/${configStore.configChannel[configStore.configID].id}/${listDate.value}`, {
|
||||
method: 'DELETE',
|
||||
headers: { ...configStore.contentType, ...authStore.authHeader },
|
||||
}).then(() => {
|
||||
|
@ -6,8 +6,8 @@ export const useConfig = defineStore('config', {
|
||||
configID: 0,
|
||||
configCount: 0,
|
||||
contentType: { 'content-type': 'application/json;charset=UTF-8' },
|
||||
configGui: [] as GuiConfig[],
|
||||
configGuiRaw: [] as GuiConfig[],
|
||||
configChannel: [] as GuiConfig[],
|
||||
configChannelRaw: [] as GuiConfig[],
|
||||
playlistLength: 86400.0,
|
||||
playout: {} as any,
|
||||
currentUser: '',
|
||||
@ -48,8 +48,8 @@ export const useConfig = defineStore('config', {
|
||||
.then((response) => response.json())
|
||||
.then((objs) => {
|
||||
this.utcOffset = objs[0].utc_offset
|
||||
this.configGui = objs
|
||||
this.configGuiRaw = _.cloneDeep(objs)
|
||||
this.configChannel = objs
|
||||
this.configChannelRaw = _.cloneDeep(objs)
|
||||
this.configCount = objs.length
|
||||
})
|
||||
.catch((e) => {
|
||||
@ -61,14 +61,12 @@ export const useConfig = defineStore('config', {
|
||||
navigateTo('/')
|
||||
}
|
||||
|
||||
this.configGui = [
|
||||
this.configChannel = [
|
||||
{
|
||||
id: 1,
|
||||
config_path: '',
|
||||
extra_extensions: '',
|
||||
name: 'Channel 1',
|
||||
preview_url: '',
|
||||
service: '',
|
||||
uts_offset: 0,
|
||||
},
|
||||
]
|
||||
@ -82,7 +80,7 @@ export const useConfig = defineStore('config', {
|
||||
const stringObj = _.cloneDeep(obj)
|
||||
let response
|
||||
|
||||
if (this.configGuiRaw.some((e) => e.id === stringObj.id)) {
|
||||
if (this.configChannelRaw.some((e) => e.id === stringObj.id)) {
|
||||
response = await fetch(`/api/channel/${obj.id}`, {
|
||||
method: 'PATCH',
|
||||
headers: { ...this.contentType, ...authStore.authHeader },
|
||||
@ -98,7 +96,7 @@ export const useConfig = defineStore('config', {
|
||||
const json = await response.json()
|
||||
const guiConfigs = []
|
||||
|
||||
for (const obj of this.configGui) {
|
||||
for (const obj of this.configChannel) {
|
||||
if (obj.name === stringObj.name) {
|
||||
guiConfigs.push(json)
|
||||
} else {
|
||||
@ -106,8 +104,8 @@ export const useConfig = defineStore('config', {
|
||||
}
|
||||
}
|
||||
|
||||
this.configGui = guiConfigs
|
||||
this.configGuiRaw = _.cloneDeep(guiConfigs)
|
||||
this.configChannel = guiConfigs
|
||||
this.configChannelRaw = _.cloneDeep(guiConfigs)
|
||||
this.configCount = guiConfigs.length
|
||||
}
|
||||
|
||||
@ -121,7 +119,7 @@ export const useConfig = defineStore('config', {
|
||||
const { timeToSeconds } = stringFormatter()
|
||||
const authStore = useAuth()
|
||||
const indexStore = useIndex()
|
||||
const channel = this.configGui[this.configID].id
|
||||
const channel = this.configChannel[this.configID].id
|
||||
|
||||
await fetch(`/api/playout/config/${channel}`, {
|
||||
method: 'GET',
|
||||
@ -146,7 +144,7 @@ export const useConfig = defineStore('config', {
|
||||
async setPlayoutConfig(obj: any) {
|
||||
const { timeToSeconds } = stringFormatter()
|
||||
const authStore = useAuth()
|
||||
const channel = this.configGui[this.configID].id
|
||||
const channel = this.configChannel[this.configID].id
|
||||
|
||||
this.playlistLength = timeToSeconds(obj.playlist.length)
|
||||
this.playout.playlist.startInSec = timeToSeconds(obj.playlist.day_start)
|
||||
|
@ -23,7 +23,7 @@ export const useMedia = defineStore('media', {
|
||||
const authStore = useAuth()
|
||||
const configStore = useConfig()
|
||||
const indexStore = useIndex()
|
||||
const channel = configStore.configGui[configStore.configID].id
|
||||
const channel = configStore.configChannel[configStore.configID].id
|
||||
const crumbs: Crumb[] = []
|
||||
let root = '/'
|
||||
|
||||
|
@ -35,7 +35,7 @@ export const usePlaylist = defineStore('playlist', {
|
||||
const authStore = useAuth()
|
||||
const configStore = useConfig()
|
||||
const indexStore = useIndex()
|
||||
const channel = configStore.configGui[configStore.configID].id
|
||||
const channel = configStore.configChannel[configStore.configID].id
|
||||
|
||||
await $fetch<Playlist>(`/api/playlist/${channel}?date=${date}`, {
|
||||
method: 'GET',
|
||||
|
2
types/index.d.ts
vendored
2
types/index.d.ts
vendored
@ -23,11 +23,9 @@ declare global {
|
||||
|
||||
interface GuiConfig {
|
||||
id: number
|
||||
config_path: string
|
||||
extra_extensions: string | string[]
|
||||
name: string
|
||||
preview_url: string
|
||||
service: string
|
||||
uts_offset?: number
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user