补充证书部署任务重试流程
支持证书部署失败、取消和部分成功任务重试,补充任务执行阶段、权限判断、前端操作入口及回归测试。
This commit is contained in:
1 parent
cfe8f35e42
commit
9edb7c11be
5 files changed
+157
-34
No files matched your search
@@ -1096,7 +1096,7 @@ test("workflowTasks.renderOnlySupportedActions", async () => {
|
||||
assert.deepEqual(compiled.errors, []);
|
||||
const render = new Function("Vue", compiled.code)(Vue);
|
||||
for (const taskType of ["certificate_issue", "renewal_run", "certificate_deploy", "management_renewal", "unknown"]) {
|
||||
for (const status of ["queued", "running", "success", "failed", "cancelled"]) {
|
||||
for (const status of ["queued", "running", "success", "failed", "cancelled", "partial_success"]) {
|
||||
const html = await renderToString(Vue.createSSRApp({
|
||||
render,
|
||||
setup: () => ({
|
||||
@@ -1112,8 +1112,8 @@ test("workflowTasks.renderOnlySupportedActions", async () => {
|
||||
retryTask: () => {},
|
||||
}),
|
||||
}));
|
||||
const canCancel = taskType === "certificate_issue" && ["queued", "running"].includes(status);
|
||||
const canRetry = taskType === "certificate_issue" && ["failed", "cancelled"].includes(status);
|
||||
const canCancel = ["certificate_issue", "certificate_deploy"].includes(taskType) && ["queued", "running"].includes(status);
|
||||
const canRetry = (taskType === "certificate_issue" && ["failed", "cancelled"].includes(status)) || (taskType === "certificate_deploy" && ["failed", "cancelled", "partial_success"].includes(status));
|
||||
const buttonCount = (html.match(/<button\b/g) || []).length;
|
||||
assert.equal(buttonCount, canCancel || canRetry ? 2 : 1, `${taskType}:${status}`);
|
||||
assert.equal(canCancel && canRetry, false, `${taskType}:${status} must not show cancel and retry together`);
|
||||
|
||||
@@ -92,12 +92,12 @@ const { detailView, summary, visibleTasks, taskDomain } = useRuntimeOverview(pro
|
||||
<td>
|
||||
<button type="button" @click="openTaskDetails(item)">查看详情</button>
|
||||
<button
|
||||
v-if="item.task_type === 'certificate_issue' && (item.status === 'queued' || item.status === 'running')"
|
||||
v-if="(item.task_type === 'certificate_issue' || item.task_type === 'certificate_deploy') && (item.status === 'queued' || item.status === 'running')"
|
||||
type="button"
|
||||
@click="cancelTask(item)"
|
||||
>取消任务</button>
|
||||
<button
|
||||
v-if="item.task_type === 'certificate_issue' && (item.status === 'failed' || item.status === 'cancelled')"
|
||||
v-if="(item.task_type === 'certificate_issue' && (item.status === 'failed' || item.status === 'cancelled')) || (item.task_type === 'certificate_deploy' && (item.status === 'failed' || item.status === 'cancelled' || item.status === 'partial_success'))"
|
||||
type="button"
|
||||
@click="retryTask(item)"
|
||||
>重试任务</button>
|
||||
|
||||
Reference in new issue
Block a user