fixed some bugs, dark/white mode fix and sessionid in url
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function navigateTo(url: string) {
|
||||
window.history.pushState("", "", url);
|
||||
}
|
||||
@@ -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) : "";
|
||||
}
|
||||
@@ -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/";
|
||||
|
||||
Reference in New Issue
Block a user