1 parent
e0e9ca77cd
commit
26540cec82
6 files changed
+189
-98
No files matched your search
@@ -26,6 +26,40 @@ export abstract class BaseClient {
|
||||
}
|
||||
}
|
||||
|
||||
static async fetchInfo(
|
||||
base: string,
|
||||
): Promise<{ type: ClientType; version: string } | null> {
|
||||
try {
|
||||
const res = await fetch(new URL('/nodeinfo/2.1', base))
|
||||
|
||||
if (!res.ok) return null
|
||||
|
||||
const software: { name: string; version: string } = (await res.json())
|
||||
.software
|
||||
|
||||
// should probably extract this into not a static function but its ok
|
||||
switch (software.name) {
|
||||
case 'lemmy': {
|
||||
return {
|
||||
type: { baseUrl: '/api/v3', name: 'lemmy' },
|
||||
version: software.version,
|
||||
}
|
||||
}
|
||||
case 'piefed': {
|
||||
return {
|
||||
type: { baseUrl: '/api/alpha', name: 'piefed' },
|
||||
version: software.version,
|
||||
}
|
||||
}
|
||||
default:
|
||||
return null
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
abstract getSite(): Promise<types.GetSiteResponse>
|
||||
abstract editSite(form: types.EditSite): Promise<types.SiteResponse>
|
||||
abstract generateTotpSecret(): Promise<types.GenerateTotpSecretResponse>
|
||||
|
||||
@@ -953,7 +953,8 @@
|
||||
"not_an_admin": "You are not an admin of this server.",
|
||||
"rate_limit_error": "You are performing that action too fast.",
|
||||
"unimplemented": "That function of your account's server software is not yet supported by Photon.",
|
||||
"unsupported": "That function is not supported by your account's server software."
|
||||
"unsupported": "That function is not supported by your account's server software.",
|
||||
"not_live_supported": "That server is not running supported software, or is offline."
|
||||
},
|
||||
"aria": {
|
||||
"pagination": {
|
||||
|
||||
@@ -65,9 +65,10 @@
|
||||
<Label
|
||||
for={id}
|
||||
text={label}
|
||||
class="peer-invalid:text-red-500 {required
|
||||
? "after:content-['*'] after:text-red-500 after:ml-1"
|
||||
: ''}"
|
||||
class={[
|
||||
'peer-invalid:text-red-500 relative',
|
||||
required && "after:content-['*'] after:text-red-500 after:ml-1",
|
||||
]}
|
||||
>
|
||||
{@render passedCustomLabel?.()}
|
||||
</Label>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
{#if children}
|
||||
{@render children?.()}
|
||||
{:else if content}
|
||||
<p>
|
||||
<p class="text-left justify-self-start">
|
||||
{content}
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
Reference in new issue
Block a user