Skip to content

Commit

Permalink
Add notification for maintaince
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Oct 14, 2023
1 parent a307103 commit a540f19
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
23 changes: 18 additions & 5 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,25 @@ function normalizeItem(item) {
item.authors = item.authors || [];
item.description = item.description || "";

item.root_url =
if (
item.rdf_source &&
item.rdf_source
.split("/")
.slice(0, -1)
.join("/");
item.rdf_source.startsWith("https://zenodo.org/api/records/") &&
item.rdf_source.endsWith("/content")
) {
item.root_url =
item.rdf_source &&
item.rdf_source
.split("/")
.slice(0, -2)
.join("/");
} else {
item.root_url =
item.rdf_source &&
item.rdf_source
.split("/")
.slice(0, -1)
.join("/");
}
if (item.covers && !Array.isArray(item.covers)) {
item.covers = [item.covers];
}
Expand Down
10 changes: 9 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,15 @@ export function concatAndResolveUrl(url, concat) {
url3.push(url2[i]);
}
}
return url3.join("/");

const ret = url3.join("/");
const regex = /https:\/\/zenodo\.org\/api\/records\/(\d+)\/files\/([\w.]+)/;
const match = ret.match(regex);
if (match) {
return ret + "/content";
} else {
return ret;
}
}

function rel2abs(url, base_url) {
Expand Down
14 changes: 14 additions & 0 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
class="hero is-link is-fullheight is-fullheight-with-navbar"
style="max-height: 1024px!important;min-height:380px;background-image:url(/static/img/bg.jpg)"
>
<b-notification
type="is-warning"
has-icon
aria-close-label="close"
role="alert"
style="margin-bottom: 0px;"
>
Dear ShareLoc Users, our website is currently undergoing maintenance due
to a significant API change in Zenodo (https://zenodo.org), which we
used for our storage. This affects downloads and other features. Our
developer team is actively working on a fix to restore access as soon as
possible. We apologize for any inconvenience and appreciate your
patience.
</b-notification>
<b-notification
v-if="zenodoClient.isSandbox"
type="is-warning"
Expand Down

0 comments on commit a540f19

Please sign in to comment.