mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fixes to git
This commit is contained in:
@@ -26,6 +26,10 @@ export function deploymentStatusConverter(status: string) {
|
||||
return 'processing';
|
||||
case 'building':
|
||||
return 'pending';
|
||||
case 'waiting':
|
||||
return 'waiting';
|
||||
case 'queued':
|
||||
return 'waiting';
|
||||
case 'failed':
|
||||
return 'failed';
|
||||
}
|
||||
|
||||
+2
@@ -134,6 +134,8 @@ export function logStatusConverter(status: string) {
|
||||
return 'processing';
|
||||
case 'waiting':
|
||||
return 'waiting';
|
||||
case 'queued':
|
||||
return 'waiting';
|
||||
case 'peding':
|
||||
return 'pending';
|
||||
case 'cancelled':
|
||||
|
||||
@@ -100,7 +100,9 @@
|
||||
</Table.Cell>
|
||||
{:else if column.id === 'buildDuration'}
|
||||
<Table.Cell>
|
||||
{#if ['processing', 'building'].includes(deployment.status)}
|
||||
{#if ['waiting'].includes(deployment.status)}
|
||||
-
|
||||
{:else if ['processing', 'building'].includes(deployment.status)}
|
||||
<span use:timer={{ start: deployment.$createdAt }} />
|
||||
{:else}
|
||||
{formatTimeDetailed(deployment.buildDuration)}
|
||||
|
||||
+23
-9
@@ -4,7 +4,7 @@
|
||||
import { Repositories } from '$lib/components/git';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Link } from '$lib/elements';
|
||||
import { Button, InputCheckbox, InputSelect } from '$lib/elements/forms';
|
||||
import { Button, InputCheckbox, InputSelect, InputText } from '$lib/elements/forms';
|
||||
import { timeFromNow } from '$lib/helpers/date';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
@@ -20,6 +20,7 @@
|
||||
let hasRepository = !!site?.providerRepositoryId;
|
||||
let selectedRepository: string = site.providerRepositoryId;
|
||||
let branch: string = null;
|
||||
let commit: string = null;
|
||||
let activate = true;
|
||||
let error = '';
|
||||
|
||||
@@ -54,8 +55,6 @@
|
||||
selectedRepository
|
||||
);
|
||||
|
||||
console.log(branchList);
|
||||
|
||||
const sorted = sortBranches(branchList.branches);
|
||||
branch = sorted[0]?.name ?? null;
|
||||
|
||||
@@ -72,12 +71,21 @@
|
||||
|
||||
async function createDeployment() {
|
||||
try {
|
||||
await sdk.forProject.sites.createVcsDeployment(
|
||||
site.$id,
|
||||
VCSDeploymentType.Branch,
|
||||
branch,
|
||||
activate
|
||||
);
|
||||
if (branch) {
|
||||
await sdk.forProject.sites.createVcsDeployment(
|
||||
site.$id,
|
||||
VCSDeploymentType.Branch,
|
||||
branch,
|
||||
activate
|
||||
);
|
||||
} else {
|
||||
await sdk.forProject.sites.createVcsDeployment(
|
||||
site.$id,
|
||||
'commit',
|
||||
commit,
|
||||
activate
|
||||
);
|
||||
}
|
||||
show = false;
|
||||
invalidate(Dependencies.DEPLOYMENTS);
|
||||
addNotification({
|
||||
@@ -158,6 +166,12 @@
|
||||
branch = event.detail.value;
|
||||
}}
|
||||
{options} />
|
||||
<!-- <InputText
|
||||
required={true}
|
||||
id="commit"
|
||||
label="Commit hash"
|
||||
placeholder="Select commit"
|
||||
bind:value={commit} /> -->
|
||||
{#if branch}
|
||||
<InputCheckbox
|
||||
label="Activate deployment after build"
|
||||
|
||||
@@ -71,7 +71,9 @@
|
||||
</Table.Cell>
|
||||
{:else if column.id === 'buildDuration'}
|
||||
<Table.Cell width={column?.width?.toString() ?? ''}>
|
||||
{#if ['processing', 'building'].includes(deployment.status)}
|
||||
{#if ['waiting'].includes(deployment.status)}
|
||||
-
|
||||
{:else if ['processing', 'building'].includes(deployment.status)}
|
||||
<span use:timer={{ start: deployment.$createdAt }} />
|
||||
{:else}
|
||||
{formatTimeDetailed(deployment.buildDuration)}
|
||||
|
||||
Reference in New Issue
Block a user