完善后台任务中心历史摘要视图
- 为系统任务和插件调度补充批量历史摘要查询,支持最近成功时间、最近失败原因与累计成功失败次数 - 任务列表接口合并内存运行态与数据库日志态,服务重启后后台仍可回看最近执行结果 - 系统任务页与插件调度页新增健康状态、历史执行摘要与插件调度快捷启停入口 - 更新工程优化文档,记录 7.3 第一阶段当前进展
This commit is contained in:
@@ -33,6 +33,28 @@
|
||||
<el-tag :type="statusTag(scope.row.last_status)">{% raw %}{{ scope.row.last_status || 'never' }}{% endraw %}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="健康状态" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="healthTag(scope.row.health_status)">{% raw %}{{ healthLabel(scope.row.health_status) }}{% endraw %}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="latest_success_at" label="最近成功" min-width="170"></el-table-column>
|
||||
<el-table-column label="最近失败原因" min-width="240">
|
||||
<template slot-scope="scope">
|
||||
<div class="cell-ellipsis" :title="scope.row.latest_failure_summary || scope.row.last_error || '-'">
|
||||
{% raw %}{{ scope.row.latest_failure_summary || scope.row.last_error || '-' }}{% endraw %}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="历史执行" width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="history-metrics">
|
||||
<span class="metric-success">{% raw %}{{ `成 ${scope.row.history_success_count || 0}` }}{% endraw %}</span>
|
||||
<span class="metric-fail">{% raw %}{{ `失 ${scope.row.history_fail_count || 0}` }}{% endraw %}</span>
|
||||
</div>
|
||||
<div class="history-total">{% raw %}{{ `共 ${scope.row.history_total_count || 0}` }}{% endraw %}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="280">
|
||||
<template slot-scope="scope">
|
||||
<div class="action-row">
|
||||
@@ -143,6 +165,23 @@ new Vue({
|
||||
if (status === 'running') return 'warning';
|
||||
return 'info';
|
||||
},
|
||||
healthTag(status) {
|
||||
if (status === 'healthy') return 'success';
|
||||
if (status === 'running') return 'warning';
|
||||
if (status === 'failed') return 'danger';
|
||||
if (status === 'disabled') return 'info';
|
||||
return '';
|
||||
},
|
||||
healthLabel(status) {
|
||||
const mapping = {
|
||||
healthy: '健康',
|
||||
running: '执行中',
|
||||
failed: '异常',
|
||||
disabled: '停用',
|
||||
idle: '待运行'
|
||||
};
|
||||
return mapping[status] || '待运行';
|
||||
},
|
||||
async loadJobs() {
|
||||
this.loading = true;
|
||||
try {
|
||||
@@ -269,5 +308,10 @@ new Vue({
|
||||
.page-hero-copy h1{font-size:30px;line-height:1.1;margin-bottom:10px;color:#0f172a}
|
||||
.page-hero-copy p{color:#64748b;font-size:14px}
|
||||
.action-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
|
||||
.cell-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#475569}
|
||||
.history-metrics{display:flex;align-items:center;justify-content:center;gap:8px}
|
||||
.metric-success{color:#16a34a;font-weight:600}
|
||||
.metric-fail{color:#dc2626;font-weight:600}
|
||||
.history-total{margin-top:4px;color:#64748b;font-size:12px}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user