mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-22 10:32:40 +08:00
feat(ql3): expose worker observations in console
This commit is contained in:
@@ -14,6 +14,8 @@ export const CLUSTER_COPILOT_CONSOLE_READ_OPERATIONS = Object.freeze([
|
||||
'run_cancellation_status',
|
||||
'run_cancellation_blocked_list',
|
||||
'run_cancellation_inspect',
|
||||
'worker_list',
|
||||
'worker_inspect',
|
||||
'run_list',
|
||||
'run_read',
|
||||
'run_event_list',
|
||||
@@ -46,6 +48,9 @@ export type ClusterCopilotConsoleReadRequest =
|
||||
| (BaseReadRequest<'run_cancellation_blocked_list'> &
|
||||
Readonly<{ cursor: string | null }>)
|
||||
| (BaseReadRequest<'run_cancellation_inspect'> & Readonly<{ runId: string }>)
|
||||
| (BaseReadRequest<'worker_list'> &
|
||||
Readonly<{ afterWorkerId: string | null }>)
|
||||
| (BaseReadRequest<'worker_inspect'> & Readonly<{ workerId: string }>)
|
||||
| (BaseReadRequest<'run_list'> &
|
||||
Readonly<{
|
||||
afterCreatedAtMs: number | null;
|
||||
@@ -243,6 +248,25 @@ export function normalizeClusterCopilotConsoleReadRequest(
|
||||
runId: record.runId,
|
||||
});
|
||||
}
|
||||
if (op === 'worker_list') {
|
||||
exact(record, op, ['afterWorkerId']);
|
||||
if (record.afterWorkerId !== null && !identifier(record.afterWorkerId))
|
||||
invalid();
|
||||
return Object.freeze({
|
||||
...common(record),
|
||||
operation: op,
|
||||
afterWorkerId: record.afterWorkerId as string | null,
|
||||
});
|
||||
}
|
||||
if (op === 'worker_inspect') {
|
||||
exact(record, op, ['workerId']);
|
||||
if (!identifier(record.workerId)) invalid();
|
||||
return Object.freeze({
|
||||
...common(record),
|
||||
operation: op,
|
||||
workerId: record.workerId,
|
||||
});
|
||||
}
|
||||
if (op === 'run_list') {
|
||||
exact(record, op, ['afterCreatedAtMs', 'afterRunId', 'limit']);
|
||||
if (
|
||||
@@ -476,7 +500,9 @@ export function clusterCopilotConsoleProjectReadPath(
|
||||
normalized.operation === 'output' ||
|
||||
normalized.operation === 'run_cancellation_status' ||
|
||||
normalized.operation === 'run_cancellation_blocked_list' ||
|
||||
normalized.operation === 'run_cancellation_inspect'
|
||||
normalized.operation === 'run_cancellation_inspect' ||
|
||||
normalized.operation === 'worker_list' ||
|
||||
normalized.operation === 'worker_inspect'
|
||||
)
|
||||
invalid();
|
||||
const project = '/api/v3/projects/' + encoded(normalized.projectId);
|
||||
|
||||
Reference in New Issue
Block a user