From 02f3582e578a30a2fb43900c02ab5a1dfc20106f Mon Sep 17 00:00:00 2001 From: Bo Robbrecht Date: Wed, 17 Jul 2024 14:17:13 +0200 Subject: [PATCH 1/8] Added fallback loading animation for when ResourceExplorer is loading --- .../components/explorer/FallbackExplorer.vue | 48 +++++++++++++++++++ .../components/explorer/ResourceExplorer.vue | 13 +++++ loama/src/views/HomeView.vue | 9 ++-- 3 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 loama/src/components/explorer/FallbackExplorer.vue create mode 100644 loama/src/components/explorer/ResourceExplorer.vue diff --git a/loama/src/components/explorer/FallbackExplorer.vue b/loama/src/components/explorer/FallbackExplorer.vue new file mode 100644 index 0000000..46da54a --- /dev/null +++ b/loama/src/components/explorer/FallbackExplorer.vue @@ -0,0 +1,48 @@ + + + + + \ No newline at end of file diff --git a/loama/src/components/explorer/ResourceExplorer.vue b/loama/src/components/explorer/ResourceExplorer.vue new file mode 100644 index 0000000..a8bac40 --- /dev/null +++ b/loama/src/components/explorer/ResourceExplorer.vue @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/loama/src/views/HomeView.vue b/loama/src/views/HomeView.vue index 6015961..d2c8827 100644 --- a/loama/src/views/HomeView.vue +++ b/loama/src/views/HomeView.vue @@ -5,12 +5,10 @@
-
- - +
@@ -19,5 +17,6 @@ From 5411b59144312ff20eeb72ae21d6265b53f5fd8e Mon Sep 17 00:00:00 2001 From: Bo Robbrecht Date: Wed, 17 Jul 2024 15:11:09 +0200 Subject: [PATCH 2/8] Able to display the resources on the top-level of pod --- .../components/explorer/ResourceExplorer.vue | 51 +++++++++++++++++-- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/loama/src/components/explorer/ResourceExplorer.vue b/loama/src/components/explorer/ResourceExplorer.vue index a8bac40..80a9833 100644 --- a/loama/src/components/explorer/ResourceExplorer.vue +++ b/loama/src/components/explorer/ResourceExplorer.vue @@ -1,13 +1,54 @@ \ No newline at end of file +const resource = ref(await getTopLevelThings()); + +/** + * TODO: This function causes the icons to be re-active, so we'll need to extract the format function to a separate function + */ +async function getTopLevelThings(){ + const content = (await getPod(store.session as Session, store.usedPod || (await listPods(store.session as Session))[0])).things + .filter(thing => thing.url !== store.usedPod) + .filter(thing => { + const depth = thing.url.replace(store.usedPod, '').split('/'); + return depth.length <= 2; + }) + return content + .map(thing => { + const uri = thing.url.replace(store.usedPod, ''); + const depth = uri.split('/').length; + console.log(thing) + return { + icon: (depth === 2) ? PhFolder : PhFile, + name: uri.replace('/', ''), + ...thing + } + }) +} + + + \ No newline at end of file From 910cd752526198ed4dffd0e82b41230cb3801264 Mon Sep 17 00:00:00 2001 From: Bo Robbrecht Date: Wed, 17 Jul 2024 15:33:58 +0200 Subject: [PATCH 3/8] Moved resource entry to seperate component --- .../src/components/explorer/ExplorerEntry.vue | 36 +++++++++++++++++++ .../components/explorer/ResourceExplorer.vue | 19 ++++------ 2 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 loama/src/components/explorer/ExplorerEntry.vue diff --git a/loama/src/components/explorer/ExplorerEntry.vue b/loama/src/components/explorer/ExplorerEntry.vue new file mode 100644 index 0000000..04a0146 --- /dev/null +++ b/loama/src/components/explorer/ExplorerEntry.vue @@ -0,0 +1,36 @@ + + + + + \ No newline at end of file diff --git a/loama/src/components/explorer/ResourceExplorer.vue b/loama/src/components/explorer/ResourceExplorer.vue index 80a9833..ab8836b 100644 --- a/loama/src/components/explorer/ResourceExplorer.vue +++ b/loama/src/components/explorer/ResourceExplorer.vue @@ -1,8 +1,7 @@ + + \ No newline at end of file diff --git a/loama/src/components/explorer/ExplorerEntry.vue b/loama/src/components/explorer/ExplorerEntry.vue index e4c1442..f486bcb 100644 --- a/loama/src/components/explorer/ExplorerEntry.vue +++ b/loama/src/components/explorer/ExplorerEntry.vue @@ -1,37 +1,66 @@ \ No newline at end of file diff --git a/loama/src/components/explorer/ResourceExplorer.vue b/loama/src/components/explorer/ResourceExplorer.vue index 4fa67e2..2a9c42a 100644 --- a/loama/src/components/explorer/ResourceExplorer.vue +++ b/loama/src/components/explorer/ResourceExplorer.vue @@ -1,26 +1,51 @@ \ No newline at end of file diff --git a/loama/src/components/header/HeaderBase.vue b/loama/src/components/header/HeaderBase.vue index 4de316a..669c171 100644 --- a/loama/src/components/header/HeaderBase.vue +++ b/loama/src/components/header/HeaderBase.vue @@ -61,6 +61,7 @@ header { border-radius: 0 0 var(--base-corner) var(--base-corner); border-bottom: 0.5rem solid var(--solid-purple); border-top: 0; + border-inline: 0; padding: calc(var(--base-unit)*3) calc(var(--base-unit)*6) 0 calc(var(--base-unit)*3); } diff --git a/loama/src/router/index.ts b/loama/src/router/index.ts index 3b8c4da..b8b4562 100644 --- a/loama/src/router/index.ts +++ b/loama/src/router/index.ts @@ -14,7 +14,7 @@ const router = createRouter({ component: LoginView }, { - path: '/home', + path: '/home/:filePath(.*)', name: 'home', component: HomeView } @@ -25,6 +25,7 @@ router.beforeEach(async (to) => { if (!store.session.info.isLoggedIn) { await store.session.handleIncomingRedirect() if (store.session.info.isLoggedIn) { + // Default to the first pod store.setUsedPod((await listPods(store.session as Session))[0]) } if (!store.session.info.isLoggedIn && to.name !== 'login') { diff --git a/loama/src/store.ts b/loama/src/store.ts index 07ef5c3..07d3a8e 100644 --- a/loama/src/store.ts +++ b/loama/src/store.ts @@ -1,9 +1,10 @@ import { getDefaultSession } from '@inrupt/solid-client-authn-browser' import { reactive } from 'vue' -export const store = reactive({ - session: getDefaultSession(), - usedPod: "", - setUsedPod(url:string) { - this.usedPod = url - }}) +export const store = reactive({ + session: getDefaultSession(), + usedPod: '', + setUsedPod(url: string) { + this.usedPod = url + } +}) diff --git a/loama/src/views/HomeView.vue b/loama/src/views/HomeView.vue index d2c8827..d4af4de 100644 --- a/loama/src/views/HomeView.vue +++ b/loama/src/views/HomeView.vue @@ -8,7 +8,7 @@ diff --git a/loama/src/views/LoginView.vue b/loama/src/views/LoginView.vue index 1aab9e6..6f83505 100644 --- a/loama/src/views/LoginView.vue +++ b/loama/src/views/LoginView.vue @@ -1,5 +1,5 @@ @@ -41,6 +43,16 @@ const openPodUrl = (pod: { name: string; url: string }) => { width: 100%; margin-top: 10px; border-right: 0.25rem solid var(--solid-purple); + background-color: #f0f0f0; + width: 30%; + position: fixed; + top: 0; + left: 0; + bottom: 0; + z-index: 999; + overflow-y: auto; + padding: 20px; + margin: 0; } h2 { diff --git a/loama/src/components/explorer/ExplorerEntry.vue b/loama/src/components/explorer/ExplorerEntry.vue index f486bcb..13c0a5b 100644 --- a/loama/src/components/explorer/ExplorerEntry.vue +++ b/loama/src/components/explorer/ExplorerEntry.vue @@ -14,7 +14,6 @@