diff --git a/package.json b/package.json index 790581339..b0cc06e68 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,9 @@ "oauth_secret": "NBWGhWDrD3QDB35xtVuxv4aExnmIt4FA_WgeLtwxasg", "url": "https://www.openstreetmap.org" }, - "mvt_layer_server": "https://proxy.mapcomplete.org/public.{type}_{layer}/{z}/{x}/{y}.pbf", + "mvt_layer_server": "https://cache.mapcomplete.org/public.{type}_{layer}/{z}/{x}/{y}.pbf", "#summary_server": "Should be the endpoint; appending status.json should work", - "summary_server": "https://proxy0.mapcomplete.org/", + "summary_server": "https://cache.mapcomplete.org/", "geoip_server": "https://ipinfo.mapcomplete.org/", "error_server": "https://report.mapcomplete.org/report", "disabled:oauth_credentials": { @@ -93,7 +93,7 @@ "generate:charging-stations": "cd ./assets/layers/charging_station && vite-node csvToJson.ts && cd -", "clean:tests": "find . -type f -name \"*.doctest.ts\" | xargs -r rm", - "clean": "rm -rf .cache/ && (find *.html | grep -v \"^\\(404\\|index\\|land\\|privacy\\|test\\|studio\\|theme\\|style_test\\|statistics\\|leaderboard\\).html\" | xargs -r rm) && (ls | grep \"^index_[a-zA-Z_-]\\+\\.ts$\" | xargs -r rm)", + "clean": "rm -rf .cache/ && (find *.html | grep -v \"^\\(404\\|index\\|land\\|privacy\\|test\\|studio\\|theme\\|style_test\\|statistics\\|status\\|leaderboard\\).html\" | xargs -r rm) && (ls | grep \"^index_[a-zA-Z_-]\\+\\.ts$\" | xargs -r rm)", "generate:dependency-graph": "node_modules/.bin/depcruise --exclude \"^node_modules\" --output-type dot Logic/State/MapState.ts > dependencies.dot && dot dependencies.dot -T svg -o dependencies.svg && rm dependencies.dot", "scrapeWebsites": "vite-node scripts/importscripts/compareWebsiteData.ts -- ~/Downloads/ShopsWithWebsiteNodes.csv ~/data/scraped_websites/", diff --git a/src/UI/Status/MCService.ts b/src/UI/Status/MCService.ts new file mode 100644 index 000000000..6734911bf --- /dev/null +++ b/src/UI/Status/MCService.ts @@ -0,0 +1,7 @@ +import { Store } from "../../Logic/UIEventSource" + +export interface MCService { + name: string + status: Store<"online" | "degraded" | "offline">, + message?: Store +} diff --git a/src/UI/Status/ServiceIndicator.svelte b/src/UI/Status/ServiceIndicator.svelte new file mode 100644 index 000000000..e7894668d --- /dev/null +++ b/src/UI/Status/ServiceIndicator.svelte @@ -0,0 +1,22 @@ + + + + + +

{service.name}

+
+ {#if $msg} + {$msg} + {:else} + No extra information available + {/if} +
+
diff --git a/src/UI/Status/StatusGUI.svelte b/src/UI/Status/StatusGUI.svelte new file mode 100644 index 000000000..c7ee49590 --- /dev/null +++ b/src/UI/Status/StatusGUI.svelte @@ -0,0 +1,285 @@ + + +

MapComplete status indicators

+ +{#if $someLoading} + +{/if} + + +{#each services as service} + +{/each} diff --git a/src/UI/Status/StatusIcon.svelte b/src/UI/Status/StatusIcon.svelte new file mode 100644 index 000000000..8db8604ce --- /dev/null +++ b/src/UI/Status/StatusIcon.svelte @@ -0,0 +1,26 @@ + + +{#if status === "online"} + +{:else if status === "degraded"} + +{:else if status === "offline"} + +{:else if status === undefined} + +{:else} + ? {status} +{/if} + diff --git a/src/UI/StatusGui.ts b/src/UI/StatusGui.ts new file mode 100644 index 000000000..8cb3fa14e --- /dev/null +++ b/src/UI/StatusGui.ts @@ -0,0 +1,11 @@ +import StatusGUI from "./Status/StatusGUI.svelte" + +export default class StatusGui { + public setup() { + new StatusGUI({ + target: document.getElementById("main"), + }) + } +} + +new StatusGui().setup()