File browser on admin page
This commit is contained in:
@@ -3,7 +3,7 @@ import { useLocalStorage } from "@vueuse/core";
|
||||
import { ThemeEnum } from "../data/enums/themeEnums";
|
||||
import { LanguageEnum } from "../data/enums/languageEnum";
|
||||
import { ref } from "vue";
|
||||
import { fetchServerState, resetDatabase, resetExerciseProgress } from "@/data/api/mainApi";
|
||||
import { fetchFileNames, fetchServerState, resetDatabase, resetExerciseProgress } from "@/data/api/mainApi";
|
||||
import { ServerStateEnum } from "@/data/enums/serverStateEnum";
|
||||
import { BannerStateEnum } from "@/data/enums/bannerStateEnum";
|
||||
import { useFeedbackStore } from "./feedback.store";
|
||||
@@ -26,7 +26,9 @@ export const usePreferencesStore = defineStore('preferencesStore', {
|
||||
showDeleteDbDialog: ref(false),
|
||||
|
||||
/** Show the "Delete Exercise progress?" confirm dialog */
|
||||
showDeleteExerciseDialog: ref(false)
|
||||
showDeleteExerciseDialog: ref(false),
|
||||
|
||||
staticFiles: ref([])
|
||||
}),
|
||||
|
||||
actions: {
|
||||
@@ -90,6 +92,16 @@ export const usePreferencesStore = defineStore('preferencesStore', {
|
||||
this.fetchInProgress = false
|
||||
this.showDeleteExerciseDialog = false
|
||||
})
|
||||
},
|
||||
|
||||
async getStaticFiles() {
|
||||
this.fetchInProgress = true
|
||||
|
||||
fetchFileNames()
|
||||
.then(res => {
|
||||
this.staticFiles = res.data
|
||||
this.fetchInProgress = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user