refactor(instance): migrate from name-based to ID-based instance management
feat(instanceDetail): add instance status display and restart && stop/start control - Change instance identification from name to ID in API endpoints and routes - Add instance status management functionality with start/stop/restart - Implement user type checks for instance operations - Update UI to reflect instance status changes - Remove completed TODO notes for implemented APIs
This commit is contained in:
@@ -67,32 +67,33 @@ export const instanceApi = {
|
||||
runUser,
|
||||
additionalProperties
|
||||
}),
|
||||
deleteInstance: (instanceName) =>
|
||||
api.post('/frpcAct/instanceMgr/delete', { instanceName }),
|
||||
modifyInstance: (instanceName, instanceID, type, modifiedData) =>
|
||||
deleteInstance: (instanceID) =>
|
||||
api.post('/frpcAct/instanceMgr/delete', { instanceID }),
|
||||
modifyInstance: (instanceID, type, modifiedData) =>
|
||||
api.post('/frpcAct/instanceMgr/modify', {
|
||||
instanceName,
|
||||
instanceID,
|
||||
type,
|
||||
modifiedData
|
||||
}),
|
||||
listInstances: () => api.get('/frpcAct/instanceMgr/list'),
|
||||
startInstance: (instanceName) =>
|
||||
api.post('/frpcAct/instanceMgr/start', { instanceName }),
|
||||
stopInstance: (instanceName) =>
|
||||
api.post('/frpcAct/instanceMgr/stop', { instanceName }),
|
||||
restartInstance: (instanceName) =>
|
||||
api.post('/frpcAct/instanceMgr/restart', { instanceName }),
|
||||
getInstanceLogs: (instanceName) =>
|
||||
api.get('/frpcAct/instanceMgr/logs', { params: { instanceName } }),
|
||||
startInstance: (instanceID) =>
|
||||
api.post('/frpcAct/instanceMgr/start', { instanceID }),
|
||||
stopInstance: (instanceID) =>
|
||||
api.post('/frpcAct/instanceMgr/stop', { instanceID }),
|
||||
restartInstance: (instanceID) =>
|
||||
api.post('/frpcAct/instanceMgr/restart', { instanceID }),
|
||||
getInstanceStatus: (instanceID) =>
|
||||
api.post('/frpcAct/instanceMgr/status', { instanceID }),
|
||||
getInstanceLogs: (instanceID) =>
|
||||
api.post('/frpcAct/instanceMgr/logs', { instanceID }),
|
||||
getInstanceProxies: (instanceID) =>
|
||||
api.get('/frpcAct/proxyMgr/list', { params: { instanceID } }),
|
||||
api.get(`/frpcAct/proxyMgr/list?instanceID=${instanceID}`),
|
||||
createProxy: (instanceID, proxyInfo) =>
|
||||
api.post('/frpcAct/proxyMgr/create', { instanceID, proxyInfo })
|
||||
};
|
||||
|
||||
export const logApi = {
|
||||
getLogs: (level) => api.get('/logMgr/list', { params: { level } })
|
||||
getLogs: (level) => api.post('/logMgr/list', { level })
|
||||
};
|
||||
|
||||
export const monitorApi = {
|
||||
@@ -106,9 +107,6 @@ export const systemInfoApi = {
|
||||
export default api;
|
||||
|
||||
export const TODO_API_NOTES = {
|
||||
instanceStart: 'TODO: /frpcAct/instanceMgr/start - 启动实例 API 未在 api-backend.md 中定义',
|
||||
instanceStop: 'TODO: /frpcAct/instanceMgr/stop - 停止实例 API 未在 api-backend.md 中定义',
|
||||
instanceRestart: 'TODO: /frpcAct/instanceMgr/restart - 重启实例 API 未在 api-backend.md 中定义',
|
||||
instanceLogs: 'TODO: /frpcAct/instanceMgr/logs - 获取实例日志 API 未在 api-backend.md 中定义',
|
||||
instanceProxies: 'TODO: /frpcAct/instanceMgr/proxies - 获取实例代理列表 API 未在 api-backend.md 中定义',
|
||||
logList: 'TODO: /logMgr/list - 获取系统日志 API 未在 api-backend.md 中定义',
|
||||
|
||||
Reference in New Issue
Block a user