mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-09 23:17:21 +08:00
fix: 解决主机默认分组失败的问题 (#2839)
This commit is contained in:
parent
8adca0efa2
commit
d8588d06ce
11 changed files with 265 additions and 72 deletions
|
@ -9,7 +9,7 @@ type SSHUpdate struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type SSHInfo struct {
|
type SSHInfo struct {
|
||||||
AutoStart bool `json:"authStart"`
|
AutoStart bool `json:"autoStart"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
Port string `json:"port"`
|
Port string `json:"port"`
|
||||||
|
|
|
@ -15,7 +15,7 @@ type IGroupRepo interface {
|
||||||
Update(id uint, vars map[string]interface{}) error
|
Update(id uint, vars map[string]interface{}) error
|
||||||
Delete(opts ...DBOption) error
|
Delete(opts ...DBOption) error
|
||||||
CancelDefault(groupType string) error
|
CancelDefault(groupType string) error
|
||||||
WithByIsDefault(isDefault bool) DBOption
|
WithByHostDefault() DBOption
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewIGroupRepo() IGroupRepo {
|
func NewIGroupRepo() IGroupRepo {
|
||||||
|
@ -50,9 +50,9 @@ func (u *GroupRepo) Update(id uint, vars map[string]interface{}) error {
|
||||||
return global.DB.Model(&model.Group{}).Where("id = ?", id).Updates(vars).Error
|
return global.DB.Model(&model.Group{}).Where("id = ?", id).Updates(vars).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *GroupRepo) WithByIsDefault(isDefault bool) DBOption {
|
func (u *GroupRepo) WithByHostDefault() DBOption {
|
||||||
return func(g *gorm.DB) *gorm.DB {
|
return func(g *gorm.DB) *gorm.DB {
|
||||||
return g.Where("is_default = ?", isDefault)
|
return g.Where("is_default = ? AND type = ?", 1, "host")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -249,7 +249,7 @@ func (u *HostService) Create(req dto.HostOperate) (*dto.HostInfo, error) {
|
||||||
return nil, errors.WithMessage(constant.ErrStructTransform, err.Error())
|
return nil, errors.WithMessage(constant.ErrStructTransform, err.Error())
|
||||||
}
|
}
|
||||||
if req.GroupID == 0 {
|
if req.GroupID == 0 {
|
||||||
group, err := groupRepo.Get(groupRepo.WithByIsDefault(true))
|
group, err := groupRepo.Get(groupRepo.WithByHostDefault())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("get default group failed")
|
return nil, errors.New("get default group failed")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Package docs GENERATED BY SWAG; DO NOT EDIT
|
// Code generated by swaggo/swag. DO NOT EDIT.
|
||||||
// This file was generated by swaggo/swag
|
|
||||||
package docs
|
package docs
|
||||||
|
|
||||||
import "github.com/swaggo/swag"
|
import "github.com/swaggo/swag"
|
||||||
|
@ -5085,6 +5085,51 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/files/batch/role": {
|
||||||
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "批量修改文件权限和用户/组",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"File"
|
||||||
|
],
|
||||||
|
"summary": "Batch change file mode and owner",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "request",
|
||||||
|
"name": "request",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/request.FileRoleReq"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-panel-log": {
|
||||||
|
"BeforeFunctions": [],
|
||||||
|
"bodyKeys": [
|
||||||
|
"paths",
|
||||||
|
"mode",
|
||||||
|
"user",
|
||||||
|
"group"
|
||||||
|
],
|
||||||
|
"formatEN": "Batch change file mode and owner [paths] =\u003e [mode]/[user]/[group]",
|
||||||
|
"formatZH": "批量修改文件权限和用户/组 [paths] =\u003e [mode]/[user]/[group]",
|
||||||
|
"paramKeys": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/files/check": {
|
"/files/check": {
|
||||||
"post": {
|
"post": {
|
||||||
"security": [
|
"security": [
|
||||||
|
@ -15411,7 +15456,7 @@ const docTemplate = `{
|
||||||
"dto.SSHInfo": {
|
"dto.SSHInfo": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"authStart": {
|
"autoStart": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"listenAddress": {
|
"listenAddress": {
|
||||||
|
@ -15711,6 +15756,9 @@ const docTemplate = `{
|
||||||
"appStoreLastModified": {
|
"appStoreLastModified": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"appStoreSyncStatus": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"appStoreVersion": {
|
"appStoreVersion": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -16504,6 +16552,9 @@ const docTemplate = `{
|
||||||
"editCompose": {
|
"editCompose": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"hostMode": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"memoryLimit": {
|
"memoryLimit": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
|
@ -16652,6 +16703,9 @@ const docTemplate = `{
|
||||||
"editCompose": {
|
"editCompose": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"hostMode": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"installId": {
|
"installId": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
@ -16873,7 +16927,6 @@ const docTemplate = `{
|
||||||
"request.FileDownload": {
|
"request.FileDownload": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"compress",
|
|
||||||
"name",
|
"name",
|
||||||
"paths",
|
"paths",
|
||||||
"type"
|
"type"
|
||||||
|
@ -17019,12 +17072,40 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"request.FileRoleReq": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"group",
|
||||||
|
"mode",
|
||||||
|
"paths",
|
||||||
|
"user"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"group": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"mode": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sub": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"request.FileRoleUpdate": {
|
"request.FileRoleUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"group",
|
"group",
|
||||||
"path",
|
"path",
|
||||||
"sub",
|
|
||||||
"user"
|
"user"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -17163,6 +17244,9 @@ const docTemplate = `{
|
||||||
"editCompose": {
|
"editCompose": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"hostMode": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"memoryLimit": {
|
"memoryLimit": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
|
@ -17181,7 +17265,6 @@ const docTemplate = `{
|
||||||
"request.NginxAntiLeechUpdate": {
|
"request.NginxAntiLeechUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"enable",
|
|
||||||
"extends",
|
"extends",
|
||||||
"return",
|
"return",
|
||||||
"websiteID"
|
"websiteID"
|
||||||
|
@ -17276,7 +17359,6 @@ const docTemplate = `{
|
||||||
"request.NginxConfigFileUpdate": {
|
"request.NginxConfigFileUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"backup",
|
|
||||||
"content"
|
"content"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -17328,8 +17410,6 @@ const docTemplate = `{
|
||||||
"request.NginxRedirectReq": {
|
"request.NginxRedirectReq": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"enable",
|
|
||||||
"keepPath",
|
|
||||||
"name",
|
"name",
|
||||||
"operate",
|
"operate",
|
||||||
"redirect",
|
"redirect",
|
||||||
|
@ -17900,18 +17980,14 @@ const docTemplate = `{
|
||||||
"request.WebsiteDomainCreate": {
|
"request.WebsiteDomainCreate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"domain",
|
"domains",
|
||||||
"port",
|
"websiteID"
|
||||||
"websiteId"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"domain": {
|
"domains": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"port": {
|
"websiteID": {
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"websiteId": {
|
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17930,7 +18006,6 @@ const docTemplate = `{
|
||||||
"request.WebsiteHTTPSOp": {
|
"request.WebsiteHTTPSOp": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"enable",
|
|
||||||
"websiteId"
|
"websiteId"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -18102,7 +18177,6 @@ const docTemplate = `{
|
||||||
"request.WebsitePHPVersionReq": {
|
"request.WebsitePHPVersionReq": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"retainConfig",
|
|
||||||
"runtimeID",
|
"runtimeID",
|
||||||
"websiteID"
|
"websiteID"
|
||||||
],
|
],
|
||||||
|
@ -18121,10 +18195,8 @@ const docTemplate = `{
|
||||||
"request.WebsiteProxyConfig": {
|
"request.WebsiteProxyConfig": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"cache",
|
|
||||||
"cacheTime",
|
"cacheTime",
|
||||||
"cacheUnit",
|
"cacheUnit",
|
||||||
"enable",
|
|
||||||
"id",
|
"id",
|
||||||
"match",
|
"match",
|
||||||
"modifier",
|
"modifier",
|
||||||
|
@ -18207,7 +18279,6 @@ const docTemplate = `{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"acmeAccountId",
|
"acmeAccountId",
|
||||||
"autoRenew",
|
|
||||||
"primaryDomain",
|
"primaryDomain",
|
||||||
"provider"
|
"provider"
|
||||||
],
|
],
|
||||||
|
@ -18264,7 +18335,6 @@ const docTemplate = `{
|
||||||
"request.WebsiteSSLUpdate": {
|
"request.WebsiteSSLUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"autoRenew",
|
|
||||||
"id"
|
"id"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -18414,7 +18484,6 @@ const docTemplate = `{
|
||||||
"request.WebsiteWafUpdate": {
|
"request.WebsiteWafUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"enable",
|
|
||||||
"key",
|
"key",
|
||||||
"websiteId"
|
"websiteId"
|
||||||
],
|
],
|
||||||
|
@ -18531,6 +18600,9 @@ const docTemplate = `{
|
||||||
"enable": {
|
"enable": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"hostMode": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
|
|
@ -5078,6 +5078,51 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/files/batch/role": {
|
||||||
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"ApiKeyAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "批量修改文件权限和用户/组",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"File"
|
||||||
|
],
|
||||||
|
"summary": "Batch change file mode and owner",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "request",
|
||||||
|
"name": "request",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/request.FileRoleReq"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-panel-log": {
|
||||||
|
"BeforeFunctions": [],
|
||||||
|
"bodyKeys": [
|
||||||
|
"paths",
|
||||||
|
"mode",
|
||||||
|
"user",
|
||||||
|
"group"
|
||||||
|
],
|
||||||
|
"formatEN": "Batch change file mode and owner [paths] =\u003e [mode]/[user]/[group]",
|
||||||
|
"formatZH": "批量修改文件权限和用户/组 [paths] =\u003e [mode]/[user]/[group]",
|
||||||
|
"paramKeys": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/files/check": {
|
"/files/check": {
|
||||||
"post": {
|
"post": {
|
||||||
"security": [
|
"security": [
|
||||||
|
@ -15404,7 +15449,7 @@
|
||||||
"dto.SSHInfo": {
|
"dto.SSHInfo": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"authStart": {
|
"autoStart": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"listenAddress": {
|
"listenAddress": {
|
||||||
|
@ -15704,6 +15749,9 @@
|
||||||
"appStoreLastModified": {
|
"appStoreLastModified": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"appStoreSyncStatus": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"appStoreVersion": {
|
"appStoreVersion": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -16497,6 +16545,9 @@
|
||||||
"editCompose": {
|
"editCompose": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"hostMode": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"memoryLimit": {
|
"memoryLimit": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
|
@ -16645,6 +16696,9 @@
|
||||||
"editCompose": {
|
"editCompose": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"hostMode": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"installId": {
|
"installId": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
@ -16866,7 +16920,6 @@
|
||||||
"request.FileDownload": {
|
"request.FileDownload": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"compress",
|
|
||||||
"name",
|
"name",
|
||||||
"paths",
|
"paths",
|
||||||
"type"
|
"type"
|
||||||
|
@ -17012,12 +17065,40 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"request.FileRoleReq": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"group",
|
||||||
|
"mode",
|
||||||
|
"paths",
|
||||||
|
"user"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"group": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"mode": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sub": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"request.FileRoleUpdate": {
|
"request.FileRoleUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"group",
|
"group",
|
||||||
"path",
|
"path",
|
||||||
"sub",
|
|
||||||
"user"
|
"user"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -17156,6 +17237,9 @@
|
||||||
"editCompose": {
|
"editCompose": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"hostMode": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"memoryLimit": {
|
"memoryLimit": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
|
@ -17174,7 +17258,6 @@
|
||||||
"request.NginxAntiLeechUpdate": {
|
"request.NginxAntiLeechUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"enable",
|
|
||||||
"extends",
|
"extends",
|
||||||
"return",
|
"return",
|
||||||
"websiteID"
|
"websiteID"
|
||||||
|
@ -17269,7 +17352,6 @@
|
||||||
"request.NginxConfigFileUpdate": {
|
"request.NginxConfigFileUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"backup",
|
|
||||||
"content"
|
"content"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -17321,8 +17403,6 @@
|
||||||
"request.NginxRedirectReq": {
|
"request.NginxRedirectReq": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"enable",
|
|
||||||
"keepPath",
|
|
||||||
"name",
|
"name",
|
||||||
"operate",
|
"operate",
|
||||||
"redirect",
|
"redirect",
|
||||||
|
@ -17893,18 +17973,14 @@
|
||||||
"request.WebsiteDomainCreate": {
|
"request.WebsiteDomainCreate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"domain",
|
"domains",
|
||||||
"port",
|
"websiteID"
|
||||||
"websiteId"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"domain": {
|
"domains": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"port": {
|
"websiteID": {
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"websiteId": {
|
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17923,7 +17999,6 @@
|
||||||
"request.WebsiteHTTPSOp": {
|
"request.WebsiteHTTPSOp": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"enable",
|
|
||||||
"websiteId"
|
"websiteId"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -18095,7 +18170,6 @@
|
||||||
"request.WebsitePHPVersionReq": {
|
"request.WebsitePHPVersionReq": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"retainConfig",
|
|
||||||
"runtimeID",
|
"runtimeID",
|
||||||
"websiteID"
|
"websiteID"
|
||||||
],
|
],
|
||||||
|
@ -18114,10 +18188,8 @@
|
||||||
"request.WebsiteProxyConfig": {
|
"request.WebsiteProxyConfig": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"cache",
|
|
||||||
"cacheTime",
|
"cacheTime",
|
||||||
"cacheUnit",
|
"cacheUnit",
|
||||||
"enable",
|
|
||||||
"id",
|
"id",
|
||||||
"match",
|
"match",
|
||||||
"modifier",
|
"modifier",
|
||||||
|
@ -18200,7 +18272,6 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"acmeAccountId",
|
"acmeAccountId",
|
||||||
"autoRenew",
|
|
||||||
"primaryDomain",
|
"primaryDomain",
|
||||||
"provider"
|
"provider"
|
||||||
],
|
],
|
||||||
|
@ -18257,7 +18328,6 @@
|
||||||
"request.WebsiteSSLUpdate": {
|
"request.WebsiteSSLUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"autoRenew",
|
|
||||||
"id"
|
"id"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -18407,7 +18477,6 @@
|
||||||
"request.WebsiteWafUpdate": {
|
"request.WebsiteWafUpdate": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"enable",
|
|
||||||
"key",
|
"key",
|
||||||
"websiteId"
|
"websiteId"
|
||||||
],
|
],
|
||||||
|
@ -18524,6 +18593,9 @@
|
||||||
"enable": {
|
"enable": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"hostMode": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1953,7 +1953,7 @@ definitions:
|
||||||
type: object
|
type: object
|
||||||
dto.SSHInfo:
|
dto.SSHInfo:
|
||||||
properties:
|
properties:
|
||||||
authStart:
|
autoStart:
|
||||||
type: boolean
|
type: boolean
|
||||||
listenAddress:
|
listenAddress:
|
||||||
type: string
|
type: string
|
||||||
|
@ -2153,6 +2153,8 @@ definitions:
|
||||||
type: string
|
type: string
|
||||||
appStoreLastModified:
|
appStoreLastModified:
|
||||||
type: string
|
type: string
|
||||||
|
appStoreSyncStatus:
|
||||||
|
type: string
|
||||||
appStoreVersion:
|
appStoreVersion:
|
||||||
type: string
|
type: string
|
||||||
bindAddress:
|
bindAddress:
|
||||||
|
@ -2675,6 +2677,8 @@ definitions:
|
||||||
type: string
|
type: string
|
||||||
editCompose:
|
editCompose:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
hostMode:
|
||||||
|
type: boolean
|
||||||
memoryLimit:
|
memoryLimit:
|
||||||
type: number
|
type: number
|
||||||
memoryUnit:
|
memoryUnit:
|
||||||
|
@ -2774,6 +2778,8 @@ definitions:
|
||||||
type: string
|
type: string
|
||||||
editCompose:
|
editCompose:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
hostMode:
|
||||||
|
type: boolean
|
||||||
installId:
|
installId:
|
||||||
type: integer
|
type: integer
|
||||||
memoryLimit:
|
memoryLimit:
|
||||||
|
@ -2934,7 +2940,6 @@ definitions:
|
||||||
type:
|
type:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- compress
|
|
||||||
- name
|
- name
|
||||||
- paths
|
- paths
|
||||||
- type
|
- type
|
||||||
|
@ -3021,6 +3026,26 @@ definitions:
|
||||||
- newName
|
- newName
|
||||||
- oldName
|
- oldName
|
||||||
type: object
|
type: object
|
||||||
|
request.FileRoleReq:
|
||||||
|
properties:
|
||||||
|
group:
|
||||||
|
type: string
|
||||||
|
mode:
|
||||||
|
type: integer
|
||||||
|
paths:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
sub:
|
||||||
|
type: boolean
|
||||||
|
user:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- group
|
||||||
|
- mode
|
||||||
|
- paths
|
||||||
|
- user
|
||||||
|
type: object
|
||||||
request.FileRoleUpdate:
|
request.FileRoleUpdate:
|
||||||
properties:
|
properties:
|
||||||
group:
|
group:
|
||||||
|
@ -3034,7 +3059,6 @@ definitions:
|
||||||
required:
|
required:
|
||||||
- group
|
- group
|
||||||
- path
|
- path
|
||||||
- sub
|
|
||||||
- user
|
- user
|
||||||
type: object
|
type: object
|
||||||
request.FileWget:
|
request.FileWget:
|
||||||
|
@ -3118,6 +3142,8 @@ definitions:
|
||||||
type: string
|
type: string
|
||||||
editCompose:
|
editCompose:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
hostMode:
|
||||||
|
type: boolean
|
||||||
memoryLimit:
|
memoryLimit:
|
||||||
type: number
|
type: number
|
||||||
memoryUnit:
|
memoryUnit:
|
||||||
|
@ -3155,7 +3181,6 @@ definitions:
|
||||||
websiteID:
|
websiteID:
|
||||||
type: integer
|
type: integer
|
||||||
required:
|
required:
|
||||||
- enable
|
|
||||||
- extends
|
- extends
|
||||||
- return
|
- return
|
||||||
- websiteID
|
- websiteID
|
||||||
|
@ -3199,7 +3224,6 @@ definitions:
|
||||||
content:
|
content:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- backup
|
|
||||||
- content
|
- content
|
||||||
type: object
|
type: object
|
||||||
request.NginxConfigUpdate:
|
request.NginxConfigUpdate:
|
||||||
|
@ -3254,8 +3278,6 @@ definitions:
|
||||||
websiteID:
|
websiteID:
|
||||||
type: integer
|
type: integer
|
||||||
required:
|
required:
|
||||||
- enable
|
|
||||||
- keepPath
|
|
||||||
- name
|
- name
|
||||||
- operate
|
- operate
|
||||||
- redirect
|
- redirect
|
||||||
|
@ -3613,16 +3635,13 @@ definitions:
|
||||||
type: object
|
type: object
|
||||||
request.WebsiteDomainCreate:
|
request.WebsiteDomainCreate:
|
||||||
properties:
|
properties:
|
||||||
domain:
|
domains:
|
||||||
type: string
|
type: string
|
||||||
port:
|
websiteID:
|
||||||
type: integer
|
|
||||||
websiteId:
|
|
||||||
type: integer
|
type: integer
|
||||||
required:
|
required:
|
||||||
- domain
|
- domains
|
||||||
- port
|
- websiteID
|
||||||
- websiteId
|
|
||||||
type: object
|
type: object
|
||||||
request.WebsiteDomainDelete:
|
request.WebsiteDomainDelete:
|
||||||
properties:
|
properties:
|
||||||
|
@ -3668,7 +3687,6 @@ definitions:
|
||||||
websiteSSLId:
|
websiteSSLId:
|
||||||
type: integer
|
type: integer
|
||||||
required:
|
required:
|
||||||
- enable
|
|
||||||
- websiteId
|
- websiteId
|
||||||
type: object
|
type: object
|
||||||
request.WebsiteInstallCheckReq:
|
request.WebsiteInstallCheckReq:
|
||||||
|
@ -3756,7 +3774,6 @@ definitions:
|
||||||
websiteID:
|
websiteID:
|
||||||
type: integer
|
type: integer
|
||||||
required:
|
required:
|
||||||
- retainConfig
|
|
||||||
- runtimeID
|
- runtimeID
|
||||||
- websiteID
|
- websiteID
|
||||||
type: object
|
type: object
|
||||||
|
@ -3793,10 +3810,8 @@ definitions:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- cache
|
|
||||||
- cacheTime
|
- cacheTime
|
||||||
- cacheUnit
|
- cacheUnit
|
||||||
- enable
|
|
||||||
- id
|
- id
|
||||||
- match
|
- match
|
||||||
- modifier
|
- modifier
|
||||||
|
@ -3835,7 +3850,6 @@ definitions:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- acmeAccountId
|
- acmeAccountId
|
||||||
- autoRenew
|
|
||||||
- primaryDomain
|
- primaryDomain
|
||||||
- provider
|
- provider
|
||||||
type: object
|
type: object
|
||||||
|
@ -3865,7 +3879,6 @@ definitions:
|
||||||
id:
|
id:
|
||||||
type: integer
|
type: integer
|
||||||
required:
|
required:
|
||||||
- autoRenew
|
|
||||||
- id
|
- id
|
||||||
type: object
|
type: object
|
||||||
request.WebsiteSSLUpload:
|
request.WebsiteSSLUpload:
|
||||||
|
@ -3968,7 +3981,6 @@ definitions:
|
||||||
websiteId:
|
websiteId:
|
||||||
type: integer
|
type: integer
|
||||||
required:
|
required:
|
||||||
- enable
|
|
||||||
- key
|
- key
|
||||||
- websiteId
|
- websiteId
|
||||||
type: object
|
type: object
|
||||||
|
@ -4039,6 +4051,8 @@ definitions:
|
||||||
type: string
|
type: string
|
||||||
enable:
|
enable:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
hostMode:
|
||||||
|
type: boolean
|
||||||
id:
|
id:
|
||||||
type: integer
|
type: integer
|
||||||
ignoreUpgrade:
|
ignoreUpgrade:
|
||||||
|
@ -7595,6 +7609,36 @@ paths:
|
||||||
formatEN: Batch delete dir or file [paths]
|
formatEN: Batch delete dir or file [paths]
|
||||||
formatZH: 批量删除文件/文件夹 [paths]
|
formatZH: 批量删除文件/文件夹 [paths]
|
||||||
paramKeys: []
|
paramKeys: []
|
||||||
|
/files/batch/role:
|
||||||
|
post:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: 批量修改文件权限和用户/组
|
||||||
|
parameters:
|
||||||
|
- description: request
|
||||||
|
in: body
|
||||||
|
name: request
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/request.FileRoleReq'
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
summary: Batch change file mode and owner
|
||||||
|
tags:
|
||||||
|
- File
|
||||||
|
x-panel-log:
|
||||||
|
BeforeFunctions: []
|
||||||
|
bodyKeys:
|
||||||
|
- paths
|
||||||
|
- mode
|
||||||
|
- user
|
||||||
|
- group
|
||||||
|
formatEN: Batch change file mode and owner [paths] => [mode]/[user]/[group]
|
||||||
|
formatZH: 批量修改文件权限和用户/组 [paths] => [mode]/[user]/[group]
|
||||||
|
paramKeys: []
|
||||||
/files/check:
|
/files/check:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
|
|
|
@ -117,6 +117,7 @@ export namespace Host {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SSHInfo {
|
export interface SSHInfo {
|
||||||
|
autoStart: boolean;
|
||||||
status: string;
|
status: string;
|
||||||
message: string;
|
message: string;
|
||||||
port: string;
|
port: string;
|
||||||
|
|
|
@ -880,6 +880,7 @@ const message = {
|
||||||
resource: 'Resource',
|
resource: 'Resource',
|
||||||
operate: 'Operate',
|
operate: 'Operate',
|
||||||
detail: {
|
detail: {
|
||||||
|
groups: 'Group',
|
||||||
hosts: 'Host',
|
hosts: 'Host',
|
||||||
apps: 'App',
|
apps: 'App',
|
||||||
websites: 'Website',
|
websites: 'Website',
|
||||||
|
|
|
@ -844,6 +844,7 @@ const message = {
|
||||||
resource: '資源',
|
resource: '資源',
|
||||||
operate: '操作',
|
operate: '操作',
|
||||||
detail: {
|
detail: {
|
||||||
|
groups: '分組',
|
||||||
hosts: '主機',
|
hosts: '主機',
|
||||||
apps: '應用',
|
apps: '應用',
|
||||||
websites: '網站',
|
websites: '網站',
|
||||||
|
|
|
@ -845,6 +845,7 @@ const message = {
|
||||||
resource: '资源',
|
resource: '资源',
|
||||||
operate: '操作',
|
operate: '操作',
|
||||||
detail: {
|
detail: {
|
||||||
|
groups: '分组',
|
||||||
hosts: '主机',
|
hosts: '主机',
|
||||||
apps: '应用',
|
apps: '应用',
|
||||||
websites: '网站',
|
websites: '网站',
|
||||||
|
|
|
@ -322,6 +322,7 @@ const search = async () => {
|
||||||
const res = await getSSHInfo();
|
const res = await getSSHInfo();
|
||||||
form.status = res.data.status;
|
form.status = res.data.status;
|
||||||
form.port = Number(res.data.port);
|
form.port = Number(res.data.port);
|
||||||
|
autoStart.value = res.data.autoStart ? 'enable' : 'disable';
|
||||||
form.listenAddress = res.data.listenAddress;
|
form.listenAddress = res.data.listenAddress;
|
||||||
form.passwordAuthentication = res.data.passwordAuthentication;
|
form.passwordAuthentication = res.data.passwordAuthentication;
|
||||||
form.pubkeyAuthentication = res.data.pubkeyAuthentication;
|
form.pubkeyAuthentication = res.data.pubkeyAuthentication;
|
||||||
|
|
Loading…
Add table
Reference in a new issue