fix(shipping-process-gates): 收口技术重试并补齐运维 UI
跨 Job 累计技术失败次数,耗尽后将 Attempt/Gate 置为 failed_terminal; 收缩旧 action_buttons;healthcheck 增加 Worker 领取探针;恢复卡展示责任方与审计,Admin 诊断改主从布局。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
323928626b
commit
cef3d5b26a
15 files changed
+489
-150
No files matched your search
+59
-57
@@ -2,7 +2,8 @@
|
||||
features/admin/modules/shipping-process-gates/ShippingProcessGateDiagnosticsPage.vue
|
||||
用途:管理员 Process Gate Execution 诊断——列表、Gate 轨道与 Attempt 明细。
|
||||
依赖:process-gates.api、Vue Router、Vue I18n(admin + workspace.processGate 动作文案)。
|
||||
逻辑:只读诊断;多维度筛选(status/gate/reason/party/q/时间);小屏卡片化列表,lg+ 横向表格(nowrap + 滚动提示);
|
||||
逻辑:只读诊断;多维度筛选(status/gate/reason/party/q/时间);小屏卡片列表 + 详情下置;
|
||||
lg+ 主从布局(左侧 ~38% Execution 紧凑列表 + 分页,右侧 sticky 详情:Gate/findings/attempts);
|
||||
状态/动作展示业务标签并附技术码;Gate 诊断结构化卡片(findings/blocking/effective_result);
|
||||
Attempt 展示 snapshot_diff 摘要并可跳转 AdminShippingAudit。
|
||||
-->
|
||||
@@ -393,6 +394,13 @@ async function loadAttempts(gateCode: string) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断 Execution 是否为当前详情选中项,供 lg+ 主从列表行高亮。
|
||||
*/
|
||||
function isExecutionSelected(executionNo: string): boolean {
|
||||
return Boolean(detail.value?.execution_no && detail.value.execution_no === executionNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭详情面板。
|
||||
*/
|
||||
@@ -531,63 +539,56 @@ onMounted(() => {
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<!-- lg+:横向表格;表头 nowrap + 外层滚动 -->
|
||||
<div class="hidden lg:block">
|
||||
<p class="mb-2 text-xs text-muted">{{ t('admin.shippingProcessGates.scrollHint') }}</p>
|
||||
<div class="overflow-x-auto rounded-xl border border-default">
|
||||
<table class="min-w-[720px] w-full text-sm">
|
||||
<thead class="bg-surface-soft text-left text-xs uppercase text-muted">
|
||||
<tr>
|
||||
<th class="whitespace-nowrap px-4 py-3">{{ t('admin.shippingProcessGates.executionNo') }}</th>
|
||||
<th class="whitespace-nowrap px-4 py-3">{{ t('admin.shippingProcessGates.status') }}</th>
|
||||
<th class="whitespace-nowrap px-4 py-3">{{ t('admin.shippingProcessGates.currentGate') }}</th>
|
||||
<th class="whitespace-nowrap px-4 py-3">{{ t('admin.shippingProcessGates.nextAction') }}</th>
|
||||
<th class="whitespace-nowrap px-4 py-3">{{ t('admin.shippingProcessGates.updatedAt') }}</th>
|
||||
<th class="whitespace-nowrap px-4 py-3">{{ t('admin.shippingProcessGates.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-if="loading">
|
||||
<td colspan="6" class="px-4 py-8 text-center text-muted">{{ t('admin.shippingProcessGates.loading') }}</td>
|
||||
</tr>
|
||||
<tr v-else-if="!rows.length">
|
||||
<td colspan="6" class="px-4 py-8 text-center text-muted">{{ t('admin.shippingProcessGates.empty') }}</td>
|
||||
</tr>
|
||||
<tr v-for="row in rows" :key="row.execution_no" class="border-t border-default">
|
||||
<td class="whitespace-nowrap px-4 py-3 font-mono text-xs">{{ row.execution_no }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<div>{{ statusLabel(row.status) }}</div>
|
||||
<div class="font-mono text-[11px] text-muted">{{ row.status }}</div>
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-4 py-3 font-mono text-xs">{{ row.current_gate_code || '—' }}</td>
|
||||
<td class="px-4 py-3 text-xs">{{ actionLabel(row.primary_next_action_code) }}</td>
|
||||
<td class="whitespace-nowrap px-4 py-3">{{ formatTime(row.updated_at) }}</td>
|
||||
<td class="whitespace-nowrap px-4 py-3">
|
||||
<button type="button" class="text-brand-600 hover:underline" @click="openDetail(row.execution_no)">
|
||||
{{ t('admin.shippingProcessGates.viewDetail') }}
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- lg+ 主从:左列表+分页,右 sticky 详情;小屏在网格外卡片列表,网格内仅分页+详情 -->
|
||||
<div class="grid lg:grid-cols-[minmax(280px,38%)_minmax(0,1fr)] gap-4 items-start">
|
||||
<div class="space-y-3">
|
||||
<!-- lg+:紧凑 Execution 行列表 -->
|
||||
<div class="hidden lg:block space-y-1.5" data-testid="shipping-process-gate-list">
|
||||
<p v-if="loading" class="rounded-xl border border-default px-4 py-8 text-center text-sm text-muted">
|
||||
{{ t('admin.shippingProcessGates.loading') }}
|
||||
</p>
|
||||
<p v-else-if="!rows.length" class="rounded-xl border border-default px-4 py-8 text-center text-sm text-muted">
|
||||
{{ t('admin.shippingProcessGates.empty') }}
|
||||
</p>
|
||||
<button
|
||||
v-for="row in rows"
|
||||
:key="row.execution_no"
|
||||
type="button"
|
||||
class="w-full rounded-lg border px-3 py-2.5 text-left text-sm transition-colors"
|
||||
:class="isExecutionSelected(row.execution_no)
|
||||
? 'border-brand-500 bg-brand-50/80 ring-1 ring-brand-500/40 dark:bg-brand-950/30'
|
||||
: 'border-default bg-surface hover:bg-surface-soft'"
|
||||
@click="openDetail(row.execution_no)"
|
||||
>
|
||||
<div class="font-mono text-xs break-all">{{ row.execution_no }}</div>
|
||||
<div class="mt-1.5 flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-xs">
|
||||
<span>{{ statusLabel(row.status) }}</span>
|
||||
<span class="font-mono text-[11px] text-muted">{{ row.status }}</span>
|
||||
</div>
|
||||
<div class="mt-1 truncate font-mono text-[11px] text-muted">
|
||||
{{ row.current_gate_code || '—' }}
|
||||
</div>
|
||||
<div class="mt-1 truncate text-[11px] text-muted">{{ actionLabel(row.primary_next_action_code) }}</div>
|
||||
<div class="mt-1 text-[11px] text-muted">{{ formatTime(row.updated_at) }}</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2 text-sm">
|
||||
<button type="button" class="rounded border border-default px-3 py-1.5 disabled:opacity-50" :disabled="page <= 1 || loading" @click="page -= 1; load()">
|
||||
{{ t('admin.shippingProcessGates.previous') }}
|
||||
</button>
|
||||
<span>{{ page }}</span>
|
||||
<button type="button" class="rounded border border-default px-3 py-1.5 disabled:opacity-50" :disabled="page * pageSize >= total || loading" @click="page += 1; load()">
|
||||
{{ t('admin.shippingProcessGates.next') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2 text-sm">
|
||||
<button type="button" class="rounded border border-default px-3 py-1.5 disabled:opacity-50" :disabled="page <= 1 || loading" @click="page -= 1; load()">
|
||||
{{ t('admin.shippingProcessGates.previous') }}
|
||||
</button>
|
||||
<span>{{ page }}</span>
|
||||
<button type="button" class="rounded border border-default px-3 py-1.5 disabled:opacity-50" :disabled="page * pageSize >= total || loading" @click="page += 1; load()">
|
||||
{{ t('admin.shippingProcessGates.next') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<aside
|
||||
v-if="detail"
|
||||
class="rounded-xl border border-default bg-surface p-4"
|
||||
data-testid="shipping-process-gate-detail"
|
||||
>
|
||||
<aside
|
||||
v-if="detail"
|
||||
class="rounded-xl border border-default bg-surface p-4 lg:sticky lg:top-24 lg:max-h-[calc(100vh-8rem)] lg:overflow-y-auto"
|
||||
data-testid="shipping-process-gate-detail"
|
||||
>
|
||||
<div class="mb-4 flex items-center justify-between gap-2">
|
||||
<h2 class="text-lg font-semibold">{{ t('admin.shippingProcessGates.detailTitle') }}</h2>
|
||||
<button type="button" class="text-sm text-muted hover:text-primary" @click="closeDetail">{{ t('admin.close') }}</button>
|
||||
@@ -789,6 +790,7 @@ onMounted(() => {
|
||||
</div>
|
||||
<p v-else class="mt-2 text-sm text-muted">{{ t('admin.shippingProcessGates.noAttempts') }}</p>
|
||||
</template>
|
||||
</aside>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user