fix fences

This commit is contained in:
tglide
2023-10-02 17:53:04 +01:00
parent 5a5b200db7
commit 554c27de74
5 changed files with 209 additions and 192 deletions

View File

@@ -4,117 +4,119 @@ import { browser } from '$app/environment';
export type Version = '1.4.x' | '1.3.x' | '1.2.x' | '1.1.x' | '1.0.x' | '0.15.x' | 'cloud';
export const versions: Readonly<Array<Omit<Version, 'cloud'>>> = [
'1.4.x',
'1.3.x',
'1.2.x',
'1.1.x',
'1.0.x',
'0.15.x'
'1.4.x',
'1.3.x',
'1.2.x',
'1.1.x',
'1.0.x',
'0.15.x'
] as const;
export enum Service {
Account = 'account',
Avatars = 'avatars',
Databases = 'databases',
Functions = 'functions',
Health = 'health',
Locale = 'locale',
Storage = 'storage',
Teams = 'teams',
Users = 'users'
Account = 'account',
Avatars = 'avatars',
Databases = 'databases',
Functions = 'functions',
Health = 'health',
Locale = 'locale',
Storage = 'storage',
Teams = 'teams',
Users = 'users'
}
export enum Platform {
ClientWeb = 'client-web',
ClientFlutter = 'client-flutter',
ClientApple = 'client-apple',
ClientAndroidKotlin = 'client-android-kotlin',
ClientAndroidJava = 'client-android-java',
ClientGraphql = 'client-graphql',
ClientRest = 'client-rest',
ServerDart = 'server-dart',
ServerDeno = 'server-deno',
ServerDotNet = 'server-dotnet',
ServerNodeJs = 'server-nodejs',
ServerPhp = 'server-php',
ServerPython = 'server-python',
ServerRuby = 'server-ruby',
ServerSwift = 'server-swift'
ClientWeb = 'client-web',
ClientFlutter = 'client-flutter',
ClientApple = 'client-apple',
ClientAndroidKotlin = 'client-android-kotlin',
ClientAndroidJava = 'client-android-java',
ClientGraphql = 'client-graphql',
ClientRest = 'client-rest',
ServerDart = 'server-dart',
ServerDeno = 'server-deno',
ServerDotNet = 'server-dotnet',
ServerNodeJs = 'server-nodejs',
ServerPhp = 'server-php',
ServerPython = 'server-python',
ServerRuby = 'server-ruby',
ServerSwift = 'server-swift'
}
export const platformMap: Record<Language|string, string> = {
[Platform.ClientApple]: 'Apple',
[Platform.ClientFlutter]: 'Flutter',
[Platform.ClientWeb]: 'Web',
[Platform.ClientAndroidKotlin]: 'Android (Kotlin)',
[Platform.ClientAndroidJava]: 'Android (Java)',
[Platform.ClientGraphql]: 'GraphQL',
[Platform.ClientRest]: 'REST',
[Platform.ServerDart]: 'Dart',
[Platform.ServerDeno]: 'Deno',
[Platform.ServerDotNet]: '.NET',
[Platform.ServerNodeJs]: 'Node.js',
[Platform.ServerPhp]: 'PHP',
[Platform.ServerPython]: 'Python',
[Platform.ServerRuby]: 'Ruby',
[Platform.ServerSwift]: 'Swift',
sh: 'Shell',
js: 'JavaScript',
ts: 'TypeScript',
dart: 'Dart',
java: 'Java',
kotlin: 'Kotlin',
cs: 'C#',
py: 'Python',
rb: 'Ruby',
php: 'PHP',
swift: 'Swift',
xml: 'XML',
html: 'HTML',
md: 'Markdown',
json: 'JSON',
diff: 'Diff',
http: 'HTTP',
css: 'CSS',
graphql: 'GraphQL',
deno: 'Deno',
python: 'Python',
ruby: 'Ruby',
csharp: 'C#',
cpp: 'C++',
bash: 'Bash',
powershell: 'PowerShell',
cmd: 'CMD',
yaml: 'YAML',
text: 'Text',
vue: 'Vue',
svelte: 'Svelte'
export const platformMap: Record<Language | string, string> = {
[Platform.ClientApple]: 'Apple',
[Platform.ClientFlutter]: 'Flutter',
[Platform.ClientWeb]: 'Web',
[Platform.ClientAndroidKotlin]: 'Android (Kotlin)',
[Platform.ClientAndroidJava]: 'Android (Java)',
[Platform.ClientGraphql]: 'GraphQL',
[Platform.ClientRest]: 'REST',
[Platform.ServerDart]: 'Dart',
[Platform.ServerDeno]: 'Deno',
[Platform.ServerDotNet]: '.NET',
[Platform.ServerNodeJs]: 'Node.js',
[Platform.ServerPhp]: 'PHP',
[Platform.ServerPython]: 'Python',
[Platform.ServerRuby]: 'Ruby',
[Platform.ServerSwift]: 'Swift',
sh: 'Shell',
js: 'JavaScript',
jsx: 'React',
tsx: 'React',
ts: 'TypeScript',
dart: 'Dart',
java: 'Java',
kotlin: 'Kotlin',
cs: 'C#',
py: 'Python',
rb: 'Ruby',
php: 'PHP',
swift: 'Swift',
xml: 'XML',
html: 'HTML',
md: 'Markdown',
json: 'JSON',
diff: 'Diff',
http: 'HTTP',
css: 'CSS',
graphql: 'GraphQL',
deno: 'Deno',
python: 'Python',
ruby: 'Ruby',
csharp: 'C#',
cpp: 'C++',
bash: 'Bash',
powershell: 'PowerShell',
cmd: 'CMD',
yaml: 'YAML',
text: 'Text',
vue: 'Vue',
svelte: 'Svelte'
};
export const serviceMap: Record<Service, string> = {
[Service.Account]: 'Account',
[Service.Avatars]: 'Avatars',
[Service.Databases]: 'Databases',
[Service.Functions]: 'Functions',
[Service.Health]: 'Health',
[Service.Locale]: 'Locale',
[Service.Storage]: 'Storage',
[Service.Teams]: 'Teams',
[Service.Users]: 'Users'
[Service.Account]: 'Account',
[Service.Avatars]: 'Avatars',
[Service.Databases]: 'Databases',
[Service.Functions]: 'Functions',
[Service.Health]: 'Health',
[Service.Locale]: 'Locale',
[Service.Storage]: 'Storage',
[Service.Teams]: 'Teams',
[Service.Users]: 'Users'
};
export const preferredVersion = writable<Version | null>(
globalThis?.localStorage?.getItem('preferredVersion') as Version
globalThis?.localStorage?.getItem('preferredVersion') as Version
);
export const preferredPlatform = writable<Platform | null>(
globalThis?.localStorage?.getItem('preferredPlatform') as Platform
globalThis?.localStorage?.getItem('preferredPlatform') as Platform
);
if (browser) {
preferredVersion.subscribe((value) => {
if (value) globalThis?.sessionStorage?.setItem('preferredVersion', value);
});
preferredPlatform.subscribe((value) => {
if (value) globalThis?.sessionStorage?.setItem('preferredPlatform', value);
});
preferredVersion.subscribe((value) => {
if (value) globalThis?.sessionStorage?.setItem('preferredVersion', value);
});
preferredPlatform.subscribe((value) => {
if (value) globalThis?.sessionStorage?.setItem('preferredPlatform', value);
});
}