setup: show internal and external links on finish
internal generated from host, port and url_base, external is just jfa_url. Both are shown (if jfa_url is set).
This commit is contained in:
+3
-2
@@ -557,12 +557,13 @@
|
|||||||
<div class="card lg:container sectioned ~neutral @low unfocused">
|
<div class="card lg:container sectioned ~neutral @low unfocused">
|
||||||
<section class="section flex flex-col gap-2 justify-center items-center">
|
<section class="section flex flex-col gap-2 justify-center items-center">
|
||||||
<span class="heading">{{ .lang.EndPage.finished }}</span>
|
<span class="heading">{{ .lang.EndPage.finished }}</span>
|
||||||
<p class="content text-center">{{ .lang.EndPage.restartMessage }} {{ .lang.EndPage.urlChangedNotice }}</p>
|
<p class="content text-center">{{ .lang.EndPage.moreFeatures }} {{ .lang.EndPage.restartReload }} {{ .lang.EndPage.ifFailedLoad }}</p>
|
||||||
</section>
|
</section>
|
||||||
<section class="section w-full ~neutral footer flex flex-row justify-center items-center gap-2">
|
<section class="section w-full ~neutral footer flex flex-row justify-center items-center gap-2">
|
||||||
<span class="button ~neutral @low back">{{ .lang.Strings.back }}</span>
|
<span class="button ~neutral @low back">{{ .lang.Strings.back }}</span>
|
||||||
<span class="button ~urge @low" id="restart">{{ .lang.Strings.submit }}</span>
|
<span class="button ~urge @low" id="restart">{{ .lang.Strings.submit }}</span>
|
||||||
<span class="button ~urge @low unfocused" id="refresh">{{ .lang.EndPage.refreshPage }}</span>
|
<a class="button ~urge @low flex flex-col gap-0.5 unfocused" id="refresh-internal"></a>
|
||||||
|
<a class="button ~urge @low flex flex-col gap-0.5 unfocused" id="refresh-external"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -41,7 +41,9 @@
|
|||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
"myAccount": "My Account",
|
"myAccount": "My Account",
|
||||||
"referrals": "Referrals",
|
"referrals": "Referrals",
|
||||||
"inviteRemainingUses": "Remaining uses"
|
"inviteRemainingUses": "Remaining uses",
|
||||||
|
"internal": "Internal",
|
||||||
|
"external": "External"
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"errorLoginBlank": "The username and/or password were left blank.",
|
"errorLoginBlank": "The username and/or password were left blank.",
|
||||||
|
|||||||
@@ -33,8 +33,9 @@
|
|||||||
},
|
},
|
||||||
"endPage": {
|
"endPage": {
|
||||||
"finished": "Finished!",
|
"finished": "Finished!",
|
||||||
"restartMessage": "Features like Discord/Telegram/Matrix bots, custom Markdown messages, and a user-accessible \"My Account\" page can be found in Settings, so make sure to give it a browse. Click below to restart, then refresh the page.",
|
"moreFeatures": "Tons more features like Discord/Telegram/Matrix bots and custom Markdown messages can be found in Settings, so make sure to give it a browse.",
|
||||||
"urlChangedNotice": "If you've changed the host, port, subfolder etc. that jfa-go is hosted on, check the URL is right.",
|
"restartReload": "Click below to restart, then access jfa-go at one of the given internal/external URLs.",
|
||||||
|
"ifFailedLoad": "If it doesn't load, check the application's logs for any clues as to why.",
|
||||||
"refreshPage": "Refresh"
|
"refreshPage": "Refresh"
|
||||||
},
|
},
|
||||||
"language": {
|
"language": {
|
||||||
|
|||||||
+37
-6
@@ -365,6 +365,33 @@ const checkTheme = () => {
|
|||||||
settings["ui"]["theme"].onchange = checkTheme;
|
settings["ui"]["theme"].onchange = checkTheme;
|
||||||
checkTheme();
|
checkTheme();
|
||||||
|
|
||||||
|
const fixFullURL = (v: string): string => {
|
||||||
|
if (!(v.startsWith("http://")) && !(v.startsWith("https://"))) {
|
||||||
|
v = "http://" + v;
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatSubpath = (v: string): string => {
|
||||||
|
if (v == "/") return "";
|
||||||
|
if (v.charAt(-1) == "/") { v = v.slice(0, -1); }
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
const constructNewURLs = (): string[] => {
|
||||||
|
let local = settings["ui"]["host"].value + ":" + settings["ui"]["port"].value;
|
||||||
|
if (settings["ui"]["url_base"].value != "") {
|
||||||
|
local += formatSubpath(settings["ui"]["url_base"].value);
|
||||||
|
}
|
||||||
|
local = fixFullURL(local);
|
||||||
|
let remote = settings["ui"]["jfa_url"].value;
|
||||||
|
if (remote == "") {
|
||||||
|
return [local];
|
||||||
|
}
|
||||||
|
remote = fixFullURL(remote);
|
||||||
|
return [local, remote];
|
||||||
|
}
|
||||||
|
|
||||||
const restartButton = document.getElementById("restart") as HTMLSpanElement;
|
const restartButton = document.getElementById("restart") as HTMLSpanElement;
|
||||||
const serialize = () => {
|
const serialize = () => {
|
||||||
toggleLoader(restartButton);
|
toggleLoader(restartButton);
|
||||||
@@ -409,12 +436,16 @@ const serialize = () => {
|
|||||||
}
|
}
|
||||||
restartButton.parentElement.querySelector("span.back").classList.add("unfocused");
|
restartButton.parentElement.querySelector("span.back").classList.add("unfocused");
|
||||||
restartButton.classList.add("unfocused");
|
restartButton.classList.add("unfocused");
|
||||||
const refresh = document.getElementById("refresh") as HTMLSpanElement;
|
const refreshURLs = constructNewURLs();
|
||||||
refresh.classList.remove("unfocused");
|
const refreshButtons = [document.getElementById("refresh-internal") as HTMLAnchorElement, document.getElementById("refresh-external") as HTMLAnchorElement];
|
||||||
refresh.onclick = () => {
|
["internal", "external"].forEach((urltype, i) => {
|
||||||
let host = window.location.href.split("#")[0].split("?")[0] + settings["ui"]["url_base"].value;
|
const button = refreshButtons[i];
|
||||||
window.location.href = host;
|
button.classList.remove("unfocused");
|
||||||
};
|
button.href = refreshURLs[i];
|
||||||
|
button.innerHTML = `<span>${urltype.charAt(0).toUpperCase() + urltype.slice(1)}:</span><i class="italic underline">${button.href}</i>`;
|
||||||
|
// skip external if it isn't set
|
||||||
|
if (refreshURLs.length == 1) return;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, true, (req: XMLHttpRequest) => {
|
}, true, (req: XMLHttpRequest) => {
|
||||||
if (req.status == 0) {
|
if (req.status == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user