Ask for app restart confirmation

This commit is contained in:
Johannes Zellner
2024-11-08 18:10:46 +01:00
parent 9f80578bab
commit fcccccaaae
3 changed files with 30 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
<template>
<MainLayout>
<template #dialogs>
<InputDialog ref="inputDialog" />
</template>
<template #header>
<TopBar class="navbar">
@@ -26,7 +27,7 @@
<script>
import { Button, TopBar, MainLayout } from 'pankow';
import { Button, InputDialog, TopBar, MainLayout } from 'pankow';
import LogsModel from '../models/LogsModel.js';
import AppModel from '../models/AppModel.js';
@@ -37,6 +38,7 @@ export default {
name: 'LogsViewer',
components: {
Button,
InputDialog,
MainLayout,
TopBar
},
@@ -66,6 +68,15 @@ export default {
async onRestartApp() {
if (this.type !== 'app') return;
const confirmed = await this.$refs.inputDialog.confirm({
message: this.$t('filemanager.toolbar.restartApp') + '?',
confirmStyle: 'danger',
confirmLabel: this.$t('main.dialog.yes'),
rejectLabel: this.$t('main.dialog.no')
});
if (!confirmed) return;
this.busyRestart = true;
await this.appModel.restart();