Startup dialog on first run
This commit is contained in:
@@ -9,6 +9,8 @@ import { useFeedbackStore } from './stores/feedback.store';
|
|||||||
import companyFooter from './components/navigation/companyFooter.vue';
|
import companyFooter from './components/navigation/companyFooter.vue';
|
||||||
import urlBar from './components/navigation/urlBar.vue';
|
import urlBar from './components/navigation/urlBar.vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
import actionDialog from './components/basics/actionDialog.vue';
|
||||||
|
import CircularProgressIndeterminate from './components/basics/circularProgressIndeterminate.vue';
|
||||||
|
|
||||||
const preferencesStore = usePreferencesStore()
|
const preferencesStore = usePreferencesStore()
|
||||||
const feedbackStore = useFeedbackStore()
|
const feedbackStore = useFeedbackStore()
|
||||||
@@ -18,6 +20,12 @@ const router = useRouter()
|
|||||||
theme.global.name.value = preferencesStore.theme
|
theme.global.name.value = preferencesStore.theme
|
||||||
|
|
||||||
|
|
||||||
|
// First startup
|
||||||
|
if (preferencesStore.firstStartup) {
|
||||||
|
preferencesStore.firstStartupRoutine()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Global watcher
|
// Global watcher
|
||||||
watch(() => preferencesStore.language, () => {
|
watch(() => preferencesStore.language, () => {
|
||||||
i18n.global.locale = preferencesStore.language
|
i18n.global.locale = preferencesStore.language
|
||||||
@@ -84,4 +92,23 @@ watch(() => feedbackStore.notFound, () => {
|
|||||||
<company-footer />
|
<company-footer />
|
||||||
</v-main>
|
</v-main>
|
||||||
</v-app>
|
</v-app>
|
||||||
|
|
||||||
|
<action-dialog
|
||||||
|
v-model="preferencesStore.firstStartup"
|
||||||
|
:title="$t('misc.firstStartup.title')"
|
||||||
|
persistent
|
||||||
|
max-width="600"
|
||||||
|
>
|
||||||
|
<v-row>
|
||||||
|
<v-col>
|
||||||
|
{{ $t('misc.firstStartup.description') }}
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
|
||||||
|
<v-row>
|
||||||
|
<v-col class="text-center pa-8">
|
||||||
|
<circular-progress-indeterminate />
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</action-dialog>
|
||||||
</template>
|
</template>
|
||||||
@@ -207,6 +207,10 @@
|
|||||||
},
|
},
|
||||||
"file": "Datei | Dateien",
|
"file": "Datei | Dateien",
|
||||||
"folder": "Ordner | Ordner",
|
"folder": "Ordner | Ordner",
|
||||||
"uploadFile": "Datei hochladen"
|
"uploadFile": "Datei hochladen",
|
||||||
|
"firstStartup": {
|
||||||
|
"title": "Ersteinrichtung",
|
||||||
|
"description": "Die Datenbank wird eingerichtet. Dies kann 1-2 Minuten dauern. Bitte warten..."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,6 +207,10 @@
|
|||||||
},
|
},
|
||||||
"file": "File | Files",
|
"file": "File | Files",
|
||||||
"folder": "folder | folders",
|
"folder": "folder | folders",
|
||||||
"uploadFile": "Upload file"
|
"uploadFile": "Upload file",
|
||||||
|
"firstStartup": {
|
||||||
|
"title": "First startup",
|
||||||
|
"description": "Creating database. This could take 1-2 minutes. Please wait..."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,11 @@ export const usePreferencesStore = defineStore('preferencesStore', {
|
|||||||
/** Show the "Delete Exercise progress?" confirm dialog */
|
/** Show the "Delete Exercise progress?" confirm dialog */
|
||||||
showDeleteExerciseDialog: ref(false),
|
showDeleteExerciseDialog: ref(false),
|
||||||
|
|
||||||
staticFiles: ref([])
|
/** List of files on the server */
|
||||||
|
staticFiles: ref([]),
|
||||||
|
|
||||||
|
/** Marks the first run of the app */
|
||||||
|
firstStartup: useLocalStorage<Boolean>("hackmycart/preferencesStore/firstStartup", true)
|
||||||
}),
|
}),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
@@ -102,6 +106,13 @@ export const usePreferencesStore = defineStore('preferencesStore', {
|
|||||||
this.staticFiles = res.data
|
this.staticFiles = res.data
|
||||||
this.fetchInProgress = false
|
this.fetchInProgress = false
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
async firstStartupRoutine() {
|
||||||
|
await this.resetDb()
|
||||||
|
await this.resetExerciseProg()
|
||||||
|
|
||||||
|
this.firstStartup = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user