web/settings: add advanced & debug pages
This commit is contained in:
23
web/src/lib/version.ts
Normal file
23
web/src/lib/version.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
type VersionResponse = {
|
||||
commit: string;
|
||||
branch: string;
|
||||
remote: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
const fetchVersion = async function () {
|
||||
const response: VersionResponse | undefined = await fetch('/version.json')
|
||||
.then(r => r.json())
|
||||
.catch(() => {});
|
||||
|
||||
if (!response) return {
|
||||
commit: "unknown",
|
||||
branch: "unknown",
|
||||
remote: "unknown",
|
||||
version: "unknown"
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
export const version = await fetchVersion();
|
||||
Reference in New Issue
Block a user