feat(scan): add guided Linux agent setup in administration
This commit is contained in:
@@ -255,8 +255,10 @@ export const useAdmin = () => {
|
||||
return await $api("/api/admin/system-status")
|
||||
}
|
||||
|
||||
const getInstanceAgents = async (): Promise<{ agents: InstanceAgent[] }> => {
|
||||
const response = await $api("/api/instance-agents") as any
|
||||
const getInstanceAgents = async (quiet = false): Promise<{ agents: InstanceAgent[] }> => {
|
||||
const response = await $api("/api/instance-agents", quiet ? {
|
||||
retry: 0, timeout: 15000, onRequestError: () => {}, onResponseError: () => {},
|
||||
} : {}) as any
|
||||
return { agents: response?.agents || [] }
|
||||
}
|
||||
|
||||
@@ -274,12 +276,17 @@ export const useAdmin = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const rotateInstanceAgentToken = async (id: string): Promise<{ token: string }> => {
|
||||
return await $api(`/api/instance-agents/${id}/token`, { method: "POST" })
|
||||
}
|
||||
|
||||
return {
|
||||
getOverview,
|
||||
getSystemStatus,
|
||||
getInstanceAgents,
|
||||
createInstanceAgent,
|
||||
updateInstanceAgent,
|
||||
rotateInstanceAgentToken,
|
||||
createUser,
|
||||
createUserForProfile,
|
||||
updateUser,
|
||||
|
||||
Reference in New Issue
Block a user