restart modal for config save
This commit is contained in:
parent
b5aa06a504
commit
2f3234221a
@ -64,22 +64,71 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
id="restartModal"
|
||||||
|
ref="restartModal"
|
||||||
|
class="modal"
|
||||||
|
tabindex="-1"
|
||||||
|
aria-labelledby="restartModalLabel"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h1 class="modal-title fs-5" id="restartModalLabel">Restart Playout</h1>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Cancel"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">Restart ffplayout to apply changes?</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">No</button>
|
||||||
|
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" @click="restart()">
|
||||||
|
Yes
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useAuth } from '~/stores/auth'
|
||||||
import { useConfig } from '~/stores/config'
|
import { useConfig } from '~/stores/config'
|
||||||
import { useIndex } from '~/stores/index'
|
import { useIndex } from '~/stores/index'
|
||||||
|
|
||||||
|
const { $bootstrap } = useNuxtApp()
|
||||||
|
|
||||||
|
const authStore = useAuth()
|
||||||
const configStore = useConfig()
|
const configStore = useConfig()
|
||||||
const indexStore = useIndex()
|
const indexStore = useIndex()
|
||||||
|
|
||||||
|
const contentType = { 'content-type': 'application/json;charset=UTF-8' }
|
||||||
|
|
||||||
|
const restartModal = ref()
|
||||||
|
|
||||||
async function onSubmitPlayout() {
|
async function onSubmitPlayout() {
|
||||||
const update = await configStore.setPlayoutConfig(configStore.configPlayout)
|
const update = await configStore.setPlayoutConfig(configStore.configPlayout)
|
||||||
|
|
||||||
if (update.status === 200) {
|
if (update.status === 200) {
|
||||||
indexStore.alertVariant = 'alert-success'
|
indexStore.alertVariant = 'alert-success'
|
||||||
indexStore.alertMsg = 'Update playout config success!'
|
indexStore.alertMsg = 'Update playout config success!'
|
||||||
|
|
||||||
|
const channel = configStore.configGui[configStore.configID].id
|
||||||
|
|
||||||
|
await $fetch(`/api/control/${channel}/process/`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { ...contentType, ...authStore.authHeader },
|
||||||
|
body: JSON.stringify({ command: 'status' }),
|
||||||
|
}).then((response: any) => {
|
||||||
|
if (response === 'active') {
|
||||||
|
console.log('---restart modal')
|
||||||
|
// @ts-ignore
|
||||||
|
const modal = $bootstrap.Modal.getOrCreateInstance(restartModal.value)
|
||||||
|
|
||||||
|
modal.show()
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
indexStore.alertVariant = 'alert-danger'
|
indexStore.alertVariant = 'alert-danger'
|
||||||
indexStore.alertMsg = 'Update playout config failed!'
|
indexStore.alertMsg = 'Update playout config failed!'
|
||||||
@ -91,4 +140,14 @@ async function onSubmitPlayout() {
|
|||||||
indexStore.showAlert = false
|
indexStore.showAlert = false
|
||||||
}, 2000)
|
}, 2000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function restart() {
|
||||||
|
const channel = configStore.configGui[configStore.configID].id
|
||||||
|
|
||||||
|
await $fetch(`/api/control/${channel}/process/`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { ...contentType, ...authStore.authHeader },
|
||||||
|
body: JSON.stringify({ command: 'restart' }),
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ffplayout-frontend",
|
"name": "ffplayout-frontend",
|
||||||
"version": "0.3.6",
|
"version": "0.4.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ffplayout-frontend",
|
"name": "ffplayout-frontend",
|
||||||
"version": "0.3.6",
|
"version": "0.4.0",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/types": "^2.17.1",
|
"@nuxt/types": "^2.17.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ffplayout-frontend",
|
"name": "ffplayout-frontend",
|
||||||
"version": "0.3.6",
|
"version": "0.4.0",
|
||||||
"description": "Web GUI for ffplayout",
|
"description": "Web GUI for ffplayout",
|
||||||
"author": "Jonathan Baecker",
|
"author": "Jonathan Baecker",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
@ -236,23 +236,6 @@ useHead({
|
|||||||
title: 'Messages | ffplayout'
|
title: 'Messages | ffplayout'
|
||||||
})
|
})
|
||||||
|
|
||||||
interface Preset {
|
|
||||||
id: number
|
|
||||||
name: string
|
|
||||||
text: string
|
|
||||||
x: string
|
|
||||||
y: string
|
|
||||||
fontSize: number
|
|
||||||
fontSpacing: number
|
|
||||||
fontColor: string
|
|
||||||
fontAlpha: number
|
|
||||||
showBox: boolean
|
|
||||||
boxColor: string
|
|
||||||
boxAlpha: number
|
|
||||||
border: number
|
|
||||||
overallAlpha: number
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PresetName {
|
interface PresetName {
|
||||||
name: string
|
name: string
|
||||||
value: number
|
value: number
|
||||||
|
Loading…
x
Reference in New Issue
Block a user