Frontend created and rewritten a few times, with some backend fixes #1

Merged
leo merged 110 commits from plaintable into main 2023-11-08 20:38:40 +00:00
Showing only changes of commit d27cb2133a - Show all commits

View File

@ -45,21 +45,28 @@ export const useDocumentStore = defineStore({
actions: {
setActualDocument(location: string){
this.loading = true;
let data = this.root
const dataMapped = [];
const locations = location.split('/').slice(1)
// Get data target location
locations.forEach(location => {
location = decodeURIComponent(location)
if(data && data.dir){
for (const key in data.dir) {
if(key === location) data = data.dir[key]
this.loading = true
let data = this.root
const actualDirArr = []
try {
// Navigate to target folder
for (const dirname of location.split('/').slice(1)) {
if (!dirname) continue
actualDirArr.push(dirname)
data = data.dir[dirname]
}
} catch (error) {
console.error("Cannot show requested folder", location, actualDirArr.join('/'), error)
}
if (data.dir === undefined) {
// Target folder not available
this.document = []
this.loading = false // ???
return
}
})
// Transform data
const dataMapped = []
for (const [name, attr] of Object.entries(data.dir)) {
const {id, size, mtime, dir} = attr
const element: Document = {