From 38c0d290e78b9cd1b0d52abe6720375e5765bf6e Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 28 Jun 2023 14:50:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=E7=AE=A1=E7=90=86=20(#1476)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/v1/entry.go | 1 + backend/app/api/v1/file.go | 9 +- backend/app/api/v1/process.go | 40 ++ backend/app/dto/request/process.go | 5 + backend/app/service/process.go | 27 + backend/init/router/router.go | 1 + backend/router/entry.go | 1 + backend/router/ro_process.go | 20 + backend/utils/ps/ps_test.go | 68 +++ backend/utils/websocket/client.go | 30 +- backend/utils/websocket/client_manager.go | 38 -- backend/utils/websocket/process_data.go | 222 ++++++++ cmd/server/docs/docs.go | 482 ++++++++++-------- cmd/server/docs/swagger.json | 411 +++++++++------ cmd/server/docs/swagger.yaml | 384 ++++++++------ frontend/src/api/interface/process.ts | 5 + frontend/src/api/modules/process.ts | 6 + .../src/components/complex-table/index.vue | 5 + frontend/src/lang/modules/en.ts | 36 ++ frontend/src/lang/modules/zh.ts | 36 ++ frontend/src/routers/modules/host.ts | 11 + frontend/src/views/host/process/index.vue | 20 + .../host/process/process/detail/index.vue | 129 +++++ .../src/views/host/process/process/index.vue | 284 +++++++++++ 24 files changed, 1652 insertions(+), 619 deletions(-) create mode 100644 backend/app/api/v1/process.go create mode 100644 backend/app/dto/request/process.go create mode 100644 backend/app/service/process.go create mode 100644 backend/router/ro_process.go create mode 100644 backend/utils/ps/ps_test.go delete mode 100644 backend/utils/websocket/client_manager.go create mode 100644 backend/utils/websocket/process_data.go create mode 100644 frontend/src/api/interface/process.ts create mode 100644 frontend/src/api/modules/process.ts create mode 100644 frontend/src/views/host/process/index.vue create mode 100644 frontend/src/views/host/process/process/detail/index.vue create mode 100644 frontend/src/views/host/process/process/index.vue diff --git a/backend/app/api/v1/entry.go b/backend/app/api/v1/entry.go index 86aded121..0683a8446 100644 --- a/backend/app/api/v1/entry.go +++ b/backend/app/api/v1/entry.go @@ -49,4 +49,5 @@ var ( upgradeService = service.NewIUpgradeService() runtimeService = service.NewRuntimeService() + processService = service.NewIProcessService() ) diff --git a/backend/app/api/v1/file.go b/backend/app/api/v1/file.go index 9d969e743..a5f03280b 100644 --- a/backend/app/api/v1/file.go +++ b/backend/app/api/v1/file.go @@ -734,19 +734,12 @@ var wsUpgrade = websocket.Upgrader{ }, } -var WsManager = websocket2.Manager{ - Group: make(map[string]*websocket2.Client), - Register: make(chan *websocket2.Client, 128), - UnRegister: make(chan *websocket2.Client, 128), - ClientCount: 0, -} - func (b *BaseApi) Ws(c *gin.Context) { ws, err := wsUpgrade.Upgrade(c.Writer, c.Request, nil) if err != nil { return } - wsClient := websocket2.NewWsClient("wsClient", ws) + wsClient := websocket2.NewWsClient("fileClient", ws) go wsClient.Read() go wsClient.Write() } diff --git a/backend/app/api/v1/process.go b/backend/app/api/v1/process.go new file mode 100644 index 000000000..7961bf942 --- /dev/null +++ b/backend/app/api/v1/process.go @@ -0,0 +1,40 @@ +package v1 + +import ( + "github.com/1Panel-dev/1Panel/backend/app/api/v1/helper" + "github.com/1Panel-dev/1Panel/backend/app/dto/request" + "github.com/1Panel-dev/1Panel/backend/constant" + websocket2 "github.com/1Panel-dev/1Panel/backend/utils/websocket" + "github.com/gin-gonic/gin" +) + +func (b *BaseApi) ProcessWs(c *gin.Context) { + ws, err := wsUpgrade.Upgrade(c.Writer, c.Request, nil) + if err != nil { + return + } + wsClient := websocket2.NewWsClient("processClient", ws) + go wsClient.Read() + go wsClient.Write() +} + +// @Tags Process +// @Summary Stop Process +// @Description 停止进程 +// @Param request body request.ProcessReq true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /process/stop [post] +// @x-panel-log {"bodyKeys":["PID"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"结束进程 [PID]","formatEN":"结束进程 [PID]"} +func (b *BaseApi) StopProcess(c *gin.Context) { + var req request.ProcessReq + if err := c.ShouldBindJSON(&req); err != nil { + helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) + return + } + if err := processService.StopProcess(req); err != nil { + helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) + return + } + helper.SuccessWithOutData(c) +} diff --git a/backend/app/dto/request/process.go b/backend/app/dto/request/process.go new file mode 100644 index 000000000..9269c4c7d --- /dev/null +++ b/backend/app/dto/request/process.go @@ -0,0 +1,5 @@ +package request + +type ProcessReq struct { + PID int32 `json:"PID" validate:"required"` +} diff --git a/backend/app/service/process.go b/backend/app/service/process.go new file mode 100644 index 000000000..494b40282 --- /dev/null +++ b/backend/app/service/process.go @@ -0,0 +1,27 @@ +package service + +import ( + "github.com/1Panel-dev/1Panel/backend/app/dto/request" + "github.com/shirou/gopsutil/v3/process" +) + +type ProcessService struct{} + +type IProcessService interface { + StopProcess(req request.ProcessReq) error +} + +func NewIProcessService() IProcessService { + return &ProcessService{} +} + +func (p *ProcessService) StopProcess(req request.ProcessReq) error { + proc, err := process.NewProcess(req.PID) + if err != nil { + return err + } + if err := proc.Kill(); err != nil { + return err + } + return nil +} diff --git a/backend/init/router/router.go b/backend/init/router/router.go index 58f49e4d4..4517f40f9 100644 --- a/backend/init/router/router.go +++ b/backend/init/router/router.go @@ -86,6 +86,7 @@ func Routers() *gin.Engine { systemRouter.InitWebsiteAcmeAccountRouter(PrivateGroup) systemRouter.InitNginxRouter(PrivateGroup) systemRouter.InitRuntimeRouter(PrivateGroup) + systemRouter.InitProcessRouter(PrivateGroup) } return Router diff --git a/backend/router/entry.go b/backend/router/entry.go index 9898932e6..b69635804 100644 --- a/backend/router/entry.go +++ b/backend/router/entry.go @@ -20,6 +20,7 @@ type RouterGroup struct { DatabaseRouter NginxRouter RuntimeRouter + ProcessRouter } var RouterGroupApp = new(RouterGroup) diff --git a/backend/router/ro_process.go b/backend/router/ro_process.go new file mode 100644 index 000000000..604c88983 --- /dev/null +++ b/backend/router/ro_process.go @@ -0,0 +1,20 @@ +package router + +import ( + v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1" + "github.com/1Panel-dev/1Panel/backend/middleware" + "github.com/gin-gonic/gin" +) + +type ProcessRouter struct { +} + +func (f *ProcessRouter) InitProcessRouter(Router *gin.RouterGroup) { + processRouter := Router.Group("process") + processRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired()) + baseApi := v1.ApiGroupApp.BaseApi + { + processRouter.GET("/ws", baseApi.ProcessWs) + processRouter.POST("/stop", baseApi.StopProcess) + } +} diff --git a/backend/utils/ps/ps_test.go b/backend/utils/ps/ps_test.go new file mode 100644 index 000000000..3e925b553 --- /dev/null +++ b/backend/utils/ps/ps_test.go @@ -0,0 +1,68 @@ +package ps + +import ( + "fmt" + "github.com/shirou/gopsutil/v3/process" + "strconv" + "testing" + "time" +) + +func TestPs(t *testing.T) { + processes, err := process.Processes() + if err != nil { + panic(err) + } + for _, pro := range processes { + var ( + name string + parentID int32 + userName string + status string + startTime string + numThreads int32 + numConnections int + cpuPercent float64 + //mem string + rss string + ioRead string + ioWrite string + ) + name, _ = pro.Name() + parentID, _ = pro.Ppid() + userName, _ = pro.Username() + array, err := pro.Status() + if err == nil { + status = array[0] + } + createTime, err := pro.CreateTime() + if err == nil { + t := time.Unix(createTime/1000, 0) + startTime = t.Format("2006-1-2 15:04:05") + } + numThreads, _ = pro.NumThreads() + connections, err := pro.Connections() + if err == nil && len(connections) > 0 { + numConnections = len(connections) + } + cpuPercent, _ = pro.CPUPercent() + menInfo, err := pro.MemoryInfo() + if err == nil { + rssF := float64(menInfo.RSS) / 1048576 + rss = fmt.Sprintf("%.2f", rssF) + } + ioStat, err := pro.IOCounters() + if err == nil { + ioWrite = strconv.FormatUint(ioStat.WriteBytes, 10) + ioRead = strconv.FormatUint(ioStat.ReadBytes, 10) + } + + cmdLine, err := pro.Cmdline() + if err == nil { + fmt.Println(cmdLine) + } + + fmt.Println(fmt.Sprintf("Name: %s PId: %v ParentID: %v Username: %v status:%s startTime: %s numThreads: %v numConnections:%v cpuPercent:%v rss:%s MB IORead: %s IOWrite: %s", + name, pro.Pid, parentID, userName, status, startTime, numThreads, numConnections, cpuPercent, rss, ioRead, ioWrite)) + } +} diff --git a/backend/utils/websocket/client.go b/backend/utils/websocket/client.go index 2665d2e05..368eeeee9 100644 --- a/backend/utils/websocket/client.go +++ b/backend/utils/websocket/client.go @@ -1,17 +1,9 @@ package websocket import ( - "encoding/json" - "github.com/1Panel-dev/1Panel/backend/global" - "github.com/1Panel-dev/1Panel/backend/utils/files" "github.com/gorilla/websocket" ) -type WsMsg struct { - Type string - Keys []string -} - type Client struct { ID string Socket *websocket.Conn @@ -35,9 +27,7 @@ func (c *Client) Read() { if err != nil { return } - msg := &WsMsg{} - _ = json.Unmarshal(message, msg) - ProcessData(c, msg) + ProcessData(c, message) } } @@ -53,21 +43,3 @@ func (c *Client) Write() { _ = c.Socket.WriteMessage(websocket.TextMessage, message) } } - -func ProcessData(c *Client, msg *WsMsg) { - if msg.Type == "wget" { - var res []files.Process - for _, k := range msg.Keys { - value, err := global.CACHE.Get(k) - if err != nil { - global.LOG.Errorf("get cache error,err %s", err.Error()) - return - } - process := &files.Process{} - _ = json.Unmarshal(value, process) - res = append(res, *process) - } - reByte, _ := json.Marshal(res) - c.Msg <- reByte - } -} diff --git a/backend/utils/websocket/client_manager.go b/backend/utils/websocket/client_manager.go deleted file mode 100644 index 73548ecd6..000000000 --- a/backend/utils/websocket/client_manager.go +++ /dev/null @@ -1,38 +0,0 @@ -package websocket - -import "sync" - -type Manager struct { - Group map[string]*Client - Lock sync.Mutex - Register, UnRegister chan *Client - ClientCount uint -} - -func (m *Manager) Start() { - for { - select { - case client := <-m.Register: - m.Lock.Lock() - m.Group[client.ID] = client - m.ClientCount++ - m.Lock.Unlock() - case client := <-m.UnRegister: - m.Lock.Lock() - if _, ok := m.Group[client.ID]; ok { - close(client.Msg) - delete(m.Group, client.ID) - m.ClientCount-- - } - m.Lock.Unlock() - } - } -} - -func (m *Manager) RegisterClient(client *Client) { - m.Register <- client -} - -func (m *Manager) UnRegisterClient(client *Client) { - m.UnRegister <- client -} diff --git a/backend/utils/websocket/process_data.go b/backend/utils/websocket/process_data.go new file mode 100644 index 000000000..6bf67d9c4 --- /dev/null +++ b/backend/utils/websocket/process_data.go @@ -0,0 +1,222 @@ +package websocket + +import ( + "encoding/json" + "fmt" + "github.com/1Panel-dev/1Panel/backend/global" + "github.com/1Panel-dev/1Panel/backend/utils/files" + "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v3/process" + "strings" + "time" +) + +type WsInput struct { + Type string `json:"type"` + DownloadProgress + PsProcessConfig +} + +type DownloadProgress struct { + Keys []string `json:"keys"` +} + +type PsProcessConfig struct { + Pid int32 `json:"pid"` + Name string `json:"name"` + Username string `json:"username"` +} + +type PsProcessData struct { + PID int32 `json:"PID"` + Name string `json:"name"` + PPID int32 `json:"PPID"` + Username string `json:"username"` + Status string `json:"status"` + StartTime string `json:"startTime"` + NumThreads int32 `json:"numThreads"` + NumConnections int `json:"numConnections"` + CpuPercent string `json:"cpuPercent"` + + DiskRead string `json:"diskRead"` + DiskWrite string `json:"diskWrite"` + CmdLine string `json:"cmdLine"` + + Rss string `json:"rss"` + VMS string `json:"vms"` + HWM string `json:"hwm"` + Data string `json:"data"` + Stack string `json:"stack"` + Locked string `json:"locked"` + Swap string `json:"swap"` + + CpuValue float64 `json:"cpuValue"` + RssValue uint64 `json:"rssValue"` + + Envs []string `json:"envs"` + + OpenFiles []process.OpenFilesStat `json:"openFiles"` + Connects []processConnect `json:"connects"` +} + +type processConnect struct { + Type string `json:"type"` + Status string `json:"status"` + Laddr net.Addr `json:"localaddr"` + Raddr net.Addr `json:"remoteaddr"` +} + +func ProcessData(c *Client, inputMsg []byte) { + wsInput := &WsInput{} + err := json.Unmarshal(inputMsg, wsInput) + if err != nil { + global.LOG.Errorf("unmarshal wsInput error,err %s", err.Error()) + return + } + switch wsInput.Type { + case "wget": + res, err := getDownloadProcess(wsInput.DownloadProgress) + if err != nil { + return + } + c.Msg <- res + case "ps": + res, err := getProcessData(wsInput.PsProcessConfig) + if err != nil { + return + } + c.Msg <- res + } + +} + +func getDownloadProcess(progress DownloadProgress) (res []byte, err error) { + var result []files.Process + for _, k := range progress.Keys { + value, err := global.CACHE.Get(k) + if err != nil { + global.LOG.Errorf("get cache error,err %s", err.Error()) + return nil, err + } + downloadProcess := &files.Process{} + _ = json.Unmarshal(value, downloadProcess) + result = append(result, *downloadProcess) + } + res, err = json.Marshal(result) + return +} + +const ( + b = uint64(1) + kb = 1024 * b + mb = 1024 * kb + gb = 1024 * mb +) + +func formatBytes(bytes uint64) string { + switch { + case bytes < kb: + return fmt.Sprintf("%dB", bytes) + case bytes < mb: + return fmt.Sprintf("%.2fKB", float64(bytes)/float64(kb)) + case bytes < gb: + return fmt.Sprintf("%.2fMB", float64(bytes)/float64(mb)) + default: + return fmt.Sprintf("%.2fGB", float64(bytes)/float64(gb)) + } +} + +func getProcessData(processConfig PsProcessConfig) (res []byte, err error) { + var ( + result []PsProcessData + processes []*process.Process + ) + processes, err = process.Processes() + if err != nil { + return + } + for _, proc := range processes { + procData := PsProcessData{ + PID: proc.Pid, + } + if processConfig.Pid > 0 && processConfig.Pid != proc.Pid { + continue + } + if procName, err := proc.Name(); err == nil { + procData.Name = procName + } else { + procData.Name = "" + } + if processConfig.Name != "" && !strings.Contains(procData.Name, processConfig.Name) { + continue + } + if username, err := proc.Username(); err == nil { + procData.Username = username + } + if processConfig.Username != "" && !strings.Contains(procData.Username, processConfig.Username) { + continue + } + procData.PPID, _ = proc.Ppid() + statusArray, _ := proc.Status() + if len(statusArray) > 0 { + procData.Status = strings.Join(statusArray, ",") + } + createTime, procErr := proc.CreateTime() + if procErr == nil { + t := time.Unix(createTime/1000, 0) + procData.StartTime = t.Format("2006-1-2 15:04:05") + } + procData.NumThreads, _ = proc.NumThreads() + connections, procErr := proc.Connections() + if procErr == nil { + procData.NumConnections = len(connections) + for _, conn := range connections { + if conn.Laddr.IP != "" || conn.Raddr.IP != "" { + procData.Connects = append(procData.Connects, processConnect{ + Status: conn.Status, + Laddr: conn.Laddr, + Raddr: conn.Raddr, + }) + } + } + } + procData.CpuValue, _ = proc.CPUPercent() + procData.CpuPercent = fmt.Sprintf("%.2f", procData.CpuValue) + "%" + menInfo, procErr := proc.MemoryInfo() + if procErr == nil { + procData.Rss = formatBytes(menInfo.RSS) + procData.RssValue = menInfo.RSS + procData.Data = formatBytes(menInfo.Data) + procData.VMS = formatBytes(menInfo.VMS) + procData.HWM = formatBytes(menInfo.HWM) + procData.Stack = formatBytes(menInfo.Stack) + procData.Locked = formatBytes(menInfo.Locked) + procData.Swap = formatBytes(menInfo.Swap) + } else { + procData.Rss = "--" + procData.Data = "--" + procData.VMS = "--" + procData.HWM = "--" + procData.Stack = "--" + procData.Locked = "--" + procData.Swap = "--" + + procData.RssValue = 0 + } + ioStat, procErr := proc.IOCounters() + if procErr == nil { + procData.DiskWrite = formatBytes(ioStat.WriteBytes) + procData.DiskRead = formatBytes(ioStat.ReadBytes) + } else { + procData.DiskWrite = "--" + procData.DiskRead = "--" + } + procData.CmdLine, _ = proc.Cmdline() + procData.OpenFiles, _ = proc.OpenFiles() + procData.Envs, _ = proc.Environ() + + result = append(result, procData) + } + res, err = json.Marshal(result) + return +} diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go index 73a1298c8..a055dd906 100644 --- a/cmd/server/docs/docs.go +++ b/cmd/server/docs/docs.go @@ -1,17 +1,10 @@ -// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// Package docs GENERATED BY SWAG; DO NOT EDIT // This file was generated by swaggo/swag package docs -import ( - "bytes" - "encoding/json" - "strings" - "text/template" +import "github.com/swaggo/swag" - "github.com/swaggo/swag" -) - -var doc = `{ +const docTemplate = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { @@ -76,7 +69,7 @@ var doc = `{ "summary": "Get app list update", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -456,7 +449,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -558,7 +551,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -600,7 +593,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -644,7 +637,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -663,7 +656,7 @@ var doc = `{ "summary": "Sync app installed", "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -703,7 +696,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -756,7 +749,7 @@ var doc = `{ "summary": "Sync app list", "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -794,7 +787,7 @@ var doc = `{ "summary": "Check System isDemo", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -808,7 +801,7 @@ var doc = `{ "summary": "Load safety status", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -858,7 +851,7 @@ var doc = `{ "summary": "User logout", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -922,7 +915,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -965,7 +958,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1007,7 +1000,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1049,7 +1042,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1128,7 +1121,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1170,7 +1163,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1262,7 +1255,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1302,7 +1295,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1342,7 +1335,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1479,7 +1472,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1632,7 +1625,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1674,7 +1667,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1757,7 +1750,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1900,7 +1893,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1942,7 +1935,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2023,7 +2016,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2138,7 +2131,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2183,7 +2176,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2276,7 +2269,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -2312,7 +2305,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2497,7 +2490,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2539,7 +2532,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2629,7 +2622,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2680,7 +2673,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2723,7 +2716,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2766,7 +2759,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2808,7 +2801,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2926,7 +2919,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2969,7 +2962,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3020,7 +3013,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3071,7 +3064,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3122,7 +3115,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3245,7 +3238,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3297,7 +3290,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3430,7 +3423,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3494,7 +3487,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3545,7 +3538,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3596,7 +3589,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3636,7 +3629,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3723,7 +3716,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3869,7 +3862,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3909,7 +3902,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3949,7 +3942,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4011,7 +4004,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4175,7 +4168,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4215,7 +4208,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4257,7 +4250,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4299,7 +4292,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4341,7 +4334,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4378,7 +4371,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -4411,7 +4404,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4498,7 +4491,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4540,7 +4533,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4582,7 +4575,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4624,7 +4617,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4702,7 +4695,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4745,7 +4738,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4788,7 +4781,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4832,7 +4825,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4875,7 +4868,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4953,7 +4946,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5026,7 +5019,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5104,7 +5097,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5148,7 +5141,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5191,7 +5184,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5289,7 +5282,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5332,7 +5325,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5372,7 +5365,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5508,7 +5501,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -5541,7 +5534,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5584,7 +5577,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5681,7 +5674,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5724,7 +5717,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5811,7 +5804,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5853,7 +5846,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5926,7 +5919,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -5959,7 +5952,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6047,7 +6040,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6126,7 +6119,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -6159,7 +6152,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -6262,7 +6255,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -6331,7 +6324,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6374,7 +6367,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6565,7 +6558,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6663,7 +6656,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6686,6 +6679,45 @@ var doc = `{ } } }, + "/process/stop": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "停止进程", + "tags": [ + "Process" + ], + "summary": "Stop Process", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.ProcessReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "PID" + ], + "formatEN": "结束进程 [PID]", + "formatZH": "结束进程 [PID]", + "paramKeys": [] + } + } + }, "/runtimes": { "post": { "security": [ @@ -6714,7 +6746,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6754,7 +6786,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -6787,7 +6819,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6829,7 +6861,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -6862,7 +6894,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6904,7 +6936,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6946,7 +6978,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6990,7 +7022,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7041,7 +7073,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7092,7 +7124,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7135,7 +7167,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -7168,7 +7200,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7213,7 +7245,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7350,7 +7382,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7414,7 +7446,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7426,7 +7458,7 @@ var doc = `{ } } }, - "/settings/mfa": { + "/settings/mfa/:interval": { "get": { "security": [ { @@ -7438,6 +7470,15 @@ var doc = `{ "System Setting" ], "summary": "Load mfa info", + "parameters": [ + { + "type": "string", + "description": "request", + "name": "interval", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -7476,7 +7517,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7502,7 +7543,7 @@ var doc = `{ "summary": "Clean monitor datas", "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7542,7 +7583,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7582,7 +7623,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7632,7 +7673,7 @@ var doc = `{ "summary": "Load system available status", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -7665,7 +7706,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7708,7 +7749,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7759,7 +7800,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7811,7 +7852,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7854,7 +7895,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7905,7 +7946,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8014,7 +8055,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8042,7 +8083,7 @@ var doc = `{ "summary": "Load time zone options", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -8120,7 +8161,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8163,7 +8204,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } }, @@ -8194,7 +8235,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8236,7 +8277,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8477,7 +8518,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8564,7 +8605,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -8597,7 +8638,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -8702,7 +8743,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8753,7 +8794,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8805,7 +8846,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8856,7 +8897,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8907,7 +8948,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8958,7 +8999,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9000,7 +9041,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9087,7 +9128,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9208,7 +9249,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9259,7 +9300,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -9292,7 +9333,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -9402,7 +9443,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9453,7 +9494,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9527,7 +9568,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9612,7 +9653,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9663,7 +9704,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -9696,7 +9737,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9747,7 +9788,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9798,7 +9839,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -9831,7 +9872,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9961,7 +10002,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -9994,7 +10035,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -10045,7 +10086,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -10132,7 +10173,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -10165,7 +10206,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -10214,7 +10255,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -10247,7 +10288,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -10325,7 +10366,7 @@ var doc = `{ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -10398,6 +10439,9 @@ var doc = `{ "accessKey": { "type": "string" }, + "backupPath": { + "type": "string" + }, "bucket": { "type": "string" }, @@ -11871,6 +11915,9 @@ var doc = `{ "code": { "type": "string" }, + "interval": { + "type": "string" + }, "secret": { "type": "string" } @@ -12153,6 +12200,25 @@ var doc = `{ } } }, + "dto.NginxKey": { + "type": "string", + "enum": [ + "index", + "limit-conn", + "ssl", + "cache", + "http-per", + "proxy-cache" + ], + "x-enum-varnames": [ + "Index", + "LimitConn", + "SSL", + "CACHE", + "HttpPer", + "ProxyCache" + ] + }, "dto.Operate": { "type": "object", "required": [ @@ -12803,6 +12869,9 @@ var doc = `{ "messageType": { "type": "string" }, + "mfaInterval": { + "type": "string" + }, "mfaSecret": { "type": "string" }, @@ -14073,7 +14142,7 @@ var doc = `{ }, "params": {}, "scope": { - "type": "string" + "$ref": "#/definitions/dto.NginxKey" }, "websiteId": { "type": "integer" @@ -14140,7 +14209,7 @@ var doc = `{ ], "properties": { "scope": { - "type": "string" + "$ref": "#/definitions/dto.NginxKey" }, "websiteId": { "type": "integer" @@ -14161,6 +14230,17 @@ var doc = `{ } } }, + "request.ProcessReq": { + "type": "object", + "required": [ + "PID" + ], + "properties": { + "PID": { + "type": "integer" + } + } + }, "request.RuntimeCreate": { "type": "object", "properties": { @@ -15402,56 +15482,18 @@ var doc = `{ } }` -type swaggerInfo struct { - Version string - Host string - BasePath string - Schemes []string - Title string - Description string -} - // SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = swaggerInfo{ - Version: "1.0", - Host: "localhost", - BasePath: "/api/v1", - Schemes: []string{}, - Title: "1Panel", - Description: "开源Linux面板", -} - -type s struct{} - -func (s *s) ReadDoc() string { - sInfo := SwaggerInfo - sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) - - t, err := template.New("swagger_info").Funcs(template.FuncMap{ - "marshal": func(v interface{}) string { - a, _ := json.Marshal(v) - return string(a) - }, - "escape": func(v interface{}) string { - // escape tabs - str := strings.Replace(v.(string), "\t", "\\t", -1) - // replace " with \", and if that results in \\", replace that with \\\" - str = strings.Replace(str, "\"", "\\\"", -1) - return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1) - }, - }).Parse(doc) - if err != nil { - return doc - } - - var tpl bytes.Buffer - if err := t.Execute(&tpl, sInfo); err != nil { - return doc - } - - return tpl.String() +var SwaggerInfo = &swag.Spec{ + Version: "1.0", + Host: "localhost", + BasePath: "/api/v1", + Schemes: []string{}, + Title: "1Panel", + Description: "开源Linux面板", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, } func init() { - swag.Register("swagger", &s{}) + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) } diff --git a/cmd/server/docs/swagger.json b/cmd/server/docs/swagger.json index 55df7c9d8..d7b8bd4a0 100644 --- a/cmd/server/docs/swagger.json +++ b/cmd/server/docs/swagger.json @@ -62,7 +62,7 @@ "summary": "Get app list update", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -442,7 +442,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -544,7 +544,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -586,7 +586,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -630,7 +630,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -649,7 +649,7 @@ "summary": "Sync app installed", "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -689,7 +689,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -742,7 +742,7 @@ "summary": "Sync app list", "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -780,7 +780,7 @@ "summary": "Check System isDemo", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -794,7 +794,7 @@ "summary": "Load safety status", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -844,7 +844,7 @@ "summary": "User logout", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -908,7 +908,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -951,7 +951,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -993,7 +993,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1035,7 +1035,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1114,7 +1114,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1156,7 +1156,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1248,7 +1248,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1288,7 +1288,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1328,7 +1328,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1465,7 +1465,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1618,7 +1618,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1660,7 +1660,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1743,7 +1743,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1886,7 +1886,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -1928,7 +1928,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2009,7 +2009,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2124,7 +2124,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2169,7 +2169,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2262,7 +2262,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -2298,7 +2298,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2483,7 +2483,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2525,7 +2525,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2615,7 +2615,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2666,7 +2666,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2709,7 +2709,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2752,7 +2752,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2794,7 +2794,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2912,7 +2912,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -2955,7 +2955,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3006,7 +3006,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3057,7 +3057,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3108,7 +3108,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3231,7 +3231,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3283,7 +3283,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3416,7 +3416,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3480,7 +3480,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3531,7 +3531,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3582,7 +3582,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3622,7 +3622,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3709,7 +3709,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3855,7 +3855,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3895,7 +3895,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3935,7 +3935,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -3997,7 +3997,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4161,7 +4161,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4201,7 +4201,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4243,7 +4243,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4285,7 +4285,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4327,7 +4327,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4364,7 +4364,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -4397,7 +4397,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4484,7 +4484,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4526,7 +4526,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4568,7 +4568,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4610,7 +4610,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4688,7 +4688,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4731,7 +4731,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4774,7 +4774,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4818,7 +4818,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4861,7 +4861,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -4939,7 +4939,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5012,7 +5012,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5090,7 +5090,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5134,7 +5134,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5177,7 +5177,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5275,7 +5275,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5318,7 +5318,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5358,7 +5358,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5494,7 +5494,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -5527,7 +5527,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5570,7 +5570,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5667,7 +5667,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5710,7 +5710,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5797,7 +5797,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5839,7 +5839,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -5912,7 +5912,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -5945,7 +5945,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6033,7 +6033,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6112,7 +6112,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -6145,7 +6145,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -6248,7 +6248,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -6317,7 +6317,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6360,7 +6360,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6551,7 +6551,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6649,7 +6649,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6672,6 +6672,45 @@ } } }, + "/process/stop": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "停止进程", + "tags": [ + "Process" + ], + "summary": "Stop Process", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.ProcessReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "PID" + ], + "formatEN": "结束进程 [PID]", + "formatZH": "结束进程 [PID]", + "paramKeys": [] + } + } + }, "/runtimes": { "post": { "security": [ @@ -6700,7 +6739,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6740,7 +6779,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -6773,7 +6812,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6815,7 +6854,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -6848,7 +6887,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6890,7 +6929,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6932,7 +6971,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -6976,7 +7015,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7027,7 +7066,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7078,7 +7117,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7121,7 +7160,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -7154,7 +7193,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7199,7 +7238,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7336,7 +7375,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7400,7 +7439,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7412,7 +7451,7 @@ } } }, - "/settings/mfa": { + "/settings/mfa/:interval": { "get": { "security": [ { @@ -7424,6 +7463,15 @@ "System Setting" ], "summary": "Load mfa info", + "parameters": [ + { + "type": "string", + "description": "request", + "name": "interval", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -7462,7 +7510,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7488,7 +7536,7 @@ "summary": "Clean monitor datas", "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7528,7 +7576,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7568,7 +7616,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7618,7 +7666,7 @@ "summary": "Load system available status", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -7651,7 +7699,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7694,7 +7742,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7745,7 +7793,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7797,7 +7845,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7840,7 +7888,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -7891,7 +7939,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8000,7 +8048,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8028,7 +8076,7 @@ "summary": "Load time zone options", "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -8106,7 +8154,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8149,7 +8197,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } }, @@ -8180,7 +8228,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8222,7 +8270,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8463,7 +8511,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8550,7 +8598,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -8583,7 +8631,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -8688,7 +8736,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8739,7 +8787,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8791,7 +8839,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8842,7 +8890,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8893,7 +8941,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8944,7 +8992,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -8986,7 +9034,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9073,7 +9121,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9194,7 +9242,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9245,7 +9293,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -9278,7 +9326,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -9388,7 +9436,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9439,7 +9487,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9513,7 +9561,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9598,7 +9646,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9649,7 +9697,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -9682,7 +9730,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9733,7 +9781,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9784,7 +9832,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -9817,7 +9865,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -9947,7 +9995,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -9980,7 +10028,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -10031,7 +10079,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -10118,7 +10166,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -10151,7 +10199,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -10200,7 +10248,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } } } @@ -10233,7 +10281,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -10311,7 +10359,7 @@ ], "responses": { "200": { - "description": "" + "description": "OK" } }, "x-panel-log": { @@ -10384,6 +10432,9 @@ "accessKey": { "type": "string" }, + "backupPath": { + "type": "string" + }, "bucket": { "type": "string" }, @@ -11857,6 +11908,9 @@ "code": { "type": "string" }, + "interval": { + "type": "string" + }, "secret": { "type": "string" } @@ -12139,6 +12193,25 @@ } } }, + "dto.NginxKey": { + "type": "string", + "enum": [ + "index", + "limit-conn", + "ssl", + "cache", + "http-per", + "proxy-cache" + ], + "x-enum-varnames": [ + "Index", + "LimitConn", + "SSL", + "CACHE", + "HttpPer", + "ProxyCache" + ] + }, "dto.Operate": { "type": "object", "required": [ @@ -12789,6 +12862,9 @@ "messageType": { "type": "string" }, + "mfaInterval": { + "type": "string" + }, "mfaSecret": { "type": "string" }, @@ -14059,7 +14135,7 @@ }, "params": {}, "scope": { - "type": "string" + "$ref": "#/definitions/dto.NginxKey" }, "websiteId": { "type": "integer" @@ -14126,7 +14202,7 @@ ], "properties": { "scope": { - "type": "string" + "$ref": "#/definitions/dto.NginxKey" }, "websiteId": { "type": "integer" @@ -14147,6 +14223,17 @@ } } }, + "request.ProcessReq": { + "type": "object", + "required": [ + "PID" + ], + "properties": { + "PID": { + "type": "integer" + } + } + }, "request.RuntimeCreate": { "type": "object", "properties": { diff --git a/cmd/server/docs/swagger.yaml b/cmd/server/docs/swagger.yaml index a80241a75..f57c08583 100644 --- a/cmd/server/docs/swagger.yaml +++ b/cmd/server/docs/swagger.yaml @@ -30,6 +30,8 @@ definitions: properties: accessKey: type: string + backupPath: + type: string bucket: type: string credential: @@ -1023,6 +1025,8 @@ definitions: properties: code: type: string + interval: + type: string secret: type: string type: object @@ -1211,6 +1215,22 @@ definitions: subnet: type: string type: object + dto.NginxKey: + enum: + - index + - limit-conn + - ssl + - cache + - http-per + - proxy-cache + type: string + x-enum-varnames: + - Index + - LimitConn + - SSL + - CACHE + - HttpPer + - ProxyCache dto.Operate: properties: operation: @@ -1643,6 +1663,8 @@ definitions: type: string messageType: type: string + mfaInterval: + type: string mfaSecret: type: string mfaStatus: @@ -2487,7 +2509,7 @@ definitions: type: string params: {} scope: - type: string + $ref: '#/definitions/dto.NginxKey' websiteId: type: integer required: @@ -2532,7 +2554,7 @@ definitions: request.NginxScopeReq: properties: scope: - type: string + $ref: '#/definitions/dto.NginxKey' websiteId: type: integer required: @@ -2547,6 +2569,13 @@ definitions: port: type: integer type: object + request.ProcessReq: + properties: + PID: + type: integer + required: + - PID + type: object request.RuntimeCreate: properties: appDetailId: @@ -3412,7 +3441,7 @@ paths: description: 获取应用更新版本 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Get app list update @@ -3650,7 +3679,7 @@ paths: $ref: '#/definitions/request.AppInstalledOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Operate installed app @@ -3717,7 +3746,7 @@ paths: $ref: '#/definitions/request.AppInstalledUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change app params @@ -3744,7 +3773,7 @@ paths: $ref: '#/definitions/request.PortUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change app port @@ -3773,7 +3802,7 @@ paths: $ref: '#/definitions/request.AppInstalledSearch' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: List app installed @@ -3784,7 +3813,7 @@ paths: description: 同步已安装应用列表 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Sync app installed @@ -3810,7 +3839,7 @@ paths: $ref: '#/definitions/request.AppSearch' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: List apps @@ -3842,7 +3871,7 @@ paths: description: 同步应用列表 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Sync app list @@ -3870,7 +3899,7 @@ paths: description: 判断是否为demo环境 responses: "200": - description: "" + description: OK summary: Check System isDemo tags: - Auth @@ -3879,7 +3908,7 @@ paths: description: 获取系统安全登录状态 responses: "200": - description: "" + description: OK summary: Load safety status tags: - Auth @@ -3908,7 +3937,7 @@ paths: description: 用户登出 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: User logout @@ -3948,7 +3977,7 @@ paths: $ref: '#/definitions/dto.ContainerOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create container @@ -3976,7 +4005,7 @@ paths: $ref: '#/definitions/dto.OperationWithName' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Clean container log @@ -4003,7 +4032,7 @@ paths: $ref: '#/definitions/dto.ComposeCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create compose @@ -4030,7 +4059,7 @@ paths: $ref: '#/definitions/dto.ComposeOperation' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Operate compose @@ -4080,7 +4109,7 @@ paths: $ref: '#/definitions/dto.ComposeCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Test compose @@ -4107,7 +4136,7 @@ paths: $ref: '#/definitions/dto.ComposeUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update compose @@ -4164,7 +4193,7 @@ paths: $ref: '#/definitions/dto.LogOption' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update docker daemon.json log option @@ -4190,7 +4219,7 @@ paths: $ref: '#/definitions/dto.DaemonJsonUpdateByFile' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update docker daemon.json by upload file @@ -4216,7 +4245,7 @@ paths: $ref: '#/definitions/dto.DockerOperation' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Operate docker @@ -4302,7 +4331,7 @@ paths: $ref: '#/definitions/dto.ImageLoad' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Load image @@ -4402,7 +4431,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete image @@ -4429,7 +4458,7 @@ paths: $ref: '#/definitions/dto.ImageSave' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Save image @@ -4482,7 +4511,7 @@ paths: $ref: '#/definitions/dto.ImageTag' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Tag image @@ -4571,7 +4600,7 @@ paths: $ref: '#/definitions/dto.NetworkCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create network @@ -4598,7 +4627,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete network @@ -4649,7 +4678,7 @@ paths: $ref: '#/definitions/dto.ContainerOperation' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Operate Container @@ -4723,7 +4752,7 @@ paths: - application/json responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create image repo @@ -4752,7 +4781,7 @@ paths: - application/json responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete image repo @@ -4811,7 +4840,7 @@ paths: - application/json responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Load repo status @@ -4833,7 +4862,7 @@ paths: - application/json responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update image repo @@ -4949,7 +4978,7 @@ paths: $ref: '#/definitions/dto.ComposeTemplateCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create compose template @@ -4976,7 +5005,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete compose template @@ -5033,7 +5062,7 @@ paths: $ref: '#/definitions/dto.ComposeTemplateUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update compose template @@ -5066,7 +5095,7 @@ paths: $ref: '#/definitions/dto.ContainerOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update container @@ -5094,7 +5123,7 @@ paths: $ref: '#/definitions/dto.ContainerUpgrade' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Upgrade container @@ -5122,7 +5151,7 @@ paths: $ref: '#/definitions/dto.VolumeCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create volume @@ -5149,7 +5178,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete volume @@ -5223,7 +5252,7 @@ paths: $ref: '#/definitions/dto.CronjobCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create cronjob @@ -5251,7 +5280,7 @@ paths: $ref: '#/definitions/dto.CronjobBatchDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete cronjob @@ -5284,7 +5313,7 @@ paths: $ref: '#/definitions/dto.CronjobDownload' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Download cronjob records @@ -5317,7 +5346,7 @@ paths: $ref: '#/definitions/dto.OperateByID' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Handle cronjob once @@ -5350,7 +5379,7 @@ paths: $ref: '#/definitions/dto.CronjobClean' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Clean job records @@ -5427,7 +5456,7 @@ paths: $ref: '#/definitions/dto.CronjobUpdateStatus' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update cronjob status @@ -5461,7 +5490,7 @@ paths: $ref: '#/definitions/dto.CronjobUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update cronjob @@ -5546,7 +5575,7 @@ paths: $ref: '#/definitions/dto.MysqlDBCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create mysql database @@ -5586,7 +5615,7 @@ paths: $ref: '#/definitions/dto.ChangeDBInfo' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change mysql access @@ -5619,7 +5648,7 @@ paths: $ref: '#/definitions/dto.ChangeDBInfo' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change mysql password @@ -5652,7 +5681,7 @@ paths: $ref: '#/definitions/dto.MysqlConfUpdateByFile' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update mysql conf by upload file @@ -5678,7 +5707,7 @@ paths: $ref: '#/definitions/dto.MysqlDBDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete mysql database @@ -5733,7 +5762,7 @@ paths: $ref: '#/definitions/dto.UpdateDescription' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update mysql database description @@ -5824,7 +5853,7 @@ paths: $ref: '#/definitions/dto.RedisConfUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update redis conf @@ -5850,7 +5879,7 @@ paths: $ref: '#/definitions/dto.RedisConfUpdateByFile' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update redis conf by file @@ -5876,7 +5905,7 @@ paths: $ref: '#/definitions/dto.ChangeDBInfo' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change redis password @@ -5915,7 +5944,7 @@ paths: $ref: '#/definitions/dto.RedisConfPersistenceUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update redis persistence conf @@ -6015,7 +6044,7 @@ paths: $ref: '#/definitions/dto.MysqlVariablesUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update mysql variables @@ -6041,7 +6070,7 @@ paths: $ref: '#/definitions/request.FileCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create file @@ -6068,7 +6097,7 @@ paths: $ref: '#/definitions/request.FileBatchDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Batch delete file @@ -6095,7 +6124,7 @@ paths: $ref: '#/definitions/request.FilePathCheck' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Check file exist @@ -6122,7 +6151,7 @@ paths: $ref: '#/definitions/request.FileDownload' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Chunk Download file @@ -6146,7 +6175,7 @@ paths: type: file responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: ChunkUpload file @@ -6166,7 +6195,7 @@ paths: $ref: '#/definitions/request.FileCompress' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Compress file @@ -6222,7 +6251,7 @@ paths: $ref: '#/definitions/request.FileDeCompress' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Decompress file @@ -6249,7 +6278,7 @@ paths: $ref: '#/definitions/request.FileDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete file @@ -6276,7 +6305,7 @@ paths: $ref: '#/definitions/request.FileDownload' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Download file @@ -6303,7 +6332,7 @@ paths: $ref: '#/definitions/dto.FilePath' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Download file with path @@ -6352,7 +6381,7 @@ paths: $ref: '#/definitions/request.FileCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change file mode @@ -6380,7 +6409,7 @@ paths: $ref: '#/definitions/request.FileMove' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Move file @@ -6408,7 +6437,7 @@ paths: $ref: '#/definitions/request.FileRoleUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change file owner @@ -6437,7 +6466,7 @@ paths: $ref: '#/definitions/request.FileRename' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change file name @@ -6465,7 +6494,7 @@ paths: $ref: '#/definitions/request.FileEdit' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update file content @@ -6514,7 +6543,7 @@ paths: $ref: '#/definitions/request.DirSizeReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Load file size @@ -6560,7 +6589,7 @@ paths: type: file responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Upload file @@ -6609,7 +6638,7 @@ paths: $ref: '#/definitions/request.FileWget' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Wget file @@ -6638,7 +6667,7 @@ paths: $ref: '#/definitions/dto.GroupCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create group @@ -6666,7 +6695,7 @@ paths: $ref: '#/definitions/dto.OperateByID' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete group @@ -6729,7 +6758,7 @@ paths: $ref: '#/definitions/dto.GroupUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update group @@ -6757,7 +6786,7 @@ paths: $ref: '#/definitions/dto.SSHConf' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update host ssh setting by file @@ -6783,7 +6812,7 @@ paths: $ref: '#/definitions/dto.GenerateSSH' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Generate host ssh secret @@ -6869,7 +6898,7 @@ paths: $ref: '#/definitions/dto.GenerateLoad' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Load host ssh secret @@ -6889,7 +6918,7 @@ paths: $ref: '#/definitions/dto.SettingUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update host ssh setting @@ -6917,7 +6946,7 @@ paths: $ref: '#/definitions/dto.HostOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create host @@ -6978,7 +7007,7 @@ paths: $ref: '#/definitions/dto.CommandOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create command @@ -7006,7 +7035,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete command @@ -7061,7 +7090,7 @@ paths: $ref: '#/definitions/dto.CommandOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update command @@ -7088,7 +7117,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete host @@ -7134,7 +7163,7 @@ paths: $ref: '#/definitions/dto.BatchRuleOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create group @@ -7154,7 +7183,7 @@ paths: $ref: '#/definitions/dto.AddrRuleOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create group @@ -7211,7 +7240,7 @@ paths: $ref: '#/definitions/dto.PortRuleOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create group @@ -7261,7 +7290,7 @@ paths: $ref: '#/definitions/dto.AddrRuleUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create group @@ -7281,7 +7310,7 @@ paths: $ref: '#/definitions/dto.PortRuleUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create group @@ -7344,7 +7373,7 @@ paths: $ref: '#/definitions/dto.HostConnTest' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Test host conn by info @@ -7386,7 +7415,7 @@ paths: $ref: '#/definitions/dto.HostOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update host @@ -7414,7 +7443,7 @@ paths: $ref: '#/definitions/dto.ChangeHostGroup' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update host group @@ -7534,7 +7563,7 @@ paths: $ref: '#/definitions/request.NginxConfigFileUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update OpenResty conf by upload file @@ -7595,7 +7624,7 @@ paths: $ref: '#/definitions/request.NginxConfigUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update OpenResty conf @@ -7614,6 +7643,31 @@ paths: formatEN: Update nginx conf [domain] formatZH: 更新 nginx 配置 [domain] paramKeys: [] + /process/stop: + post: + description: 停止进程 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/request.ProcessReq' + responses: + "200": + description: OK + security: + - ApiKeyAuth: [] + summary: Stop Process + tags: + - Process + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - PID + formatEN: 结束进程 [PID] + formatZH: 结束进程 [PID] + paramKeys: [] /runtimes: post: consumes: @@ -7628,7 +7682,7 @@ paths: $ref: '#/definitions/request.RuntimeCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create runtime @@ -7654,7 +7708,7 @@ paths: type: string responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Get runtime @@ -7674,7 +7728,7 @@ paths: $ref: '#/definitions/request.RuntimeDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete runtime @@ -7701,7 +7755,7 @@ paths: $ref: '#/definitions/request.RuntimeSearch' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: List runtimes @@ -7721,7 +7775,7 @@ paths: $ref: '#/definitions/request.RuntimeUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update runtime @@ -7748,7 +7802,7 @@ paths: $ref: '#/definitions/dto.BackupOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create backup account @@ -7775,7 +7829,7 @@ paths: $ref: '#/definitions/dto.CommonBackup' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Backup system data @@ -7804,7 +7858,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete backup account @@ -7837,7 +7891,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete backup record @@ -7870,7 +7924,7 @@ paths: $ref: '#/definitions/dto.DownloadRecord' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Download backup record @@ -7898,7 +7952,7 @@ paths: $ref: '#/definitions/dto.RecordSearch' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Page backup records @@ -7918,7 +7972,7 @@ paths: $ref: '#/definitions/dto.CommonRecover' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Recover system data @@ -7948,7 +8002,7 @@ paths: $ref: '#/definitions/dto.CommonRecover' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Recover system data by upload @@ -8034,7 +8088,7 @@ paths: $ref: '#/definitions/dto.BackupOperate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update backup account @@ -8074,7 +8128,7 @@ paths: $ref: '#/definitions/dto.PasswordUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Reset system password expired @@ -8086,9 +8140,15 @@ paths: formatEN: reset an expired Password formatZH: 重置过期密码 paramKeys: [] - /settings/mfa: + /settings/mfa/:interval: get: description: 获取 mfa 信息 + parameters: + - description: request + in: path + name: interval + required: true + type: string responses: "200": description: OK @@ -8113,7 +8173,7 @@ paths: $ref: '#/definitions/dto.MfaCredential' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Bind mfa @@ -8130,7 +8190,7 @@ paths: description: 清空监控数据 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Clean monitor datas @@ -8156,7 +8216,7 @@ paths: $ref: '#/definitions/dto.PasswordUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update system password @@ -8182,7 +8242,7 @@ paths: $ref: '#/definitions/dto.PortUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update system port @@ -8213,7 +8273,7 @@ paths: description: 获取系统可用状态 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Load system available status @@ -8233,7 +8293,7 @@ paths: $ref: '#/definitions/dto.SnapshotCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create system snapshot @@ -8261,7 +8321,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete system backup @@ -8294,7 +8354,7 @@ paths: $ref: '#/definitions/dto.UpdateDescription' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update snapshot description @@ -8328,7 +8388,7 @@ paths: $ref: '#/definitions/dto.SnapshotImport' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Import system snapshot @@ -8356,7 +8416,7 @@ paths: $ref: '#/definitions/dto.SnapshotRecover' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Recover system backup @@ -8389,7 +8449,7 @@ paths: $ref: '#/definitions/dto.SnapshotRecover' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Rollback system backup @@ -8457,7 +8517,7 @@ paths: $ref: '#/definitions/dto.SSLUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update system ssl @@ -8475,7 +8535,7 @@ paths: description: 加载系统可用时区 responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Load time zone options @@ -8524,7 +8584,7 @@ paths: $ref: '#/definitions/dto.SettingUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update system setting @@ -8552,7 +8612,7 @@ paths: $ref: '#/definitions/dto.Upgrade' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Load release notes by version @@ -8571,7 +8631,7 @@ paths: $ref: '#/definitions/dto.Upgrade' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Upgrade @@ -8598,7 +8658,7 @@ paths: $ref: '#/definitions/request.WebsiteCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create website @@ -8751,7 +8811,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete website acme account @@ -8806,7 +8866,7 @@ paths: $ref: '#/definitions/request.NginxAuthReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Get AuthBasic conf @@ -8826,7 +8886,7 @@ paths: $ref: '#/definitions/request.NginxAuthUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Get AuthBasic conf @@ -8890,7 +8950,7 @@ paths: $ref: '#/definitions/request.NginxConfigUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update nginx conf @@ -8923,7 +8983,7 @@ paths: $ref: '#/definitions/request.WebsiteDefaultUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Change default server @@ -8957,7 +9017,7 @@ paths: $ref: '#/definitions/request.WebsiteDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete website @@ -8990,7 +9050,7 @@ paths: $ref: '#/definitions/request.WebsiteUpdateDirPermission' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update Site Dir permission @@ -9023,7 +9083,7 @@ paths: $ref: '#/definitions/request.WebsiteUpdateDir' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update Site Dir @@ -9056,7 +9116,7 @@ paths: $ref: '#/definitions/request.WebsiteDnsAccountCreate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Create website dns account @@ -9083,7 +9143,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete website dns account @@ -9138,7 +9198,7 @@ paths: $ref: '#/definitions/request.WebsiteDnsAccountUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update website dns account @@ -9215,7 +9275,7 @@ paths: $ref: '#/definitions/request.WebsiteDomainDelete' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete website domain @@ -9248,7 +9308,7 @@ paths: $ref: '#/definitions/request.NginxCommonReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Get AntiLeech conf @@ -9268,7 +9328,7 @@ paths: $ref: '#/definitions/request.NginxAntiLeechUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update AntiLeech @@ -9337,7 +9397,7 @@ paths: $ref: '#/definitions/request.WebsiteNginxUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update website nginx conf @@ -9370,7 +9430,7 @@ paths: $ref: '#/definitions/request.WebsiteOp' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Operate website @@ -9417,7 +9477,7 @@ paths: $ref: '#/definitions/request.WebsitePHPConfigUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update website php conf @@ -9471,7 +9531,7 @@ paths: $ref: '#/definitions/request.WebsitePHPFileUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update php conf @@ -9504,7 +9564,7 @@ paths: $ref: '#/definitions/request.WebsiteProxyReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Get proxy conf @@ -9524,7 +9584,7 @@ paths: $ref: '#/definitions/request.WebsiteProxyConfig' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update proxy conf @@ -9557,7 +9617,7 @@ paths: $ref: '#/definitions/request.NginxProxyUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update proxy file @@ -9590,7 +9650,7 @@ paths: $ref: '#/definitions/request.NginxRewriteReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Get rewrite conf @@ -9610,7 +9670,7 @@ paths: $ref: '#/definitions/request.NginxRewriteUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update rewrite conf @@ -9693,7 +9753,7 @@ paths: type: integer responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Search website ssl by id @@ -9713,7 +9773,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Delete website ssl @@ -9746,7 +9806,7 @@ paths: $ref: '#/definitions/request.WebsiteSSLRenew' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Reset website ssl @@ -9801,7 +9861,7 @@ paths: $ref: '#/definitions/request.WebsiteSSLSearch' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Page website ssl @@ -9821,7 +9881,7 @@ paths: $ref: '#/definitions/request.WebsiteSSLUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update ssl @@ -9853,7 +9913,7 @@ paths: type: integer responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Search website ssl by website id @@ -9873,7 +9933,7 @@ paths: $ref: '#/definitions/request.WebsiteUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update website @@ -9922,7 +9982,7 @@ paths: $ref: '#/definitions/request.WebsiteWafUpdate' responses: "200": - description: "" + description: OK security: - ApiKeyAuth: [] summary: Update website waf conf diff --git a/frontend/src/api/interface/process.ts b/frontend/src/api/interface/process.ts new file mode 100644 index 000000000..95e010fb7 --- /dev/null +++ b/frontend/src/api/interface/process.ts @@ -0,0 +1,5 @@ +export namespace Process { + export interface StopReq { + PID: number; + } +} diff --git a/frontend/src/api/modules/process.ts b/frontend/src/api/modules/process.ts new file mode 100644 index 000000000..fa0217245 --- /dev/null +++ b/frontend/src/api/modules/process.ts @@ -0,0 +1,6 @@ +import http from '@/api'; +import { Process } from '../interface/process'; + +export const StopProcess = (req: Process.StopReq) => { + return http.post(`/process/stop`, req); +}; diff --git a/frontend/src/components/complex-table/index.vue b/frontend/src/components/complex-table/index.vue index aaa70eb18..0de0b4b10 100644 --- a/frontend/src/components/complex-table/index.vue +++ b/frontend/src/components/complex-table/index.vue @@ -75,11 +75,16 @@ function handleSelectionChange(row: any) { emit('update:selects', row); } +function sort(prop: string, order: string) { + tableRef.value.refElTable.sort(prop, order); +} + function clearSelects() { tableRef.value.refElTable.clearSelection(); } defineExpose({ clearSelects, + sort, }); diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index aeee34ace..691cf41ee 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -241,6 +241,8 @@ const message = { logs: 'Log', ssl: 'Certificate', runtime: 'Runtime', + processManage: 'Process', + process: 'Process', }, home: { overview: 'Overview', @@ -1619,6 +1621,40 @@ const message = { rebuildHelper: 'After editing the extension, you need to go to the [App Store-Installed] page to rebuild the PHP application to take effect', }, + process: { + pid: 'Process ID', + ppid: 'Parent process ID', + numThreads: 'Threads', + username: 'User', + memory: 'Memory', + diskRead: 'Disk read', + diskWrite: 'Disk write', + netSent: 'uplink', + netRecv: 'downstream', + numConnections: 'Connections', + startTime: 'Start time', + status: 'Status', + running: 'Running', + sleep: 'sleep', + stop: 'stop', + idle: 'idle', + zombie: 'zombie process', + wait: 'waiting', + lock: 'lock', + blocked: 'blocked', + cmdLine: 'Start command', + basic: 'Basic information', + mem: 'Memory information', + openFiles: 'File Open', + file: 'File', + env: 'Environment variable', + noenv: 'None', + net: 'Network connection', + laddr: 'Source address/port', + raddr: 'Destination address/port', + stopProcess: 'End', + stopProcessWarn: 'Are you sure you want to end this process (PID:{0})? This operation cannot be rolled back', + }, }; export default { diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 5aeeb0fc3..4c5a82b5d 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -244,6 +244,8 @@ const message = { toolbox: '工具箱', logs: '日志审计', runtime: '运行环境', + processManage: '进程管理', + process: '进程', }, home: { overview: '概览', @@ -1559,6 +1561,40 @@ const message = { extendHelper: '列表中不存在的扩展,可以手动输入之后选择,例:输入 sockets ,然后在下拉列表中选择第一个', rebuildHelper: '编辑扩展后需要去【应用商店-已安装】页面【重建】PHP 应用之后才能生效', }, + process: { + pid: '进程ID', + ppid: '父进程ID', + numThreads: '线程', + username: '用户', + memory: '内存', + diskRead: '磁盘读', + diskWrite: '磁盘写', + netSent: '上行', + netRecv: '下行', + numConnections: '连接', + startTime: '启动时间', + status: '状态', + running: '运行中', + sleep: '睡眠', + stop: '停止', + idle: '空闲', + zombie: '僵尸进程', + wait: '等待', + lock: '锁定', + blocked: '阻塞', + cmdLine: '启动命令', + basic: '基本信息', + mem: '内存信息', + openFiles: '文件打开', + file: '文件', + env: '环境变量', + noenv: '无', + net: '网络连接', + laddr: '源地址/端口', + raddr: '目标地址/端口', + stopProcess: '结束', + stopProcessWarn: '是否确定结束此进程 (PID:{0})?此操作不可回滚', + }, }; export default { ...fit2cloudZhLocale, diff --git a/frontend/src/routers/modules/host.ts b/frontend/src/routers/modules/host.ts index e65264e68..322a712f1 100644 --- a/frontend/src/routers/modules/host.ts +++ b/frontend/src/routers/modules/host.ts @@ -69,6 +69,17 @@ const hostRouter = { requiresAuth: false, }, }, + { + path: '/hosts/process/process', + name: 'Process', + component: () => import('@/views/host/process/process/index.vue'), + meta: { + title: 'menu.processManage', + activeMenu: '/hosts/process/process', + keepAlive: true, + requiresAuth: false, + }, + }, { path: '/hosts/ssh/ssh', name: 'SSH', diff --git a/frontend/src/views/host/process/index.vue b/frontend/src/views/host/process/index.vue new file mode 100644 index 000000000..1a9eb16c8 --- /dev/null +++ b/frontend/src/views/host/process/index.vue @@ -0,0 +1,20 @@ + + + diff --git a/frontend/src/views/host/process/process/detail/index.vue b/frontend/src/views/host/process/process/detail/index.vue new file mode 100644 index 000000000..0945a7781 --- /dev/null +++ b/frontend/src/views/host/process/process/detail/index.vue @@ -0,0 +1,129 @@ + + + diff --git a/frontend/src/views/host/process/process/index.vue b/frontend/src/views/host/process/process/index.vue new file mode 100644 index 000000000..e78390914 --- /dev/null +++ b/frontend/src/views/host/process/process/index.vue @@ -0,0 +1,284 @@ + + +