2020-09-01 10:34:11 +08:00
|
|
|
import Api from '@/common/Api';
|
|
|
|
|
|
|
|
|
|
export const machineApi = {
|
|
|
|
|
// 获取权限列表
|
2023-04-13 20:11:22 +08:00
|
|
|
list: Api.newGet("/machines"),
|
|
|
|
|
getMachinePwd: Api.newGet("/machines/{id}/pwd"),
|
|
|
|
|
info: Api.newGet("/machines/{id}/sysinfo"),
|
|
|
|
|
stats: Api.newGet("/machines/{id}/stats"),
|
|
|
|
|
process: Api.newGet("/machines/{id}/process"),
|
2022-01-16 21:45:00 +08:00
|
|
|
// 终止进程
|
2023-04-13 20:11:22 +08:00
|
|
|
killProcess: Api.newDelete("/machines/{id}/process"),
|
|
|
|
|
closeCli: Api.newDelete("/machines/{id}/close-cli"),
|
|
|
|
|
testConn: Api.newPost("/machines/test-conn"),
|
2020-09-01 10:34:11 +08:00
|
|
|
// 保存按钮
|
2023-04-13 20:11:22 +08:00
|
|
|
saveMachine: Api.newPost("/machines"),
|
2022-04-27 10:59:02 +08:00
|
|
|
// 调整状态
|
2023-04-13 20:11:22 +08:00
|
|
|
changeStatus: Api.newPut("/machines/{id}/{status}"),
|
2020-09-01 10:34:11 +08:00
|
|
|
// 删除机器
|
2023-04-13 20:11:22 +08:00
|
|
|
del: Api.newDelete("/machines/{id}"),
|
|
|
|
|
scripts: Api.newGet("/machines/{machineId}/scripts"),
|
|
|
|
|
runScript: Api.newGet("/machines/{machineId}/scripts/{scriptId}/run"),
|
|
|
|
|
saveScript: Api.newPost("/machines/{machineId}/scripts"),
|
|
|
|
|
deleteScript: Api.newDelete("/machines/{machineId}/scripts/{scriptId}"),
|
2020-09-01 10:34:11 +08:00
|
|
|
// 获取配置文件列表
|
2023-04-13 20:11:22 +08:00
|
|
|
files: Api.newGet("/machines/{id}/files"),
|
|
|
|
|
lsFile: Api.newGet("/machines/{machineId}/files/{fileId}/read-dir"),
|
2023-07-05 00:26:00 +08:00
|
|
|
dirSize: Api.newGet("/machines/{machineId}/files/{fileId}/dir-size"),
|
|
|
|
|
fileStat: Api.newGet("/machines/{machineId}/files/{fileId}/file-stat"),
|
2023-04-13 20:11:22 +08:00
|
|
|
rmFile: Api.newDelete("/machines/{machineId}/files/{fileId}/remove"),
|
|
|
|
|
uploadFile: Api.newPost("/machines/{machineId}/files/{fileId}/upload?token={token}"),
|
|
|
|
|
fileContent: Api.newGet("/machines/{machineId}/files/{fileId}/read"),
|
|
|
|
|
createFile: Api.newPost("/machines/{machineId}/files/{id}/create-file"),
|
2020-09-01 10:34:11 +08:00
|
|
|
// 修改文件内容
|
2023-04-13 20:11:22 +08:00
|
|
|
updateFileContent: Api.newPost("/machines/{machineId}/files/{id}/write"),
|
2020-09-01 10:34:11 +08:00
|
|
|
// 添加文件or目录
|
2023-04-13 20:11:22 +08:00
|
|
|
addConf: Api.newPost("/machines/{machineId}/files"),
|
2020-09-01 10:34:11 +08:00
|
|
|
// 删除配置的文件or目录
|
2023-04-13 20:11:22 +08:00
|
|
|
delConf: Api.newDelete("/machines/{machineId}/files/{id}"),
|
|
|
|
|
terminal: Api.newGet("/api/machines/{id}/terminal"),
|
|
|
|
|
recDirNames: Api.newGet("/machines/rec/names")
|
2023-03-06 16:59:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const authCertApi = {
|
2023-04-13 20:11:22 +08:00
|
|
|
baseList : Api.newGet("/sys/authcerts/base"),
|
|
|
|
|
list: Api.newGet("/sys/authcerts"),
|
|
|
|
|
save: Api.newPost("/sys/authcerts"),
|
|
|
|
|
delete: Api.newDelete("/sys/authcerts/{id}"),
|
2020-09-01 10:34:11 +08:00
|
|
|
}
|