fixed some bugs, dark/white mode fix and sessionid in url

This commit is contained in:
David Meincke
2023-05-30 11:39:21 +02:00
parent e0c998cfac
commit 28631e8251
10 changed files with 5339 additions and 3554 deletions
+13
View File
@@ -0,0 +1,13 @@
export function formatDate(date: string): string {
if (date == "") {
return "No date";
}
var d = new Date(date);
return pad(d.getDate()) + "-" + pad(d.getMonth() + 1) + "-" + d.getFullYear() + " " + pad(d.getHours()) + ":" + pad(d.getMinutes());
}
function pad(value: number): string {
var strVal = value.toString();
return strVal.length > 1 ? strVal : "0" + strVal;
}
+3
View File
@@ -0,0 +1,3 @@
export function navigateTo(url: string) {
window.history.pushState("", "", url);
}
+8
View File
@@ -4,4 +4,12 @@ export function isSessionPage() {
export function isRootPage() {
return document.URL.indexOf("/sessions") == -1;
}
export function isSessionDetailPage() {
return document.URL.indexOf("/sessions") != -1 && document.URL.length > 40;
}
export function getSessionDetailsId() {
return document.URL.length > 40 ? document.URL.substring(document.URL.indexOf("/sessions/") + 10) : "";
}
+1 -1
View File
@@ -8,7 +8,7 @@ export function IsLocalhost(): boolean {
export function GetOutputFrameUrl(): string {
if (IsLocalhost()) {
return "http://127.0.0.1:8021/";
return "http://localhost:8021/";
}
else {
return "https://outputframe.davidmeincke.dk/";