定时清理未使用的 tag.

This commit is contained in:
lijiahangmax
2024-04-16 00:41:20 +08:00
parent 4150ab0666
commit 73537d8671
7 changed files with 117 additions and 9 deletions

View File

@@ -46,7 +46,6 @@
const logViewRef = ref();
const currentHostExecId = ref();
const statusIntervalId = ref();
const finishIntervalId = ref();
const execLog = ref<ExecLogQueryResponse>();
const appender = ref<ILogAppender>();
@@ -60,8 +59,6 @@
record.status === execStatus.RUNNING) {
// 注册状态轮询
statusIntervalId.value = setInterval(fetchTaskStatus, 5000);
// 注册完成时间轮询
finishIntervalId.value = setInterval(setTaskFinishTime, 1000);
}
// 打开日志
nextTick(() => {
@@ -95,9 +92,8 @@
if (hostStatus) {
host.status = hostStatus.status;
host.startTime = hostStatus.startTime;
if (hostStatus.finishTime) {
host.finishTime = hostStatus.finishTime;
}
// 使用时间
host.finishTime = host.finishTime || Date.now();
host.exitStatus = hostStatus.exitStatus;
host.errorMessage = hostStatus.errorMessage;
}
@@ -154,8 +150,6 @@
const clearAllInterval = () => {
// 关闭状态轮询
clearInterval(statusIntervalId.value);
// 关闭使用时间轮询
clearInterval(finishIntervalId.value);
};
// 加载字典值

View File

@@ -23,7 +23,9 @@
<span class="tag-value">{{ host.exitStatus }}</span>
</a-tag>
<!-- 持续时间 -->
<a-tag color="arcoblue" title="持续时间">
<a-tag v-if="host.startTime"
color="arcoblue"
title="持续时间">
<template #icon>
<icon-loading v-if="host.status === execHostStatus.WAITING || host.status === execHostStatus.RUNNING" />
<icon-clock-circle v-else />