From 1bab7c22d720e5be43b16314b7bfd9a892d28a1b Mon Sep 17 00:00:00 2001 From: caoxiaozhu Date: Fri, 15 May 2026 09:36:16 +0000 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E6=96=B0=E5=A2=9E=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E6=97=A5=E5=BF=97=E6=9C=8D=E5=8A=A1=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E5=92=8C=E6=99=BA=E8=83=BD=E4=BD=93=E8=B5=84=E6=BA=90=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=EF=BC=8C=E6=B7=BB=E5=8A=A0=E8=AE=BF=E9=97=AE=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=B7=A5=E5=85=B7=E5=87=BD=E6=95=B0=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=BC=BA=E5=89=8D=E7=AB=AF=E6=9C=8D=E5=8A=A1=E5=B1=82=E8=83=BD?= =?UTF-8?q?=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/services/agentAssets.js | 4 ++++ web/src/services/systemLogs.js | 17 +++++++++++++++++ web/src/utils/accessControl.js | 12 +++++++----- 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 web/src/services/systemLogs.js diff --git a/web/src/services/agentAssets.js b/web/src/services/agentAssets.js index c5a5622..ce8b00f 100644 --- a/web/src/services/agentAssets.js +++ b/web/src/services/agentAssets.js @@ -118,3 +118,7 @@ export function activateAgentAsset(assetId, options = {}) { export function fetchAgentRuns(params = {}) { return apiRequest(`/agent-runs${buildQuery(params)}`) } + +export function fetchAgentRunDetail(runId) { + return apiRequest(`/agent-runs/${encodeURIComponent(runId)}`) +} diff --git a/web/src/services/systemLogs.js b/web/src/services/systemLogs.js new file mode 100644 index 0000000..814dd00 --- /dev/null +++ b/web/src/services/systemLogs.js @@ -0,0 +1,17 @@ +import { apiRequest } from './api.js' + +export function fetchSystemLogFiles() { + return apiRequest('/system-logs/files') +} + +export function fetchSystemLogTail(fileName, lines = 300) { + return apiRequest(`/system-logs/files/${encodeURIComponent(fileName)}?lines=${encodeURIComponent(lines)}`) +} + +export function fetchSystemLogEntries(limit = 300) { + return apiRequest(`/system-logs/entries?limit=${encodeURIComponent(limit)}`) +} + +export function fetchSystemLogEntry(entryId) { + return apiRequest(`/system-logs/entries/${encodeURIComponent(entryId)}`) +} diff --git a/web/src/utils/accessControl.js b/web/src/utils/accessControl.js index 4e6c2c3..5f81095 100644 --- a/web/src/utils/accessControl.js +++ b/web/src/utils/accessControl.js @@ -5,6 +5,7 @@ export const DEFAULT_APP_VIEW_ORDER = [ 'approval', 'policies', 'audit', + 'logs', 'employees', 'settings' ] @@ -12,11 +13,12 @@ export const DEFAULT_APP_VIEW_ORDER = [ const ALWAYS_VISIBLE_VIEWS = new Set(['workbench', 'requests', 'policies']) const VIEW_ROLE_RULES = { overview: ['finance', 'executive'], - approval: ['approver'], - audit: ['auditor'], - employees: ['manager'], - settings: ['manager'] -} + approval: ['approver'], + audit: ['auditor'], + logs: ['manager'], + employees: ['manager'], + settings: ['manager'] +} function normalizedRoleCodes(user) { if (!user) {