chore: initialize qiming workspace repository
This commit is contained in:
52
qiming-mobile/subpackages/servers/sandbox.uts
Normal file
52
qiming-mobile/subpackages/servers/sandbox.uts
Normal file
@@ -0,0 +1,52 @@
|
||||
import request from "@/servers/useRequest";
|
||||
import { RequestResponse } from "@/types/interfaces/request";
|
||||
import { SandboxListResponse } from "@/types/interfaces/sandbox";
|
||||
|
||||
/**
|
||||
* 获取沙盒列表
|
||||
*/
|
||||
export const apiGetSandboxList = (): Promise<
|
||||
RequestResponse<SandboxListResponse>
|
||||
> => {
|
||||
return request<RequestResponse<SandboxListResponse>>({
|
||||
url: "/api/sandbox/config/select/list",
|
||||
method: "GET",
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 更新选中的沙盒
|
||||
*/
|
||||
export const apiUpdateSelectedSandbox = (
|
||||
agentId: string,
|
||||
sandboxId: string,
|
||||
): Promise<RequestResponse<null>> => {
|
||||
return request<RequestResponse<null>>({
|
||||
url: `/api/sandbox/config/selected/${agentId}/${sandboxId}`,
|
||||
method: "POST",
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 重启智能体
|
||||
*/
|
||||
export const apiRestartAgent = (
|
||||
conversationId: number,
|
||||
): Promise<RequestResponse<null>> => {
|
||||
return request<RequestResponse<null>>({
|
||||
url: `/api/computer/agent/stop/${conversationId}`,
|
||||
method: "POST",
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 重启容器
|
||||
*/
|
||||
export const apiRestartSandbox = (
|
||||
conversationId: number,
|
||||
): Promise<RequestResponse<null>> => {
|
||||
return request<RequestResponse<null>>({
|
||||
url: `/api/computer/pod/restart?cId=${conversationId}`,
|
||||
method: "POST",
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user