Skip to content

Commit 7765d07

Browse files
authored
Merge pull request #58 from KNowledgeOnWebScale/EDC_active
Edc active
2 parents 8b83595 + 3b94f6c commit 7765d07

File tree

3 files changed

+121
-5
lines changed

3 files changed

+121
-5
lines changed

404.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!DOCTYPE html>
2+
<html lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<title>Solid Cockpit</title>
8+
9+
<!-- section to help make the Z3 solver work in a browser setting -->
10+
<script src="/z3-built.js"></script>
11+
<script>
12+
globalThis.global = { initZ3: globalThis.initZ3 };
13+
</script>
14+
15+
<meta property="og:title" content="Solid Cockpit" />
16+
<meta
17+
name="description"
18+
content="An applicaiton for accessing, editing, and querying data in Solid pods"
19+
/>
20+
<meta
21+
property="og:description"
22+
content="An applicaiton for accessing, editing, and querying data in Solid pods"
23+
/>
24+
<meta property="og:image" content="favicon.ico" />
25+
<meta name="author" content="KNoWS, IDLab - Ghent University" />
26+
<meta name="keywords" content="Solid, RDF, SPARQL Querying, Privacy Editing" />
27+
<link rel="icon" type="image/x-icon" href="favicon.ico" />
28+
29+
</head>
30+
<body>
31+
<noscript>
32+
<strong>We're sorry but this app doesn't work properly without JavaScript enabled.
33+
Please enable it to continue.</strong>
34+
</noscript>
35+
<div id="app"></div>
36+
<!-- built files will be auto injected -->
37+
</body>
38+
<link href="https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css" rel="stylesheet">
39+
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400..900&family=Oxanium:wght@200..800&display=swap" rel="stylesheet">
40+
41+
<script type="module" src="/src/main.ts"></script>
42+
</html>

src/components/EditPrivacy.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,8 @@ button:focus {
13841384
.resource-name {
13851385
font-family: "Oxanium", monospace;
13861386
color: var(--text-secondary);
1387+
user-select: text;
1388+
cursor: text;
13871389
}
13881390
.info-icon {
13891391
margin-left: auto;

src/components/PodBrowser.vue

Lines changed: 77 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,24 @@
5757
<ul>
5858
<!-- Iterates over list of containers in a pod -->
5959
<li v-for="(url, index) in urls" :key="index">
60-
<div class="card-panel folder">
60+
<div
61+
v-if="loadingIndex === index"
62+
class="loading-spinner-container"
63+
>
64+
<div class="spinner"></div>
65+
<span class="loading-text">Loading access rights...</span>
66+
</div>
67+
<div v-else class="card-panel folder">
6168
<button
6269
@click="toggleInfo(index, url)"
6370
class="icon-button full-width"
6471
>
72+
6573
<div class="icon-hash">
6674
<i class="material-icons not-colored left">{{
6775
containerCheck(url) ? "folder" : "description"
6876
}}</i>
69-
{{ url }}
77+
<span class="highlightable-text">{{ url }}</span>
7078
</div>
7179
<div class="info-icon">
7280
<i class="material-icons not-colored info-icon">
@@ -112,7 +120,7 @@
112120
v-if="info && info.linkedResources.describedby"
113121
>
114122
<strong class="info-label">Metadata:</strong>
115-
<div class="info-value-container">
123+
<div v-if="checkUrl(url)" class="info-value-container">
116124
<a
117125
:href="info.linkedResources.describedby"
118126
target="_blank"
@@ -121,6 +129,9 @@
121129
>{{ info.linkedResources.describedby }}</a
122130
>
123131
</div>
132+
<div v-else class="info-value-container">
133+
<span>{{ info.linkedResources.describedby }}</span>
134+
</div>
124135
</div>
125136
<!-- TODO: figure out if this works and what edit does -->
126137
<div class="edit-delete">
@@ -163,6 +174,7 @@ import ContainerNav from "./ContainerNav.vue";
163174
import PodRegistration from "./PodRegistration.vue";
164175
import PodBrowserGuide from "./Guides/PodBrowserGuide.vue";
165176
import { useAuthStore } from "../stores/auth";
177+
import { checkUrl } from "./privacyEdit";
166178
167179
interface info {
168180
sourceIri: string;
@@ -197,6 +209,7 @@ export default {
197209
renderKey: 0 as number,
198210
deletionSuccess: false,
199211
deletedItemType: "" as "Resource" | "Container" | "",
212+
loadingIndex: null as number | null,
200213
};
201214
},
202215
computed: {
@@ -383,19 +396,38 @@ export default {
383396
this.newName = name;
384397
}
385398
},
386-
toggleInfo(index: number, url: string) {
399+
async toggleInfo(index: number, url: string) {
387400
if (this.showInfoIndex === index) {
388401
this.showInfoIndex = null; // Hide the form if it's already shown
389402
} else {
403+
try {
404+
this.showInfoIndex = index;
405+
this.loadingIndex = index;
406+
await this.getItemInfo(url);
407+
} catch (error) {
408+
this.dirContents = null;
409+
this.info = {
410+
sourceIri: "error fetching info",
411+
linkedResources: {
412+
type: "error fetching info",
413+
describedby: "error fetching info",
414+
},
415+
};
416+
console.error("Error fetching item info:", error);
417+
} finally {
418+
this.loadingIndex = null;
419+
}
390420
this.showInfoIndex = index; // Show the form for the clicked item
391-
this.getItemInfo(url);
392421
}
393422
},
394423
/* Takes in the emitted value from ContainerNav.vue */
395424
async handleSelectedContainer(selectedContainer: string) {
396425
this.displayPath = selectedContainer;
397426
await this.getItems(this.displayPath);
398427
},
428+
checkUrl(url: string) {
429+
return checkUrl(url, this.currentLocation);
430+
},
399431
},
400432
mounted() {
401433
setTimeout(() => {
@@ -581,6 +613,42 @@ body {
581613
.info-icon {
582614
margin-left: auto;
583615
}
616+
.highlightable-text {
617+
user-select: text;
618+
cursor: text;
619+
}
620+
621+
/* Loading spinner */
622+
.loading-spinner-container {
623+
display: flex;
624+
flex-direction: column;
625+
align-items: center;
626+
justify-content: center;
627+
height: 100px;
628+
margin: 20px 0;
629+
}
630+
.spinner {
631+
border: 4px solid var(--border);
632+
border-top: 4px solid var(--primary);
633+
border-radius: 50%;
634+
width: 40px;
635+
height: 40px;
636+
animation: spin 1s linear infinite;
637+
}
638+
.loading-text {
639+
margin-top: 10px;
640+
font-family: "Oxanium", monospace;
641+
font-size: 14pt;
642+
color: var(--text-secondary);
643+
}
644+
@keyframes spin {
645+
0% {
646+
transform: rotate(0deg);
647+
}
648+
100% {
649+
transform: rotate(360deg);
650+
}
651+
}
584652
585653
.item-info-container {
586654
background-color: var(--bg);
@@ -610,6 +678,10 @@ body {
610678
gap: 0.5rem;
611679
overflow: hidden;
612680
}
681+
.info-value-container span {
682+
color: var(--text-secondary);
683+
}
684+
613685
614686
.info-value {
615687
color: var(--text-secondary);

0 commit comments

Comments
 (0)