feat(backup): add scheduled database backups
This commit is contained in:
1 parent
cc518e8753
commit
f08a0b7f7f
26 files changed
+2491
-137
No files matched your search
@@ -826,8 +826,15 @@ function saveEditorSettings(settings: EditorSettings) {
|
||||
void api.saveEditorSettings(settings).catch(() => {});
|
||||
}
|
||||
|
||||
export interface SettingsNavigationRequest {
|
||||
id: number;
|
||||
tab: string;
|
||||
section?: string;
|
||||
}
|
||||
|
||||
export const useSettingsStore = defineStore("settings", () => {
|
||||
const settingsPageActive = ref(false);
|
||||
const settingsNavigationRequest = ref<SettingsNavigationRequest | null>(null);
|
||||
const activeModel = ref<{ configId: string; modelId: string } | null>(null);
|
||||
const isAiConfigLoaded = ref(false);
|
||||
const aiConfigs = ref<AiConfigItem[]>([]);
|
||||
@@ -837,6 +844,18 @@ export const useSettingsStore = defineStore("settings", () => {
|
||||
|
||||
const editorSettings = ref<EditorSettings>(normalizeEditorSettings({}));
|
||||
|
||||
function requestSettingsNavigation(tab: string, section?: string) {
|
||||
settingsNavigationRequest.value = {
|
||||
id: Date.now(),
|
||||
tab,
|
||||
section,
|
||||
};
|
||||
}
|
||||
|
||||
function clearSettingsNavigationRequest(id: number) {
|
||||
if (settingsNavigationRequest.value?.id === id) settingsNavigationRequest.value = null;
|
||||
}
|
||||
|
||||
async function initEditorSettings() {
|
||||
if (isEditorSettingsLoaded.value) return;
|
||||
const saved = await api.loadEditorSettings().catch(() => null);
|
||||
@@ -1132,6 +1151,9 @@ export const useSettingsStore = defineStore("settings", () => {
|
||||
|
||||
return {
|
||||
settingsPageActive,
|
||||
settingsNavigationRequest,
|
||||
requestSettingsNavigation,
|
||||
clearSettingsNavigationRequest,
|
||||
activeModel,
|
||||
isAiConfigLoaded,
|
||||
aiConfigs,
|
||||
|
||||
Reference in new issue
Block a user