|
1 | 1 | <script lang="ts"> |
2 | 2 | import { page } from '$app/state'; |
3 | 3 |
|
4 | | - import { timestamp } from '$lib/components/timestamp.svelte'; |
5 | 4 | import Tooltip from '$lib/holocene/tooltip.svelte'; |
6 | 5 | import { translate } from '$lib/i18n/translate'; |
7 | 6 | import { fetchWorkflow } from '$lib/services/workflow-service'; |
8 | 7 | import { isCloud } from '$lib/stores/advanced-visibility'; |
9 | 8 | import { fullEventHistory, sdkInfo } from '$lib/stores/events'; |
10 | | - import { |
11 | | - relativeTime, |
12 | | - timeFormat, |
13 | | - timestampFormat, |
14 | | - } from '$lib/stores/time-format'; |
15 | 9 | import type { WorkflowExecution } from '$lib/types/workflows'; |
16 | 10 | import { formatBytes } from '$lib/utilities/format-bytes'; |
17 | | - import { formatDate } from '$lib/utilities/format-date'; |
18 | 11 | import { |
19 | 12 | formatDistanceAbbreviated, |
20 | 13 | formatDuration, |
|
36 | 29 | DetailListTextValue, |
37 | 30 | DetailListValue, |
38 | 31 | } from '../detail-list'; |
| 32 | + import DetailListTimestampValue from '../detail-list/detail-list-timestamp-value.svelte'; |
39 | 33 |
|
40 | 34 | import SdkLogo from './sdk-logo.svelte'; |
41 | 35 |
|
|
110 | 104 |
|
111 | 105 | <DetailList aria-label="workflow details" rowCount={5}> |
112 | 106 | <DetailListLabel>{translate('common.start')}</DetailListLabel> |
113 | | - <DetailListTextValue |
114 | | - text={$timestamp(workflow?.startTime)} |
115 | | - tooltipText={formatDate(workflow?.startTime, $timeFormat, { |
116 | | - relative: !$relativeTime, |
117 | | - format: $timestampFormat, |
118 | | - })} |
119 | | - /> |
| 107 | + <DetailListTimestampValue timestamp={workflow?.startTime} /> |
120 | 108 |
|
121 | 109 | {#if workflow?.startDelay} |
122 | 110 | <DetailListLabel>{translate('workflows.execution-start')}</DetailListLabel> |
123 | | - <DetailListTextValue |
124 | | - text={$timestamp(workflow?.executionTime)} |
125 | | - tooltipText={formatDate(workflow?.executionTime, $timeFormat, { |
126 | | - relative: !$relativeTime, |
127 | | - format: $timestampFormat, |
128 | | - })} |
129 | | - /> |
| 111 | + <DetailListTimestampValue timestamp={workflow?.executionTime} /> |
130 | 112 | {/if} |
131 | 113 |
|
132 | 114 | <DetailListLabel>{translate('common.end')}</DetailListLabel> |
133 | | - <DetailListTextValue |
134 | | - text={workflow?.endTime ? $timestamp(workflow?.endTime) : '-'} |
135 | | - tooltipText={formatDate(workflow?.endTime, $timeFormat, { |
136 | | - relative: !$relativeTime, |
137 | | - format: $timestampFormat, |
138 | | - })} |
139 | | - /> |
| 115 | + <DetailListTimestampValue timestamp={workflow?.endTime} fallback="-" /> |
140 | 116 |
|
141 | 117 | <DetailListLabel> |
142 | 118 | {translate('common.duration')} |
143 | 119 | </DetailListLabel> |
144 | | - <DetailListTextValue text={elapsedTime} /> |
| 120 | + <DetailListTextValue class="font-mono" text={elapsedTime} /> |
145 | 121 |
|
146 | 122 | {#if workflow?.workflowExecutionTimeout && workflow?.workflowExecutionTimeout.toString() !== '0s'} |
147 | 123 | <DetailListLabel>{translate('workflows.workflow-timeout')}</DetailListLabel> |
148 | 124 | <DetailListTextValue |
| 125 | + class="font-mono" |
149 | 126 | text={formatDuration(workflow.workflowExecutionTimeout)} |
150 | 127 | tooltipText={formatDuration(workflow.workflowExecutionTimeout)} |
151 | 128 | /> |
|
284 | 261 |
|
285 | 262 | <DetailListColumn> |
286 | 263 | <DetailListLabel>{translate('common.history-size')}</DetailListLabel> |
287 | | - <DetailListTextValue text={historySizeFormatted} /> |
| 264 | + <DetailListTextValue |
| 265 | + class="font-mono" |
| 266 | + tooltipText={workflow.externalPayloadCount |
| 267 | + ? translate('workflows.external-payload-tooltip') |
| 268 | + : ''} |
| 269 | + iconName={workflow.externalPayloadCount ? 'square-info' : undefined} |
| 270 | + iconPosition="trailing" |
| 271 | + text={historySizeFormatted} |
| 272 | + /> |
| 273 | + {#if workflow.externalPayloadCount} |
| 274 | + <DetailListLabel |
| 275 | + >{translate('workflows.external-payload-size')}</DetailListLabel |
| 276 | + > |
| 277 | + <DetailListTextValue |
| 278 | + class="font-mono" |
| 279 | + text={formatBytes(parseInt(workflow.externalPayloadSizeBytes, 10))} |
| 280 | + /> |
| 281 | + <DetailListLabel |
| 282 | + >{translate('workflows.external-payload-count')}</DetailListLabel |
| 283 | + > |
| 284 | + <DetailListTextValue |
| 285 | + class="font-mono" |
| 286 | + text={workflow.externalPayloadCount} |
| 287 | + /> |
| 288 | + {/if} |
288 | 289 |
|
289 | 290 | {#if !$isCloud} |
290 | 291 | <DetailListLabel |
291 | 292 | >{translate('workflows.state-transitions')}</DetailListLabel |
292 | 293 | > |
293 | | - <DetailListTextValue text={workflow?.stateTransitionCount} /> |
| 294 | + <DetailListTextValue |
| 295 | + class="font-mono" |
| 296 | + text={workflow?.stateTransitionCount} |
| 297 | + /> |
294 | 298 | {:else} |
295 | 299 | <Tooltip |
296 | 300 | bottomLeft |
|
0 commit comments