Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions agent/cmd/server/docs/x-log.json
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,51 @@
"formatZH": "更新快捷命令 [name]",
"formatEN": "update quick command [name]"
},
"/core/enterprise/user": {
"bodyKeys": [
"name"
],
"paramKeys": [],
"beforeFunctions": [],
"formatZH": "添加用户 [name]",
"formatEN": "add user [name]"
},
"/core/enterprise/users/del": {
"bodyKeys": [
"ids"
],
"paramKeys": [],
"beforeFunctions": [
{
"input_column": "id",
"input_value": "ids",
"isList": true,
"db": "users",
"output_column": "name",
"output_value": "names"
}
],
"formatZH": "删除用户 [names]",
"formatEN": "delete user [names]"
},
"/core/enterprise/users/info/update": {
"bodyKeys": [
"name"
],
"paramKeys": [],
"beforeFunctions": [],
"formatZH": "更新 [name] 认证信息",
"formatEN": "update user [name] auth info"
},
"/core/enterprise/users/update": {
"bodyKeys": [
"name"
],
"paramKeys": [],
"beforeFunctions": [],
"formatZH": "更新 [name]",
"formatEN": "update user [name]"
},
"/core/groups": {
"bodyKeys": [
"name",
Expand Down
4 changes: 2 additions & 2 deletions agent/global/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func RepoURL() string {
}
func ResourceURL() string {
if CONF.Base.IsEnterprise {
return "https://resource.fit2cloud.com/1panel/resource/enterprise"
return "https://resource.fit2cloud.com/1panel/resource/v2"
}
if CONF.Base.IsFxplay {
return "https://resource.fit2cloud.com/1panel/resource/fusionxplay"
return "https://resource.fit2cloud.com/1panel/resource/v2"
}
if CONF.Base.Edition != "intl" {
return "https://resource.fit2cloud.com/1panel/resource/v2"
Expand Down
4 changes: 2 additions & 2 deletions agent/init/lang/lang.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func loadRestorePath(upgradeDir string) (string, error) {
}

func downloadLangFromRemote(fileOp files.FileOp) {
path := fmt.Sprintf("%s/language/lang.tar.gz", global.RepoURL())
path := fmt.Sprintf("%s/language/lang.tar.gz", global.ResourceURL())
if err := fileOp.DownloadFile(path, "/usr/local/bin/lang.tar.gz"); err != nil {
global.LOG.Errorf("download lang.tar.gz failed, err: %v", err)
return
Expand All @@ -127,7 +127,7 @@ func downloadLangFromRemote(fileOp files.FileOp) {
}
func downloadGeoFromRemote(fileOp files.FileOp, targetPath string) {
_ = os.MkdirAll(path.Dir(targetPath), os.ModePerm)
pathItem := fmt.Sprintf("%s/geo/GeoIP.mmdb", global.RepoURL())
pathItem := fmt.Sprintf("%s/geo/GeoIP.mmdb", global.ResourceURL())
if err := fileOp.DownloadFile(pathItem, targetPath); err != nil {
global.LOG.Errorf("download geo ip failed, err: %v", err)
return
Expand Down
81 changes: 78 additions & 3 deletions core/cmd/server/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -14155,6 +14155,41 @@ const docTemplate = `{
}
}
},
"/files/decompress/stop": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/request.FileDeCompressStopReq"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Stop decompress task",
"tags": [
"File"
]
}
},
"/files/del": {
"post": {
"consumes": [
Expand Down Expand Up @@ -20162,6 +20197,30 @@ const docTemplate = `{
}
}
},
"/settings/website/dir": {
"get": {
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Load website dir",
"tags": [
"System Setting"
]
}
},
"/toolbox/clam": {
"post": {
"consumes": [
Expand Down Expand Up @@ -34334,6 +34393,9 @@ const docTemplate = `{
"proxyType": {
"type": "string"
},
"scriptSync": {
"type": "string"
},
"securityEntrance": {
"type": "string"
},
Expand Down Expand Up @@ -36577,6 +36639,9 @@ const docTemplate = `{
"secret": {
"type": "string"
},
"taskID": {
"type": "string"
},
"type": {
"type": "string"
}
Expand All @@ -36588,6 +36653,17 @@ const docTemplate = `{
],
"type": "object"
},
"request.FileDeCompressStopReq": {
"properties": {
"taskID": {
"type": "string"
}
},
"required": [
"taskID"
],
"type": "object"
},
"request.FileDelete": {
"properties": {
"forceDelete": {
Expand Down Expand Up @@ -36877,8 +36953,7 @@ const docTemplate = `{
},
"required": [
"page",
"pageSize",
"type"
"pageSize"
],
"type": "object"
},
Expand Down Expand Up @@ -41850,4 +41925,4 @@ var SwaggerInfo = &swag.Spec{

func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
}
81 changes: 78 additions & 3 deletions core/cmd/server/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -14151,6 +14151,41 @@
}
}
},
"/files/decompress/stop": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/request.FileDeCompressStopReq"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Stop decompress task",
"tags": [
"File"
]
}
},
"/files/del": {
"post": {
"consumes": [
Expand Down Expand Up @@ -20158,6 +20193,30 @@
}
}
},
"/settings/website/dir": {
"get": {
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Load website dir",
"tags": [
"System Setting"
]
}
},
"/toolbox/clam": {
"post": {
"consumes": [
Expand Down Expand Up @@ -34330,6 +34389,9 @@
"proxyType": {
"type": "string"
},
"scriptSync": {
"type": "string"
},
"securityEntrance": {
"type": "string"
},
Expand Down Expand Up @@ -36573,6 +36635,9 @@
"secret": {
"type": "string"
},
"taskID": {
"type": "string"
},
"type": {
"type": "string"
}
Expand All @@ -36584,6 +36649,17 @@
],
"type": "object"
},
"request.FileDeCompressStopReq": {
"properties": {
"taskID": {
"type": "string"
}
},
"required": [
"taskID"
],
"type": "object"
},
"request.FileDelete": {
"properties": {
"forceDelete": {
Expand Down Expand Up @@ -36873,8 +36949,7 @@
},
"required": [
"page",
"pageSize",
"type"
"pageSize"
],
"type": "object"
},
Expand Down Expand Up @@ -41829,4 +41904,4 @@
"type": "object"
}
}
}
}
4 changes: 3 additions & 1 deletion core/cmd/server/docs/swagger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ func TestGenerateXlog(t *testing.T) {
filepath.Join(workDir, "core/app/api/v2"),
filepath.Join(workDir, "agent/xpack/app/api/v2"),
filepath.Join(workDir, "core/xpack/app/api/v2"),
filepath.Join(workDir, "agent/enterprise/app/api/v2"),
filepath.Join(workDir, "core/enterprise/app/api/v2"),
}

xlogMap := make(map[string]operationJson)
Expand Down Expand Up @@ -89,7 +91,7 @@ func TestGenerateSwaggerDoc(t *testing.T) {
cmd2.Dir = workDir
std2, err := cmd2.CombinedOutput()
if err != nil {
fmt.Printf("generate swagger doc of core failed, std1: %v, err: %v", string(std2), err)
fmt.Printf("generate swagger doc of core failed, std2: %v, err: %v", string(std2), err)
return
}

Expand Down
Loading
Loading