Skip to content

Commit 9a4fdc1

Browse files
authored
Merge pull request #70 from KNowledgeOnWebScale/EDC_active
fixes to access revoke and querycache usage + version display
2 parents a1a28dc + bd7523a commit 9a4fdc1

12 files changed

Lines changed: 622 additions & 90 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "solid-cockpit",
3-
"version": "1.0.0",
4-
"description": "The Solid Cockpit applicaiton for Pod utilization",
3+
"version": "1.2.1",
4+
"description": "The Solid Cockpit application for Solid Pod utilization",
55
"main": "~/src/App.vue",
66
"homepage": "https://knowledgeonwebscale.github.io/solid-cockpit",
77
"repository": "https://github.com/KNowledgeOnWebScale/solid-cockpit/tree/EDC_active",

src/components/DataQuery.vue

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@
648648
<span class="user-tag">Query File: <br /></span>
649649
<button
650650
@click="
651-
fetchQuery(query.hash, selectedPodUrl + 'querycache/')
651+
fetchQuery(query.hash, getQueryCacheContainerUrl())
652652
"
653653
class="drop-down"
654654
>
@@ -679,7 +679,7 @@
679679
@click="
680680
fetchResults(
681681
query.hash,
682-
selectedPodUrl + 'querycache/',
682+
getQueryCacheContainerUrl(),
683683
)
684684
"
685685
class="drop-down"
@@ -902,6 +902,7 @@
902902
class="results-container"
903903
v-if="
904904
loading ||
905+
queryError != null ||
905906
(currentQuery.output != null &&
906907
typeof currentQuery.output !== 'string')
907908
"
@@ -1020,6 +1021,7 @@
10201021
class="null-results"
10211022
v-show="
10221023
!loading &&
1024+
queryError == null &&
10231025
resultsForYasr != null &&
10241026
resultsForYasr.results.bindings.length === 0
10251027
"
@@ -2199,7 +2201,7 @@ export default {
21992201
this.renameFeedback = null;
22002202
try {
22012203
const renamed = await renameCachedQueryEntry(
2202-
`${this.selectedPodUrl}querycache/queries.ttl`,
2204+
this.getQueryCacheIndexUrl(),
22032205
query.hash,
22042206
trimmedLabel,
22052207
);
@@ -3292,8 +3294,8 @@ export default {
32923294
32933295
// Methods for the deletion of a query cache entry
32943296
async confirmAndDelete(queryHash: string) {
3295-
const queryFile = `${this.selectedPodUrl}querycache/${queryHash}.rq`;
3296-
const resultsFile = `${this.selectedPodUrl}querycache/${queryHash}.json`;
3297+
const queryFile = `${this.getQueryCacheContainerUrl()}${queryHash}.rq`;
3298+
const resultsFile = `${this.getQueryCacheContainerUrl()}${queryHash}.json`;
32973299
32983300
const message =
32993301
"Are you sure you want to delete this cache entry? This action cannot be undone.";
@@ -3336,7 +3338,7 @@ export default {
33363338
async removeCachedRecord(queryHash: string) {
33373339
// remove the record from queries.ttl
33383340
const queriesttlUpdate = await deleteThing(
3339-
this.selectedPodUrl + "querycache/queries.ttl",
3341+
this.getQueryCacheIndexUrl(),
33403342
queryHash,
33413343
);
33423344
return queriesttlUpdate;
@@ -3348,16 +3350,37 @@ export default {
33483350
this.currentView = "previousQueries";
33493351
await this.loadCache();
33503352
},
3353+
/**
3354+
* Normalizes the selected pod URL into a predictable querycache container.
3355+
* This prevents subtle path bugs when the selected pod omits trailing slash.
3356+
*/
3357+
getQueryCacheContainerUrl() {
3358+
const podUrl = this.selectedPodUrl.trim();
3359+
if (podUrl === "") {
3360+
return "";
3361+
}
3362+
const podBase = podUrl.endsWith("/") ? podUrl : `${podUrl}/`;
3363+
return `${podBase}querycache/`;
3364+
},
3365+
/**
3366+
* Resolves the canonical path of the cache index file.
3367+
*/
3368+
getQueryCacheIndexUrl() {
3369+
return `${this.getQueryCacheContainerUrl()}queries.ttl`;
3370+
},
33513371
async loadCache() {
3372+
if (!this.loggedIn || this.selectedPodUrl.trim() === "") {
3373+
this.queriesCacheExists = false;
3374+
this.cachedQueries = [];
3375+
return;
3376+
}
3377+
33523378
this.clearRetrievedResults();
3353-
this.queriesCacheExists = await getStoredTtl(
3354-
this.selectedPodUrl + "querycache/queries.ttl",
3355-
);
3379+
const cacheIndexUrl = this.getQueryCacheIndexUrl();
3380+
this.queriesCacheExists = await getStoredTtl(cacheIndexUrl);
33563381
if (this.queriesCacheExists) {
33573382
try {
3358-
this.cachedQueries = await getCachedQueries(
3359-
this.selectedPodUrl + "querycache/queries.ttl",
3360-
);
3383+
this.cachedQueries = await getCachedQueries(cacheIndexUrl);
33613384
} catch (err) {
33623385
console.log("Error fetching queries:", err);
33633386
}
@@ -3443,7 +3466,7 @@ export default {
34433466
* @param path the URL of the resource or container for which access rights are to be displayed
34443467
*/
34453468
async getSpecificCacheAclData() {
3446-
const cacheUrl = this.selectedPodUrl + "querycache/";
3469+
const cacheUrl = this.getQueryCacheContainerUrl();
34473470
this.hasAcl = await fetchPermissionsData(cacheUrl); // value is either .acl obj OR null (if .acl does not exist)
34483471
if (this.hasAcl !== null) {
34493472
this.hasAccess = await fetchAclAgents(cacheUrl);
@@ -3461,7 +3484,7 @@ export default {
34613484
* @param path the URL of the resource or container for which access rights are to be displayed
34623485
*/
34633486
async getSpecificQueryAclData(queryHash: string) {
3464-
const queryUrl = this.selectedPodUrl + "querycache/" + queryHash;
3487+
const queryUrl = `${this.getQueryCacheContainerUrl()}${queryHash}`;
34653488
this.hasAcl = await fetchPermissionsData(queryUrl); // value is either .acl obj OR null (if .acl does not exist)
34663489
if (this.hasAcl !== null) {
34673490
this.hasAccess = await fetchAclAgents(queryUrl);
@@ -3479,7 +3502,7 @@ export default {
34793502
* @param path the URL of the resource or container for which an .acl is to be made
34803503
*/
34813504
async makeNewAcl() {
3482-
const cacheUrl = this.selectedPodUrl + "querycache/";
3505+
const cacheUrl = this.getQueryCacheContainerUrl();
34833506
try {
34843507
await generateAcl(cacheUrl, this.webId);
34853508
await this.getSpecificCacheAclData();

src/components/PodUpload.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,11 @@ export default {
633633
.input-box {
634634
width: 100%;
635635
}
636+
/* Keep selected file chip text readable in both light and dark themes. */
637+
.input-box :deep(.v-field__input .v-chip),
638+
.input-box :deep(.v-field__input .v-chip .v-chip__content) {
639+
color: var(--text-primary) !important;
640+
}
636641
.check-exists {
637642
list-style-type: none;
638643
}

0 commit comments

Comments
 (0)