License system implemented

This commit is contained in:
2024-11-25 18:55:28 +01:00
parent 1b0f48d374
commit 2e15d4a960
22 changed files with 313 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
import { fetchFileNames, fetchFolderNames, postFile } from "@/data/api/files.api";
import { FilesApiModel } from "@/data/models/files/filesApiModel";
import { defineStore } from "pinia";
import { ref } from "vue";
@@ -7,14 +8,17 @@ export const useFilesStore = defineStore('filesStore', {
/** Request to server sent, waiting for data response */
fetchInProgress: ref(false),
/** List of all folders on the server */
staticFolders: ref<Array<{name: string, nrOfItems: number}>>([]),
/** Current selected folder in file browsre */
selectedFolder: ref<{name: string, nrOfItems: number}>(),
/** List of files on the server */
staticFiles: ref<Array<{name: string, size: number, content: string, url: string}>>([]),
staticFiles: ref<Array<FilesApiModel>>([]),
selectedFile: ref<{name: string, size: number, content: string, url: string}>(),
/** Current selected file in file browser */
selectedFile: ref<FilesApiModel>(),
showFileUploadDialog: ref(false),
@@ -24,6 +28,9 @@ export const useFilesStore = defineStore('filesStore', {
}),
actions: {
/**
* Fetch all static folders on the server
*/
async getStaticFolders() {
this.fetchInProgress = true
@@ -47,6 +54,7 @@ export const useFilesStore = defineStore('filesStore', {
})
},
async uploadFile() {
this.fetchInProgress = true