-
Notifications
You must be signed in to change notification settings - Fork 249
Expand file tree
/
Copy pathconnectGit.svelte
More file actions
48 lines (45 loc) · 1.89 KB
/
Copy pathconnectGit.svelte
File metadata and controls
48 lines (45 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<script lang="ts">
import { isSelfHosted } from '$lib/system';
import { connectGitHub } from '$lib/stores/git';
import Button from '$lib/elements/forms/button.svelte';
import { IconGithub } from '@appwrite.io/pink-icons-svelte';
import { Alert, Card, Empty, Icon, Layout } from '@appwrite.io/pink-svelte';
import { regionalConsoleVariables } from '$routes/(console)/project-[region]-[project]/store';
export let callbackState: Record<string, string> = null;
let isVcsEnabled = $regionalConsoleVariables?._APP_VCS_ENABLED === true;
</script>
<Layout.Stack>
{#if !isVcsEnabled && isSelfHosted}
<Alert.Inline status="info" title="Installing Git on a self-hosted instance ">
<Layout.Stack>
<p>
Before installing Git in a locally hosted Appwrite project, ensure your
environment variables are configured.
</p>
<div>
<Button
compact
external
href="https://appwrite.io/docs/advanced/self-hosting/configuration/version-control"
>Learn more</Button>
</div>
</Layout.Stack>
</Alert.Inline>
{/if}
<Card.Base padding="none" border="dashed">
<Empty
type="secondary"
title="No installation was added to the project yet"
description="Add an installation to connect repositories">
<svelte:fragment slot="actions">
<Button
secondary
href={connectGitHub(callbackState).toString()}
disabled={!isVcsEnabled}>
<Icon slot="start" icon={IconGithub} />
Connect to GitHub
</Button>
</svelte:fragment>
</Empty>
</Card.Base>
</Layout.Stack>