web/settings: add advanced & debug pages

This commit is contained in:
wukko
2024-07-10 23:35:53 +06:00
parent 49f9057b6b
commit a6ddceb643
7 changed files with 123 additions and 1 deletions

View File

@@ -8,6 +8,9 @@ const defaultSettings: CobaltSettings = {
reduceAnimations: false,
reduceTransparency: false,
},
advanced: {
debug: false,
},
appearance: {
theme: "auto",
language: defaultLocale,

View File

@@ -18,6 +18,10 @@ type CobaltSettingsAppearance = {
autoLanguage: boolean,
};
type CobaltSettingsAdvanced = {
debug: boolean,
};
type CobaltSettingsGeneral = {
customProcessingEndpoint: string,
seenOnboarding: boolean,
@@ -45,6 +49,7 @@ type CobaltSettingsPrivacy = {
export type CobaltSettings = {
schemaVersion: number,
accessibility: CobaltSettingsAccessibility,
advanced: CobaltSettingsAdvanced,
appearance: CobaltSettingsAppearance,
general: CobaltSettingsGeneral,
save: CobaltSettingsSave,

23
web/src/lib/version.ts Normal file
View 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();