mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
feat: deisgn fixes
This commit is contained in:
@@ -7,3 +7,4 @@ export { default as DeploymentSource } from './deploymentSource.svelte';
|
||||
export { default as DeploymentDomains } from './deploymentDomains.svelte';
|
||||
export { default as ConnectBehaviour } from './connectBehaviour.svelte';
|
||||
export { default as ProductionBranchFieldset } from './productionBranchFieldset.svelte';
|
||||
export { default as RepositoryCard } from './repositoryCard.svelte';
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import Link from '$lib/elements/link.svelte';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { IconGithub } from '@appwrite.io/pink-icons-svelte';
|
||||
import { Card, Icon, Layout, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
export let repository: Models.ProviderRepository;
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
</script>
|
||||
|
||||
<Card.Base padding="xs" radius="s" variant="secondary">
|
||||
<Layout.Stack direction="row" gap="s">
|
||||
<Layout.Stack direction="row" gap="s">
|
||||
<Icon icon={IconGithub} color="--fgcolor-neutral-primary" />
|
||||
<Layout.Stack gap="xxxs">
|
||||
<Typography.Text variant="m-400" color="--fgcolor-neutral-primary">
|
||||
{repository.name}
|
||||
</Typography.Text>
|
||||
<Layout.Stack direction="row" gap="s" alignItems="center">
|
||||
<Typography.Caption variant="400" color="--fgcolor-neutral-tertiary">
|
||||
Last updated: {toLocaleDateTime(repository.pushedAt)}
|
||||
</Typography.Caption>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="2"
|
||||
height="3"
|
||||
viewBox="0 0 2 3"
|
||||
fill="none">
|
||||
<circle cx="1" cy="1.5" r="1" fill="currentColor" />
|
||||
</svg>
|
||||
<Link
|
||||
size="s"
|
||||
variant="muted"
|
||||
external
|
||||
href={`https://github.com/${repository.organization}`}
|
||||
>{repository.organization}</Link>
|
||||
</Layout.Stack>
|
||||
</Layout.Stack>
|
||||
</Layout.Stack>
|
||||
<Button secondary on:click={() => dispatch('disconnect')}>Disconnect</Button>
|
||||
</Layout.Stack>
|
||||
</Card.Base>
|
||||
+10
-2
@@ -5,17 +5,20 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
export let show = false;
|
||||
export let selectedDeployment: Models.Deployment = null;
|
||||
export let redirect = false;
|
||||
let error: string;
|
||||
|
||||
async function redeploy() {
|
||||
try {
|
||||
await sdk.forProject.functions.createDuplicateDeployment(
|
||||
const deployment = await sdk.forProject.functions.createDuplicateDeployment(
|
||||
$func.$id,
|
||||
selectedDeployment.$id,
|
||||
selectedDeployment?.buildId || undefined
|
||||
@@ -28,6 +31,11 @@
|
||||
|
||||
invalidate(Dependencies.FUNCTION);
|
||||
invalidate(Dependencies.DEPLOYMENTS);
|
||||
if (redirect) {
|
||||
goto(
|
||||
`${base}/project-${$page.params.project}/functions/function-${$func.$id}/deployments/deployment-${deployment.$id}`
|
||||
);
|
||||
}
|
||||
show = false;
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
|
||||
+2
-26
@@ -7,7 +7,6 @@
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Runtime, type Models } from '@appwrite.io/console';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import { onMount } from 'svelte';
|
||||
import DisconnectRepo from './disconnectRepo.svelte';
|
||||
import { sortBranches } from '$lib/stores/vcs';
|
||||
@@ -17,14 +16,13 @@
|
||||
Icon,
|
||||
Layout,
|
||||
Skeleton,
|
||||
Typography,
|
||||
Card as PinkCard,
|
||||
Input,
|
||||
Selector
|
||||
} from '@appwrite.io/pink-svelte';
|
||||
import Card from '$lib/components/card.svelte';
|
||||
import { IconGithub } from '@appwrite.io/pink-icons-svelte';
|
||||
import { ConnectGit } from '$lib/components/git';
|
||||
import { ConnectGit, RepositoryCard } from '$lib/components/git';
|
||||
import { isValueOfStringEnum } from '$lib/helpers/types';
|
||||
import ConnectRepoModal from '../(modals)/connectRepoModal.svelte';
|
||||
|
||||
@@ -161,29 +159,7 @@
|
||||
</Layout.Stack>
|
||||
{:else if repository}
|
||||
<Layout.Stack gap="xl">
|
||||
<Card padding="xs" radius="s" variant="secondary">
|
||||
<Layout.Stack direction="row" gap="s">
|
||||
<Layout.Stack direction="row" gap="s">
|
||||
<Icon icon={IconGithub} color="--fgcolor-neutral-primary" />
|
||||
<Layout.Stack gap="xxxs">
|
||||
<Typography.Text
|
||||
variant="m-400"
|
||||
color="--fgcolor-neutral-primary">
|
||||
{repository.name}
|
||||
</Typography.Text>
|
||||
<Typography.Caption
|
||||
variant="400"
|
||||
color="--fgcolor-neutral-tertiary">
|
||||
Last updated: {toLocaleDateTime(repository.pushedAt)}
|
||||
</Typography.Caption>
|
||||
</Layout.Stack>
|
||||
</Layout.Stack>
|
||||
<Button secondary on:click={() => (showDisconnect = true)}>
|
||||
Disconnect
|
||||
</Button>
|
||||
</Layout.Stack>
|
||||
</Card>
|
||||
|
||||
<RepositoryCard {repository} on:disconnect={() => (showDisconnect = true)} />
|
||||
<Fieldset legend="Branch">
|
||||
<Layout.Stack gap="xl">
|
||||
<Input.ComboBox
|
||||
|
||||
@@ -97,18 +97,18 @@
|
||||
<Table.Root
|
||||
let:root
|
||||
columns={[
|
||||
{ id: 'repo', width: { min: 150, max: 500 } },
|
||||
{ id: 'owner', width: { min: 150, max: 500 } },
|
||||
{ id: 'updated', width: { min: 150, max: 500 } },
|
||||
{ id: 'actions', width: 60 }
|
||||
]}>
|
||||
<svelte:fragment slot="header" let:root>
|
||||
<Table.Header.Cell column="repo" {root}>Repository</Table.Header.Cell>
|
||||
<Table.Header.Cell column="owner" {root}>Owner</Table.Header.Cell>
|
||||
<Table.Header.Cell column="updated" {root}>Updated</Table.Header.Cell>
|
||||
<Table.Header.Cell column="actions" {root} />
|
||||
</svelte:fragment>
|
||||
{#each installations as installation, i}
|
||||
<Table.Row.Base {root}>
|
||||
<Table.Cell column="repo" {root}>
|
||||
<Table.Cell column="owner" {root}>
|
||||
<Layout.Stack direction="row" gap="s" alignItems="center">
|
||||
<Avatar alt={installation.provider} size="xs">
|
||||
<Icon
|
||||
|
||||
@@ -4,26 +4,37 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
export let show = false;
|
||||
export let selectedDeploymentId: string;
|
||||
export let site: Models.Site;
|
||||
export let redirect = false;
|
||||
let error: string;
|
||||
|
||||
async function redeploy() {
|
||||
try {
|
||||
sdk.forProject.sites.createDuplicateDeployment(site.$id, selectedDeploymentId);
|
||||
const deployment = await sdk.forProject.sites.createDuplicateDeployment(
|
||||
site.$id,
|
||||
selectedDeploymentId
|
||||
);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `Redeploying ${site.name}`
|
||||
});
|
||||
trackEvent(Submit.SiteRedeploy);
|
||||
|
||||
invalidate(Dependencies.SITE);
|
||||
invalidate(Dependencies.DEPLOYMENTS);
|
||||
if (redirect) {
|
||||
await goto(
|
||||
`${base}/project-${$page.params.project}/sites/site-${site.$id}/deployments/deployment-${deployment.$id}`
|
||||
);
|
||||
}
|
||||
await invalidate(Dependencies.SITE);
|
||||
await invalidate(Dependencies.DEPLOYMENTS);
|
||||
show = false;
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
|
||||
+1
@@ -93,6 +93,7 @@
|
||||
<RedeployModal
|
||||
selectedDeploymentId={data.deployment.$id}
|
||||
bind:show={showRedeploy}
|
||||
redirect
|
||||
site={data.site} />
|
||||
{#if showActivate}
|
||||
<ActivateDeploymentModal
|
||||
|
||||
+2
-25
@@ -7,7 +7,6 @@
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Adapter, BuildRuntime, Framework, type Models } from '@appwrite.io/console';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import { onMount } from 'svelte';
|
||||
import DisconnectRepo from './disconnectRepo.svelte';
|
||||
import { sortBranches } from '$lib/stores/vcs';
|
||||
@@ -17,14 +16,13 @@
|
||||
Icon,
|
||||
Layout,
|
||||
Skeleton,
|
||||
Typography,
|
||||
Card as PinkCard,
|
||||
Input,
|
||||
Selector
|
||||
} from '@appwrite.io/pink-svelte';
|
||||
import Card from '$lib/components/card.svelte';
|
||||
import { IconGithub } from '@appwrite.io/pink-icons-svelte';
|
||||
import { ConnectGit } from '$lib/components/git';
|
||||
import { ConnectGit, RepositoryCard } from '$lib/components/git';
|
||||
import ConnectRepoModal from '../../(components)/connectRepoModal.svelte';
|
||||
import { showConnectRepo } from './store';
|
||||
|
||||
@@ -159,28 +157,7 @@
|
||||
</Layout.Stack>
|
||||
{:else if repository}
|
||||
<Layout.Stack gap="xl">
|
||||
<Card padding="xs" radius="s" variant="secondary">
|
||||
<Layout.Stack direction="row" gap="s">
|
||||
<Layout.Stack direction="row" gap="s">
|
||||
<Icon icon={IconGithub} color="--fgcolor-neutral-primary" />
|
||||
<Layout.Stack gap="xxxs">
|
||||
<Typography.Text
|
||||
variant="m-400"
|
||||
color="--fgcolor-neutral-primary">
|
||||
{repository.name}
|
||||
</Typography.Text>
|
||||
<Typography.Caption
|
||||
variant="400"
|
||||
color="--fgcolor-neutral-tertiary">
|
||||
Last updated: {toLocaleDateTime(repository.pushedAt)}
|
||||
</Typography.Caption>
|
||||
</Layout.Stack>
|
||||
</Layout.Stack>
|
||||
<Button secondary on:click={() => (showDisconnect = true)}>
|
||||
Disconnect
|
||||
</Button>
|
||||
</Layout.Stack>
|
||||
</Card>
|
||||
<RepositoryCard {repository} on:disconnect={() => (showDisconnect = true)} />
|
||||
|
||||
<Fieldset legend="Branch">
|
||||
<Layout.Stack gap="xl">
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
template: Models.TemplateFunction | Models.TemplateSite,
|
||||
product: 'site' | 'function'
|
||||
): template is Models.TemplateSite {
|
||||
return product === 'site';
|
||||
return product === 'site' && 'frameworks' in template;
|
||||
}
|
||||
|
||||
function onGithubLogin() {
|
||||
|
||||
Reference in New Issue
Block a user