Add client side app postProcess() to fix postinstall message

This commit is contained in:
Johannes Zellner
2025-03-18 19:04:47 +01:00
parent f6f97e69eb
commit 7d07e34d6b
5 changed files with 116 additions and 65 deletions
+25 -14
View File
@@ -4,11 +4,12 @@ import { useI18n } from 'vue-i18n';
const i18n = useI18n();
const t = i18n.t;
import { ref, watch, onMounted, useTemplateRef } from 'vue';
import { ref, onMounted, useTemplateRef } from 'vue';
import { Icon, Button, Switch, Checkbox, FormGroup, TextInput, TableView, ButtonGroup, Dialog } from 'pankow';
import { prettyLongDate } from 'pankow/utils';
import { API_ORIGIN, SECRET_PLACEHOLDER } from '../../constants.js';
import { download } from '../../utils.js';
import SettingsItem from '../SettingsItem.vue';
import AppsModel from '../../models/AppsModel.js';
import BackupsModel from '../../models/BackupsModel.js';
@@ -52,10 +53,13 @@ const backups = ref([]);
const editDialog = useTemplateRef('editDialog');
const restoreDialog = useTemplateRef('restoreDialog');
watch(autoBackupsEnabled, async (newValue) => {
const [error] = await appsModel.configure(props.app.id, 'automatic_backup', { enable: newValue });
if (error) return console.error(error);
});
async function onChangeAutoBackups(value) {
const [error] = await appsModel.configure(props.app.id, 'automatic_backup', { enable: value });
if (error) {
autoBackupsEnabled.value = !value;
return console.error(error);
}
}
async function onCreate() {
createBusy.value = true;
@@ -253,15 +257,22 @@ onMounted(async () => {
<hr/>
<label>{{ $t('app.backups.import.title') }}</label>
<p>{{ $t('app.backups.import.description') }}</p>
<SettingsItem>
<FormGroup>
<label>{{ $t('app.backups.import.title') }}</label>
<div>{{ $t('app.backups.import.description') }}</div>
</FormGroup>
<div style="display: flex; align-items: center">
<Button @click="onImport()" :loading="importBusy" :disabled="importBusy || app.taskId || app.runState === 'stopped'" tooltip-enable="app.taskId" uib-tooltip="App is not running">{{ $t('app.backups.backups.importAction') }}</Button>
</div>
</SettingsItem>
<Button @click="onImport()" :loading="importBusy" :disabled="importBusy || app.taskId || app.runState === 'stopped'" tooltip-enable="app.taskId" uib-tooltip="App is not running">{{ $t('app.backups.backups.importAction') }}</Button>
<hr/>
<label>{{ $t('app.backups.auto.title') }}</label>
<p v-html="$t('app.backups.auto.description', { backupLink: '/#/backups' })"></p>
<Switch v-model="autoBackupsEnabled" :label="$t(autoBackupsEnabled ? 'app.backups.auto.enabled' : 'app.backups.auto.disabled')"/>
<SettingsItem>
<FormGroup>
<label>{{ $t('app.backups.auto.title') }}</label>
<div v-html="$t('app.backups.auto.description', { backupLink: '/#/backups' })"></div>
</FormGroup>
<Switch v-model="autoBackupsEnabled" @change="onChangeAutoBackups"/>
</SettingsItem>
</div>
</template>