mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
updated the formating issue with pnpm format
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
import type { Models } from "@appwrite.io/console";
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
/**
|
||||
* Build VCS repo URL from the template response model.
|
||||
* Example (GitHub): https://github.com/appwrite/templates-for-sites
|
||||
*/
|
||||
export function getTemplateSourceUrl(
|
||||
t: Models.TemplateSite | Models.TemplateFunction
|
||||
t: Models.TemplateSite | Models.TemplateFunction
|
||||
): string | null {
|
||||
const owner = t.providerOwner;
|
||||
const repo = t.providerRepositoryId;
|
||||
const provider = t.vcsProvider; // e.g., "github"
|
||||
const owner = t.providerOwner;
|
||||
const repo = t.providerRepositoryId;
|
||||
const provider = t.vcsProvider; // e.g., "github"
|
||||
|
||||
if (!owner || !repo || !provider) return null;
|
||||
if (!owner || !repo || !provider) return null;
|
||||
|
||||
// Map provider → host (extend if needed)
|
||||
const hostMap: Record<string, string> = {
|
||||
github: "github.com",
|
||||
gitlab: "gitlab.com",
|
||||
bitbucket: "bitbucket.org",
|
||||
};
|
||||
// Map provider → host (extend if needed)
|
||||
const hostMap: Record<string, string> = {
|
||||
github: 'github.com',
|
||||
gitlab: 'gitlab.com',
|
||||
bitbucket: 'bitbucket.org'
|
||||
};
|
||||
|
||||
const host = hostMap[provider.toLowerCase()] ?? provider; // fallback
|
||||
const host = hostMap[provider.toLowerCase()] ?? provider; // fallback
|
||||
|
||||
return `https://${host}/${owner}/${repo}`;
|
||||
return `https://${host}/${owner}/${repo}`;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</Typography.Text>
|
||||
</Layout.Stack>
|
||||
</Layout.Stack>
|
||||
<slot name="framework-actions" />
|
||||
<slot name="framework-actions" />
|
||||
{/if}
|
||||
|
||||
{#if domain && showAfter}
|
||||
|
||||
+3
-7
@@ -352,15 +352,11 @@
|
||||
alt={data.template.name}
|
||||
ratio="16/9" />
|
||||
</Layout.Stack>
|
||||
|
||||
<svelte:fragment slot="framework-actions" >
|
||||
|
||||
<svelte:fragment slot="framework-actions">
|
||||
{@const sourceUrl = getTemplateSourceUrl(data.template)}
|
||||
{#if sourceUrl}
|
||||
<Button
|
||||
secondary
|
||||
size="s"
|
||||
external
|
||||
href={sourceUrl}>
|
||||
<Button secondary size="s" external href={sourceUrl}>
|
||||
View source
|
||||
<Icon icon={IconExternalLink} slot="end" size="s" />
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user