feat(web): 新增系统日志服务代理和智能体资源服务,添加访问控制工具函数,增强前端服务层能力
This commit is contained in:
@@ -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)}`)
|
||||
}
|
||||
|
||||
17
web/src/services/systemLogs.js
Normal file
17
web/src/services/systemLogs.js
Normal file
@@ -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)}`)
|
||||
}
|
||||
@@ -5,6 +5,7 @@ export const DEFAULT_APP_VIEW_ORDER = [
|
||||
'approval',
|
||||
'policies',
|
||||
'audit',
|
||||
'logs',
|
||||
'employees',
|
||||
'settings'
|
||||
]
|
||||
@@ -14,6 +15,7 @@ const VIEW_ROLE_RULES = {
|
||||
overview: ['finance', 'executive'],
|
||||
approval: ['approver'],
|
||||
audit: ['auditor'],
|
||||
logs: ['manager'],
|
||||
employees: ['manager'],
|
||||
settings: ['manager']
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user