mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
perf: 优化流水线列表页面、详情页面性能,精简返回数据
This commit is contained in:
@@ -335,7 +335,7 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
|
||||
}
|
||||
},
|
||||
},
|
||||
_triggerCount: {
|
||||
triggerCount: {
|
||||
title: t("certd.fields.scheduledTaskCount"),
|
||||
type: "number",
|
||||
column: {
|
||||
@@ -346,7 +346,7 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
_stepCount: {
|
||||
stepCount: {
|
||||
title: t("certd.fields.deployTaskCount"),
|
||||
type: "number",
|
||||
form: { show: false },
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
<fs-icon v-bind="status" :color="status.iconColor || status.color" />
|
||||
</template>
|
||||
<p>
|
||||
<fs-date-format :model-value="runnable.status?.startTime"></fs-date-format>
|
||||
<fs-date-format :model-value="runnable.createTime"></fs-date-format>
|
||||
<a-tag class="ml-5" :color="status.color" :closable="status.value === 'start'" @close="cancelTask">
|
||||
{{ status.label }}
|
||||
</a-tag>
|
||||
@@ -46,7 +46,7 @@ export default defineComponent({
|
||||
emits: ["view", "cancel"],
|
||||
setup(props: any, ctx: any) {
|
||||
const status = computed(() => {
|
||||
return statusUtil.get(props.runnable?.status?.result);
|
||||
return statusUtil.get(props.runnable?.status);
|
||||
});
|
||||
|
||||
function view() {
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
<a-timeline class="mt-10">
|
||||
<template v-for="item of histories" :key="item.id">
|
||||
<pi-history-timeline-item
|
||||
:runnable="item.pipeline"
|
||||
:runnable="item"
|
||||
:history-id="item.id"
|
||||
:is-current="currentHistory?.id === item.id"
|
||||
:edit-mode="editMode"
|
||||
@@ -371,7 +371,7 @@ export default defineComponent({
|
||||
const loadCurrentHistoryDetail = async () => {
|
||||
const detail: RunHistory = await props.options?.getHistoryDetail({ historyId: currentHistory.value.id });
|
||||
currentHistory.value.logs = detail.logs;
|
||||
merge(currentHistory.value.pipeline, detail.pipeline);
|
||||
currentHistory.value.pipeline = detail.pipeline;
|
||||
};
|
||||
const changeCurrentHistory = async (history?: RunHistory) => {
|
||||
if (!history) {
|
||||
@@ -382,7 +382,8 @@ export default defineComponent({
|
||||
}
|
||||
currentHistory.value = history;
|
||||
await loadCurrentHistoryDetail();
|
||||
pipeline.value = history.pipeline;
|
||||
pipeline.value = currentHistory.value.pipeline;
|
||||
currentPipeline.value = cloneDeep(pipeline.value);
|
||||
};
|
||||
|
||||
async function loadHistoryList(reload = false) {
|
||||
@@ -413,7 +414,8 @@ export default defineComponent({
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (historyList[0].pipeline?.version === pipeline.value.version) {
|
||||
//@ts-ignore
|
||||
if (historyList[0]?.version === pipeline.value.version) {
|
||||
await changeCurrentHistory(historyList[0]);
|
||||
}
|
||||
}
|
||||
@@ -486,7 +488,6 @@ export default defineComponent({
|
||||
},
|
||||
detail.pipeline
|
||||
);
|
||||
debugger;
|
||||
pipeline.value = currentPipeline.value;
|
||||
await loadHistoryList(true);
|
||||
},
|
||||
@@ -707,7 +708,6 @@ export default defineComponent({
|
||||
title: "确认",
|
||||
content: `确定要手动触发运行吗?`,
|
||||
async onOk() {
|
||||
debugger;
|
||||
//@ts-ignore
|
||||
await changeCurrentHistory(null);
|
||||
await props.options.doTrigger({ pipelineId: pipeline.value.id, stepId: stepId });
|
||||
@@ -787,7 +787,6 @@ export default defineComponent({
|
||||
pipeline.value.version = 0;
|
||||
}
|
||||
pipeline.value.version++;
|
||||
debugger;
|
||||
currentPipeline.value = pipeline.value;
|
||||
|
||||
//移除空阶段
|
||||
|
||||
@@ -214,6 +214,7 @@ function transformStatusCount() {
|
||||
{ name: "error", label: "失败" },
|
||||
{ name: "canceled", label: "已取消" },
|
||||
{ name: null, label: "未执行" },
|
||||
{ name: "skip", label: "跳过" },
|
||||
];
|
||||
const result = [];
|
||||
for (const item of sorted) {
|
||||
|
||||
@@ -43,7 +43,7 @@ const slots = defineSlots();
|
||||
.data-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 180px;
|
||||
height: 188px;
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
Reference in New Issue
Block a user