refactor: 使用 Naive UI 重构后台布局与黑白双主题
This commit is contained in:
1 parent
55516537bf
commit
db8c176b55
51 files changed
+3277
-2442
No files matched your search
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { NEmpty, NTimeline, NTimelineItem } from 'naive-ui'
|
||||
import { Clock3 } from '@lucide/vue'
|
||||
import { formatDate, nodeLabel } from '../../lib/format'
|
||||
import { workflowCheckpoints } from './selectors'
|
||||
@@ -14,9 +15,13 @@ const history = computed(() => workflowCheckpoints(props.checkpoints, props.work
|
||||
<aside class="history-panel">
|
||||
<h3 class="mb-1 flex items-center gap-2 text-sm font-semibold"><Clock3 :size="15" />执行记录</h3>
|
||||
<p class="mb-6 text-xs leading-5 text-muted">最近 18 个 checkpoint · 自动刷新</p>
|
||||
<p v-if="!history.length" class="text-xs leading-6 text-muted">工作流尚未保存执行记录。</p>
|
||||
<ol v-else class="timeline">
|
||||
<li v-for="(item, index) in history" :key="item.checkpointId" :class="{ 'timeline-latest': index === 0 }">
|
||||
<NEmpty v-if="!history.length" size="small" description="工作流尚未保存执行记录。" />
|
||||
<NTimeline v-else>
|
||||
<NTimelineItem
|
||||
v-for="item in history"
|
||||
:key="item.checkpointId"
|
||||
:type="item.state.workflowExecution?.status === 'failed' ? 'error' : 'default'"
|
||||
>
|
||||
<p class="text-xs font-medium">{{ nodeLabel(item.metadata?.nodeName) }}</p>
|
||||
<p class="mt-1 text-[11px] text-muted">
|
||||
{{ formatDate(item.createdAt)
|
||||
@@ -27,8 +32,8 @@ const history = computed(() => workflowCheckpoints(props.checkpoints, props.work
|
||||
<span v-if="item.state.workflowExecution?.status === 'failed'" class="mt-1 block text-xs text-danger"
|
||||
>运行失败</span
|
||||
>
|
||||
</li>
|
||||
</ol>
|
||||
</NTimelineItem>
|
||||
</NTimeline>
|
||||
<p class="mt-5 border-t border-line pt-4 text-[11px] leading-5 text-muted">
|
||||
记录在节点或批次结束后更新,长时间无新记录不一定意味着任务失败。
|
||||
</p>
|
||||
|
||||
Reference in new issue
Block a user