mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
perf: 任务支持禁用
This commit is contained in:
@@ -184,3 +184,12 @@ h1, h2, h3, h4, h5, h6 {
|
||||
.need-plus {
|
||||
color: #c5913f !important;
|
||||
}
|
||||
|
||||
|
||||
.disabled{
|
||||
color: #c7c7c7;
|
||||
}
|
||||
.deleted{
|
||||
//删除线
|
||||
text-decoration: line-through;
|
||||
}
|
||||
+2
-1
@@ -48,9 +48,10 @@
|
||||
<div class="step-row">
|
||||
<div class="text">
|
||||
<fs-icon icon="ion:flash"></fs-icon>
|
||||
<h4 class="title">{{ element.title }}</h4>
|
||||
<h4 class="title" :class="{ disabled: element.disabled, deleted: element.disabled }">{{ element.title }}</h4>
|
||||
</div>
|
||||
<div class="action">
|
||||
<a key="disabled" @click="element.disabled = !!!element.disabled">{{ element.disabled ? "启用" : "禁用" }}</a>
|
||||
<a key="edit" @click="stepEdit(currentTask, element, index)">编辑</a>
|
||||
<a key="edit" @click="stepCopy(currentTask, element, index)">复制</a>
|
||||
<a key="remove" @click="stepDelete(currentTask, index)">删除</a>
|
||||
|
||||
@@ -94,7 +94,9 @@
|
||||
<!-- :open="true"-->
|
||||
<template #content>
|
||||
<div v-for="(item, index) of task.steps" class="flex-o w-100">
|
||||
<span class="ellipsis flex-1">{{ index + 1 }}. {{ item.title }} </span>
|
||||
<span class="ellipsis flex-1 step-title" :class="{ disabled: item.disabled, deleted: item.disabled }">
|
||||
{{ index + 1 }}. {{ item.title }}
|
||||
</span>
|
||||
<pi-status-show v-if="!editMode" :status="item.status?.result"></pi-status-show>
|
||||
<fs-icon
|
||||
v-if="!editMode"
|
||||
@@ -346,14 +348,23 @@ export default defineComponent({
|
||||
}
|
||||
const intervalLoadHistoryRef = ref();
|
||||
function watchNewHistoryList() {
|
||||
intervalLoadHistoryRef.value = setInterval(async () => {
|
||||
if (currentHistory.value == null) {
|
||||
await loadHistoryList();
|
||||
} else if (currentHistory.value.pipeline?.status?.status === "start") {
|
||||
await loadCurrentHistoryDetail();
|
||||
} else {
|
||||
clearInterval(intervalLoadHistoryRef.value);
|
||||
intervalLoadHistoryRef.value = setTimeout(async () => {
|
||||
try {
|
||||
if (currentHistory.value == null) {
|
||||
await loadHistoryList();
|
||||
}
|
||||
|
||||
if (!currentHistory.value) {
|
||||
if (currentHistory.value.pipeline?.status?.status === "start") {
|
||||
await loadCurrentHistoryDetail();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
watchNewHistoryList();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,12 @@ const StatusEnum: StatusEnumType = {
|
||||
label: "未运行",
|
||||
color: "blue",
|
||||
icon: "ant-design:minus-circle-twotone"
|
||||
},
|
||||
disabled: {
|
||||
value: "disabled",
|
||||
label: "禁用",
|
||||
color: "gray",
|
||||
icon: "ant-design:stop-outlined"
|
||||
}
|
||||
};
|
||||
export const statusUtil = {
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
"build": "mwtsc --cleanOutDir --skipLibCheck",
|
||||
"build-on-docker": "node ./before-build.js && npm run build",
|
||||
"up-mw-deps": "npx midway-version -u -w",
|
||||
"clinic": "clinic heapprofiler -- node ./bootstrap.js"
|
||||
"heap": "clinic heapprofiler -- node ./bootstrap.js",
|
||||
"flame": "clinic flame -- node ./bootstrap.js"
|
||||
|
||||
},
|
||||
"dependencies": {
|
||||
"@alicloud/cs20151215": "^3.0.3",
|
||||
|
||||
Reference in New Issue
Block a user