mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #1276 from appwrite/feat-add-schedule-tooltip-date
feat: add schedule executions tooltip info
This commit is contained in:
2 files changed
+48
-15
No files matched your search
+43
-12
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { hoursToDays, toLocaleDateTime } from '$lib/helpers/date';
|
||||
import { hoursToDays, timeFromNow, toLocaleDateTime } from '$lib/helpers/date';
|
||||
import { log } from '$lib/stores/logs';
|
||||
import { Alert, Card, Code, Heading, Id, SvgIcon, Tab, Tabs } from '../components';
|
||||
import { Alert, Card, Code, Copy, Heading, Id, SvgIcon, Tab, Tabs } from '../components';
|
||||
import { calculateTime } from '$lib/helpers/timeConversion';
|
||||
import {
|
||||
TableBody,
|
||||
@@ -18,6 +18,7 @@
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { BillingPlan } from '$lib/constants';
|
||||
import { tooltip } from '$lib/actions/tooltip';
|
||||
|
||||
let selectedRequest = 'parameters';
|
||||
let selectedResponse = 'logs';
|
||||
@@ -124,13 +125,26 @@
|
||||
{/if}
|
||||
</ul>
|
||||
<div class="status u-margin-inline-start-auto">
|
||||
<Pill
|
||||
warning={execution.status === 'waiting' ||
|
||||
execution.status === 'building'}
|
||||
danger={execution.status === 'failed'}
|
||||
info={execution.status === 'completed' || execution.status === 'ready'}>
|
||||
{execution.status}
|
||||
</Pill>
|
||||
<div
|
||||
use:tooltip={{
|
||||
content: `Scheduled to execute on ${toLocaleDateTime(execution.scheduledAt)}`,
|
||||
disabled:
|
||||
!execution?.scheduledAt || execution.status !== 'scheduled'
|
||||
}}>
|
||||
<Pill
|
||||
warning={execution.status === 'waiting' ||
|
||||
execution.status === 'building'}
|
||||
danger={execution.status === 'failed'}
|
||||
info={execution.status === 'completed' ||
|
||||
execution.status === 'ready'}>
|
||||
{#if execution.status === 'scheduled'}
|
||||
<span class="icon-clock" aria-hidden="true" />
|
||||
{timeFromNow(execution.scheduledAt)}
|
||||
{:else}
|
||||
{execution.status}
|
||||
{/if}
|
||||
</Pill>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -145,7 +159,23 @@
|
||||
</div>
|
||||
<div class="u-flex u-gap-16">
|
||||
<h4 class="text u-bold">Path:</h4>
|
||||
<span class="u-text-color-gray">{execution.requestPath}</span>
|
||||
|
||||
<Copy value={execution.requestPath}>
|
||||
<div
|
||||
class="interactive-text-output is-textarea"
|
||||
style:min-inline-size="0">
|
||||
<span class="text u-line-height-1-5 u-break-all">
|
||||
{execution.requestPath}
|
||||
</span>
|
||||
<div class="u-flex u-cross-child-start u-gap-8">
|
||||
<button
|
||||
class="interactive-text-output-button"
|
||||
aria-label="copy text">
|
||||
<span class="icon-duplicate" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</Copy>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -156,8 +186,9 @@
|
||||
</div>
|
||||
<div class="u-flex u-gap-16">
|
||||
<h4 class="text u-bold">Status Code:</h4>
|
||||
<span class="u-text-color-gray"
|
||||
>{execution.responseStatusCode}</span>
|
||||
<span class="u-text-color-gray">
|
||||
{execution.responseStatusCode}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
+5
-3
@@ -66,8 +66,8 @@
|
||||
{@const status = execution.status}
|
||||
<div
|
||||
use:tooltip={{
|
||||
content: `Scheduled to execute on ${toLocaleDateTime(execution?.schedule)}`,
|
||||
disabled: !execution?.schedule
|
||||
content: `Scheduled to execute on ${toLocaleDateTime(execution.scheduledAt)}`,
|
||||
disabled: !execution?.scheduledAt || status !== 'scheduled'
|
||||
}}>
|
||||
<Pill
|
||||
warning={status === 'waiting' || status === 'building'}
|
||||
@@ -75,8 +75,10 @@
|
||||
info={status === 'completed' || status === 'ready'}>
|
||||
{#if status === 'scheduled'}
|
||||
<span class="icon-clock" aria-hidden="true" />
|
||||
{timeFromNow(execution.scheduledAt)}
|
||||
{:else}
|
||||
{status}
|
||||
{/if}
|
||||
{status}
|
||||
</Pill>
|
||||
</div>
|
||||
</TableCell>
|
||||
|
||||
Reference in new issue
Block a user