mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #1649 from appwrite/fix-sites-sdk-changes
Chore: Upgrade Consoel SDK
This commit is contained in:
@@ -14,7 +14,8 @@
|
||||
|
||||
const checkDomain = debounce(async (value: string) => {
|
||||
try {
|
||||
await sdk.forProject.proxy.checkSubdomain(ResourceType.Site, value);
|
||||
// TODO: @Meldiron Fix in future, blocked by issue PLA-2254
|
||||
// await sdk.forProject.proxy.checkSubdomain(ResourceType.Site, value);
|
||||
domainIsValid = true;
|
||||
} catch {
|
||||
domainIsValid = false;
|
||||
|
||||
@@ -11,15 +11,10 @@
|
||||
import InputChoice from '$lib/elements/forms/inputChoice.svelte';
|
||||
|
||||
export let site: Models.Site;
|
||||
let siteAdapter = 'static';
|
||||
let fallback = '';
|
||||
let fallback: null | string;
|
||||
|
||||
onMount(async () => {
|
||||
siteAdapter = site?.adapter ?? 'static';
|
||||
fallback ??= site.fallbackFile;
|
||||
|
||||
// what was this check even for?
|
||||
// if (fallback !== undefined) siteAdapter = '';
|
||||
fallback = site.fallbackFile;
|
||||
});
|
||||
|
||||
async function updateSPA() {
|
||||
@@ -34,7 +29,7 @@
|
||||
site.buildCommand || undefined,
|
||||
site.outputDirectory || undefined,
|
||||
(site?.buildRuntime as BuildRuntime) || undefined,
|
||||
siteAdapter,
|
||||
site.adapter || undefined,
|
||||
fallback,
|
||||
site.installationId || undefined,
|
||||
site.providerRepositoryId || undefined,
|
||||
@@ -67,15 +62,16 @@
|
||||
id="spa"
|
||||
type="switchbox"
|
||||
label="Single page application (SPA)"
|
||||
value={site.fallbackFile !== null}
|
||||
on:change={(value) => {
|
||||
if (value.detail) {
|
||||
siteAdapter = 'static';
|
||||
fallback = '';
|
||||
} else {
|
||||
siteAdapter = 'ssr';
|
||||
fallback = null;
|
||||
}
|
||||
}} />
|
||||
|
||||
{#if siteAdapter === 'static'}
|
||||
{#if fallback !== null}
|
||||
<InputText
|
||||
id="fallback"
|
||||
label="Fallback"
|
||||
@@ -85,7 +81,7 @@
|
||||
</svelte:fragment>
|
||||
|
||||
<svelte:fragment slot="actions">
|
||||
<Button disabled={siteAdapter === site.adapter} submit>Update</Button>
|
||||
<Button disabled={fallback === site.fallbackFile} submit>Update</Button>
|
||||
</svelte:fragment>
|
||||
</CardGrid>
|
||||
</Form>
|
||||
|
||||
Reference in New Issue
Block a user