feat: update agent button on server page
This commit is contained in:
@@ -8,6 +8,7 @@ export interface Server {
|
||||
ip_address: string;
|
||||
os_info: string;
|
||||
status: ServerStatus;
|
||||
agent_version?: string;
|
||||
last_seen: string;
|
||||
created_at: string;
|
||||
}
|
||||
@@ -116,6 +117,16 @@ export const api = {
|
||||
return `curl -fsSL "${window.location.origin}/update" | bash`;
|
||||
},
|
||||
|
||||
getLatestAgentVersion(): Promise<{ version: string }> {
|
||||
return request<{ version: string }>("/agent/latest-version");
|
||||
},
|
||||
|
||||
updateAgent(serverId: string): Promise<{ message: string; version: string }> {
|
||||
return request<{ message: string; version: string }>(`/servers/${serverId}/update-agent`, {
|
||||
method: "POST",
|
||||
});
|
||||
},
|
||||
|
||||
// Keys
|
||||
listKeys(): Promise<Key[]> {
|
||||
return request<Key[]>("/keys");
|
||||
|
||||
Reference in New Issue
Block a user