* darkmode fixes * fix: darkmode: empty beats in active/ hovered state * fix: color for empty beats * fix: navbar background color * Update src/assets/vars.scss Co-authored-by: Adam Stachowicz <saibamenppl@gmail.com> * Update src/assets/app.scss Co-authored-by: Adam Stachowicz <saibamenppl@gmail.com> * wip, split dark theme style by .dark and store light theme to normal * add back missing css * working switch theme button and tuning dark theme * finish dark theme Co-authored-by: Adam Stachowicz <saibamenppl@gmail.com> Co-authored-by: LouisLam <louislam@users.noreply.github.com>
44 lines
839 B
TypeScript
44 lines
839 B
TypeScript
// Common Util for frontend and backend
|
|
// Backend uses the compiled file util.js
|
|
// Frontend uses util.ts
|
|
// Need to run "tsc" to compile if there are any changes.
|
|
|
|
export const appName = "Uptime Kuma";
|
|
export const DOWN = 0;
|
|
export const UP = 1;
|
|
export const PENDING = 2;
|
|
|
|
export function flipStatus(s) {
|
|
if (s === UP) {
|
|
return DOWN;
|
|
}
|
|
|
|
if (s === DOWN) {
|
|
return UP;
|
|
}
|
|
|
|
return s;
|
|
}
|
|
|
|
export function sleep(ms) {
|
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
}
|
|
|
|
/**
|
|
* PHP's ucfirst
|
|
* @param str
|
|
*/
|
|
export function ucfirst(str) {
|
|
if (! str) {
|
|
return str;
|
|
}
|
|
|
|
const firstLetter = str.substr(0, 1);
|
|
return firstLetter.toUpperCase() + str.substr(1);
|
|
}
|
|
|
|
export function debug(msg) {
|
|
if (process.env.NODE_ENV === "development") {
|
|
console.debug(msg);
|
|
}
|
|
}
|