Skip to content

Commit 22cfbcb

Browse files
authored
Merge branch 'main' into ser-399-fix-duration-filter
2 parents ee54761 + 0e707ff commit 22cfbcb

9 files changed

Lines changed: 54 additions & 11 deletions

File tree

src/lib/actions/timer.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ export const timer: Action<HTMLElement, Props> = (node, props) => {
2121
}
2222

2323
function step() {
24-
const diffInSeconds = Math.floor((new Date().getTime() - startDate.getTime()) / 1000);
25-
const minutes = Math.floor(diffInSeconds / 60);
24+
const elapsedSeconds = Math.max(
25+
0,
26+
Math.floor((new Date().getTime() - startDate.getTime()) / 1000)
27+
);
28+
const minutes = Math.floor(elapsedSeconds / 60);
2629
if (minutes > 0) {
27-
const seconds = diffInSeconds % 60;
30+
const seconds = elapsedSeconds % 60;
2831
node.textContent = `${minutes}m ${seconds}s`;
2932
} else {
30-
node.textContent = calculateTime(diffInSeconds);
33+
node.textContent = calculateTime(elapsedSeconds);
3134
}
3235
frame = window.requestAnimationFrame(step);
3336
}

src/lib/components/csvImportBox.svelte

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
6363
if (isSuccess) {
6464
await invalidate(Dependencies.ROWS);
65-
$spreadsheetRenderKey = hash(Date.now().toString());
65+
spreadsheetRenderKey.set(hash(Date.now().toString()));
6666
}
6767
}
6868
@@ -90,6 +90,15 @@
9090
}
9191
}
9292
93+
if (tableId && tableName === null) {
94+
importItems.update((items) => {
95+
const next = new Map(items);
96+
next.delete(importData.$id);
97+
return next;
98+
});
99+
return;
100+
}
101+
93102
importItems.update((items) => {
94103
const existing = items.get(importData.$id);
95104

src/lib/data/testimonials.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const testimonials: Testimonial[] = [
4444
{
4545
id: 'phil-majikkids',
4646
logo: Phil,
47-
headline: 'Just like a Swiss Army Knife - choose and use the tools you need',
47+
headline: 'With Appwrite, Majik Kids built an entire app with one developer.',
4848
blurb: 'Just like a Swiss Army Knife you can choose and use the tools that you need with Appwrite.',
4949
name: 'Phil McCluskey',
5050
title: 'App Manager, Majik Kids',

src/routes/(console)/account/payments/addressModal.svelte

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,25 +89,34 @@
8989
id="address"
9090
label="Street address"
9191
placeholder="Enter street address"
92+
autocomplete
9293
required />
9394
<InputText
9495
bind:value={address2}
9596
id="address2"
9697
label="Address line 2"
98+
autocomplete
9799
placeholder="Unit number, floor, etc." />
98100
<InputText
99101
bind:value={city}
100102
id="city"
101103
label="City or suburb"
102104
placeholder="Enter your city"
105+
autocomplete
103106
required />
104107
<InputText
105108
bind:value={state}
106109
id="state"
107110
label="State"
108111
placeholder="Enter your state"
112+
autocomplete
109113
required />
110-
<InputText bind:value={zip} id="zip" label="Postal code" placeholder="Enter postal code" />
114+
<InputText
115+
bind:value={zip}
116+
id="zip"
117+
label="Postal code"
118+
placeholder="Enter postal code"
119+
autocomplete />
111120

112121
<svelte:fragment slot="footer">
113122
<Button text on:click={() => (show = false)}>Cancel</Button>

src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/sheet.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import { Copy } from '$lib/components';
2222
import { logStatusConverter } from './store';
2323
import { LogsRequest, LogsResponse } from '$lib/components/logs';
24+
import { timer } from '$lib/actions/timer';
2425
2526
export let selectedLogId: string;
2627
export let logs: Models.Execution[];
@@ -139,7 +140,11 @@
139140
Duration
140141
</Typography.Text>
141142
<Typography.Text variant="m-400">
142-
{calculateTime(selectedLog.duration)}
143+
{#if ['processing', 'waiting'].includes(selectedLog.status)}
144+
<span use:timer={{ start: selectedLog.$createdAt }}></span>
145+
{:else}
146+
{calculateTime(selectedLog.duration)}
147+
{/if}
143148
</Typography.Text>
144149
</Layout.Stack>
145150

src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/table.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import { invalidate } from '$app/navigation';
2626
import { Dependencies } from '$lib/constants';
2727
import { Button } from '$lib/elements/forms';
28+
import { timer } from '$lib/actions/timer';
2829
2930
export let columns: Column[];
3031
export let executions: Models.ExecutionList;
@@ -121,7 +122,11 @@
121122
</span>
122123
</Tooltip>
123124
{:else if column.id === 'duration'}
124-
{calculateTime(log.duration)}
125+
{#if ['processing', 'waiting'].includes(log.status)}
126+
<span use:timer={{ start: log.$createdAt }}></span>
127+
{:else}
128+
{calculateTime(log.duration)}
129+
{/if}
125130
{/if}
126131
</Table.Cell>
127132
{/each}

src/routes/(console)/project-[region]-[project]/sites/site-[site]/logs/sheet.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import { Copy } from '$lib/components';
2020
import { LogsRequest, LogsResponse } from '$lib/components/logs';
2121
import { site } from '../store';
22+
import { timer } from '$lib/actions/timer';
2223
2324
export let open = false;
2425
export let selectedLogId: string;
@@ -112,7 +113,12 @@
112113
Duration
113114
</Typography.Text>
114115
<Typography.Text variant="m-400">
115-
{calculateTime(selectedLog.duration)}
116+
{#if ['processing', 'waiting'].includes(selectedLog.status)}
117+
<span use:timer={{ start: selectedLog.$createdAt }}
118+
></span>
119+
{:else}
120+
{calculateTime(selectedLog.duration)}
121+
{/if}
116122
</Typography.Text>
117123
</Layout.Stack>
118124
<Layout.Stack gap="xs" inline>

src/routes/(console)/project-[region]-[project]/sites/site-[site]/logs/table.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import { calculateTime } from '$lib/helpers/timeConversion';
1515
import { getBadgeTypeFromStatusCode } from '$lib/helpers/httpStatus';
1616
import { Button } from '$lib/elements/forms';
17+
import { timer } from '$lib/actions/timer';
1718
1819
export let columns: Column[];
1920
export let logs: Models.ExecutionList;
@@ -83,7 +84,11 @@
8384
{log.requestMethod}
8485
</Typography.Code>
8586
{:else if column.id === 'duration'}
86-
{calculateTime(log.duration)}
87+
{#if ['processing', 'waiting'].includes(log.status)}
88+
<span use:timer={{ start: log.$createdAt }}></span>
89+
{:else}
90+
{calculateTime(log.duration)}
91+
{/if}
8792
{:else if column.id === 'responseStatusCode'}
8893
<div>
8994
<Badge

src/routes/(public)/(guest)/register/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
placeholder="Your name"
131131
autofocus
132132
required
133+
autocomplete
133134
bind:value={name} />
134135
<InputEmail
135136
id="email"

0 commit comments

Comments
 (0)