diff --git a/agent/app/api/v2/file_history.go b/agent/app/api/v2/file_history.go index 5f6f3105264f..21c9f08966d3 100644 --- a/agent/app/api/v2/file_history.go +++ b/agent/app/api/v2/file_history.go @@ -11,7 +11,7 @@ import ( // @Summary Load file history list // @Accept json // @Param request body request.FileHistorySearchReq true "request" -// @Success 200 {object} response.PageResult +// @Success 200 {object} dto.PageResult // @Security ApiKeyAuth // @Security Timestamp // @Router /files/history/search [post] diff --git a/agent/app/api/v2/gpu.go b/agent/app/api/v2/gpu.go index a862c61f8556..5720001e0863 100644 --- a/agent/app/api/v2/gpu.go +++ b/agent/app/api/v2/gpu.go @@ -50,7 +50,7 @@ func (b *BaseApi) GetCPUOptions(c *gin.Context) { // @Success 200 {object} dto.MonitorGPUData // @Security ApiKeyAuth // @Security Timestamp -// @Router /hosts/monitor/gpu/search [post] +// @Router /ai/gpu/search [post] func (b *BaseApi) LoadGPUMonitor(c *gin.Context) { var req dto.MonitorGPUSearch if err := helper.CheckBindAndValidate(&req, c); err != nil { diff --git a/agent/app/api/v2/host_tool.go b/agent/app/api/v2/host_tool.go index 24f977ef23e0..6dc20d852151 100644 --- a/agent/app/api/v2/host_tool.go +++ b/agent/app/api/v2/host_tool.go @@ -9,13 +9,13 @@ import ( // @Tags Host tool // @Summary Get tool status // @Accept json -// @Param request body request.HostToolReq true "request" +// @Param request body request.HostToolTypeReq true "request" // @Success 200 {object} response.HostToolRes // @Security ApiKeyAuth // @Security Timestamp -// @Router /hosts/tool [post] +// @Router /hosts/tool/status [post] func (b *BaseApi) GetToolStatus(c *gin.Context) { - var req request.HostToolReq + var req request.HostToolTypeReq if err := helper.CheckBindAndValidate(&req, c); err != nil { return } @@ -53,14 +53,14 @@ func (b *BaseApi) InitToolConfig(c *gin.Context) { // @Tags Host tool // @Summary Operate tool // @Accept json -// @Param request body request.HostToolReq true "request" +// @Param request body request.HostToolOperateReq true "request" // @Success 200 // @Security ApiKeyAuth // @Security Timestamp // @Router /hosts/tool/operate [post] // @x-panel-log {"bodyKeys":["operate","type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] [type] ","formatEN":"[operate] [type]"} func (b *BaseApi) OperateTool(c *gin.Context) { - var req request.HostToolReq + var req request.HostToolOperateReq if err := helper.CheckBindAndValidate(&req, c); err != nil { return } @@ -75,19 +75,18 @@ func (b *BaseApi) OperateTool(c *gin.Context) { // @Tags Host tool // @Summary Get tool config // @Accept json -// @Param request body request.HostToolConfig true "request" +// @Param request body request.HostToolTypeReq true "request" // @Success 200 {object} response.HostToolConfig // @Security ApiKeyAuth // @Security Timestamp -// @Router /hosts/tool/config [post] -// @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] 主机工具配置文件 ","formatEN":"[operate] tool config"} -func (b *BaseApi) OperateToolConfig(c *gin.Context) { - var req request.HostToolConfig +// @Router /hosts/tool/config/get [post] +func (b *BaseApi) GetToolConfig(c *gin.Context) { + var req request.HostToolTypeReq if err := helper.CheckBindAndValidate(&req, c); err != nil { return } - config, err := hostToolService.OperateToolConfig(req) + config, err := hostToolService.GetToolConfig(req) if err != nil { helper.InternalServer(c, err) return @@ -95,6 +94,28 @@ func (b *BaseApi) OperateToolConfig(c *gin.Context) { helper.SuccessWithData(c, config) } +// @Tags Host tool +// @Summary Update tool config +// @Accept json +// @Param request body request.HostToolConfigUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Security Timestamp +// @Router /hosts/tool/config/set [post] +// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 [type] 主机工具配置文件 ","formatEN":"update [type] tool config"} +func (b *BaseApi) UpdateToolConfig(c *gin.Context) { + var req request.HostToolConfigUpdate + if err := helper.CheckBindAndValidate(&req, c); err != nil { + return + } + + if err := hostToolService.UpdateToolConfig(req); err != nil { + helper.InternalServer(c, err) + return + } + helper.Success(c) +} + // @Tags Host tool // @Summary Create Supervisor process // @Accept json @@ -137,18 +158,44 @@ func (b *BaseApi) GetProcess(c *gin.Context) { // @Tags Host tool // @Summary Get Supervisor process config file // @Accept json -// @Param request body request.SupervisorProcessFileReq true "request" +// @Param request body request.HostSupervisorProcessFileGetReq true "request" +// @Success 200 {string} content +// @Security ApiKeyAuth +// @Security Timestamp +// @Router /hosts/tool/supervisor/process/file/get [post] +func (b *BaseApi) GetProcessFile(c *gin.Context) { + var req request.HostSupervisorProcessFileGetReq + if err := helper.CheckBindAndValidate(&req, c); err != nil { + return + } + content, err := hostToolService.GetSupervisorProcessFile(req) + if err != nil { + helper.InternalServer(c, err) + return + } + helper.SuccessWithData(c, content) +} + +// @Tags Host tool +// @Summary Operate Supervisor process config file +// @Accept json +// @Param request body request.HostSupervisorProcessFileOperateReq true "request" // @Success 200 {string} content // @Security ApiKeyAuth // @Security Timestamp // @Router /hosts/tool/supervisor/process/file [post] // @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] Supervisor 进程文件 ","formatEN":"[operate] Supervisor Process Config file"} -func (b *BaseApi) GetProcessFile(c *gin.Context) { - var req request.SupervisorProcessFileReq +func (b *BaseApi) OperateProcessFile(c *gin.Context) { + var req request.HostSupervisorProcessFileOperateReq if err := helper.CheckBindAndValidate(&req, c); err != nil { return } - content, err := hostToolService.OperateSupervisorProcessFile(req) + content, err := hostToolService.OperateSupervisorProcessFile(request.SupervisorProcessFileReq{ + Name: req.Name, + Operate: req.Operate, + Content: req.Content, + File: req.File, + }) if err != nil { helper.InternalServer(c, err) return diff --git a/agent/app/api/v2/setting.go b/agent/app/api/v2/setting.go index 6a1731830ad8..bfda59429772 100644 --- a/agent/app/api/v2/setting.go +++ b/agent/app/api/v2/setting.go @@ -1,16 +1,12 @@ package v2 import ( - "encoding/json" - "github.com/1Panel-dev/1Panel/agent/app/api/v2/helper" "github.com/1Panel-dev/1Panel/agent/app/dto" "github.com/1Panel-dev/1Panel/agent/app/dto/request" - "github.com/1Panel-dev/1Panel/agent/app/model" "github.com/1Panel-dev/1Panel/agent/global" "github.com/1Panel-dev/1Panel/agent/utils/ssh" "github.com/gin-gonic/gin" - "github.com/pkg/errors" ) // @Tags System Setting @@ -50,14 +46,14 @@ func (b *BaseApi) GetSystemAvailable(c *gin.Context) { // @Tags System Setting // @Summary Update system setting // @Accept json -// @Param request body dto.SettingUpdate true "request" +// @Param request body dto.AgentSettingUpdate true "request" // @Success 200 // @Security ApiKeyAuth // @Security Timestamp // @Router /settings/update [post] // @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统配置 [key] => [value]","formatEN":"update system setting [key] => [value]"} func (b *BaseApi) UpdateSetting(c *gin.Context) { - var req dto.SettingUpdate + var req dto.AgentSettingUpdate if err := helper.CheckBindAndValidate(&req, c); err != nil { return } @@ -223,12 +219,8 @@ func (b *BaseApi) SaveLocalConn(c *gin.Context) { } func loadLocalConn() (*ssh.SSHClient, error) { - connInfoInDB := settingService.GetSettingByKey("LocalSSHConn") - if len(connInfoInDB) == 0 { - return nil, errors.New("no such ssh conn info in db!") - } - var connInDB model.LocalConnInfo - if err := json.Unmarshal([]byte(connInfoInDB), &connInDB); err != nil { + connInDB, err := settingService.GetLocalConnForSSH() + if err != nil { return nil, err } sshInfo := ssh.ConnInfo{ @@ -243,23 +235,6 @@ func loadLocalConn() (*ssh.SSHClient, error) { return ssh.NewClient(sshInfo) } -// @Tags System Setting -// @Summary Load system setting by key -// @Param key path string true "key" -// @Success 200 {object} dto.SettingInfo -// @Security ApiKeyAuth -// @Security Timestamp -// @Router /settings/get/{key} [get] -func (b *BaseApi) GetSettingByKey(c *gin.Context) { - key := c.Param("key") - if len(key) == 0 { - helper.BadRequest(c, errors.New("key is empty")) - return - } - value := settingService.GetSettingByKey(key) - helper.SuccessWithData(c, value) -} - // @Tags System Setting // @Summary Save common description // @Accept json diff --git a/agent/app/dto/request/host_tool.go b/agent/app/dto/request/host_tool.go index a784a1af415d..1ec590e15b4f 100644 --- a/agent/app/dto/request/host_tool.go +++ b/agent/app/dto/request/host_tool.go @@ -1,8 +1,12 @@ package request -type HostToolReq struct { +type HostToolTypeReq struct { + Type string `json:"type" validate:"required,oneof=supervisord"` +} + +type HostToolOperateReq struct { Type string `json:"type" validate:"required,oneof=supervisord"` - Operate string `json:"operate" validate:"oneof=status restart start stop"` + Operate string `json:"operate" validate:"required,oneof=restart start stop"` } type HostToolCreate struct { @@ -15,13 +19,8 @@ type SupervisorConfig struct { ServiceName string `json:"serviceName"` } -type HostToolLogReq struct { - Type string `json:"type" validate:"required,oneof=supervisord"` -} - -type HostToolConfig struct { +type HostToolConfigUpdate struct { Type string `json:"type" validate:"required,oneof=supervisord"` - Operate string `json:"operate" validate:"oneof=get set"` Content string `json:"content"` } @@ -43,3 +42,15 @@ type SupervisorProcessFileReq struct { Content string `json:"content"` File string `json:"file" validate:"required,oneof=out.log err.log config"` } + +type HostSupervisorProcessFileGetReq struct { + Name string `json:"name" validate:"required"` + File string `json:"file" validate:"required,oneof=out.log err.log config"` +} + +type HostSupervisorProcessFileOperateReq struct { + Name string `json:"name" validate:"required"` + Operate string `json:"operate" validate:"required,oneof=clear update"` + Content string `json:"content"` + File string `json:"file" validate:"required,oneof=out.log err.log config"` +} diff --git a/agent/app/dto/setting.go b/agent/app/dto/setting.go index 378924768d3d..659e391549d2 100644 --- a/agent/app/dto/setting.go +++ b/agent/app/dto/setting.go @@ -23,7 +23,8 @@ type SettingInfo struct { AppStoreLastModified string `json:"appStoreLastModified"` AppStoreSyncStatus string `json:"appStoreSyncStatus"` - FileRecycleBin string `json:"fileRecycleBin"` + FileRecycleBin string `json:"fileRecycleBin"` + LocalSSHConnShow string `json:"localSSHConnShow"` } type SettingUpdate struct { @@ -31,6 +32,11 @@ type SettingUpdate struct { Value string `json:"value"` } +type AgentSettingUpdate struct { + Key string `json:"key" validate:"required,oneof=SystemIP DockerSockPath FileRecycleBin"` + Value string `json:"value"` +} + type SyncTime struct { NtpSite string `json:"ntpSite" validate:"required"` } diff --git a/agent/app/service/host_tool.go b/agent/app/service/host_tool.go index 20b5943f4731..82d703131fea 100644 --- a/agent/app/service/host_tool.go +++ b/agent/app/service/host_tool.go @@ -27,12 +27,14 @@ import ( type HostToolService struct{} type IHostToolService interface { - GetToolStatus(req request.HostToolReq) (*response.HostToolRes, error) + GetToolStatus(req request.HostToolTypeReq) (*response.HostToolRes, error) CreateToolConfig(req request.HostToolCreate) error - OperateTool(req request.HostToolReq) error - OperateToolConfig(req request.HostToolConfig) (*response.HostToolConfig, error) + OperateTool(req request.HostToolOperateReq) error + GetToolConfig(req request.HostToolTypeReq) (*response.HostToolConfig, error) + UpdateToolConfig(req request.HostToolConfigUpdate) error OperateSupervisorProcess(req request.SupervisorProcessConfig) error GetSupervisorProcessConfig() ([]response.SupervisorProcessConfig, error) + GetSupervisorProcessFile(req request.HostSupervisorProcessFileGetReq) (string, error) OperateSupervisorProcessFile(req request.SupervisorProcessFileReq) (string, error) } @@ -40,7 +42,7 @@ func NewIHostToolService() IHostToolService { return &HostToolService{} } -func (h *HostToolService) GetToolStatus(req request.HostToolReq) (*response.HostToolRes, error) { +func (h *HostToolService) GetToolStatus(req request.HostToolTypeReq) (*response.HostToolRes, error) { res := &response.HostToolRes{} res.Type = req.Type switch req.Type { @@ -201,7 +203,7 @@ func (h *HostToolService) CreateToolConfig(req request.HostToolCreate) error { return nil } -func (h *HostToolService) OperateTool(req request.HostToolReq) error { +func (h *HostToolService) OperateTool(req request.HostToolOperateReq) error { serviceName := req.Type if req.Type == constant.Supervisord { serviceNameSet, _ := settingRepo.Get(settingRepo.WithByKey(constant.SupervisorServiceName)) @@ -212,12 +214,10 @@ func (h *HostToolService) OperateTool(req request.HostToolReq) error { return controller.Handle(req.Operate, serviceName) } -func (h *HostToolService) OperateToolConfig(req request.HostToolConfig) (*response.HostToolConfig, error) { - fileOp := files.NewFileOp() - res := &response.HostToolConfig{} +func (h *HostToolService) loadToolConfigInfo(toolType string) (string, string) { configPath := "" serviceName := "supervisord" - switch req.Type { + switch toolType { case constant.Supervisord: pathSet, _ := settingRepo.Get(settingRepo.WithByKey(constant.SupervisorConfigPath)) if pathSet.ID != 0 || pathSet.Value != "" { @@ -227,39 +227,50 @@ func (h *HostToolService) OperateToolConfig(req request.HostToolConfig) (*respon if serviceNameSet.ID != 0 || serviceNameSet.Value != "" { serviceName = serviceNameSet.Value } + default: + return "", "" } - switch req.Operate { - case "get": - content, err := fileOp.GetContent(configPath) - if err != nil { - return nil, err - } - res.Content = string(content) - case "set": - file, err := fileOp.OpenFile(configPath) - if err != nil { - return nil, err - } - oldContent, err := fileOp.GetContent(configPath) - if err != nil { - return nil, err - } - fileInfo, err := file.Stat() - if err != nil { - return nil, err - } - if err = fileOp.WriteFile(configPath, strings.NewReader(req.Content), fileInfo.Mode()); err != nil { - return nil, err - } - if err = controller.HandleRestart(serviceName); err != nil { - _ = fileOp.WriteFile(configPath, bytes.NewReader(oldContent), fileInfo.Mode()) - return nil, err - } - } + return configPath, serviceName +} +func (h *HostToolService) GetToolConfig(req request.HostToolTypeReq) (*response.HostToolConfig, error) { + fileOp := files.NewFileOp() + res := &response.HostToolConfig{} + configPath, _ := h.loadToolConfigInfo(req.Type) + content, err := fileOp.GetContent(configPath) + if err != nil { + return nil, err + } + res.Content = string(content) return res, nil } +func (h *HostToolService) UpdateToolConfig(req request.HostToolConfigUpdate) error { + fileOp := files.NewFileOp() + configPath, serviceName := h.loadToolConfigInfo(req.Type) + file, err := fileOp.OpenFile(configPath) + if err != nil { + return err + } + oldContent, err := fileOp.GetContent(configPath) + if err != nil { + return err + } + fileInfo, err := file.Stat() + if err != nil { + return err + } + if err = fileOp.WriteFile(configPath, strings.NewReader(req.Content), fileInfo.Mode()); err != nil { + return err + } + if err = controller.HandleRestart(serviceName); err != nil { + _ = fileOp.WriteFile(configPath, bytes.NewReader(oldContent), fileInfo.Mode()) + return err + } + + return nil +} + func (h *HostToolService) OperateSupervisorProcess(req request.SupervisorProcessConfig) error { var ( supervisordDir = path.Join(global.Dir.DataDir, "tools", "supervisord") @@ -451,7 +462,19 @@ func (h *HostToolService) OperateSupervisorProcessFile(req request.SupervisorPro return handleSupervisorFile(req, includeDir, "", "") } +func (h *HostToolService) GetSupervisorProcessFile(req request.HostSupervisorProcessFileGetReq) (string, error) { + return h.OperateSupervisorProcessFile(request.SupervisorProcessFileReq{ + Name: req.Name, + Operate: "get", + File: req.File, + }) +} + func handleSupervisorFile(req request.SupervisorProcessFileReq, includeDir, containerName, logFile string) (string, error) { + safeName := path.Base(req.Name) + if safeName != req.Name || strings.Contains(safeName, "..") { + return "", buserr.New("ErrInvalidParams") + } var ( fileOp = files.NewFileOp() group = fmt.Sprintf("program:%s", req.Name) diff --git a/agent/app/service/setting.go b/agent/app/service/setting.go index d70b5be27f1b..0b8f6b893c95 100644 --- a/agent/app/service/setting.go +++ b/agent/app/service/setting.go @@ -3,6 +3,7 @@ package service import ( "encoding/base64" "encoding/json" + "errors" "strconv" "strings" "time" @@ -37,7 +38,7 @@ type ISettingService interface { SetDefaultIsConn(req dto.SSHDefaultConn) error GetSystemProxy() (*dto.SystemProxy, error) GetLocalConn() dto.SSHConnData - GetSettingByKey(key string) string + GetLocalConnForSSH() (dto.SSHConnData, error) SaveDescription(req dto.CommonDescription) error } @@ -267,7 +268,7 @@ func (u *SettingService) GetSystemProxy() (*dto.SystemProxy, error) { return &systemProxy, nil } -func (u *SettingService) GetLocalConn() dto.SSHConnData { +func (u *SettingService) loadLocalConn() dto.SSHConnData { var data dto.SSHConnData data.LocalSSHConnShow, _ = settingRepo.GetValueByKey("LocalSSHConnShow") connItem, _ := settingRepo.GetValueByKey("LocalSSHConn") @@ -275,10 +276,14 @@ func (u *SettingService) GetLocalConn() dto.SSHConnData { return data } connInfoInDB, _ := encrypt.StringDecrypt(connItem) - data.LocalSSHConnShow, _ = settingRepo.GetValueByKey("LocalSSHConnShow") if err := json.Unmarshal([]byte(connInfoInDB), &data); err != nil { return data } + return data +} + +func (u *SettingService) GetLocalConn() dto.SSHConnData { + data := u.loadLocalConn() if len(data.Password) != 0 { data.Password = base64.StdEncoding.EncodeToString([]byte(data.Password)) } @@ -291,19 +296,12 @@ func (u *SettingService) GetLocalConn() dto.SSHConnData { return data } -func (u *SettingService) GetSettingByKey(key string) string { - switch key { - case "LocalSSHConn": - value, _ := settingRepo.GetValueByKey(key) - if len(value) == 0 { - return "" - } - itemStr, _ := encrypt.StringDecrypt(value) - return itemStr - default: - value, _ := settingRepo.GetValueByKey(key) - return value +func (u *SettingService) GetLocalConnForSSH() (dto.SSHConnData, error) { + data := u.loadLocalConn() + if len(data.Addr) == 0 { + return data, errors.New("no such ssh conn info in db") } + return data, nil } func (u *SettingService) SaveDescription(req dto.CommonDescription) error { diff --git a/agent/cmd/server/docs/x-log.json b/agent/cmd/server/docs/x-log.json index f13e74089fbc..a8099fc87b5f 100644 --- a/agent/cmd/server/docs/x-log.json +++ b/agent/cmd/server/docs/x-log.json @@ -690,6 +690,43 @@ "formatZH": "删除容器存储卷 [names]", "formatEN": "delete container volume [names]" }, + "/core/auth/api/generate": { + "bodyKeys": [], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "生成 API 接口密钥", + "formatEN": "generate api key" + }, + "/core/auth/api/update": { + "bodyKeys": [ + "ipWhiteList" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "更新 API 接口配置 =\u003e IP 白名单: [ipWhiteList]", + "formatEN": "update api config =\u003e IP White List: [ipWhiteList]" + }, + "/core/auth/expired/reset": { + "bodyKeys": [], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "重置过期密码", + "formatEN": "reset an expired Password" + }, + "/core/auth/mfa/bind": { + "bodyKeys": [], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "mfa 绑定", + "formatEN": "bind mfa" + }, + "/core/auth/mfa/close": { + "bodyKeys": [], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "mfa 关闭", + "formatEN": "close mfa" + }, "/core/backups": { "bodyKeys": [ "type" @@ -814,63 +851,6 @@ "formatZH": "更新组 [name][type]", "formatEN": "update group [name][type]" }, - "/core/hosts": { - "bodyKeys": [ - "name", - "addr" - ], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "创建主机 [name][addr]", - "formatEN": "create host [name][addr]" - }, - "/core/hosts/del": { - "bodyKeys": [ - "ids" - ], - "paramKeys": [], - "beforeFunctions": [ - { - "input_column": "id", - "input_value": "ids", - "isList": true, - "db": "hosts", - "output_column": "addr", - "output_value": "addrs" - } - ], - "formatZH": "删除主机 [addrs]", - "formatEN": "delete host [addrs]" - }, - "/core/hosts/update": { - "bodyKeys": [ - "name", - "addr" - ], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "更新主机信息 [name][addr]", - "formatEN": "update host [name][addr]" - }, - "/core/hosts/update/group": { - "bodyKeys": [ - "id", - "group" - ], - "paramKeys": [], - "beforeFunctions": [ - { - "input_column": "id", - "input_value": "id", - "isList": false, - "db": "hosts", - "output_column": "addr", - "output_value": "addr" - } - ], - "formatZH": "切换主机[addr]分组 =\u003e [group]", - "formatEN": "change host [addr] group =\u003e [group]" - }, "/core/licenses/add": { "bodyKeys": [], "paramKeys": [], @@ -981,22 +961,6 @@ "formatZH": "更新脚本库脚本 [name]", "formatEN": "update script [name]" }, - "/core/settings/api/config/generate/key": { - "bodyKeys": [], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "生成 API 接口密钥", - "formatEN": "generate api key" - }, - "/core/settings/api/config/update": { - "bodyKeys": [ - "ipWhiteList" - ], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "更新 API 接口配置 =\u003e IP 白名单: [ipWhiteList]", - "formatEN": "update api config =\u003e IP White List: [ipWhiteList]" - }, "/core/settings/bind/update": { "bodyKeys": [ "ipv6", @@ -1007,13 +971,6 @@ "formatZH": "修改系统监听信息 =\u003e ipv6: [ipv6], 监听 IP: [bindAddress]", "formatEN": "update system bind info =\u003e ipv6: [ipv6], 监听 IP: [bindAddress]" }, - "/core/settings/expired/handle": { - "bodyKeys": [], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "重置过期密码", - "formatEN": "reset an expired Password" - }, "/core/settings/memo": { "bodyKeys": [], "paramKeys": [], @@ -1035,20 +992,6 @@ "formatZH": "隐藏高级功能菜单", "formatEN": "Hide advanced feature menu." }, - "/core/settings/mfa/bind": { - "bodyKeys": [], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "mfa 绑定", - "formatEN": "bind mfa" - }, - "/core/settings/password/update": { - "bodyKeys": [], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "修改系统密码", - "formatEN": "update system password" - }, "/core/settings/port/update": { "bodyKeys": [ "serverPort" @@ -1582,6 +1525,92 @@ "formatZH": "mysql 数据库 [name] 描述信息修改 [description]", "formatEN": "The description of the mysql database [name] is modified =\u003e [description]" }, + "/databases/mongodb": { + "bodyKeys": [ + "name" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "创建 mongodb 数据库 [name]", + "formatEN": "create mongodb database [name]" + }, + "/databases/mongodb/bind": { + "bodyKeys": [ + "database", + "name", + "username" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "绑定 mongodb 数据库 [database] [name] 用户 [username]", + "formatEN": "bind mongodb database [database] [name] user [username]" + }, + "/databases/mongodb/del": { + "bodyKeys": [ + "id" + ], + "paramKeys": [], + "beforeFunctions": [ + { + "input_column": "id", + "input_value": "id", + "isList": false, + "db": "database_mongodbs", + "output_column": "name", + "output_value": "name" + } + ], + "formatZH": "删除 mongodb 数据库 [name]", + "formatEN": "delete mongodb database [name]" + }, + "/databases/mongodb/description": { + "bodyKeys": [ + "id", + "description" + ], + "paramKeys": [], + "beforeFunctions": [ + { + "input_column": "id", + "input_value": "id", + "isList": false, + "db": "database_mongodbs", + "output_column": "name", + "output_value": "name" + } + ], + "formatZH": "mongodb 数据库 [name] 描述信息修改 [description]", + "formatEN": "The description of the mongodb database [name] is modified =\u003e [description]" + }, + "/databases/mongodb/password": { + "bodyKeys": [ + "database", + "name" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "更新 mongodb 数据库 [database] [name] 密码", + "formatEN": "update mongodb database [database] [name] password" + }, + "/databases/mongodb/privileges/change": { + "bodyKeys": [ + "database", + "username" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "更新 mongodb 数据库 [database] 用户 [username] 权限", + "formatEN": "update mongodb database [database] user [username] privileges" + }, + "/databases/mongodb/root/password": { + "bodyKeys": [ + "database" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "更新 mongodb 数据库 [database] root 密码", + "formatEN": "update mongodb database [database] root password" + }, "/databases/pg": { "bodyKeys": [ "name" @@ -1880,6 +1909,25 @@ "formatZH": "更新文件内容 [path]", "formatEN": "Update file content [path]" }, + "/files/share/create": { + "bodyKeys": [ + "path", + "expireMinutes" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "创建文件分享 [path]", + "formatEN": "Create file share [path]" + }, + "/files/share/del": { + "bodyKeys": [ + "path" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "关闭文件分享 [path]", + "formatEN": "Close file share [path]" + }, "/files/size": { "bodyKeys": [ "path" @@ -1910,6 +1958,15 @@ "formatZH": "下载 url =\u003e [path]/[name]", "formatEN": "Download url =\u003e [path]/[name]" }, + "/files/wget/stop": { + "bodyKeys": [ + "key" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "停止下载任务 [key]", + "formatEN": "Stop wget task [key]" + }, "/groups": { "bodyKeys": [ "name", @@ -2115,14 +2172,14 @@ "formatZH": "修改 SSH 配置 [key] =\u003e [newValue]", "formatEN": "update SSH setting [key] =\u003e [newValue]" }, - "/hosts/tool/config": { + "/hosts/tool/config/set": { "bodyKeys": [ - "operate" + "type" ], "paramKeys": [], "beforeFunctions": [], - "formatZH": "[operate] 主机工具配置文件 ", - "formatEN": "[operate] tool config" + "formatZH": "更新 [type] 主机工具配置文件 ", + "formatEN": "update [type] tool config" }, "/hosts/tool/init": { "bodyKeys": [ diff --git a/agent/router/ro_host.go b/agent/router/ro_host.go index 06bb0a210af0..e517eee8fae3 100644 --- a/agent/router/ro_host.go +++ b/agent/router/ro_host.go @@ -59,13 +59,15 @@ func (s *HostRouter) InitRouter(Router *gin.RouterGroup) { hostRouter.POST("/ssh/cert/search", baseApi.SearchRootCert) hostRouter.POST("/ssh/cert/delete", baseApi.DeleteRootCert) - hostRouter.POST("/tool", baseApi.GetToolStatus) + hostRouter.POST("/tool/status", baseApi.GetToolStatus) hostRouter.POST("/tool/init", baseApi.InitToolConfig) hostRouter.POST("/tool/operate", baseApi.OperateTool) - hostRouter.POST("/tool/config", baseApi.OperateToolConfig) + hostRouter.POST("/tool/config/get", baseApi.GetToolConfig) + hostRouter.POST("/tool/config/set", baseApi.UpdateToolConfig) hostRouter.POST("/tool/supervisor/process", baseApi.OperateProcess) hostRouter.GET("/tool/supervisor/process", baseApi.GetProcess) - hostRouter.POST("/tool/supervisor/process/file", baseApi.GetProcessFile) + hostRouter.POST("/tool/supervisor/process/file/get", baseApi.GetProcessFile) + hostRouter.POST("/tool/supervisor/process/file", baseApi.OperateProcessFile) hostRouter.GET("/terminal/local", baseApi.WsLocalTerminal) hostRouter.GET("/terminal/ssh", baseApi.WsHostSSH) diff --git a/agent/router/ro_setting.go b/agent/router/ro_setting.go index 03c39bdf12e1..7aa32df1e56d 100644 --- a/agent/router/ro_setting.go +++ b/agent/router/ro_setting.go @@ -20,7 +20,6 @@ func (s *SettingRouter) InitRouter(Router *gin.RouterGroup) { settingRouter.POST("/terminal/ai/update", baseApi.UpdateTerminalAISetting) settingRouter.POST("/files/ai/update", baseApi.UpdateFileManageAISetting) settingRouter.POST("/file-history/update", baseApi.UpdateFileHistorySetting) - settingRouter.GET("/get/:key", baseApi.GetSettingByKey) settingRouter.POST("/description/save", baseApi.SaveDescription) diff --git a/core/cmd/server/docs/docs.go b/core/cmd/server/docs/docs.go index c69f3d9eaf2e..8e81eb1e9745 100644 --- a/core/cmd/server/docs/docs.go +++ b/core/cmd/server/docs/docs.go @@ -681,6 +681,41 @@ const docTemplate = `{ ] } }, + "/ai/agents/channel/delete": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentChannelDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete Agent channel config", + "tags": [ + "AI" + ] + } + }, "/ai/agents/channel/dingtalk/get": { "post": { "consumes": [ @@ -1154,6 +1189,44 @@ const docTemplate = `{ ] } }, + "/ai/agents/channel/weixin/get": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentIDReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.AgentWeixinConfig" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get Agent Weixin channel config", + "tags": [ + "AI" + ] + } + }, "/ai/agents/channel/weixin/login": { "post": { "consumes": [ @@ -1297,6 +1370,158 @@ const docTemplate = `{ ] } }, + "/ai/agents/delete/check": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentIDReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/dto.AppResource" + }, + "type": "array" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete check Agent", + "tags": [ + "AI" + ] + } + }, + "/ai/agents/hermes/chat/sessions": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentIDReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/dto.AgentHermesChatSessionItem" + }, + "type": "array" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get Hermes chat sessions", + "tags": [ + "AI" + ] + } + }, + "/ai/agents/hermes/chat/sessions/delete": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentHermesChatSessionDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete Hermes chat session", + "tags": [ + "AI" + ] + } + }, + "/ai/agents/hermes/chat/sessions/rename": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentHermesChatSessionRenameReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Rename Hermes chat session", + "tags": [ + "AI" + ] + } + }, "/ai/agents/model/get": { "post": { "consumes": [ @@ -1914,6 +2139,41 @@ const docTemplate = `{ ] } }, + "/ai/agents/skills/uninstall": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentSkillUninstallReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Uninstall Agent skill", + "tags": [ + "AI" + ] + } + }, "/ai/agents/skills/update": { "post": { "consumes": [ @@ -2019,6 +2279,41 @@ const docTemplate = `{ ] } }, + "/ai/agents/website/unbind": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentIDReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Unbind Agent website", + "tags": [ + "AI" + ] + } + }, "/ai/domain/bind": { "post": { "consumes": [ @@ -2116,6 +2411,41 @@ const docTemplate = `{ ] } }, + "/ai/gpu/search": { + "post": { + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MonitorGPUSearch" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.MonitorGPUData" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load monitor data", + "tags": [ + "Monitor" + ] + } + }, "/ai/mcp/domain/bind": { "post": { "consumes": [ @@ -7558,6 +7888,84 @@ const docTemplate = `{ ] } }, + "/core/auth/api/generate": { + "post": { + "consumes": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "generate api key", + "tags": [ + "Auth" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [], + "formatEN": "generate api key", + "formatZH": "生成 API 接口密钥", + "paramKeys": [] + } + } + }, + "/core/auth/api/update": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ApiInterfaceConfig" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Update api config", + "tags": [ + "Auth" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "ipWhiteList" + ], + "formatEN": "update api config =\u003e IP White List: [ipWhiteList]", + "formatZH": "更新 API 接口配置 =\u003e IP 白名单: [ipWhiteList]", + "paramKeys": [] + } + } + }, "/core/auth/captcha": { "get": { "responses": { @@ -7574,6 +7982,107 @@ const docTemplate = `{ ] } }, + "/core/auth/current": { + "get": { + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.CurrentUserInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load current user info", + "tags": [ + "Auth" + ] + } + }, + "/core/auth/current/update": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CurrentUserUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Update current user info", + "tags": [ + "Auth" + ] + } + }, + "/core/auth/expired/reset": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PasswordUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Reset system password expired", + "tags": [ + "Auth" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [], + "formatEN": "reset an expired Password", + "formatZH": "重置过期密码", + "paramKeys": [] + } + } + }, "/core/auth/login": { "post": { "consumes": [ @@ -7632,6 +8141,117 @@ const docTemplate = `{ ] } }, + "/core/auth/mfa": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MfaCredential" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/mfa.Otp" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load mfa info", + "tags": [ + "System Setting" + ] + } + }, + "/core/auth/mfa/bind": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MfaCredential" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Bind mfa", + "tags": [ + "System Setting" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [], + "formatEN": "bind mfa", + "formatZH": "mfa 绑定", + "paramKeys": [] + } + } + }, + "/core/auth/mfa/close": { + "post": { + "consumes": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Close mfa", + "tags": [ + "System Setting" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [], + "formatEN": "close mfa", + "formatZH": "mfa 关闭", + "paramKeys": [] + } + } + }, "/core/auth/mfalogin": { "post": { "consumes": [ @@ -7684,6 +8304,27 @@ const docTemplate = `{ ] } }, + "/core/auth/passkey/del": { + "post": { + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete passkey", + "tags": [ + "Auth" + ] + } + }, "/core/auth/passkey/finish": { "post": { "responses": { @@ -7700,13 +8341,102 @@ const docTemplate = `{ ] } }, + "/core/auth/passkey/list": { + "get": { + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/dto.PasskeyInfo" + }, + "type": "array" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "List passkeys", + "tags": [ + "Auth" + ] + } + }, + "/core/auth/passkey/register/begin": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PasskeyRegisterRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PasskeyBeginResponse" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Begin passkey registration", + "tags": [ + "Auth" + ] + } + }, + "/core/auth/passkey/register/finish": { + "post": { + "consumes": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Finish passkey registration", + "tags": [ + "Auth" + ] + } + }, "/core/auth/setting": { "get": { "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dto.SystemSetting" + "$ref": "#/definitions/dto.LoginSetting" } } }, @@ -8776,84 +9506,6 @@ const docTemplate = `{ } } }, - "/core/settings/api/config/generate/key": { - "post": { - "consumes": [ - "application/json" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "generate api key", - "tags": [ - "System Setting" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [], - "formatEN": "generate api key", - "formatZH": "生成 API 接口密钥", - "paramKeys": [] - } - } - }, - "/core/settings/api/config/update": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ApiInterfaceConfig" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Update api config", - "tags": [ - "System Setting" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "ipWhiteList" - ], - "formatEN": "update api config =\u003e IP White List: [ipWhiteList]", - "formatZH": "更新 API 接口配置 =\u003e IP 白名单: [ipWhiteList]", - "paramKeys": [] - } - } - }, "/core/settings/apps/store/config": { "get": { "responses": { @@ -8982,48 +9634,6 @@ const docTemplate = `{ ] } }, - "/core/settings/expired/handle": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PasswordUpdate" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Reset system password expired", - "tags": [ - "System Setting" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [], - "formatEN": "reset an expired Password", - "formatZH": "重置过期密码", - "paramKeys": [] - } - } - }, "/core/settings/interface": { "get": { "consumes": [ @@ -9191,238 +9801,6 @@ const docTemplate = `{ } } }, - "/core/settings/mfa": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.MfaCredential" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/mfa.Otp" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Load mfa info", - "tags": [ - "System Setting" - ] - } - }, - "/core/settings/mfa/bind": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.MfaCredential" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Bind mfa", - "tags": [ - "System Setting" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [], - "formatEN": "bind mfa", - "formatZH": "mfa 绑定", - "paramKeys": [] - } - } - }, - "/core/settings/passkey/list": { - "get": { - "responses": { - "200": { - "description": "OK", - "schema": { - "items": { - "$ref": "#/definitions/dto.PasskeyInfo" - }, - "type": "array" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "List passkeys", - "tags": [ - "System Setting" - ] - } - }, - "/core/settings/passkey/register/begin": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PasskeyRegisterRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.PasskeyBeginResponse" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Begin passkey registration", - "tags": [ - "System Setting" - ] - } - }, - "/core/settings/passkey/register/finish": { - "post": { - "consumes": [ - "application/json" - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Finish passkey registration", - "tags": [ - "System Setting" - ] - } - }, - "/core/settings/passkey/{id}": { - "delete": { - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Delete passkey", - "tags": [ - "System Setting" - ] - } - }, - "/core/settings/password/update": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PasswordUpdate" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Update system password", - "tags": [ - "System Setting" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [], - "formatEN": "update system password", - "formatZH": "修改系统密码", - "paramKeys": [] - } - } - }, "/core/settings/port/update": { "post": { "consumes": [ @@ -9557,6 +9935,30 @@ const docTemplate = `{ ] } }, + "/core/settings/search/base": { + "post": { + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.SettingBaseInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load base system setting info", + "tags": [ + "System Setting" + ] + } + }, "/core/settings/ssl/download": { "post": { "responses": { @@ -11864,6 +12266,489 @@ const docTemplate = `{ ] } }, + "/databases/mongodb": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbDBCreate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Create mongodb database", + "tags": [ + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create mongodb database [name]", + "formatZH": "创建 mongodb 数据库 [name]", + "paramKeys": [] + } + } + }, + "/databases/mongodb/bind": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbBind" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Bind mongodb database user info", + "tags": [ + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "database", + "name", + "username" + ], + "formatEN": "bind mongodb database [database] [name] user [username]", + "formatZH": "绑定 mongodb 数据库 [database] [name] 用户 [username]", + "paramKeys": [] + } + } + }, + "/databases/mongodb/del": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbDBDelete" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete mongodb database", + "tags": [ + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [ + { + "db": "database_mongodbs", + "input_column": "id", + "input_value": "id", + "isList": false, + "output_column": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "delete mongodb database [name]", + "formatZH": "删除 mongodb 数据库 [name]", + "paramKeys": [] + } + } + }, + "/databases/mongodb/del/check": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbDBDeleteCheck" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Check before delete mongodb database", + "tags": [ + "Database Mongodb" + ] + } + }, + "/databases/mongodb/description": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.UpdateDescription" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Update mongodb database description", + "tags": [ + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [ + { + "db": "database_mongodbs", + "input_column": "id", + "input_value": "id", + "isList": false, + "output_column": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id", + "description" + ], + "formatEN": "The description of the mongodb database [name] is modified =\u003e [description]", + "formatZH": "mongodb 数据库 [name] 描述信息修改 [description]", + "paramKeys": [] + } + } + }, + "/databases/mongodb/load": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbLoadDB" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load mongodb database from remote", + "tags": [ + "Database Mongodb" + ] + } + }, + "/databases/mongodb/password": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbPassword" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Change mongodb database password", + "tags": [ + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "database", + "name" + ], + "formatEN": "update mongodb database [database] [name] password", + "formatZH": "更新 mongodb 数据库 [database] [name] 密码", + "paramKeys": [] + } + } + }, + "/databases/mongodb/privileges": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbPrivilegesLoad" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load mongodb privileges", + "tags": [ + "Database Mongodb" + ] + } + }, + "/databases/mongodb/privileges/change": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbPrivileges" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Change mongodb privileges", + "tags": [ + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "database", + "username" + ], + "formatEN": "update mongodb database [database] user [username] privileges", + "formatZH": "更新 mongodb 数据库 [database] 用户 [username] 权限", + "paramKeys": [] + } + } + }, + "/databases/mongodb/root/password": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ChangeDBInfo" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Change mongodb root password", + "tags": [ + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "database" + ], + "formatEN": "update mongodb database [database] root password", + "formatZH": "更新 mongodb 数据库 [database] root 密码", + "paramKeys": [] + } + } + }, + "/databases/mongodb/search": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbDBSearch" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Page mongodb databases", + "tags": [ + "Database Mongodb" + ] + } + }, "/databases/pg": { "post": { "consumes": [ @@ -12771,6 +13656,45 @@ const docTemplate = `{ } } }, + "/files/ai-search": { + "post": { + "consumes": [ + "application/json" + ], + "description": "When file-management AI is enabled, returns mode=ai with summary and hits. When disabled, returns mode=grep with hits only. Scans file contents only. Supports match options, extension/size/time filters, and scan limits.", + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileAISearch" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileAISearchResult" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "File search: content grep + optional AI summary", + "tags": [ + "File" + ] + } + }, "/files/batch/check": { "post": { "consumes": [ @@ -13059,6 +13983,41 @@ const docTemplate = `{ } } }, + "/files/compress/stop": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileCompressStopReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Stop compress task", + "tags": [ + "File" + ] + } + }, "/files/content": { "post": { "consumes": [ @@ -13476,6 +14435,155 @@ const docTemplate = `{ ] } }, + "/files/history/content": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileHistoryContentReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileHistoryInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load file history content", + "tags": [ + "File" + ] + } + }, + "/files/history/del": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileHistoryDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete file history record", + "tags": [ + "File" + ] + } + }, + "/files/history/restore": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileHistoryRestoreReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Restore file history record", + "tags": [ + "File" + ] + } + }, + "/files/history/search": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileHistorySearchReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load file history list", + "tags": [ + "File" + ] + } + }, "/files/mode": { "post": { "consumes": [ @@ -14061,6 +15169,306 @@ const docTemplate = `{ ] } }, + "/files/share/check": { + "get": { + "parameters": [ + { + "description": "share code", + "in": "query", + "name": "code", + "required": true, + "type": "string" + }, + { + "description": "optional password", + "in": "query", + "name": "password", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.Response" + } + } + }, + "summary": "Check file share code (no login)", + "tags": [ + "File" + ] + } + }, + "/files/share/create": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileShareCreate" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileShareInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Create temporary file share link", + "tags": [ + "File" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "path", + "expireMinutes" + ], + "formatEN": "Create file share [path]", + "formatZH": "创建文件分享 [path]", + "paramKeys": [] + } + } + }, + "/files/share/del": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.FilePath" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete file share by path", + "tags": [ + "File" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "path" + ], + "formatEN": "Close file share [path]", + "formatZH": "关闭文件分享 [path]", + "paramKeys": [] + } + } + }, + "/files/share/detail": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.FilePath" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileShareInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get file share detail by path", + "tags": [ + "File" + ] + } + }, + "/files/share/download": { + "get": { + "parameters": [ + { + "description": "share code", + "in": "query", + "name": "code", + "required": true, + "type": "string" + }, + { + "description": "optional password", + "in": "query", + "name": "password", + "type": "string" + } + ], + "produces": [ + "application/octet-stream" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "file" + } + } + }, + "summary": "Download file by share code (no login)", + "tags": [ + "File" + ] + } + }, + "/files/share/info": { + "get": { + "parameters": [ + { + "description": "share code", + "in": "query", + "name": "code", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileSharePublicInfo" + } + } + }, + "summary": "Get file share detail by code (no login)", + "tags": [ + "File" + ] + } + }, + "/files/share/qrcode": { + "get": { + "parameters": [ + { + "description": "share code", + "in": "query", + "name": "code", + "required": true, + "type": "string" + }, + { + "description": "operate node", + "in": "query", + "name": "operateNode", + "type": "string" + } + ], + "produces": [ + "image/png" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "file" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get file share QR code image", + "tags": [ + "File" + ] + } + }, + "/files/share/search": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "List file shares", + "tags": [ + "File" + ] + } + }, "/files/size": { "post": { "consumes": [ @@ -15368,41 +16776,6 @@ const docTemplate = `{ } } }, - "/hosts/monitor/gpu/search": { - "post": { - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.MonitorGPUSearch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.MonitorGPUData" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Load monitor data", - "tags": [ - "Monitor" - ] - } - }, "/hosts/monitor/search": { "post": { "parameters": [ @@ -15970,7 +17343,332 @@ const docTemplate = `{ } } }, - "/hosts/tool": { + "/hosts/tool/config/get": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolTypeReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.HostToolConfig" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get tool config", + "tags": [ + "Host tool" + ] + } + }, + "/hosts/tool/config/set": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolConfigUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Update tool config", + "tags": [ + "Host tool" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "update [type] tool config", + "formatZH": "更新 [type] 主机工具配置文件 ", + "paramKeys": [] + } + } + }, + "/hosts/tool/init": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolCreate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Create Host tool Config", + "tags": [ + "Host tool" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "create [type] config", + "formatZH": "创建 [type] 配置", + "paramKeys": [] + } + } + }, + "/hosts/tool/operate": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolOperateReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Operate tool", + "tags": [ + "Host tool" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate", + "type" + ], + "formatEN": "[operate] [type]", + "formatZH": "[operate] [type] ", + "paramKeys": [] + } + } + }, + "/hosts/tool/status": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolTypeReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.HostToolRes" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get tool status", + "tags": [ + "Host tool" + ] + } + }, + "/hosts/tool/supervisor/process": { + "get": { + "consumes": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.SupervisorProcessConfig" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get Supervisor process config", + "tags": [ + "Host tool" + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.SupervisorProcessConfig" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Create Supervisor process", + "tags": [ + "Host tool" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate" + ], + "formatEN": "[operate] process", + "formatZH": "[operate] 守护进程 ", + "paramKeys": [] + } + } + }, + "/hosts/tool/supervisor/process/file": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostSupervisorProcessFileOperateReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Operate Supervisor process config file", + "tags": [ + "Host tool" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate" + ], + "formatEN": "[operate] Supervisor Process Config file", + "formatZH": "[operate] Supervisor 进程文件 ", + "paramKeys": [] + } + } + }, + "/hosts/tool/supervisor/process/file/get": { "post": { "consumes": [ "application/json" @@ -15982,7 +17680,7 @@ const docTemplate = `{ "name": "request", "required": true, "schema": { - "$ref": "#/definitions/request.HostToolReq" + "$ref": "#/definitions/request.HostSupervisorProcessFileGetReq" } } ], @@ -15990,7 +17688,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.HostToolRes" + "type": "string" } } }, @@ -16002,123 +17700,24 @@ const docTemplate = `{ "Timestamp": [] } ], - "summary": "Get tool status", + "summary": "Get Supervisor process config file", "tags": [ "Host tool" ] } }, - "/hosts/tool/config": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolConfig" - } - } - ], + "/logs/system/files": { + "get": { "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.HostToolConfig" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Get tool config", - "tags": [ - "Host tool" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate" - ], - "formatEN": "[operate] tool config", - "formatZH": "[operate] 主机工具配置文件 ", - "paramKeys": [] - } - } - }, - "/hosts/tool/init": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolCreate" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Create Host tool Config", - "tags": [ - "Host tool" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "type" - ], - "formatEN": "create [type] config", - "formatZH": "创建 [type] 配置", - "paramKeys": [] - } - } - }, - "/hosts/tool/operate": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolReq" + "items": { + "type": "string" + }, + "type": "array" } } - ], - "responses": { - "200": { - "description": "OK" - } }, "security": [ { @@ -16128,32 +17727,19 @@ const docTemplate = `{ "Timestamp": [] } ], - "summary": "Operate tool", + "summary": "Load system log files", "tags": [ - "Host tool" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate", - "type" - ], - "formatEN": "[operate] [type]", - "formatZH": "[operate] [type] ", - "paramKeys": [] - } + "Logs" + ] } }, - "/hosts/tool/supervisor/process": { + "/logs/tasks/executing/count": { "get": { - "consumes": [ - "application/json" - ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.SupervisorProcessConfig" + "type": "integer" } } }, @@ -16165,59 +17751,14 @@ const docTemplate = `{ "Timestamp": [] } ], - "summary": "Get Supervisor process config", + "summary": "Get the number of executing tasks", "tags": [ - "Host tool" + "TaskLog" ] - }, - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/request.SupervisorProcessConfig" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Create Supervisor process", - "tags": [ - "Host tool" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate" - ], - "formatEN": "[operate] process", - "formatZH": "[operate] 守护进程 ", - "paramKeys": [] - } } }, - "/hosts/tool/supervisor/process/file": { + "/logs/tasks/read": { "post": { - "consumes": [ - "application/json" - ], "parameters": [ { "description": "request", @@ -16225,7 +17766,7 @@ const docTemplate = `{ "name": "request", "required": true, "schema": { - "$ref": "#/definitions/request.SupervisorProcessFileReq" + "$ref": "#/definitions/request.TaskLogReadReq" } } ], @@ -16233,67 +17774,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "type": "string" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Get Supervisor process config file", - "tags": [ - "Host tool" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate" - ], - "formatEN": "[operate] Supervisor Process Config file", - "formatZH": "[operate] Supervisor 进程文件 ", - "paramKeys": [] - } - } - }, - "/logs/system/files": { - "get": { - "responses": { - "200": { - "description": "OK", - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Load system log files", - "tags": [ - "Logs" - ] - } - }, - "/logs/tasks/executing/count": { - "get": { - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "integer" + "$ref": "#/definitions/response.FileLineContent" } } }, @@ -16305,7 +17786,7 @@ const docTemplate = `{ "Timestamp": [] } ], - "summary": "Get the number of executing tasks", + "summary": "Read task log by Line", "tags": [ "TaskLog" ] @@ -18025,23 +19506,49 @@ const docTemplate = `{ ] } }, - "/settings/get/{key}": { - "get": { + "/settings/file-history/search": { + "post": { + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileHistorySettingInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load file history setting info", + "tags": [ + "System Setting" + ] + } + }, + "/settings/file-history/update": { + "post": { + "consumes": [ + "application/json" + ], "parameters": [ { - "description": "key", - "in": "path", - "name": "key", + "description": "request", + "in": "body", + "name": "request", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/request.FileHistorySettingUpdate" + } } ], "responses": { "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.SettingInfo" - } + "description": "OK" } }, "security": [ @@ -18052,7 +19559,7 @@ const docTemplate = `{ "Timestamp": [] } ], - "summary": "Load system setting by key", + "summary": "Update file history setting", "tags": [ "System Setting" ] @@ -18646,7 +20153,7 @@ const docTemplate = `{ "name": "request", "required": true, "schema": { - "$ref": "#/definitions/dto.SettingUpdate" + "$ref": "#/definitions/dto.AgentSettingUpdate" } } ], @@ -24456,6 +25963,30 @@ const docTemplate = `{ ], "type": "object" }, + "dto.AgentChannelDeleteReq": { + "properties": { + "agentId": { + "type": "integer" + }, + "type": { + "enum": [ + "feishu", + "telegram", + "discord", + "wecom", + "qqbot", + "dingtalk", + "weixin" + ], + "type": "string" + } + }, + "required": [ + "agentId", + "type" + ], + "type": "object" + }, "dto.AgentChannelPairingApproveReq": { "properties": { "accountId": { @@ -24472,7 +26003,9 @@ const docTemplate = `{ "feishu", "telegram", "discord", - "wecom" + "wecom", + "qqbot", + "dingtalk" ], "type": "string" } @@ -24566,7 +26099,8 @@ const docTemplate = `{ "agentType": { "enum": [ "openclaw", - "copaw" + "copaw", + "hermes-agent" ], "type": "string" }, @@ -24628,6 +26162,8 @@ const docTemplate = `{ "type": "string" }, "webUIPort": { + "maximum": 65535, + "minimum": 1, "type": "integer" } }, @@ -24755,6 +26291,7 @@ const docTemplate = `{ }, "dmPolicy": { "enum": [ + "pairing", "allowlist", "open", "disabled" @@ -24823,6 +26360,12 @@ const docTemplate = `{ }, "dto.AgentDiscordConfig": { "properties": { + "allowFrom": { + "items": { + "type": "string" + }, + "type": "array" + }, "bots": { "items": { "$ref": "#/definitions/dto.AgentDiscordBot" @@ -24843,6 +26386,9 @@ const docTemplate = `{ }, "proxy": { "type": "string" + }, + "requireMention": { + "type": "boolean" } }, "type": "object" @@ -24852,6 +26398,12 @@ const docTemplate = `{ "agentId": { "type": "integer" }, + "allowFrom": { + "items": { + "type": "string" + }, + "type": "array" + }, "bots": { "items": { "$ref": "#/definitions/dto.AgentDiscordBot" @@ -24878,6 +26430,9 @@ const docTemplate = `{ }, "proxy": { "type": "string" + }, + "requireMention": { + "type": "boolean" } }, "required": [ @@ -24929,6 +26484,12 @@ const docTemplate = `{ }, "type": "array" }, + "connectionMode": { + "type": "string" + }, + "domain": { + "type": "string" + }, "enabled": { "type": "boolean" }, @@ -24982,6 +26543,12 @@ const docTemplate = `{ "minItems": 1, "type": "array" }, + "connectionMode": { + "type": "string" + }, + "domain": { + "type": "string" + }, "enabled": { "type": "boolean" }, @@ -25026,6 +26593,63 @@ const docTemplate = `{ ], "type": "object" }, + "dto.AgentHermesChatSessionDeleteReq": { + "properties": { + "agentId": { + "type": "integer" + }, + "id": { + "type": "string" + } + }, + "required": [ + "agentId", + "id" + ], + "type": "object" + }, + "dto.AgentHermesChatSessionItem": { + "properties": { + "id": { + "type": "string" + }, + "lastActive": { + "type": "string" + }, + "messageCount": { + "type": "integer" + }, + "model": { + "type": "string" + }, + "startedAt": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "type": "object" + }, + "dto.AgentHermesChatSessionRenameReq": { + "properties": { + "agentId": { + "type": "integer" + }, + "id": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "required": [ + "agentId", + "id", + "title" + ], + "type": "object" + }, "dto.AgentIDReq": { "properties": { "agentId": { @@ -25122,6 +26746,9 @@ const docTemplate = `{ }, "websiteProtocol": { "type": "string" + }, + "websiteType": { + "type": "string" } }, "type": "object" @@ -25403,15 +27030,33 @@ const docTemplate = `{ }, "dto.AgentQQBotConfig": { "properties": { + "allowFrom": { + "items": { + "type": "string" + }, + "type": "array" + }, "bots": { "items": { "$ref": "#/definitions/dto.AgentQQBotBot" }, "type": "array" }, + "dmPolicy": { + "type": "string" + }, "enabled": { "type": "boolean" }, + "groupAllowFrom": { + "items": { + "type": "string" + }, + "type": "array" + }, + "groupPolicy": { + "type": "string" + }, "installed": { "type": "boolean" } @@ -25423,6 +27068,12 @@ const docTemplate = `{ "agentId": { "type": "integer" }, + "allowFrom": { + "items": { + "type": "string" + }, + "type": "array" + }, "bots": { "items": { "$ref": "#/definitions/dto.AgentQQBotBot" @@ -25430,8 +27081,20 @@ const docTemplate = `{ "minItems": 1, "type": "array" }, + "dmPolicy": { + "type": "string" + }, "enabled": { "type": "boolean" + }, + "groupAllowFrom": { + "items": { + "type": "string" + }, + "type": "array" + }, + "groupPolicy": { + "type": "string" } }, "required": [ @@ -25668,6 +27331,25 @@ const docTemplate = `{ ], "type": "object" }, + "dto.AgentSettingUpdate": { + "properties": { + "key": { + "enum": [ + "SystemIP", + "DockerSockPath", + "FileRecycleBin" + ], + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "key" + ], + "type": "object" + }, "dto.AgentSkillInstallReq": { "properties": { "agentId": { @@ -25680,7 +27362,9 @@ const docTemplate = `{ "enum": [ "clawhub-global", "clawhub-cn", - "skillhub" + "skillhub", + "official", + "skills-sh" ], "type": "string" }, @@ -25701,17 +27385,35 @@ const docTemplate = `{ "bundled": { "type": "boolean" }, + "category": { + "type": "string" + }, "description": { "type": "string" }, "disabled": { "type": "boolean" }, + "identifier": { + "type": "string" + }, "name": { "type": "string" }, "source": { "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "trust": { + "type": "string" + }, + "uninstallable": { + "type": "boolean" } }, "type": "object" @@ -25721,6 +27423,9 @@ const docTemplate = `{ "description": { "type": "string" }, + "identifier": { + "type": "string" + }, "name": { "type": "string" }, @@ -25736,6 +27441,9 @@ const docTemplate = `{ "summary": { "type": "string" }, + "trust": { + "type": "string" + }, "version": { "type": "string" } @@ -25754,7 +27462,9 @@ const docTemplate = `{ "enum": [ "clawhub-global", "clawhub-cn", - "skillhub" + "skillhub", + "official", + "skills-sh" ], "type": "string" } @@ -25766,6 +27476,21 @@ const docTemplate = `{ ], "type": "object" }, + "dto.AgentSkillUninstallReq": { + "properties": { + "agentId": { + "type": "integer" + }, + "name": { + "type": "string" + } + }, + "required": [ + "agentId", + "name" + ], + "type": "object" + }, "dto.AgentSkillUpdateReq": { "properties": { "agentId": { @@ -25848,6 +27573,9 @@ const docTemplate = `{ "proxy": { "type": "string" }, + "requireMention": { + "type": "boolean" + }, "streaming": { "type": "string" } @@ -25915,6 +27643,9 @@ const docTemplate = `{ "proxy": { "type": "string" }, + "requireMention": { + "type": "boolean" + }, "streaming": { "enum": [ "off", @@ -26049,6 +27780,14 @@ const docTemplate = `{ ], "type": "object" }, + "dto.AgentWeixinConfig": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, "dto.AgentWeixinLoginReq": { "properties": { "agentId": { @@ -26073,7 +27812,7 @@ const docTemplate = `{ "type": "string" }, "apiKeyValidityTime": { - "type": "string" + "type": "integer" }, "ipWhiteList": { "type": "string" @@ -26543,6 +28282,7 @@ const docTemplate = `{ "mariadb", "postgresql", "redis", + "mongodb", "mysql-cluster", "postgresql-cluster", "redis-cluster" @@ -26989,6 +28729,7 @@ const docTemplate = `{ "redis", "website", "postgresql", + "mongodb", "mysql-cluster", "postgresql-cluster", "redis-cluster", @@ -27038,6 +28779,9 @@ const docTemplate = `{ "downloadAccountID": { "type": "integer" }, + "dropAllCollections": { + "type": "boolean" + }, "file": { "type": "string" }, @@ -27061,6 +28805,7 @@ const docTemplate = `{ "redis", "website", "postgresql", + "mongodb", "mysql-cluster", "postgresql-cluster", "redis-cluster", @@ -28055,6 +29800,75 @@ const docTemplate = `{ ], "type": "object" }, + "dto.CurrentUserInfo": { + "properties": { + "apiInterfaceStatus": { + "type": "string" + }, + "apiKey": { + "type": "string" + }, + "apiKeyValidityTime": { + "type": "integer" + }, + "complexitySetting": { + "type": "string" + }, + "expirationDays": { + "type": "integer" + }, + "expirationTime": { + "type": "string" + }, + "ipWhiteList": { + "type": "string" + }, + "mfaInterval": { + "type": "integer" + }, + "mfaStatus": { + "type": "string" + }, + "name": { + "type": "string" + }, + "sessionTimeout": { + "type": "integer" + } + }, + "type": "object" + }, + "dto.CurrentUserUpdate": { + "properties": { + "expirationDays": { + "maximum": 60, + "minimum": 0, + "type": "integer" + }, + "expirationTime": { + "type": "string" + }, + "name": { + "type": "string" + }, + "oldPassword": { + "type": "string" + }, + "password": { + "type": "string" + }, + "sessionTimeout": { + "maximum": 864000, + "minimum": 300, + "type": "integer" + } + }, + "required": [ + "name", + "sessionTimeout" + ], + "type": "object" + }, "dto.DBBaseInfo": { "properties": { "containerName": { @@ -29740,6 +31554,44 @@ const docTemplate = `{ ], "type": "object" }, + "dto.LoginSetting": { + "properties": { + "isDemo": { + "type": "boolean" + }, + "isEnterprise": { + "type": "boolean" + }, + "isFxplay": { + "type": "boolean" + }, + "isIntl": { + "type": "boolean" + }, + "isOffline": { + "type": "boolean" + }, + "language": { + "type": "string" + }, + "menuTabs": { + "type": "string" + }, + "needCaptcha": { + "type": "boolean" + }, + "panelName": { + "type": "string" + }, + "passkeySetting": { + "type": "boolean" + }, + "theme": { + "type": "string" + } + }, + "type": "object" + }, "dto.MFALogin": { "properties": { "code": { @@ -29770,7 +31622,7 @@ const docTemplate = `{ "type": "string" }, "interval": { - "type": "string" + "type": "integer" }, "secret": { "type": "string" @@ -29783,6 +31635,255 @@ const docTemplate = `{ ], "type": "object" }, + "dto.MongodbBind": { + "properties": { + "database": { + "type": "string" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "database", + "name", + "password", + "username" + ], + "type": "object" + }, + "dto.MongodbDBCreate": { + "properties": { + "database": { + "type": "string" + }, + "description": { + "type": "string" + }, + "from": { + "enum": [ + "local", + "remote" + ], + "type": "string" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "permission": { + "enum": [ + "dbOwner", + "read", + "readWrite", + "userAdmin" + ], + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "database", + "from", + "name", + "password", + "permission", + "username" + ], + "type": "object" + }, + "dto.MongodbDBDelete": { + "properties": { + "database": { + "type": "string" + }, + "deleteBackup": { + "type": "boolean" + }, + "forceDelete": { + "type": "boolean" + }, + "id": { + "type": "integer" + }, + "type": { + "enum": [ + "mongodb" + ], + "type": "string" + } + }, + "required": [ + "database", + "id", + "type" + ], + "type": "object" + }, + "dto.MongodbDBDeleteCheck": { + "properties": { + "database": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "type": { + "enum": [ + "mongodb" + ], + "type": "string" + } + }, + "required": [ + "database", + "id", + "type" + ], + "type": "object" + }, + "dto.MongodbDBSearch": { + "properties": { + "database": { + "type": "string" + }, + "info": { + "type": "string" + }, + "order": { + "enum": [ + "null", + "ascending", + "descending" + ], + "type": "string" + }, + "orderBy": { + "enum": [ + "name", + "createdAt" + ], + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + } + }, + "required": [ + "database", + "order", + "orderBy", + "page", + "pageSize" + ], + "type": "object" + }, + "dto.MongodbLoadDB": { + "properties": { + "database": { + "type": "string" + }, + "from": { + "enum": [ + "local", + "remote" + ], + "type": "string" + }, + "type": { + "enum": [ + "mongodb" + ], + "type": "string" + } + }, + "required": [ + "database", + "from", + "type" + ], + "type": "object" + }, + "dto.MongodbPassword": { + "properties": { + "database": { + "type": "string" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "required": [ + "database", + "name", + "password" + ], + "type": "object" + }, + "dto.MongodbPrivileges": { + "properties": { + "database": { + "type": "string" + }, + "name": { + "type": "string" + }, + "permission": { + "enum": [ + "dbOwner", + "read", + "readWrite", + "userAdmin" + ], + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "database", + "name", + "permission", + "username" + ], + "type": "object" + }, + "dto.MongodbPrivilegesLoad": { + "properties": { + "database": { + "type": "string" + }, + "name": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "database", + "name", + "username" + ], + "type": "object" + }, "dto.MonitorData": { "properties": { "date": { @@ -31649,6 +33750,18 @@ const docTemplate = `{ }, "type": "object" }, + "dto.Response": { + "properties": { + "code": { + "type": "integer" + }, + "data": {}, + "message": { + "type": "string" + } + }, + "type": "object" + }, "dto.RootCertOperate": { "properties": { "description": { @@ -32167,6 +34280,9 @@ const docTemplate = `{ "status": { "type": "string" }, + "taskID": { + "type": "string" + }, "type": { "type": "string" } @@ -32195,6 +34311,71 @@ const docTemplate = `{ ], "type": "object" }, + "dto.SettingBaseInfo": { + "properties": { + "bindAddress": { + "type": "string" + }, + "complexityVerification": { + "type": "string" + }, + "dashboardMemoVisible": { + "type": "string" + }, + "dashboardSimpleNodeVisible": { + "type": "string" + }, + "developerMode": { + "type": "string" + }, + "docSource": { + "type": "string" + }, + "edition": { + "type": "string" + }, + "hideMenu": { + "type": "string" + }, + "ipv6": { + "type": "string" + }, + "language": { + "type": "string" + }, + "menuTabs": { + "type": "string" + }, + "noAuthSetting": { + "type": "string" + }, + "panelName": { + "type": "string" + }, + "port": { + "type": "string" + }, + "proxyType": { + "type": "string" + }, + "securityEntrance": { + "type": "string" + }, + "serverPort": { + "type": "string" + }, + "systemVersion": { + "type": "string" + }, + "theme": { + "type": "string" + }, + "upgradeBackupCopies": { + "type": "string" + } + }, + "type": "object" + }, "dto.SettingInfo": { "properties": { "appStoreLastModified": { @@ -32227,6 +34408,9 @@ const docTemplate = `{ "lastCleanTime": { "type": "string" }, + "localSSHConnShow": { + "type": "string" + }, "localTime": { "type": "string" }, @@ -32503,20 +34687,6 @@ const docTemplate = `{ ], "type": "object" }, - "dto.SystemSetting": { - "properties": { - "isDemo": { - "type": "boolean" - }, - "isIntl": { - "type": "boolean" - }, - "language": { - "type": "string" - } - }, - "type": "object" - }, "dto.Tag": { "properties": { "key": { @@ -32703,6 +34873,9 @@ const docTemplate = `{ "name": { "type": "string" }, + "role": { + "type": "string" + }, "token": { "type": "string" } @@ -32838,6 +35011,9 @@ const docTemplate = `{ "path": { "type": "string" }, + "shareCode": { + "type": "string" + }, "size": { "type": "integer" }, @@ -34204,6 +36380,77 @@ const docTemplate = `{ ], "type": "object" }, + "request.FileAISearch": { + "properties": { + "containSub": { + "type": "boolean" + }, + "contentHitsPromptMaxBytes": { + "type": "integer" + }, + "extensions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "llmMaxOutputTokens": { + "type": "integer" + }, + "matchCase": { + "type": "boolean" + }, + "maxFileBytes": { + "type": "integer" + }, + "maxHitsPerFile": { + "type": "integer" + }, + "maxItems": { + "maximum": 2000, + "minimum": 1, + "type": "integer" + }, + "maxScanFiles": { + "type": "integer" + }, + "maxSize": { + "type": "integer" + }, + "maxTotalHits": { + "type": "integer" + }, + "minSize": { + "type": "integer" + }, + "modifiedAfter": { + "type": "string" + }, + "modifiedBefore": { + "type": "string" + }, + "path": { + "type": "string" + }, + "query": { + "type": "string" + }, + "responseLanguage": { + "type": "string" + }, + "useRegex": { + "type": "boolean" + }, + "wholeWord": { + "type": "boolean" + } + }, + "required": [ + "path", + "query" + ], + "type": "object" + }, "request.FileBatchDelete": { "properties": { "isDir": { @@ -34241,6 +36488,9 @@ const docTemplate = `{ "secret": { "type": "string" }, + "taskID": { + "type": "string" + }, "type": { "type": "string" } @@ -34253,6 +36503,17 @@ const docTemplate = `{ ], "type": "object" }, + "request.FileCompressStopReq": { + "properties": { + "taskID": { + "type": "string" + } + }, + "required": [ + "taskID" + ], + "type": "object" + }, "request.FileContentReq": { "properties": { "isDetail": { @@ -34407,6 +36668,96 @@ const docTemplate = `{ ], "type": "object" }, + "request.FileHistoryContentReq": { + "properties": { + "id": { + "type": "integer" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "request.FileHistoryDeleteReq": { + "properties": { + "ids": { + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "ids" + ], + "type": "object" + }, + "request.FileHistoryRestoreReq": { + "properties": { + "id": { + "type": "integer" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "request.FileHistorySearchReq": { + "properties": { + "operation": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "scope": { + "enum": [ + "current", + "all" + ], + "type": "string" + } + }, + "required": [ + "page", + "pageSize", + "scope" + ], + "type": "object" + }, + "request.FileHistorySettingUpdate": { + "properties": { + "diskQuotaMB": { + "maximum": 1048576, + "minimum": 0, + "type": "integer" + }, + "enable": { + "enum": [ + "Enable", + "Disable" + ], + "type": "string" + }, + "maxPerPath": { + "maximum": 1000, + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "enable" + ], + "type": "object" + }, "request.FileMove": { "properties": { "cover": { @@ -34649,6 +37000,25 @@ const docTemplate = `{ ], "type": "object" }, + "request.FileShareCreate": { + "properties": { + "expireMinutes": { + "maximum": 10080, + "minimum": 0, + "type": "integer" + }, + "password": { + "type": "string" + }, + "path": { + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, "request.FileWget": { "properties": { "ignoreCertificate": { @@ -34671,17 +37041,61 @@ const docTemplate = `{ ], "type": "object" }, - "request.HostToolConfig": { + "request.HostSupervisorProcessFileGetReq": { + "properties": { + "file": { + "enum": [ + "out.log", + "err.log", + "config" + ], + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "file", + "name" + ], + "type": "object" + }, + "request.HostSupervisorProcessFileOperateReq": { "properties": { "content": { "type": "string" }, + "file": { + "enum": [ + "out.log", + "err.log", + "config" + ], + "type": "string" + }, + "name": { + "type": "string" + }, "operate": { "enum": [ - "get", - "set" + "clear", + "update" ], "type": "string" + } + }, + "required": [ + "file", + "name", + "operate" + ], + "type": "object" + }, + "request.HostToolConfigUpdate": { + "properties": { + "content": { + "type": "string" }, "type": { "enum": [ @@ -34712,11 +37126,10 @@ const docTemplate = `{ ], "type": "object" }, - "request.HostToolReq": { + "request.HostToolOperateReq": { "properties": { "operate": { "enum": [ - "status", "restart", "start", "stop" @@ -34730,6 +37143,21 @@ const docTemplate = `{ "type": "string" } }, + "required": [ + "operate", + "type" + ], + "type": "object" + }, + "request.HostToolTypeReq": { + "properties": { + "type": { + "enum": [ + "supervisord" + ], + "type": "string" + } + }, "required": [ "type" ], @@ -35986,35 +38414,35 @@ const docTemplate = `{ }, "type": "object" }, - "request.SupervisorProcessFileReq": { + "request.TaskLogReadReq": { "properties": { - "content": { - "type": "string" + "latest": { + "type": "boolean" }, - "file": { - "enum": [ - "out.log", - "err.log", - "config" - ], + "page": { + "minimum": 1, + "type": "integer" + }, + "pageSize": { + "minimum": 1, + "type": "integer" + }, + "resourceID": { + "type": "integer" + }, + "taskID": { "type": "string" }, - "name": { + "taskOperate": { "type": "string" }, - "operate": { - "enum": [ - "get", - "clear", - "update" - ], + "taskType": { "type": "string" } }, "required": [ - "file", - "name", - "operate" + "page", + "pageSize" ], "type": "object" }, @@ -36931,9 +39359,6 @@ const docTemplate = `{ "ID": { "type": "integer" }, - "disableLog": { - "type": "boolean" - }, "nameservers": { "items": { "type": "string" @@ -37909,6 +40334,140 @@ const docTemplate = `{ }, "type": "object" }, + "response.FileAIContentHit": { + "properties": { + "line": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "text": { + "type": "string" + } + }, + "type": "object" + }, + "response.FileAISearchResult": { + "properties": { + "completionTokens": { + "type": "integer" + }, + "contentHitsTruncated": { + "type": "boolean" + }, + "contentScannedFiles": { + "type": "integer" + }, + "duration": { + "type": "string" + }, + "hits": { + "items": { + "$ref": "#/definitions/response.FileAIContentHit" + }, + "type": "array" + }, + "itemCount": { + "type": "integer" + }, + "mode": { + "type": "string" + }, + "preFiltered": { + "type": "boolean" + }, + "promptTokens": { + "type": "integer" + }, + "summary": { + "type": "string" + }, + "totalTokens": { + "type": "integer" + }, + "truncated": { + "type": "boolean" + } + }, + "type": "object" + }, + "response.FileHistoryInfo": { + "properties": { + "content": { + "type": "string" + }, + "contentSHA": { + "type": "string" + }, + "contentSize": { + "type": "integer" + }, + "createdAt": { + "type": "string" + }, + "currentContent": { + "type": "string" + }, + "currentPath": { + "type": "string" + }, + "deleted": { + "type": "boolean" + }, + "extension": { + "type": "string" + }, + "fileId": { + "type": "string" + }, + "fileMode": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "operation": { + "type": "string" + }, + "path": { + "type": "string" + }, + "previousId": { + "type": "integer" + }, + "sourcePath": { + "type": "string" + }, + "storagePath": { + "type": "string" + }, + "targetPath": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + }, + "type": "object" + }, + "response.FileHistorySettingInfo": { + "properties": { + "diskQuotaMB": { + "type": "integer" + }, + "enable": { + "type": "string" + }, + "maxPerPath": { + "type": "integer" + } + }, + "type": "object" + }, "response.FileInfo": { "properties": { "content": { @@ -37965,6 +40524,9 @@ const docTemplate = `{ "path": { "type": "string" }, + "shareCode": { + "type": "string" + }, "size": { "type": "integer" }, @@ -38023,6 +40585,49 @@ const docTemplate = `{ }, "type": "object" }, + "response.FileShareInfo": { + "properties": { + "code": { + "type": "string" + }, + "expiresAt": { + "type": "integer" + }, + "fileName": { + "type": "string" + }, + "hasPassword": { + "type": "boolean" + }, + "password": { + "type": "string" + }, + "path": { + "type": "string" + }, + "permanent": { + "type": "boolean" + } + }, + "type": "object" + }, + "response.FileSharePublicInfo": { + "properties": { + "expiresAt": { + "type": "integer" + }, + "fileName": { + "type": "string" + }, + "hasPassword": { + "type": "boolean" + }, + "permanent": { + "type": "boolean" + } + }, + "type": "object" + }, "response.FileTree": { "properties": { "children": { @@ -39269,4 +41874,4 @@ var SwaggerInfo = &swag.Spec{ func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) -} +} \ No newline at end of file diff --git a/core/cmd/server/docs/swagger.json b/core/cmd/server/docs/swagger.json index 2548c5e0deb1..824ab9e7f687 100644 --- a/core/cmd/server/docs/swagger.json +++ b/core/cmd/server/docs/swagger.json @@ -677,6 +677,41 @@ ] } }, + "/ai/agents/channel/delete": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentChannelDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete Agent channel config", + "tags": [ + "AI" + ] + } + }, "/ai/agents/channel/dingtalk/get": { "post": { "consumes": [ @@ -1150,6 +1185,44 @@ ] } }, + "/ai/agents/channel/weixin/get": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentIDReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.AgentWeixinConfig" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get Agent Weixin channel config", + "tags": [ + "AI" + ] + } + }, "/ai/agents/channel/weixin/login": { "post": { "consumes": [ @@ -1293,6 +1366,158 @@ ] } }, + "/ai/agents/delete/check": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentIDReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/dto.AppResource" + }, + "type": "array" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete check Agent", + "tags": [ + "AI" + ] + } + }, + "/ai/agents/hermes/chat/sessions": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentIDReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/dto.AgentHermesChatSessionItem" + }, + "type": "array" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get Hermes chat sessions", + "tags": [ + "AI" + ] + } + }, + "/ai/agents/hermes/chat/sessions/delete": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentHermesChatSessionDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete Hermes chat session", + "tags": [ + "AI" + ] + } + }, + "/ai/agents/hermes/chat/sessions/rename": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentHermesChatSessionRenameReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Rename Hermes chat session", + "tags": [ + "AI" + ] + } + }, "/ai/agents/model/get": { "post": { "consumes": [ @@ -1910,6 +2135,41 @@ ] } }, + "/ai/agents/skills/uninstall": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentSkillUninstallReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Uninstall Agent skill", + "tags": [ + "AI" + ] + } + }, "/ai/agents/skills/update": { "post": { "consumes": [ @@ -2015,6 +2275,41 @@ ] } }, + "/ai/agents/website/unbind": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AgentIDReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Unbind Agent website", + "tags": [ + "AI" + ] + } + }, "/ai/domain/bind": { "post": { "consumes": [ @@ -2112,6 +2407,41 @@ ] } }, + "/ai/gpu/search": { + "post": { + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MonitorGPUSearch" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.MonitorGPUData" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load monitor data", + "tags": [ + "Monitor" + ] + } + }, "/ai/mcp/domain/bind": { "post": { "consumes": [ @@ -7554,6 +7884,84 @@ ] } }, + "/core/auth/api/generate": { + "post": { + "consumes": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "generate api key", + "tags": [ + "Auth" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [], + "formatEN": "generate api key", + "formatZH": "生成 API 接口密钥", + "paramKeys": [] + } + } + }, + "/core/auth/api/update": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ApiInterfaceConfig" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Update api config", + "tags": [ + "Auth" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "ipWhiteList" + ], + "formatEN": "update api config =\u003e IP White List: [ipWhiteList]", + "formatZH": "更新 API 接口配置 =\u003e IP 白名单: [ipWhiteList]", + "paramKeys": [] + } + } + }, "/core/auth/captcha": { "get": { "responses": { @@ -7570,6 +7978,107 @@ ] } }, + "/core/auth/current": { + "get": { + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.CurrentUserInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load current user info", + "tags": [ + "Auth" + ] + } + }, + "/core/auth/current/update": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CurrentUserUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Update current user info", + "tags": [ + "Auth" + ] + } + }, + "/core/auth/expired/reset": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PasswordUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Reset system password expired", + "tags": [ + "Auth" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [], + "formatEN": "reset an expired Password", + "formatZH": "重置过期密码", + "paramKeys": [] + } + } + }, "/core/auth/login": { "post": { "consumes": [ @@ -7628,6 +8137,117 @@ ] } }, + "/core/auth/mfa": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MfaCredential" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/mfa.Otp" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load mfa info", + "tags": [ + "System Setting" + ] + } + }, + "/core/auth/mfa/bind": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MfaCredential" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Bind mfa", + "tags": [ + "System Setting" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [], + "formatEN": "bind mfa", + "formatZH": "mfa 绑定", + "paramKeys": [] + } + } + }, + "/core/auth/mfa/close": { + "post": { + "consumes": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Close mfa", + "tags": [ + "System Setting" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [], + "formatEN": "close mfa", + "formatZH": "mfa 关闭", + "paramKeys": [] + } + } + }, "/core/auth/mfalogin": { "post": { "consumes": [ @@ -7680,6 +8300,27 @@ ] } }, + "/core/auth/passkey/del": { + "post": { + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete passkey", + "tags": [ + "Auth" + ] + } + }, "/core/auth/passkey/finish": { "post": { "responses": { @@ -7696,13 +8337,102 @@ ] } }, + "/core/auth/passkey/list": { + "get": { + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/dto.PasskeyInfo" + }, + "type": "array" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "List passkeys", + "tags": [ + "Auth" + ] + } + }, + "/core/auth/passkey/register/begin": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PasskeyRegisterRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PasskeyBeginResponse" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Begin passkey registration", + "tags": [ + "Auth" + ] + } + }, + "/core/auth/passkey/register/finish": { + "post": { + "consumes": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Finish passkey registration", + "tags": [ + "Auth" + ] + } + }, "/core/auth/setting": { "get": { "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dto.SystemSetting" + "$ref": "#/definitions/dto.LoginSetting" } } }, @@ -8772,84 +9502,6 @@ } } }, - "/core/settings/api/config/generate/key": { - "post": { - "consumes": [ - "application/json" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "generate api key", - "tags": [ - "System Setting" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [], - "formatEN": "generate api key", - "formatZH": "生成 API 接口密钥", - "paramKeys": [] - } - } - }, - "/core/settings/api/config/update": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ApiInterfaceConfig" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Update api config", - "tags": [ - "System Setting" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "ipWhiteList" - ], - "formatEN": "update api config =\u003e IP White List: [ipWhiteList]", - "formatZH": "更新 API 接口配置 =\u003e IP 白名单: [ipWhiteList]", - "paramKeys": [] - } - } - }, "/core/settings/apps/store/config": { "get": { "responses": { @@ -8978,48 +9630,6 @@ ] } }, - "/core/settings/expired/handle": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PasswordUpdate" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Reset system password expired", - "tags": [ - "System Setting" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [], - "formatEN": "reset an expired Password", - "formatZH": "重置过期密码", - "paramKeys": [] - } - } - }, "/core/settings/interface": { "get": { "consumes": [ @@ -9187,238 +9797,6 @@ } } }, - "/core/settings/mfa": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.MfaCredential" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/mfa.Otp" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Load mfa info", - "tags": [ - "System Setting" - ] - } - }, - "/core/settings/mfa/bind": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.MfaCredential" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Bind mfa", - "tags": [ - "System Setting" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [], - "formatEN": "bind mfa", - "formatZH": "mfa 绑定", - "paramKeys": [] - } - } - }, - "/core/settings/passkey/list": { - "get": { - "responses": { - "200": { - "description": "OK", - "schema": { - "items": { - "$ref": "#/definitions/dto.PasskeyInfo" - }, - "type": "array" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "List passkeys", - "tags": [ - "System Setting" - ] - } - }, - "/core/settings/passkey/register/begin": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PasskeyRegisterRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.PasskeyBeginResponse" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Begin passkey registration", - "tags": [ - "System Setting" - ] - } - }, - "/core/settings/passkey/register/finish": { - "post": { - "consumes": [ - "application/json" - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Finish passkey registration", - "tags": [ - "System Setting" - ] - } - }, - "/core/settings/passkey/{id}": { - "delete": { - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Delete passkey", - "tags": [ - "System Setting" - ] - } - }, - "/core/settings/password/update": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PasswordUpdate" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Update system password", - "tags": [ - "System Setting" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [], - "formatEN": "update system password", - "formatZH": "修改系统密码", - "paramKeys": [] - } - } - }, "/core/settings/port/update": { "post": { "consumes": [ @@ -9553,6 +9931,30 @@ ] } }, + "/core/settings/search/base": { + "post": { + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.SettingBaseInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load base system setting info", + "tags": [ + "System Setting" + ] + } + }, "/core/settings/ssl/download": { "post": { "responses": { @@ -11759,14 +12161,328 @@ "Timestamp": [] } ], - "summary": "Update mysql database description", + "summary": "Update mysql database description", + "tags": [ + "Database Mysql" + ], + "x-panel-log": { + "BeforeFunctions": [ + { + "db": "database_mysqls", + "input_column": "id", + "input_value": "id", + "isList": false, + "output_column": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id", + "description" + ], + "formatEN": "The description of the mysql database [name] is modified =\u003e [description]", + "formatZH": "mysql 数据库 [name] 描述信息修改 [description]", + "paramKeys": [] + } + } + }, + "/databases/format/options": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.OperationWithName" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/dto.MysqlFormatCollationOption" + }, + "type": "array" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "List mysql database format collation options", + "tags": [ + "Database Mysql" + ] + } + }, + "/databases/load": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MysqlLoadDB" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load mysql database from remote", + "tags": [ + "Database Mysql" + ] + } + }, + "/databases/mongodb": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbDBCreate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Create mongodb database", + "tags": [ + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create mongodb database [name]", + "formatZH": "创建 mongodb 数据库 [name]", + "paramKeys": [] + } + } + }, + "/databases/mongodb/bind": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbBind" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Bind mongodb database user info", + "tags": [ + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "database", + "name", + "username" + ], + "formatEN": "bind mongodb database [database] [name] user [username]", + "formatZH": "绑定 mongodb 数据库 [database] [name] 用户 [username]", + "paramKeys": [] + } + } + }, + "/databases/mongodb/del": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbDBDelete" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete mongodb database", + "tags": [ + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [ + { + "db": "database_mongodbs", + "input_column": "id", + "input_value": "id", + "isList": false, + "output_column": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "delete mongodb database [name]", + "formatZH": "删除 mongodb 数据库 [name]", + "paramKeys": [] + } + } + }, + "/databases/mongodb/del/check": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbDBDeleteCheck" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Check before delete mongodb database", + "tags": [ + "Database Mongodb" + ] + } + }, + "/databases/mongodb/description": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.UpdateDescription" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Update mongodb database description", "tags": [ - "Database Mysql" + "Database Mongodb" ], "x-panel-log": { "BeforeFunctions": [ { - "db": "database_mysqls", + "db": "database_mongodbs", "input_column": "id", "input_value": "id", "isList": false, @@ -11778,13 +12494,13 @@ "id", "description" ], - "formatEN": "The description of the mysql database [name] is modified =\u003e [description]", - "formatZH": "mysql 数据库 [name] 描述信息修改 [description]", + "formatEN": "The description of the mongodb database [name] is modified =\u003e [description]", + "formatZH": "mongodb 数据库 [name] 描述信息修改 [description]", "paramKeys": [] } } }, - "/databases/format/options": { + "/databases/mongodb/load": { "post": { "consumes": [ "application/json" @@ -11796,7 +12512,87 @@ "name": "request", "required": true, "schema": { - "$ref": "#/definitions/dto.OperationWithName" + "$ref": "#/definitions/dto.MongodbLoadDB" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load mongodb database from remote", + "tags": [ + "Database Mongodb" + ] + } + }, + "/databases/mongodb/password": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbPassword" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Change mongodb database password", + "tags": [ + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "database", + "name" + ], + "formatEN": "update mongodb database [database] [name] password", + "formatZH": "更新 mongodb 数据库 [database] [name] 密码", + "paramKeys": [] + } + } + }, + "/databases/mongodb/privileges": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbPrivilegesLoad" } } ], @@ -11804,10 +12600,7 @@ "200": { "description": "OK", "schema": { - "items": { - "$ref": "#/definitions/dto.MysqlFormatCollationOption" - }, - "type": "array" + "type": "string" } } }, @@ -11819,13 +12612,13 @@ "Timestamp": [] } ], - "summary": "List mysql database format collation options", + "summary": "Load mongodb privileges", "tags": [ - "Database Mysql" + "Database Mongodb" ] } }, - "/databases/load": { + "/databases/mongodb/privileges/change": { "post": { "consumes": [ "application/json" @@ -11837,7 +12630,7 @@ "name": "request", "required": true, "schema": { - "$ref": "#/definitions/dto.MysqlLoadDB" + "$ref": "#/definitions/dto.MongodbPrivileges" } } ], @@ -11854,9 +12647,101 @@ "Timestamp": [] } ], - "summary": "Load mysql database from remote", + "summary": "Change mongodb privileges", "tags": [ - "Database Mysql" + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "database", + "username" + ], + "formatEN": "update mongodb database [database] user [username] privileges", + "formatZH": "更新 mongodb 数据库 [database] 用户 [username] 权限", + "paramKeys": [] + } + } + }, + "/databases/mongodb/root/password": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ChangeDBInfo" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Change mongodb root password", + "tags": [ + "Database Mongodb" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "database" + ], + "formatEN": "update mongodb database [database] root password", + "formatZH": "更新 mongodb 数据库 [database] root 密码", + "paramKeys": [] + } + } + }, + "/databases/mongodb/search": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MongodbDBSearch" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Page mongodb databases", + "tags": [ + "Database Mongodb" ] } }, @@ -12767,6 +13652,45 @@ } } }, + "/files/ai-search": { + "post": { + "consumes": [ + "application/json" + ], + "description": "When file-management AI is enabled, returns mode=ai with summary and hits. When disabled, returns mode=grep with hits only. Scans file contents only. Supports match options, extension/size/time filters, and scan limits.", + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileAISearch" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileAISearchResult" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "File search: content grep + optional AI summary", + "tags": [ + "File" + ] + } + }, "/files/batch/check": { "post": { "consumes": [ @@ -13055,6 +13979,41 @@ } } }, + "/files/compress/stop": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileCompressStopReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Stop compress task", + "tags": [ + "File" + ] + } + }, "/files/content": { "post": { "consumes": [ @@ -13472,6 +14431,155 @@ ] } }, + "/files/history/content": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileHistoryContentReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileHistoryInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load file history content", + "tags": [ + "File" + ] + } + }, + "/files/history/del": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileHistoryDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete file history record", + "tags": [ + "File" + ] + } + }, + "/files/history/restore": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileHistoryRestoreReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Restore file history record", + "tags": [ + "File" + ] + } + }, + "/files/history/search": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileHistorySearchReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load file history list", + "tags": [ + "File" + ] + } + }, "/files/mode": { "post": { "consumes": [ @@ -14057,6 +15165,306 @@ ] } }, + "/files/share/check": { + "get": { + "parameters": [ + { + "description": "share code", + "in": "query", + "name": "code", + "required": true, + "type": "string" + }, + { + "description": "optional password", + "in": "query", + "name": "password", + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.Response" + } + } + }, + "summary": "Check file share code (no login)", + "tags": [ + "File" + ] + } + }, + "/files/share/create": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileShareCreate" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileShareInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Create temporary file share link", + "tags": [ + "File" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "path", + "expireMinutes" + ], + "formatEN": "Create file share [path]", + "formatZH": "创建文件分享 [path]", + "paramKeys": [] + } + } + }, + "/files/share/del": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.FilePath" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Delete file share by path", + "tags": [ + "File" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "path" + ], + "formatEN": "Close file share [path]", + "formatZH": "关闭文件分享 [path]", + "paramKeys": [] + } + } + }, + "/files/share/detail": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.FilePath" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileShareInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get file share detail by path", + "tags": [ + "File" + ] + } + }, + "/files/share/download": { + "get": { + "parameters": [ + { + "description": "share code", + "in": "query", + "name": "code", + "required": true, + "type": "string" + }, + { + "description": "optional password", + "in": "query", + "name": "password", + "type": "string" + } + ], + "produces": [ + "application/octet-stream" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "file" + } + } + }, + "summary": "Download file by share code (no login)", + "tags": [ + "File" + ] + } + }, + "/files/share/info": { + "get": { + "parameters": [ + { + "description": "share code", + "in": "query", + "name": "code", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileSharePublicInfo" + } + } + }, + "summary": "Get file share detail by code (no login)", + "tags": [ + "File" + ] + } + }, + "/files/share/qrcode": { + "get": { + "parameters": [ + { + "description": "share code", + "in": "query", + "name": "code", + "required": true, + "type": "string" + }, + { + "description": "operate node", + "in": "query", + "name": "operateNode", + "type": "string" + } + ], + "produces": [ + "image/png" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "file" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get file share QR code image", + "tags": [ + "File" + ] + } + }, + "/files/share/search": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "List file shares", + "tags": [ + "File" + ] + } + }, "/files/size": { "post": { "consumes": [ @@ -15364,41 +16772,6 @@ } } }, - "/hosts/monitor/gpu/search": { - "post": { - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/dto.MonitorGPUSearch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.MonitorGPUData" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Load monitor data", - "tags": [ - "Monitor" - ] - } - }, "/hosts/monitor/search": { "post": { "parameters": [ @@ -15966,7 +17339,332 @@ } } }, - "/hosts/tool": { + "/hosts/tool/config/get": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolTypeReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.HostToolConfig" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get tool config", + "tags": [ + "Host tool" + ] + } + }, + "/hosts/tool/config/set": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolConfigUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Update tool config", + "tags": [ + "Host tool" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "update [type] tool config", + "formatZH": "更新 [type] 主机工具配置文件 ", + "paramKeys": [] + } + } + }, + "/hosts/tool/init": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolCreate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Create Host tool Config", + "tags": [ + "Host tool" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "create [type] config", + "formatZH": "创建 [type] 配置", + "paramKeys": [] + } + } + }, + "/hosts/tool/operate": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolOperateReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Operate tool", + "tags": [ + "Host tool" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate", + "type" + ], + "formatEN": "[operate] [type]", + "formatZH": "[operate] [type] ", + "paramKeys": [] + } + } + }, + "/hosts/tool/status": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolTypeReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.HostToolRes" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get tool status", + "tags": [ + "Host tool" + ] + } + }, + "/hosts/tool/supervisor/process": { + "get": { + "consumes": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.SupervisorProcessConfig" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Get Supervisor process config", + "tags": [ + "Host tool" + ] + }, + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.SupervisorProcessConfig" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Create Supervisor process", + "tags": [ + "Host tool" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate" + ], + "formatEN": "[operate] process", + "formatZH": "[operate] 守护进程 ", + "paramKeys": [] + } + } + }, + "/hosts/tool/supervisor/process/file": { + "post": { + "consumes": [ + "application/json" + ], + "parameters": [ + { + "description": "request", + "in": "body", + "name": "request", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostSupervisorProcessFileOperateReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Operate Supervisor process config file", + "tags": [ + "Host tool" + ], + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate" + ], + "formatEN": "[operate] Supervisor Process Config file", + "formatZH": "[operate] Supervisor 进程文件 ", + "paramKeys": [] + } + } + }, + "/hosts/tool/supervisor/process/file/get": { "post": { "consumes": [ "application/json" @@ -15978,7 +17676,7 @@ "name": "request", "required": true, "schema": { - "$ref": "#/definitions/request.HostToolReq" + "$ref": "#/definitions/request.HostSupervisorProcessFileGetReq" } } ], @@ -15986,7 +17684,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.HostToolRes" + "type": "string" } } }, @@ -15998,123 +17696,24 @@ "Timestamp": [] } ], - "summary": "Get tool status", + "summary": "Get Supervisor process config file", "tags": [ "Host tool" ] } }, - "/hosts/tool/config": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolConfig" - } - } - ], + "/logs/system/files": { + "get": { "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.HostToolConfig" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Get tool config", - "tags": [ - "Host tool" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate" - ], - "formatEN": "[operate] tool config", - "formatZH": "[operate] 主机工具配置文件 ", - "paramKeys": [] - } - } - }, - "/hosts/tool/init": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolCreate" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Create Host tool Config", - "tags": [ - "Host tool" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "type" - ], - "formatEN": "create [type] config", - "formatZH": "创建 [type] 配置", - "paramKeys": [] - } - } - }, - "/hosts/tool/operate": { - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolReq" + "items": { + "type": "string" + }, + "type": "array" } } - ], - "responses": { - "200": { - "description": "OK" - } }, "security": [ { @@ -16124,32 +17723,19 @@ "Timestamp": [] } ], - "summary": "Operate tool", + "summary": "Load system log files", "tags": [ - "Host tool" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate", - "type" - ], - "formatEN": "[operate] [type]", - "formatZH": "[operate] [type] ", - "paramKeys": [] - } + "Logs" + ] } }, - "/hosts/tool/supervisor/process": { + "/logs/tasks/executing/count": { "get": { - "consumes": [ - "application/json" - ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/response.SupervisorProcessConfig" + "type": "integer" } } }, @@ -16161,59 +17747,14 @@ "Timestamp": [] } ], - "summary": "Get Supervisor process config", + "summary": "Get the number of executing tasks", "tags": [ - "Host tool" + "TaskLog" ] - }, - "post": { - "consumes": [ - "application/json" - ], - "parameters": [ - { - "description": "request", - "in": "body", - "name": "request", - "required": true, - "schema": { - "$ref": "#/definitions/request.SupervisorProcessConfig" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Create Supervisor process", - "tags": [ - "Host tool" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate" - ], - "formatEN": "[operate] process", - "formatZH": "[operate] 守护进程 ", - "paramKeys": [] - } } }, - "/hosts/tool/supervisor/process/file": { + "/logs/tasks/read": { "post": { - "consumes": [ - "application/json" - ], "parameters": [ { "description": "request", @@ -16221,7 +17762,7 @@ "name": "request", "required": true, "schema": { - "$ref": "#/definitions/request.SupervisorProcessFileReq" + "$ref": "#/definitions/request.TaskLogReadReq" } } ], @@ -16229,67 +17770,7 @@ "200": { "description": "OK", "schema": { - "type": "string" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Get Supervisor process config file", - "tags": [ - "Host tool" - ], - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate" - ], - "formatEN": "[operate] Supervisor Process Config file", - "formatZH": "[operate] Supervisor 进程文件 ", - "paramKeys": [] - } - } - }, - "/logs/system/files": { - "get": { - "responses": { - "200": { - "description": "OK", - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "summary": "Load system log files", - "tags": [ - "Logs" - ] - } - }, - "/logs/tasks/executing/count": { - "get": { - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "integer" + "$ref": "#/definitions/response.FileLineContent" } } }, @@ -16301,7 +17782,7 @@ "Timestamp": [] } ], - "summary": "Get the number of executing tasks", + "summary": "Read task log by Line", "tags": [ "TaskLog" ] @@ -18021,23 +19502,49 @@ ] } }, - "/settings/get/{key}": { - "get": { + "/settings/file-history/search": { + "post": { + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.FileHistorySettingInfo" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "summary": "Load file history setting info", + "tags": [ + "System Setting" + ] + } + }, + "/settings/file-history/update": { + "post": { + "consumes": [ + "application/json" + ], "parameters": [ { - "description": "key", - "in": "path", - "name": "key", + "description": "request", + "in": "body", + "name": "request", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/request.FileHistorySettingUpdate" + } } ], "responses": { "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.SettingInfo" - } + "description": "OK" } }, "security": [ @@ -18048,7 +19555,7 @@ "Timestamp": [] } ], - "summary": "Load system setting by key", + "summary": "Update file history setting", "tags": [ "System Setting" ] @@ -18642,7 +20149,7 @@ "name": "request", "required": true, "schema": { - "$ref": "#/definitions/dto.SettingUpdate" + "$ref": "#/definitions/dto.AgentSettingUpdate" } } ], @@ -24452,6 +25959,30 @@ ], "type": "object" }, + "dto.AgentChannelDeleteReq": { + "properties": { + "agentId": { + "type": "integer" + }, + "type": { + "enum": [ + "feishu", + "telegram", + "discord", + "wecom", + "qqbot", + "dingtalk", + "weixin" + ], + "type": "string" + } + }, + "required": [ + "agentId", + "type" + ], + "type": "object" + }, "dto.AgentChannelPairingApproveReq": { "properties": { "accountId": { @@ -24468,7 +25999,9 @@ "feishu", "telegram", "discord", - "wecom" + "wecom", + "qqbot", + "dingtalk" ], "type": "string" } @@ -24562,7 +26095,8 @@ "agentType": { "enum": [ "openclaw", - "copaw" + "copaw", + "hermes-agent" ], "type": "string" }, @@ -24624,6 +26158,8 @@ "type": "string" }, "webUIPort": { + "maximum": 65535, + "minimum": 1, "type": "integer" } }, @@ -24751,6 +26287,7 @@ }, "dmPolicy": { "enum": [ + "pairing", "allowlist", "open", "disabled" @@ -24819,6 +26356,12 @@ }, "dto.AgentDiscordConfig": { "properties": { + "allowFrom": { + "items": { + "type": "string" + }, + "type": "array" + }, "bots": { "items": { "$ref": "#/definitions/dto.AgentDiscordBot" @@ -24839,6 +26382,9 @@ }, "proxy": { "type": "string" + }, + "requireMention": { + "type": "boolean" } }, "type": "object" @@ -24848,6 +26394,12 @@ "agentId": { "type": "integer" }, + "allowFrom": { + "items": { + "type": "string" + }, + "type": "array" + }, "bots": { "items": { "$ref": "#/definitions/dto.AgentDiscordBot" @@ -24874,6 +26426,9 @@ }, "proxy": { "type": "string" + }, + "requireMention": { + "type": "boolean" } }, "required": [ @@ -24925,6 +26480,12 @@ }, "type": "array" }, + "connectionMode": { + "type": "string" + }, + "domain": { + "type": "string" + }, "enabled": { "type": "boolean" }, @@ -24978,6 +26539,12 @@ "minItems": 1, "type": "array" }, + "connectionMode": { + "type": "string" + }, + "domain": { + "type": "string" + }, "enabled": { "type": "boolean" }, @@ -25022,6 +26589,63 @@ ], "type": "object" }, + "dto.AgentHermesChatSessionDeleteReq": { + "properties": { + "agentId": { + "type": "integer" + }, + "id": { + "type": "string" + } + }, + "required": [ + "agentId", + "id" + ], + "type": "object" + }, + "dto.AgentHermesChatSessionItem": { + "properties": { + "id": { + "type": "string" + }, + "lastActive": { + "type": "string" + }, + "messageCount": { + "type": "integer" + }, + "model": { + "type": "string" + }, + "startedAt": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "type": "object" + }, + "dto.AgentHermesChatSessionRenameReq": { + "properties": { + "agentId": { + "type": "integer" + }, + "id": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "required": [ + "agentId", + "id", + "title" + ], + "type": "object" + }, "dto.AgentIDReq": { "properties": { "agentId": { @@ -25118,6 +26742,9 @@ }, "websiteProtocol": { "type": "string" + }, + "websiteType": { + "type": "string" } }, "type": "object" @@ -25399,15 +27026,33 @@ }, "dto.AgentQQBotConfig": { "properties": { + "allowFrom": { + "items": { + "type": "string" + }, + "type": "array" + }, "bots": { "items": { "$ref": "#/definitions/dto.AgentQQBotBot" }, "type": "array" }, + "dmPolicy": { + "type": "string" + }, "enabled": { "type": "boolean" }, + "groupAllowFrom": { + "items": { + "type": "string" + }, + "type": "array" + }, + "groupPolicy": { + "type": "string" + }, "installed": { "type": "boolean" } @@ -25419,6 +27064,12 @@ "agentId": { "type": "integer" }, + "allowFrom": { + "items": { + "type": "string" + }, + "type": "array" + }, "bots": { "items": { "$ref": "#/definitions/dto.AgentQQBotBot" @@ -25426,8 +27077,20 @@ "minItems": 1, "type": "array" }, + "dmPolicy": { + "type": "string" + }, "enabled": { "type": "boolean" + }, + "groupAllowFrom": { + "items": { + "type": "string" + }, + "type": "array" + }, + "groupPolicy": { + "type": "string" } }, "required": [ @@ -25664,6 +27327,25 @@ ], "type": "object" }, + "dto.AgentSettingUpdate": { + "properties": { + "key": { + "enum": [ + "SystemIP", + "DockerSockPath", + "FileRecycleBin" + ], + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "key" + ], + "type": "object" + }, "dto.AgentSkillInstallReq": { "properties": { "agentId": { @@ -25676,7 +27358,9 @@ "enum": [ "clawhub-global", "clawhub-cn", - "skillhub" + "skillhub", + "official", + "skills-sh" ], "type": "string" }, @@ -25697,17 +27381,35 @@ "bundled": { "type": "boolean" }, + "category": { + "type": "string" + }, "description": { "type": "string" }, "disabled": { "type": "boolean" }, + "identifier": { + "type": "string" + }, "name": { "type": "string" }, "source": { "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "trust": { + "type": "string" + }, + "uninstallable": { + "type": "boolean" } }, "type": "object" @@ -25717,6 +27419,9 @@ "description": { "type": "string" }, + "identifier": { + "type": "string" + }, "name": { "type": "string" }, @@ -25732,6 +27437,9 @@ "summary": { "type": "string" }, + "trust": { + "type": "string" + }, "version": { "type": "string" } @@ -25750,7 +27458,9 @@ "enum": [ "clawhub-global", "clawhub-cn", - "skillhub" + "skillhub", + "official", + "skills-sh" ], "type": "string" } @@ -25762,6 +27472,21 @@ ], "type": "object" }, + "dto.AgentSkillUninstallReq": { + "properties": { + "agentId": { + "type": "integer" + }, + "name": { + "type": "string" + } + }, + "required": [ + "agentId", + "name" + ], + "type": "object" + }, "dto.AgentSkillUpdateReq": { "properties": { "agentId": { @@ -25844,6 +27569,9 @@ "proxy": { "type": "string" }, + "requireMention": { + "type": "boolean" + }, "streaming": { "type": "string" } @@ -25911,6 +27639,9 @@ "proxy": { "type": "string" }, + "requireMention": { + "type": "boolean" + }, "streaming": { "enum": [ "off", @@ -26045,6 +27776,14 @@ ], "type": "object" }, + "dto.AgentWeixinConfig": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, "dto.AgentWeixinLoginReq": { "properties": { "agentId": { @@ -26069,7 +27808,7 @@ "type": "string" }, "apiKeyValidityTime": { - "type": "string" + "type": "integer" }, "ipWhiteList": { "type": "string" @@ -26539,6 +28278,7 @@ "mariadb", "postgresql", "redis", + "mongodb", "mysql-cluster", "postgresql-cluster", "redis-cluster" @@ -26985,6 +28725,7 @@ "redis", "website", "postgresql", + "mongodb", "mysql-cluster", "postgresql-cluster", "redis-cluster", @@ -27034,6 +28775,9 @@ "downloadAccountID": { "type": "integer" }, + "dropAllCollections": { + "type": "boolean" + }, "file": { "type": "string" }, @@ -27057,6 +28801,7 @@ "redis", "website", "postgresql", + "mongodb", "mysql-cluster", "postgresql-cluster", "redis-cluster", @@ -28051,6 +29796,75 @@ ], "type": "object" }, + "dto.CurrentUserInfo": { + "properties": { + "apiInterfaceStatus": { + "type": "string" + }, + "apiKey": { + "type": "string" + }, + "apiKeyValidityTime": { + "type": "integer" + }, + "complexitySetting": { + "type": "string" + }, + "expirationDays": { + "type": "integer" + }, + "expirationTime": { + "type": "string" + }, + "ipWhiteList": { + "type": "string" + }, + "mfaInterval": { + "type": "integer" + }, + "mfaStatus": { + "type": "string" + }, + "name": { + "type": "string" + }, + "sessionTimeout": { + "type": "integer" + } + }, + "type": "object" + }, + "dto.CurrentUserUpdate": { + "properties": { + "expirationDays": { + "maximum": 60, + "minimum": 0, + "type": "integer" + }, + "expirationTime": { + "type": "string" + }, + "name": { + "type": "string" + }, + "oldPassword": { + "type": "string" + }, + "password": { + "type": "string" + }, + "sessionTimeout": { + "maximum": 864000, + "minimum": 300, + "type": "integer" + } + }, + "required": [ + "name", + "sessionTimeout" + ], + "type": "object" + }, "dto.DBBaseInfo": { "properties": { "containerName": { @@ -29736,6 +31550,44 @@ ], "type": "object" }, + "dto.LoginSetting": { + "properties": { + "isDemo": { + "type": "boolean" + }, + "isEnterprise": { + "type": "boolean" + }, + "isFxplay": { + "type": "boolean" + }, + "isIntl": { + "type": "boolean" + }, + "isOffline": { + "type": "boolean" + }, + "language": { + "type": "string" + }, + "menuTabs": { + "type": "string" + }, + "needCaptcha": { + "type": "boolean" + }, + "panelName": { + "type": "string" + }, + "passkeySetting": { + "type": "boolean" + }, + "theme": { + "type": "string" + } + }, + "type": "object" + }, "dto.MFALogin": { "properties": { "code": { @@ -29766,7 +31618,7 @@ "type": "string" }, "interval": { - "type": "string" + "type": "integer" }, "secret": { "type": "string" @@ -29779,6 +31631,255 @@ ], "type": "object" }, + "dto.MongodbBind": { + "properties": { + "database": { + "type": "string" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "database", + "name", + "password", + "username" + ], + "type": "object" + }, + "dto.MongodbDBCreate": { + "properties": { + "database": { + "type": "string" + }, + "description": { + "type": "string" + }, + "from": { + "enum": [ + "local", + "remote" + ], + "type": "string" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "permission": { + "enum": [ + "dbOwner", + "read", + "readWrite", + "userAdmin" + ], + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "database", + "from", + "name", + "password", + "permission", + "username" + ], + "type": "object" + }, + "dto.MongodbDBDelete": { + "properties": { + "database": { + "type": "string" + }, + "deleteBackup": { + "type": "boolean" + }, + "forceDelete": { + "type": "boolean" + }, + "id": { + "type": "integer" + }, + "type": { + "enum": [ + "mongodb" + ], + "type": "string" + } + }, + "required": [ + "database", + "id", + "type" + ], + "type": "object" + }, + "dto.MongodbDBDeleteCheck": { + "properties": { + "database": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "type": { + "enum": [ + "mongodb" + ], + "type": "string" + } + }, + "required": [ + "database", + "id", + "type" + ], + "type": "object" + }, + "dto.MongodbDBSearch": { + "properties": { + "database": { + "type": "string" + }, + "info": { + "type": "string" + }, + "order": { + "enum": [ + "null", + "ascending", + "descending" + ], + "type": "string" + }, + "orderBy": { + "enum": [ + "name", + "createdAt" + ], + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + } + }, + "required": [ + "database", + "order", + "orderBy", + "page", + "pageSize" + ], + "type": "object" + }, + "dto.MongodbLoadDB": { + "properties": { + "database": { + "type": "string" + }, + "from": { + "enum": [ + "local", + "remote" + ], + "type": "string" + }, + "type": { + "enum": [ + "mongodb" + ], + "type": "string" + } + }, + "required": [ + "database", + "from", + "type" + ], + "type": "object" + }, + "dto.MongodbPassword": { + "properties": { + "database": { + "type": "string" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "required": [ + "database", + "name", + "password" + ], + "type": "object" + }, + "dto.MongodbPrivileges": { + "properties": { + "database": { + "type": "string" + }, + "name": { + "type": "string" + }, + "permission": { + "enum": [ + "dbOwner", + "read", + "readWrite", + "userAdmin" + ], + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "database", + "name", + "permission", + "username" + ], + "type": "object" + }, + "dto.MongodbPrivilegesLoad": { + "properties": { + "database": { + "type": "string" + }, + "name": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "database", + "name", + "username" + ], + "type": "object" + }, "dto.MonitorData": { "properties": { "date": { @@ -31645,6 +33746,18 @@ }, "type": "object" }, + "dto.Response": { + "properties": { + "code": { + "type": "integer" + }, + "data": {}, + "message": { + "type": "string" + } + }, + "type": "object" + }, "dto.RootCertOperate": { "properties": { "description": { @@ -32163,6 +34276,9 @@ "status": { "type": "string" }, + "taskID": { + "type": "string" + }, "type": { "type": "string" } @@ -32191,6 +34307,71 @@ ], "type": "object" }, + "dto.SettingBaseInfo": { + "properties": { + "bindAddress": { + "type": "string" + }, + "complexityVerification": { + "type": "string" + }, + "dashboardMemoVisible": { + "type": "string" + }, + "dashboardSimpleNodeVisible": { + "type": "string" + }, + "developerMode": { + "type": "string" + }, + "docSource": { + "type": "string" + }, + "edition": { + "type": "string" + }, + "hideMenu": { + "type": "string" + }, + "ipv6": { + "type": "string" + }, + "language": { + "type": "string" + }, + "menuTabs": { + "type": "string" + }, + "noAuthSetting": { + "type": "string" + }, + "panelName": { + "type": "string" + }, + "port": { + "type": "string" + }, + "proxyType": { + "type": "string" + }, + "securityEntrance": { + "type": "string" + }, + "serverPort": { + "type": "string" + }, + "systemVersion": { + "type": "string" + }, + "theme": { + "type": "string" + }, + "upgradeBackupCopies": { + "type": "string" + } + }, + "type": "object" + }, "dto.SettingInfo": { "properties": { "appStoreLastModified": { @@ -32223,6 +34404,9 @@ "lastCleanTime": { "type": "string" }, + "localSSHConnShow": { + "type": "string" + }, "localTime": { "type": "string" }, @@ -32499,20 +34683,6 @@ ], "type": "object" }, - "dto.SystemSetting": { - "properties": { - "isDemo": { - "type": "boolean" - }, - "isIntl": { - "type": "boolean" - }, - "language": { - "type": "string" - } - }, - "type": "object" - }, "dto.Tag": { "properties": { "key": { @@ -32699,6 +34869,9 @@ "name": { "type": "string" }, + "role": { + "type": "string" + }, "token": { "type": "string" } @@ -32834,6 +35007,9 @@ "path": { "type": "string" }, + "shareCode": { + "type": "string" + }, "size": { "type": "integer" }, @@ -34200,6 +36376,77 @@ ], "type": "object" }, + "request.FileAISearch": { + "properties": { + "containSub": { + "type": "boolean" + }, + "contentHitsPromptMaxBytes": { + "type": "integer" + }, + "extensions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "llmMaxOutputTokens": { + "type": "integer" + }, + "matchCase": { + "type": "boolean" + }, + "maxFileBytes": { + "type": "integer" + }, + "maxHitsPerFile": { + "type": "integer" + }, + "maxItems": { + "maximum": 2000, + "minimum": 1, + "type": "integer" + }, + "maxScanFiles": { + "type": "integer" + }, + "maxSize": { + "type": "integer" + }, + "maxTotalHits": { + "type": "integer" + }, + "minSize": { + "type": "integer" + }, + "modifiedAfter": { + "type": "string" + }, + "modifiedBefore": { + "type": "string" + }, + "path": { + "type": "string" + }, + "query": { + "type": "string" + }, + "responseLanguage": { + "type": "string" + }, + "useRegex": { + "type": "boolean" + }, + "wholeWord": { + "type": "boolean" + } + }, + "required": [ + "path", + "query" + ], + "type": "object" + }, "request.FileBatchDelete": { "properties": { "isDir": { @@ -34237,6 +36484,9 @@ "secret": { "type": "string" }, + "taskID": { + "type": "string" + }, "type": { "type": "string" } @@ -34249,6 +36499,17 @@ ], "type": "object" }, + "request.FileCompressStopReq": { + "properties": { + "taskID": { + "type": "string" + } + }, + "required": [ + "taskID" + ], + "type": "object" + }, "request.FileContentReq": { "properties": { "isDetail": { @@ -34403,6 +36664,96 @@ ], "type": "object" }, + "request.FileHistoryContentReq": { + "properties": { + "id": { + "type": "integer" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "request.FileHistoryDeleteReq": { + "properties": { + "ids": { + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "ids" + ], + "type": "object" + }, + "request.FileHistoryRestoreReq": { + "properties": { + "id": { + "type": "integer" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "request.FileHistorySearchReq": { + "properties": { + "operation": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "scope": { + "enum": [ + "current", + "all" + ], + "type": "string" + } + }, + "required": [ + "page", + "pageSize", + "scope" + ], + "type": "object" + }, + "request.FileHistorySettingUpdate": { + "properties": { + "diskQuotaMB": { + "maximum": 1048576, + "minimum": 0, + "type": "integer" + }, + "enable": { + "enum": [ + "Enable", + "Disable" + ], + "type": "string" + }, + "maxPerPath": { + "maximum": 1000, + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "enable" + ], + "type": "object" + }, "request.FileMove": { "properties": { "cover": { @@ -34645,6 +36996,25 @@ ], "type": "object" }, + "request.FileShareCreate": { + "properties": { + "expireMinutes": { + "maximum": 10080, + "minimum": 0, + "type": "integer" + }, + "password": { + "type": "string" + }, + "path": { + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, "request.FileWget": { "properties": { "ignoreCertificate": { @@ -34667,17 +37037,61 @@ ], "type": "object" }, - "request.HostToolConfig": { + "request.HostSupervisorProcessFileGetReq": { + "properties": { + "file": { + "enum": [ + "out.log", + "err.log", + "config" + ], + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "file", + "name" + ], + "type": "object" + }, + "request.HostSupervisorProcessFileOperateReq": { "properties": { "content": { "type": "string" }, + "file": { + "enum": [ + "out.log", + "err.log", + "config" + ], + "type": "string" + }, + "name": { + "type": "string" + }, "operate": { "enum": [ - "get", - "set" + "clear", + "update" ], "type": "string" + } + }, + "required": [ + "file", + "name", + "operate" + ], + "type": "object" + }, + "request.HostToolConfigUpdate": { + "properties": { + "content": { + "type": "string" }, "type": { "enum": [ @@ -34708,11 +37122,10 @@ ], "type": "object" }, - "request.HostToolReq": { + "request.HostToolOperateReq": { "properties": { "operate": { "enum": [ - "status", "restart", "start", "stop" @@ -34726,6 +37139,21 @@ "type": "string" } }, + "required": [ + "operate", + "type" + ], + "type": "object" + }, + "request.HostToolTypeReq": { + "properties": { + "type": { + "enum": [ + "supervisord" + ], + "type": "string" + } + }, "required": [ "type" ], @@ -35982,35 +38410,35 @@ }, "type": "object" }, - "request.SupervisorProcessFileReq": { + "request.TaskLogReadReq": { "properties": { - "content": { - "type": "string" + "latest": { + "type": "boolean" }, - "file": { - "enum": [ - "out.log", - "err.log", - "config" - ], + "page": { + "minimum": 1, + "type": "integer" + }, + "pageSize": { + "minimum": 1, + "type": "integer" + }, + "resourceID": { + "type": "integer" + }, + "taskID": { "type": "string" }, - "name": { + "taskOperate": { "type": "string" }, - "operate": { - "enum": [ - "get", - "clear", - "update" - ], + "taskType": { "type": "string" } }, "required": [ - "file", - "name", - "operate" + "page", + "pageSize" ], "type": "object" }, @@ -36927,9 +39355,6 @@ "ID": { "type": "integer" }, - "disableLog": { - "type": "boolean" - }, "nameservers": { "items": { "type": "string" @@ -37905,6 +40330,140 @@ }, "type": "object" }, + "response.FileAIContentHit": { + "properties": { + "line": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "text": { + "type": "string" + } + }, + "type": "object" + }, + "response.FileAISearchResult": { + "properties": { + "completionTokens": { + "type": "integer" + }, + "contentHitsTruncated": { + "type": "boolean" + }, + "contentScannedFiles": { + "type": "integer" + }, + "duration": { + "type": "string" + }, + "hits": { + "items": { + "$ref": "#/definitions/response.FileAIContentHit" + }, + "type": "array" + }, + "itemCount": { + "type": "integer" + }, + "mode": { + "type": "string" + }, + "preFiltered": { + "type": "boolean" + }, + "promptTokens": { + "type": "integer" + }, + "summary": { + "type": "string" + }, + "totalTokens": { + "type": "integer" + }, + "truncated": { + "type": "boolean" + } + }, + "type": "object" + }, + "response.FileHistoryInfo": { + "properties": { + "content": { + "type": "string" + }, + "contentSHA": { + "type": "string" + }, + "contentSize": { + "type": "integer" + }, + "createdAt": { + "type": "string" + }, + "currentContent": { + "type": "string" + }, + "currentPath": { + "type": "string" + }, + "deleted": { + "type": "boolean" + }, + "extension": { + "type": "string" + }, + "fileId": { + "type": "string" + }, + "fileMode": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "operation": { + "type": "string" + }, + "path": { + "type": "string" + }, + "previousId": { + "type": "integer" + }, + "sourcePath": { + "type": "string" + }, + "storagePath": { + "type": "string" + }, + "targetPath": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + }, + "type": "object" + }, + "response.FileHistorySettingInfo": { + "properties": { + "diskQuotaMB": { + "type": "integer" + }, + "enable": { + "type": "string" + }, + "maxPerPath": { + "type": "integer" + } + }, + "type": "object" + }, "response.FileInfo": { "properties": { "content": { @@ -37961,6 +40520,9 @@ "path": { "type": "string" }, + "shareCode": { + "type": "string" + }, "size": { "type": "integer" }, @@ -38019,6 +40581,49 @@ }, "type": "object" }, + "response.FileShareInfo": { + "properties": { + "code": { + "type": "string" + }, + "expiresAt": { + "type": "integer" + }, + "fileName": { + "type": "string" + }, + "hasPassword": { + "type": "boolean" + }, + "password": { + "type": "string" + }, + "path": { + "type": "string" + }, + "permanent": { + "type": "boolean" + } + }, + "type": "object" + }, + "response.FileSharePublicInfo": { + "properties": { + "expiresAt": { + "type": "integer" + }, + "fileName": { + "type": "string" + }, + "hasPassword": { + "type": "boolean" + }, + "permanent": { + "type": "boolean" + } + }, + "type": "object" + }, "response.FileTree": { "properties": { "children": { diff --git a/core/cmd/server/docs/swagger_test.go b/core/cmd/server/docs/swagger_test.go index e973c87598ef..f9bd22dbd9f4 100644 --- a/core/cmd/server/docs/swagger_test.go +++ b/core/cmd/server/docs/swagger_test.go @@ -8,16 +8,21 @@ import ( "go/token" "os" "os/exec" - "path" + "path/filepath" "strings" "testing" ) func TestGenerateXlog(t *testing.T) { - workDir := "/usr/songliu/dev-v2/1Panel" + workDir := panelWorkDir(t) fset := token.NewFileSet() - apiDirs := []string{workDir + "/agent/app/api/v2", workDir + "/core/app/api/v2", workDir + "/agent/xpack/app/api/v2", workDir + "/core/xpack/app/api/v2"} + apiDirs := []string{ + filepath.Join(workDir, "agent/app/api/v2"), + filepath.Join(workDir, "core/app/api/v2"), + filepath.Join(workDir, "agent/xpack/app/api/v2"), + filepath.Join(workDir, "core/xpack/app/api/v2"), + } xlogMap := make(map[string]operationJson) for _, dir := range apiDirs { @@ -26,7 +31,7 @@ func TestGenerateXlog(t *testing.T) { if info.IsDir() { continue } - fileItem, err := parser.ParseFile(fset, path.Join(dir, info.Name()), nil, parser.ParseComments) + fileItem, err := parser.ParseFile(fset, filepath.Join(dir, info.Name()), nil, parser.ParseComments) if err != nil { continue } @@ -64,23 +69,23 @@ func TestGenerateXlog(t *testing.T) { if err := os.WriteFile("x-log.json", newJson, 0640); err != nil { panic(fmt.Sprintf("write core x-log.json failed, err: %v", err)) } - if err := os.WriteFile(workDir+"/agent/cmd/server/docs/x-log.json", newJson, 0640); err != nil { + if err := os.WriteFile(filepath.Join(workDir, "agent/cmd/server/docs/x-log.json"), newJson, 0640); err != nil { panic(fmt.Sprintf("write agent x-log.json failed, err: %v", err)) } } func TestGenerateSwaggerDoc(t *testing.T) { - workDir := "/usr/songliu/dev-v2/1Panel" - swagBin := "/root/go/bin/swag" + workDir := panelWorkDir(t) + swagBin := swagBin(t) - cmd1 := exec.Command(swagBin, "init", "-o", workDir+"/core/cmd/server/docs/docs_agent", "-d", workDir+"/agent", "-g", "../agent/cmd/server/main.go") + cmd1 := exec.Command(swagBin, "init", "-o", filepath.Join(workDir, "core/cmd/server/docs/docs_agent"), "-d", filepath.Join(workDir, "agent"), "-g", "../agent/cmd/server/main.go") cmd1.Dir = workDir std1, err := cmd1.CombinedOutput() if err != nil { fmt.Printf("generate swagger doc of agent failed, std1: %v, err: %v", string(std1), err) return } - cmd2 := exec.Command(swagBin, "init", "-o", workDir+"/core/cmd/server/docs/docs_core", "-d", workDir+"/core", "-g", "./cmd/server/main.go") + cmd2 := exec.Command(swagBin, "init", "-o", filepath.Join(workDir, "core/cmd/server/docs/docs_core"), "-d", filepath.Join(workDir, "core"), "-g", "./cmd/server/main.go") cmd2.Dir = workDir std2, err := cmd2.CombinedOutput() if err != nil { @@ -88,7 +93,7 @@ func TestGenerateSwaggerDoc(t *testing.T) { return } - agentJson := workDir + "/core/cmd/server/docs/docs_agent/swagger.json" + agentJson := filepath.Join(workDir, "core/cmd/server/docs/docs_agent/swagger.json") agentFile, err := os.ReadFile(agentJson) if err != nil { fmt.Printf("read file docs_agent failed, err: %v", err) @@ -100,7 +105,7 @@ func TestGenerateSwaggerDoc(t *testing.T) { return } - coreJson := workDir + "/core/cmd/server/docs/docs_core/swagger.json" + coreJson := filepath.Join(workDir, "core/cmd/server/docs/docs_core/swagger.json") coreFile, err := os.ReadFile(coreJson) if err != nil { fmt.Printf("read file docs_core failed, err: %v", err) @@ -142,13 +147,37 @@ func TestGenerateSwaggerDoc(t *testing.T) { return } docTemplate := strings.ReplaceAll(loadDefaultDocs(), "const docTemplate = \"aa\"", fmt.Sprintf("const docTemplate = `%s`", string(newJson))) - if err := os.WriteFile(workDir+"/core/cmd/server/docs/docs.go", []byte(docTemplate), 0640); err != nil { + if err := os.WriteFile(filepath.Join(workDir, "core/cmd/server/docs/docs.go"), []byte(docTemplate), 0640); err != nil { fmt.Printf("write new docs.go failed, err: %v", err) return } - _ = os.RemoveAll(workDir + "/core/cmd/server/docs/docs_agent") - _ = os.RemoveAll(workDir + "/core/cmd/server/docs/docs_core") + _ = os.RemoveAll(filepath.Join(workDir, "core/cmd/server/docs/docs_agent")) + _ = os.RemoveAll(filepath.Join(workDir, "core/cmd/server/docs/docs_core")) +} + +func panelWorkDir(t *testing.T) string { + t.Helper() + + wd, err := os.Getwd() + if err != nil { + t.Fatalf("get current work dir failed: %v", err) + } + workDir, err := filepath.Abs(filepath.Join(wd, "../../../..")) + if err != nil { + t.Fatalf("resolve 1Panel work dir failed: %v", err) + } + return workDir +} + +func swagBin(t *testing.T) string { + t.Helper() + + swagBin, err := exec.LookPath("swag") + if err != nil { + t.Skip("swag is not installed or not in PATH") + } + return swagBin } type Swagger struct { diff --git a/core/cmd/server/docs/x-log.json b/core/cmd/server/docs/x-log.json index f13e74089fbc..a8099fc87b5f 100644 --- a/core/cmd/server/docs/x-log.json +++ b/core/cmd/server/docs/x-log.json @@ -690,6 +690,43 @@ "formatZH": "删除容器存储卷 [names]", "formatEN": "delete container volume [names]" }, + "/core/auth/api/generate": { + "bodyKeys": [], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "生成 API 接口密钥", + "formatEN": "generate api key" + }, + "/core/auth/api/update": { + "bodyKeys": [ + "ipWhiteList" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "更新 API 接口配置 =\u003e IP 白名单: [ipWhiteList]", + "formatEN": "update api config =\u003e IP White List: [ipWhiteList]" + }, + "/core/auth/expired/reset": { + "bodyKeys": [], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "重置过期密码", + "formatEN": "reset an expired Password" + }, + "/core/auth/mfa/bind": { + "bodyKeys": [], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "mfa 绑定", + "formatEN": "bind mfa" + }, + "/core/auth/mfa/close": { + "bodyKeys": [], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "mfa 关闭", + "formatEN": "close mfa" + }, "/core/backups": { "bodyKeys": [ "type" @@ -814,63 +851,6 @@ "formatZH": "更新组 [name][type]", "formatEN": "update group [name][type]" }, - "/core/hosts": { - "bodyKeys": [ - "name", - "addr" - ], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "创建主机 [name][addr]", - "formatEN": "create host [name][addr]" - }, - "/core/hosts/del": { - "bodyKeys": [ - "ids" - ], - "paramKeys": [], - "beforeFunctions": [ - { - "input_column": "id", - "input_value": "ids", - "isList": true, - "db": "hosts", - "output_column": "addr", - "output_value": "addrs" - } - ], - "formatZH": "删除主机 [addrs]", - "formatEN": "delete host [addrs]" - }, - "/core/hosts/update": { - "bodyKeys": [ - "name", - "addr" - ], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "更新主机信息 [name][addr]", - "formatEN": "update host [name][addr]" - }, - "/core/hosts/update/group": { - "bodyKeys": [ - "id", - "group" - ], - "paramKeys": [], - "beforeFunctions": [ - { - "input_column": "id", - "input_value": "id", - "isList": false, - "db": "hosts", - "output_column": "addr", - "output_value": "addr" - } - ], - "formatZH": "切换主机[addr]分组 =\u003e [group]", - "formatEN": "change host [addr] group =\u003e [group]" - }, "/core/licenses/add": { "bodyKeys": [], "paramKeys": [], @@ -981,22 +961,6 @@ "formatZH": "更新脚本库脚本 [name]", "formatEN": "update script [name]" }, - "/core/settings/api/config/generate/key": { - "bodyKeys": [], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "生成 API 接口密钥", - "formatEN": "generate api key" - }, - "/core/settings/api/config/update": { - "bodyKeys": [ - "ipWhiteList" - ], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "更新 API 接口配置 =\u003e IP 白名单: [ipWhiteList]", - "formatEN": "update api config =\u003e IP White List: [ipWhiteList]" - }, "/core/settings/bind/update": { "bodyKeys": [ "ipv6", @@ -1007,13 +971,6 @@ "formatZH": "修改系统监听信息 =\u003e ipv6: [ipv6], 监听 IP: [bindAddress]", "formatEN": "update system bind info =\u003e ipv6: [ipv6], 监听 IP: [bindAddress]" }, - "/core/settings/expired/handle": { - "bodyKeys": [], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "重置过期密码", - "formatEN": "reset an expired Password" - }, "/core/settings/memo": { "bodyKeys": [], "paramKeys": [], @@ -1035,20 +992,6 @@ "formatZH": "隐藏高级功能菜单", "formatEN": "Hide advanced feature menu." }, - "/core/settings/mfa/bind": { - "bodyKeys": [], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "mfa 绑定", - "formatEN": "bind mfa" - }, - "/core/settings/password/update": { - "bodyKeys": [], - "paramKeys": [], - "beforeFunctions": [], - "formatZH": "修改系统密码", - "formatEN": "update system password" - }, "/core/settings/port/update": { "bodyKeys": [ "serverPort" @@ -1582,6 +1525,92 @@ "formatZH": "mysql 数据库 [name] 描述信息修改 [description]", "formatEN": "The description of the mysql database [name] is modified =\u003e [description]" }, + "/databases/mongodb": { + "bodyKeys": [ + "name" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "创建 mongodb 数据库 [name]", + "formatEN": "create mongodb database [name]" + }, + "/databases/mongodb/bind": { + "bodyKeys": [ + "database", + "name", + "username" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "绑定 mongodb 数据库 [database] [name] 用户 [username]", + "formatEN": "bind mongodb database [database] [name] user [username]" + }, + "/databases/mongodb/del": { + "bodyKeys": [ + "id" + ], + "paramKeys": [], + "beforeFunctions": [ + { + "input_column": "id", + "input_value": "id", + "isList": false, + "db": "database_mongodbs", + "output_column": "name", + "output_value": "name" + } + ], + "formatZH": "删除 mongodb 数据库 [name]", + "formatEN": "delete mongodb database [name]" + }, + "/databases/mongodb/description": { + "bodyKeys": [ + "id", + "description" + ], + "paramKeys": [], + "beforeFunctions": [ + { + "input_column": "id", + "input_value": "id", + "isList": false, + "db": "database_mongodbs", + "output_column": "name", + "output_value": "name" + } + ], + "formatZH": "mongodb 数据库 [name] 描述信息修改 [description]", + "formatEN": "The description of the mongodb database [name] is modified =\u003e [description]" + }, + "/databases/mongodb/password": { + "bodyKeys": [ + "database", + "name" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "更新 mongodb 数据库 [database] [name] 密码", + "formatEN": "update mongodb database [database] [name] password" + }, + "/databases/mongodb/privileges/change": { + "bodyKeys": [ + "database", + "username" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "更新 mongodb 数据库 [database] 用户 [username] 权限", + "formatEN": "update mongodb database [database] user [username] privileges" + }, + "/databases/mongodb/root/password": { + "bodyKeys": [ + "database" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "更新 mongodb 数据库 [database] root 密码", + "formatEN": "update mongodb database [database] root password" + }, "/databases/pg": { "bodyKeys": [ "name" @@ -1880,6 +1909,25 @@ "formatZH": "更新文件内容 [path]", "formatEN": "Update file content [path]" }, + "/files/share/create": { + "bodyKeys": [ + "path", + "expireMinutes" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "创建文件分享 [path]", + "formatEN": "Create file share [path]" + }, + "/files/share/del": { + "bodyKeys": [ + "path" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "关闭文件分享 [path]", + "formatEN": "Close file share [path]" + }, "/files/size": { "bodyKeys": [ "path" @@ -1910,6 +1958,15 @@ "formatZH": "下载 url =\u003e [path]/[name]", "formatEN": "Download url =\u003e [path]/[name]" }, + "/files/wget/stop": { + "bodyKeys": [ + "key" + ], + "paramKeys": [], + "beforeFunctions": [], + "formatZH": "停止下载任务 [key]", + "formatEN": "Stop wget task [key]" + }, "/groups": { "bodyKeys": [ "name", @@ -2115,14 +2172,14 @@ "formatZH": "修改 SSH 配置 [key] =\u003e [newValue]", "formatEN": "update SSH setting [key] =\u003e [newValue]" }, - "/hosts/tool/config": { + "/hosts/tool/config/set": { "bodyKeys": [ - "operate" + "type" ], "paramKeys": [], "beforeFunctions": [], - "formatZH": "[operate] 主机工具配置文件 ", - "formatEN": "[operate] tool config" + "formatZH": "更新 [type] 主机工具配置文件 ", + "formatEN": "update [type] tool config" }, "/hosts/tool/init": { "bodyKeys": [ diff --git a/frontend/src/api/interface/host-tool.ts b/frontend/src/api/interface/host-tool.ts index dc609216bc3a..0be8850e67d4 100644 --- a/frontend/src/api/interface/host-tool.ts +++ b/frontend/src/api/interface/host-tool.ts @@ -17,9 +17,7 @@ export namespace HostTool { serviceName: string; } - export interface SupervisorConfig { - type: string; - operate: string; + export interface SupervisorConfigUpdate { content?: string; } @@ -59,6 +57,11 @@ export namespace HostTool { name: string; } + export interface ProcessFileGetReq { + name: string; + file: string; + } + export interface ProcessFileReq { operate: string; name: string; diff --git a/frontend/src/api/interface/setting.ts b/frontend/src/api/interface/setting.ts index 868664b5b008..5d194dec4f1a 100644 --- a/frontend/src/api/interface/setting.ts +++ b/frontend/src/api/interface/setting.ts @@ -25,6 +25,7 @@ export namespace Setting { appStoreSyncStatus: string; fileRecycleBin: string; + localSSHConnShow: string; } export interface SettingInfo { systemVersion: string; diff --git a/frontend/src/api/modules/ai.ts b/frontend/src/api/modules/ai.ts index 03b3aab3079a..c6fde896af2b 100644 --- a/frontend/src/api/modules/ai.ts +++ b/frontend/src/api/modules/ai.ts @@ -45,7 +45,7 @@ export const getGPUOptions = () => { return http.get(`/ai/gpu/options`); }; export const loadGPUMonitor = (param: AI.MonitorGPUSearch) => { - return http.post(`/ai/gpu/monitor/search`, param); + return http.post(`/ai/gpu/search`, param); }; export const pageMcpServer = (req: AI.McpServerSearch) => { diff --git a/frontend/src/api/modules/host-tool.ts b/frontend/src/api/modules/host-tool.ts index a4cfeb702d01..fd3fb8715830 100644 --- a/frontend/src/api/modules/host-tool.ts +++ b/frontend/src/api/modules/host-tool.ts @@ -3,19 +3,19 @@ import { HostTool } from '../interface/host-tool'; import { TimeoutEnum } from '@/enums/http-enum'; export const getSupervisorStatus = () => { - return http.post(`/hosts/tool`, { type: 'supervisord', operate: 'status' }); + return http.post(`/hosts/tool/status`, { type: 'supervisord' }); }; export const operateSupervisor = (operate: string) => { return http.post(`/hosts/tool/operate`, { type: 'supervisord', operate: operate }); }; -export const operateSupervisorConfig = (req: HostTool.SupervisorConfig) => { - return http.post(`/hosts/tool/config`, req); +export const getSupervisorConfig = () => { + return http.post(`/hosts/tool/config/get`, { type: 'supervisord' }); }; -export const getSupervisorLog = () => { - return http.post(`/hosts/tool/log`, { type: 'supervisord' }); +export const updateSupervisorConfig = (req: HostTool.SupervisorConfigUpdate) => { + return http.post(`/hosts/tool/config/set`, { type: 'supervisord', ...req }); }; export const initSupervisor = (req: HostTool.SupervisorInit) => { @@ -37,3 +37,7 @@ export const getSupervisorProcess = () => { export const operateSupervisorProcessFile = (req: HostTool.ProcessFileReq) => { return http.post(`/hosts/tool/supervisor/process/file`, req, TimeoutEnum.T_60S); }; + +export const getSupervisorProcessFile = (req: HostTool.ProcessFileGetReq) => { + return http.post(`/hosts/tool/supervisor/process/file/get`, req, TimeoutEnum.T_60S); +}; diff --git a/frontend/src/api/modules/setting.ts b/frontend/src/api/modules/setting.ts index b32b43adef93..63271ce33ba1 100644 --- a/frontend/src/api/modules/setting.ts +++ b/frontend/src/api/modules/setting.ts @@ -43,9 +43,6 @@ export const loadLicenseOptions = () => { export const listNodeOptions = (type: string) => { return http.post>(`/core/nodes/list`, { type: type }); }; -export const listAllNodes = () => { - return http.get>(`/core/nodes/all`); -}; export const listAllSimpleNodes = () => { return http.get>(`/core/nodes/simple/all`); }; @@ -107,9 +104,6 @@ export const getAgentFileHistoryInfo = () => { export const updateAgentFileHistoryInfo = (param: Setting.FileHistoryInfo) => { return http.post(`/settings/file-history/update`, param); }; -export const getAgentSettingByKey = (key: string) => { - return http.get(`/settings/get/${key}`); -}; export const updateCommonDescription = (param: Setting.CommonDescription) => { return http.post(`/settings/description/save`, param); }; diff --git a/frontend/src/components/docker-proxy/dialog.vue b/frontend/src/components/docker-proxy/dialog.vue index 1724b2c475a7..beb182b7ae9b 100644 --- a/frontend/src/components/docker-proxy/dialog.vue +++ b/frontend/src/components/docker-proxy/dialog.vue @@ -25,7 +25,7 @@