mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-22 19:29:13 +08:00
feat(ql3): observe package installations in console
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
run_cancellation_inspect: '/api/v1/run-management/cancellation-inspect',
|
||||
worker_list: '/api/v1/worker-management/workers',
|
||||
worker_inspect: '/api/v1/worker-management/worker',
|
||||
package_list: '/api/v1/package-management/installations',
|
||||
package_inspect: '/api/v1/package-management/installation',
|
||||
run_list: '/api/v1/observe/run-list',
|
||||
run_read: '/api/v1/observe/run',
|
||||
run_event_list: '/api/v1/observe/run-events',
|
||||
@@ -31,6 +33,8 @@
|
||||
run_cancellation_inspect: '取消诊断',
|
||||
worker_list: 'Worker 目录',
|
||||
worker_inspect: 'Worker 详情',
|
||||
package_list: 'Package 安装目录',
|
||||
package_inspect: 'Package 安装详情',
|
||||
run_list: 'Run 目录',
|
||||
run_read: 'Run 详情',
|
||||
run_event_list: 'Run Events',
|
||||
@@ -131,6 +135,10 @@
|
||||
result.afterWorkerId = null;
|
||||
} else if (operation === 'worker_inspect') {
|
||||
result.workerId = value('worker-id');
|
||||
} else if (operation === 'package_list') {
|
||||
result.afterPackageName = null;
|
||||
} else if (operation === 'package_inspect') {
|
||||
result.packageName = value('installation-package-name');
|
||||
} else if (operation === 'run_list') {
|
||||
result.afterCreatedAtMs = null;
|
||||
result.afterRunId = null;
|
||||
@@ -188,6 +196,11 @@
|
||||
typeof fact.nextAfterWorkerId === 'string'
|
||||
) {
|
||||
next.afterWorkerId = fact.nextAfterWorkerId;
|
||||
} else if (
|
||||
operation === 'package_list' &&
|
||||
typeof fact.nextAfterPackageName === 'string'
|
||||
) {
|
||||
next.afterPackageName = fact.nextAfterPackageName;
|
||||
} else if (operation === 'run_list' && fact.hasMore === true && fact.next) {
|
||||
next.afterCreatedAtMs = fact.next.createdAtMs;
|
||||
next.afterRunId = fact.next.runId;
|
||||
@@ -260,6 +273,23 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (operation === 'package_list' && Array.isArray(fact.installations)) {
|
||||
fact.installations.forEach(function (installation) {
|
||||
if (!installation || typeof installation.packageName !== 'string') {
|
||||
return;
|
||||
}
|
||||
const button = document.createElement('button');
|
||||
button.type = 'button';
|
||||
button.textContent = '显式检查 ' + installation.packageName;
|
||||
button.addEventListener('click', function () {
|
||||
document.getElementById('installation-package-name').value =
|
||||
installation.packageName;
|
||||
void execute('package_inspect');
|
||||
});
|
||||
entry.append(button);
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (
|
||||
operation !== 'run_cancellation_blocked_list' ||
|
||||
!Array.isArray(fact.items)
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
'run_cancellation_inspect',
|
||||
'worker_list',
|
||||
'worker_inspect',
|
||||
'package_list',
|
||||
'package_inspect',
|
||||
'run_list',
|
||||
'run_read',
|
||||
'run_event_list',
|
||||
@@ -54,6 +56,8 @@
|
||||
run_cancellation_inspect: ['projectId', 'requestId', 'runId'],
|
||||
worker_list: ['afterWorkerId', 'projectId', 'requestId'],
|
||||
worker_inspect: ['projectId', 'requestId', 'workerId'],
|
||||
package_list: ['afterPackageName', 'projectId', 'requestId'],
|
||||
package_inspect: ['packageName', 'projectId', 'requestId'],
|
||||
run_list: [
|
||||
'afterCreatedAtMs',
|
||||
'afterRunId',
|
||||
@@ -122,6 +126,7 @@
|
||||
afterStepRunId: 'step',
|
||||
afterTaskId: 'task',
|
||||
afterWorkerId: 'worker',
|
||||
afterPackageName: 'package',
|
||||
artifactId: 'artifact',
|
||||
attemptId: 'attempt',
|
||||
contentDigest: 'digest',
|
||||
@@ -131,6 +136,7 @@
|
||||
id: 'identifier',
|
||||
modelId: 'model',
|
||||
nextAfterWorkerId: 'worker',
|
||||
nextAfterPackageName: 'package',
|
||||
outputRef: 'artifact',
|
||||
packageName: 'package',
|
||||
projectId: 'project',
|
||||
@@ -170,6 +176,8 @@
|
||||
'runtimes',
|
||||
'worker',
|
||||
'workers',
|
||||
'installation',
|
||||
'installations',
|
||||
'usage',
|
||||
'workflow',
|
||||
'workflows',
|
||||
@@ -207,6 +215,12 @@
|
||||
'status',
|
||||
'supportTier',
|
||||
'operatingSystem',
|
||||
'availability',
|
||||
'failureReason',
|
||||
'installOperation',
|
||||
'quarantineReason',
|
||||
'recoveryAction',
|
||||
'state',
|
||||
]);
|
||||
const safeEnumValues = new Set([
|
||||
'accepted',
|
||||
@@ -302,13 +316,31 @@
|
||||
'ok',
|
||||
'unavailable',
|
||||
'workflow',
|
||||
'not_active',
|
||||
'install',
|
||||
'reinstall',
|
||||
'upgrade',
|
||||
'rollback',
|
||||
'resume_stage',
|
||||
'resume_activation',
|
||||
'inspect_activation',
|
||||
'source_unavailable',
|
||||
'source_mismatch',
|
||||
'stage_failed',
|
||||
'activation_failed',
|
||||
'activation_fact_conflict',
|
||||
'approval_expired',
|
||||
'policy_fence_changed',
|
||||
'resource_exhausted',
|
||||
'suspected_key_compromise',
|
||||
'confirmed_key_compromise',
|
||||
]);
|
||||
const sensitiveKey =
|
||||
/credential|token|authorization|secret|session|password|cookie|private|keyring/iu;
|
||||
const freeTextKey =
|
||||
/text|content|stdout|stderr|command|input|output|environment|reason|error|message|description|name|path|url|uri|host|endpoint/iu;
|
||||
const numericKey =
|
||||
/^(?:schemaVersion|version|revision|sequence|attempt|priority|limit|offset|size|total|count|exitCode|pending|leased|retryWait|dispatched|blocked|due|expiredLease|identityMismatch|pidMismatch|unsupported|invalid|availableSlots|maxConcurrentRuns|cpuCores|[A-Za-z0-9_]*(?:AtMs|TimeMs|DurationMs|Bytes|Tokens|Micros|Sequence|Version|Count|Limit|Offset|Size|Total))$/u;
|
||||
/^(?:schemaVersion|version|revision|sequence|attempt|priority|limit|offset|size|total|count|exitCode|pending|leased|retryWait|dispatched|blocked|due|expiredLease|identityMismatch|pidMismatch|unsupported|invalid|availableSlots|maxConcurrentRuns|cpuCores|targetGeneration|[A-Za-z0-9_]*(?:AtMs|TimeMs|DurationMs|Bytes|Tokens|Micros|Sequence|Version|Count|Limit|Offset|Size|Total))$/u;
|
||||
const schemaValue = /^[a-z0-9][a-z0-9./_-]{0,126}@[a-z0-9._-]{1,16}$/u;
|
||||
|
||||
class ClusterConsoleEvidenceBundleError extends TypeError {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="boundary" aria-label="当前权限边界">
|
||||
<span class="boundary-dot" aria-hidden="true"></span>
|
||||
<span>本机只读 BFF</span>
|
||||
<strong>Run · Task · Workflow · Worker · Copilot</strong>
|
||||
<strong>Run · Task · Workflow · Worker · Package · Copilot</strong>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="section-heading">
|
||||
<p class="eyebrow">Observation coordinates</p>
|
||||
<h2 id="control-title">选择要读取的事实</h2>
|
||||
<p>每次按钮点击只发起一次有界 GET。页面不创建、取消、重试、轮询或缓存任何任务。</p>
|
||||
<p>每次按钮点击只发起一次有界读取。页面不创建、安装、升级、回滚、取消、重试、轮询或缓存任何任务。</p>
|
||||
</div>
|
||||
|
||||
<form id="session-form" class="session-gate" autocomplete="off">
|
||||
@@ -53,6 +53,7 @@
|
||||
<button type="button" class="mode-tab active" data-panel="runtime-panel" aria-pressed="true">运行态</button>
|
||||
<button type="button" class="mode-tab" data-panel="management-panel" aria-pressed="false">取消可用性</button>
|
||||
<button type="button" class="mode-tab" data-panel="worker-panel" aria-pressed="false">Worker</button>
|
||||
<button type="button" class="mode-tab" data-panel="package-panel" aria-pressed="false">Package</button>
|
||||
<button type="button" class="mode-tab" data-panel="workflow-panel" aria-pressed="false">工作流</button>
|
||||
<button type="button" class="mode-tab" data-panel="copilot-panel" aria-pressed="false">Copilot</button>
|
||||
</nav>
|
||||
@@ -81,6 +82,20 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="package-panel" class="mode-panel" hidden>
|
||||
<div class="control-group">
|
||||
<div class="control-title"><span>01</span><strong>Package 安装目录</strong></div>
|
||||
<button type="button" class="primary" data-read="package_list">读取首屏 Installations</button>
|
||||
<p class="field-note">只有启动进程显式提供独立 Package management 配置与短期 assertion 时可用;固定 16 项,下一页必须再次点击。</p>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-title"><span>02</span><strong>单 Package 安装状态</strong></div>
|
||||
<input id="installation-package-name" type="text" maxlength="63" autocomplete="off" spellcheck="false" placeholder="ops-package" />
|
||||
<button type="button" data-read="package_inspect">读取 Package 安装详情</button>
|
||||
<p class="field-note">只投影版本、安装状态、可用性与恢复提示;没有 propose、decide、install、upgrade、rollback、disable 或 uninstall mutation。</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="worker-panel" class="mode-panel" hidden>
|
||||
<div class="control-group">
|
||||
<div class="control-title"><span>01</span><strong>Worker 目录</strong></div>
|
||||
@@ -145,7 +160,7 @@
|
||||
|
||||
<aside class="trust-note">
|
||||
<span>Authority boundary</span>
|
||||
<p>Project credential、可选 Run authority 与可选 Worker authority 只由本机进程从彼此独立的私有文件读取。浏览器无法提交任意路径,也没有 start、stop、retry、rearm、drain、revoke 或 diagnose 权限入口。脱敏导出只处理本页已读事实,不补读或上传。</p>
|
||||
<p>Project credential、可选 Run、Worker 与 Package authority 只由本机进程从彼此独立的私有文件读取。浏览器无法提交任意路径,也没有 start、stop、retry、rearm、drain、revoke、propose、decide、install、upgrade、rollback、disable、uninstall 或 diagnose 权限入口。脱敏导出只处理本页已读事实,不补读或上传。</p>
|
||||
</aside>
|
||||
</aside>
|
||||
|
||||
@@ -176,7 +191,7 @@
|
||||
|
||||
<footer>
|
||||
<span>Loopback only · explicit reads · zero polling</span>
|
||||
<span>QingLong 3.0 incubation / D-375</span>
|
||||
<span>QingLong 3.0 incubation / D-376</span>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user