aboutsummaryrefslogtreecommitdiffstats
path: root/old-apps/web-shared/src/lib/configuration.ts
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-09-20 09:24:27 +0200
committerivarlovlie <git@ivarlovlie.no>2022-09-20 09:24:27 +0200
commita9072370ca1eb9a5cce928b1d487db0f307edea6 (patch)
tree59c3c23df930a8b5f888dc7813923abf4ceefed4 /old-apps/web-shared/src/lib/configuration.ts
parent56fa963a1d63cbe0bf28e29e717cceaa417c45c1 (diff)
downloadgreatoffice-a9072370ca1eb9a5cce928b1d487db0f307edea6.tar.xz
greatoffice-a9072370ca1eb9a5cce928b1d487db0f307edea6.zip
feat: Move old apps into it's own directory
Diffstat (limited to 'old-apps/web-shared/src/lib/configuration.ts')
-rw-r--r--old-apps/web-shared/src/lib/configuration.ts78
1 files changed, 78 insertions, 0 deletions
diff --git a/old-apps/web-shared/src/lib/configuration.ts b/old-apps/web-shared/src/lib/configuration.ts
new file mode 100644
index 0000000..eb38400
--- /dev/null
+++ b/old-apps/web-shared/src/lib/configuration.ts
@@ -0,0 +1,78 @@
+export const TOPBASEDOMAIN = "greatoffice.life";
+export const BASE_DOMAIN = "dev.greatoffice.life";
+export const DEV_BASE_DOMAIN = "localhost";
+export const API_ADDRESS = "https://api." + BASE_DOMAIN;
+export const PROJECTS_ADDRESS = "https://projects." + BASE_DOMAIN;
+export const PORTAL_ADDRESS = "https://portal." + BASE_DOMAIN;
+export const FRONTPAGE_ADDRESS = "https://" + BASE_DOMAIN;
+export const DEV_PORTAL_ADDRESS = "http://localhost:3001";
+export const DEV_FRONTPAGE_ADDRESS = "http://localhost:3002";
+export const DEV_API_ADDRESS = "http://localhost:5000";
+export const DEV_PROJECTS_ADDRESS = "http://localhost:3000";
+export const SECONDS_BETWEEN_SESSION_CHECK = 600;
+
+export function projects_base(path: string = ""): string {
+ return (is_development() ? DEV_PROJECTS_ADDRESS : PROJECTS_ADDRESS) + (path !== "" ? "/" + path : "");
+}
+
+export function base_domain(path: string = ""): string {
+ return (is_development() ? DEV_BASE_DOMAIN : TOPBASEDOMAIN) + (path !== "" ? "/" + path : "");
+}
+
+export function frontpage_base(path: string = ""): string {
+ return (is_development() ? DEV_FRONTPAGE_ADDRESS : FRONTPAGE_ADDRESS) + (path !== "" ? "/" + path : "");
+}
+
+export function portal_base(path: string = ""): string {
+ return (is_development() ? DEV_PORTAL_ADDRESS : PORTAL_ADDRESS) + (path !== "" ? "/" + path : "");
+}
+
+export function api_base(path: string = ""): string {
+ return (is_development() ? DEV_API_ADDRESS : API_ADDRESS) + (path !== "" ? "/" + path : "");
+}
+
+export function is_development(): boolean {
+ // @ts-ignore
+ return import.meta.env.DEV;
+}
+
+export function is_debug(): boolean {
+ return localStorage.getItem(StorageKeys.debug) !== "true";
+}
+
+export const CookieNames = {
+ theme: "go_theme",
+ locale: "go_locale"
+};
+
+export const QueryKeys = {
+ labels: "labels",
+ categories: "categories",
+ entries: "entries",
+};
+
+export const IconNames = {
+ github: "github",
+ verticalDots: "verticalDots",
+ clock: "clock",
+ trash: "trash",
+ pencilSquare: "pencilSquare",
+ x: "x",
+ funnel: "funnel",
+ funnelFilled: "funnelFilled",
+ refresh: "refresh",
+ resetHard: "resetHard",
+ arrowUp: "arrowUp",
+ arrowDown: "arrowDown",
+ chevronDown: "chevronDown"
+};
+
+export const StorageKeys = {
+ session: "sessionData",
+ theme: "theme",
+ debug: "debug",
+ categories: "categories",
+ labels: "labels",
+ entries: "entries",
+ stopwatch: "stopwatchState"
+};