Skip to content

Commit 71c6d94

Browse files
committed
frontend fallback
1 parent b3f41ca commit 71c6d94

11 files changed

Lines changed: 306 additions & 19 deletions

File tree

agent/cmd/server/docs/x-log.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,51 @@
805805
"formatZH": "更新快捷命令 [name]",
806806
"formatEN": "update quick command [name]"
807807
},
808+
"/core/enterprise/user": {
809+
"bodyKeys": [
810+
"name"
811+
],
812+
"paramKeys": [],
813+
"beforeFunctions": [],
814+
"formatZH": "添加用户 [name]",
815+
"formatEN": "add user [name]"
816+
},
817+
"/core/enterprise/users/del": {
818+
"bodyKeys": [
819+
"ids"
820+
],
821+
"paramKeys": [],
822+
"beforeFunctions": [
823+
{
824+
"input_column": "id",
825+
"input_value": "ids",
826+
"isList": true,
827+
"db": "users",
828+
"output_column": "name",
829+
"output_value": "names"
830+
}
831+
],
832+
"formatZH": "删除用户 [names]",
833+
"formatEN": "delete user [names]"
834+
},
835+
"/core/enterprise/users/info/update": {
836+
"bodyKeys": [
837+
"name"
838+
],
839+
"paramKeys": [],
840+
"beforeFunctions": [],
841+
"formatZH": "更新 [name] 认证信息",
842+
"formatEN": "update user [name] auth info"
843+
},
844+
"/core/enterprise/users/update": {
845+
"bodyKeys": [
846+
"name"
847+
],
848+
"paramKeys": [],
849+
"beforeFunctions": [],
850+
"formatZH": "更新 [name]",
851+
"formatEN": "update user [name]"
852+
},
808853
"/core/groups": {
809854
"bodyKeys": [
810855
"name",

agent/global/global.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ func RepoURL() string {
5555
}
5656
func ResourceURL() string {
5757
if CONF.Base.IsEnterprise {
58-
return "https://resource.fit2cloud.com/1panel/resource/enterprise"
58+
return "https://resource.fit2cloud.com/1panel/resource/v2"
5959
}
6060
if CONF.Base.IsFxplay {
61-
return "https://resource.fit2cloud.com/1panel/resource/fusionxplay"
61+
return "https://resource.fit2cloud.com/1panel/resource/v2"
6262
}
6363
if CONF.Base.Edition != "intl" {
6464
return "https://resource.fit2cloud.com/1panel/resource/v2"

agent/init/lang/lang.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func loadRestorePath(upgradeDir string) (string, error) {
109109
}
110110

111111
func downloadLangFromRemote(fileOp files.FileOp) {
112-
path := fmt.Sprintf("%s/language/lang.tar.gz", global.RepoURL())
112+
path := fmt.Sprintf("%s/language/lang.tar.gz", global.ResourceURL())
113113
if err := fileOp.DownloadFile(path, "/usr/local/bin/lang.tar.gz"); err != nil {
114114
global.LOG.Errorf("download lang.tar.gz failed, err: %v", err)
115115
return
@@ -127,7 +127,7 @@ func downloadLangFromRemote(fileOp files.FileOp) {
127127
}
128128
func downloadGeoFromRemote(fileOp files.FileOp, targetPath string) {
129129
_ = os.MkdirAll(path.Dir(targetPath), os.ModePerm)
130-
pathItem := fmt.Sprintf("%s/geo/GeoIP.mmdb", global.RepoURL())
130+
pathItem := fmt.Sprintf("%s/geo/GeoIP.mmdb", global.ResourceURL())
131131
if err := fileOp.DownloadFile(pathItem, targetPath); err != nil {
132132
global.LOG.Errorf("download geo ip failed, err: %v", err)
133133
return

core/cmd/server/docs/docs.go

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14155,6 +14155,41 @@ const docTemplate = `{
1415514155
}
1415614156
}
1415714157
},
14158+
"/files/decompress/stop": {
14159+
"post": {
14160+
"consumes": [
14161+
"application/json"
14162+
],
14163+
"parameters": [
14164+
{
14165+
"description": "request",
14166+
"in": "body",
14167+
"name": "request",
14168+
"required": true,
14169+
"schema": {
14170+
"$ref": "#/definitions/request.FileDeCompressStopReq"
14171+
}
14172+
}
14173+
],
14174+
"responses": {
14175+
"200": {
14176+
"description": "OK"
14177+
}
14178+
},
14179+
"security": [
14180+
{
14181+
"ApiKeyAuth": []
14182+
},
14183+
{
14184+
"Timestamp": []
14185+
}
14186+
],
14187+
"summary": "Stop decompress task",
14188+
"tags": [
14189+
"File"
14190+
]
14191+
}
14192+
},
1415814193
"/files/del": {
1415914194
"post": {
1416014195
"consumes": [
@@ -20162,6 +20197,30 @@ const docTemplate = `{
2016220197
}
2016320198
}
2016420199
},
20200+
"/settings/website/dir": {
20201+
"get": {
20202+
"responses": {
20203+
"200": {
20204+
"description": "OK",
20205+
"schema": {
20206+
"type": "string"
20207+
}
20208+
}
20209+
},
20210+
"security": [
20211+
{
20212+
"ApiKeyAuth": []
20213+
},
20214+
{
20215+
"Timestamp": []
20216+
}
20217+
],
20218+
"summary": "Load website dir",
20219+
"tags": [
20220+
"System Setting"
20221+
]
20222+
}
20223+
},
2016520224
"/toolbox/clam": {
2016620225
"post": {
2016720226
"consumes": [
@@ -34334,6 +34393,9 @@ const docTemplate = `{
3433434393
"proxyType": {
3433534394
"type": "string"
3433634395
},
34396+
"scriptSync": {
34397+
"type": "string"
34398+
},
3433734399
"securityEntrance": {
3433834400
"type": "string"
3433934401
},
@@ -36577,6 +36639,9 @@ const docTemplate = `{
3657736639
"secret": {
3657836640
"type": "string"
3657936641
},
36642+
"taskID": {
36643+
"type": "string"
36644+
},
3658036645
"type": {
3658136646
"type": "string"
3658236647
}
@@ -36588,6 +36653,17 @@ const docTemplate = `{
3658836653
],
3658936654
"type": "object"
3659036655
},
36656+
"request.FileDeCompressStopReq": {
36657+
"properties": {
36658+
"taskID": {
36659+
"type": "string"
36660+
}
36661+
},
36662+
"required": [
36663+
"taskID"
36664+
],
36665+
"type": "object"
36666+
},
3659136667
"request.FileDelete": {
3659236668
"properties": {
3659336669
"forceDelete": {
@@ -36877,8 +36953,7 @@ const docTemplate = `{
3687736953
},
3687836954
"required": [
3687936955
"page",
36880-
"pageSize",
36881-
"type"
36956+
"pageSize"
3688236957
],
3688336958
"type": "object"
3688436959
},
@@ -41850,4 +41925,4 @@ var SwaggerInfo = &swag.Spec{
4185041925

4185141926
func init() {
4185241927
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
41853-
}
41928+
}

core/cmd/server/docs/swagger.json

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14151,6 +14151,41 @@
1415114151
}
1415214152
}
1415314153
},
14154+
"/files/decompress/stop": {
14155+
"post": {
14156+
"consumes": [
14157+
"application/json"
14158+
],
14159+
"parameters": [
14160+
{
14161+
"description": "request",
14162+
"in": "body",
14163+
"name": "request",
14164+
"required": true,
14165+
"schema": {
14166+
"$ref": "#/definitions/request.FileDeCompressStopReq"
14167+
}
14168+
}
14169+
],
14170+
"responses": {
14171+
"200": {
14172+
"description": "OK"
14173+
}
14174+
},
14175+
"security": [
14176+
{
14177+
"ApiKeyAuth": []
14178+
},
14179+
{
14180+
"Timestamp": []
14181+
}
14182+
],
14183+
"summary": "Stop decompress task",
14184+
"tags": [
14185+
"File"
14186+
]
14187+
}
14188+
},
1415414189
"/files/del": {
1415514190
"post": {
1415614191
"consumes": [
@@ -20158,6 +20193,30 @@
2015820193
}
2015920194
}
2016020195
},
20196+
"/settings/website/dir": {
20197+
"get": {
20198+
"responses": {
20199+
"200": {
20200+
"description": "OK",
20201+
"schema": {
20202+
"type": "string"
20203+
}
20204+
}
20205+
},
20206+
"security": [
20207+
{
20208+
"ApiKeyAuth": []
20209+
},
20210+
{
20211+
"Timestamp": []
20212+
}
20213+
],
20214+
"summary": "Load website dir",
20215+
"tags": [
20216+
"System Setting"
20217+
]
20218+
}
20219+
},
2016120220
"/toolbox/clam": {
2016220221
"post": {
2016320222
"consumes": [
@@ -34330,6 +34389,9 @@
3433034389
"proxyType": {
3433134390
"type": "string"
3433234391
},
34392+
"scriptSync": {
34393+
"type": "string"
34394+
},
3433334395
"securityEntrance": {
3433434396
"type": "string"
3433534397
},
@@ -36573,6 +36635,9 @@
3657336635
"secret": {
3657436636
"type": "string"
3657536637
},
36638+
"taskID": {
36639+
"type": "string"
36640+
},
3657636641
"type": {
3657736642
"type": "string"
3657836643
}
@@ -36584,6 +36649,17 @@
3658436649
],
3658536650
"type": "object"
3658636651
},
36652+
"request.FileDeCompressStopReq": {
36653+
"properties": {
36654+
"taskID": {
36655+
"type": "string"
36656+
}
36657+
},
36658+
"required": [
36659+
"taskID"
36660+
],
36661+
"type": "object"
36662+
},
3658736663
"request.FileDelete": {
3658836664
"properties": {
3658936665
"forceDelete": {
@@ -36873,8 +36949,7 @@
3687336949
},
3687436950
"required": [
3687536951
"page",
36876-
"pageSize",
36877-
"type"
36952+
"pageSize"
3687836953
],
3687936954
"type": "object"
3688036955
},
@@ -41829,4 +41904,4 @@
4182941904
"type": "object"
4183041905
}
4183141906
}
41832-
}
41907+
}

core/cmd/server/docs/swagger_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ func TestGenerateXlog(t *testing.T) {
2222
filepath.Join(workDir, "core/app/api/v2"),
2323
filepath.Join(workDir, "agent/xpack/app/api/v2"),
2424
filepath.Join(workDir, "core/xpack/app/api/v2"),
25+
filepath.Join(workDir, "agent/enterprise/app/api/v2"),
26+
filepath.Join(workDir, "core/enterprise/app/api/v2"),
2527
}
2628

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

0 commit comments

Comments
 (0)