From 4efe17fbd1bf6bef4feb8510571d4e204ad5ceb8 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sun, 14 Aug 2022 20:03:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/const/build.go | 2 +- internal/const/plus.go | 1 - internal/rpc/rpc_client.go | 4 +++ internal/utils/nodelogutils/utils.go | 1 - internal/utils/service_linux.go | 8 ++--- internal/utils/service_others.go | 2 +- internal/utils/service_windows.go | 2 +- .../cluster/node/nodeutils/utils_ext.go | 1 - .../clusters/cluster/node/update_hook.go | 1 - .../clusterutils/cluster_helper_ext.go | 1 - .../default/dns/providers/createPopup.go | 1 - .../default/dns/providers/updatePopup.go | 1 - .../groups/group/servergrouputils/menu.go | 1 - .../settings/locations/locationutils/menu.go | 1 - .../default/servers/serverutils/menu.go | 1 - .../settings/settingutils/advanced_helper.go | 1 - internal/web/helpers/menu.go | 1 - web/public/js/components.js | 12 +++---- web/public/js/components.src.js | 35 +++++++++++-------- 19 files changed, 37 insertions(+), 40 deletions(-) diff --git a/internal/const/build.go b/internal/const/build.go index c12973fe..e9db0f34 100644 --- a/internal/const/build.go +++ b/internal/const/build.go @@ -1,5 +1,5 @@ // Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. -// +build !plus +//go:build !plus package teaconst diff --git a/internal/const/plus.go b/internal/const/plus.go index e3f7d0aa..6b908e9e 100644 --- a/internal/const/plus.go +++ b/internal/const/plus.go @@ -1,6 +1,5 @@ // Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. //go:build !plus -// +build !plus package teaconst diff --git a/internal/rpc/rpc_client.go b/internal/rpc/rpc_client.go index 7f85676e..69687d00 100644 --- a/internal/rpc/rpc_client.go +++ b/internal/rpc/rpc_client.go @@ -348,6 +348,10 @@ func (this *RPCClient) RegionCityRPC() pb.RegionCityServiceClient { return pb.NewRegionCityServiceClient(this.pickConn()) } +func (this *RPCClient) RegionTownRPC() pb.RegionTownServiceClient { + return pb.NewRegionTownServiceClient(this.pickConn()) +} + func (this *RPCClient) RegionProviderRPC() pb.RegionProviderServiceClient { return pb.NewRegionProviderServiceClient(this.pickConn()) } diff --git a/internal/utils/nodelogutils/utils.go b/internal/utils/nodelogutils/utils.go index 5c076901..e69f1db1 100644 --- a/internal/utils/nodelogutils/utils.go +++ b/internal/utils/nodelogutils/utils.go @@ -1,6 +1,5 @@ // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. //go:build !plus -// +build !plus package nodelogutils diff --git a/internal/utils/service_linux.go b/internal/utils/service_linux.go index 44c8e2fe..952f5b1b 100644 --- a/internal/utils/service_linux.go +++ b/internal/utils/service_linux.go @@ -1,4 +1,4 @@ -// +build linux +//go:build linux package utils @@ -15,7 +15,7 @@ import ( var systemdServiceFile = "/etc/systemd/system/edge-admin.service" var initServiceFile = "/etc/init.d/" + teaconst.SystemdServiceName -// 安装服务 +// Install 安装服务 func (this *ServiceManager) Install(exePath string, args []string) error { if os.Getgid() != 0 { return errors.New("only root users can install the service") @@ -29,7 +29,7 @@ func (this *ServiceManager) Install(exePath string, args []string) error { return this.installSystemdService(systemd, exePath, args) } -// 启动服务 +// Start 启动服务 func (this *ServiceManager) Start() error { if os.Getgid() != 0 { return errors.New("only root users can start the service") @@ -46,7 +46,7 @@ func (this *ServiceManager) Start() error { return exec.Command("service", teaconst.ProcessName, "start").Start() } -// 删除服务 +// Uninstall 删除服务 func (this *ServiceManager) Uninstall() error { if os.Getgid() != 0 { return errors.New("only root users can uninstall the service") diff --git a/internal/utils/service_others.go b/internal/utils/service_others.go index 43755dee..d95f252d 100644 --- a/internal/utils/service_others.go +++ b/internal/utils/service_others.go @@ -1,4 +1,4 @@ -// +build !linux,!windows +//go:build !linux && !windows package utils diff --git a/internal/utils/service_windows.go b/internal/utils/service_windows.go index 8faabb4f..ac04e9c4 100644 --- a/internal/utils/service_windows.go +++ b/internal/utils/service_windows.go @@ -1,4 +1,4 @@ -// +build windows +//go:build windows package utils diff --git a/internal/web/actions/default/clusters/cluster/node/nodeutils/utils_ext.go b/internal/web/actions/default/clusters/cluster/node/nodeutils/utils_ext.go index 560c9d08..459b851f 100644 --- a/internal/web/actions/default/clusters/cluster/node/nodeutils/utils_ext.go +++ b/internal/web/actions/default/clusters/cluster/node/nodeutils/utils_ext.go @@ -1,6 +1,5 @@ // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn . //go:build !plus -// +build !plus package nodeutils diff --git a/internal/web/actions/default/clusters/cluster/node/update_hook.go b/internal/web/actions/default/clusters/cluster/node/update_hook.go index a4d16e3e..da005538 100644 --- a/internal/web/actions/default/clusters/cluster/node/update_hook.go +++ b/internal/web/actions/default/clusters/cluster/node/update_hook.go @@ -1,6 +1,5 @@ // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. //go:build !plus -// +build !plus package node diff --git a/internal/web/actions/default/clusters/clusterutils/cluster_helper_ext.go b/internal/web/actions/default/clusters/clusterutils/cluster_helper_ext.go index 7d62d781..32d90016 100644 --- a/internal/web/actions/default/clusters/clusterutils/cluster_helper_ext.go +++ b/internal/web/actions/default/clusters/clusterutils/cluster_helper_ext.go @@ -1,6 +1,5 @@ // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn . //go:build !plus -// +build !plus package clusterutils diff --git a/internal/web/actions/default/dns/providers/createPopup.go b/internal/web/actions/default/dns/providers/createPopup.go index 31d8de1b..44efc166 100644 --- a/internal/web/actions/default/dns/providers/createPopup.go +++ b/internal/web/actions/default/dns/providers/createPopup.go @@ -1,7 +1,6 @@ // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. //go:build !plus -// +build !plus package providers diff --git a/internal/web/actions/default/dns/providers/updatePopup.go b/internal/web/actions/default/dns/providers/updatePopup.go index 5637565e..1f304051 100644 --- a/internal/web/actions/default/dns/providers/updatePopup.go +++ b/internal/web/actions/default/dns/providers/updatePopup.go @@ -1,5 +1,4 @@ //go:build !plus -// +build !plus package providers diff --git a/internal/web/actions/default/servers/groups/group/servergrouputils/menu.go b/internal/web/actions/default/servers/groups/group/servergrouputils/menu.go index 58789709..d73031a0 100644 --- a/internal/web/actions/default/servers/groups/group/servergrouputils/menu.go +++ b/internal/web/actions/default/servers/groups/group/servergrouputils/menu.go @@ -1,7 +1,6 @@ // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. //go:build !plus -// +build !plus package servergrouputils diff --git a/internal/web/actions/default/servers/server/settings/locations/locationutils/menu.go b/internal/web/actions/default/servers/server/settings/locations/locationutils/menu.go index e9b55c52..1ed178b9 100644 --- a/internal/web/actions/default/servers/server/settings/locations/locationutils/menu.go +++ b/internal/web/actions/default/servers/server/settings/locations/locationutils/menu.go @@ -1,6 +1,5 @@ // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. //go:build !plus -// +build !plus package locationutils diff --git a/internal/web/actions/default/servers/serverutils/menu.go b/internal/web/actions/default/servers/serverutils/menu.go index 9403a43c..1a4f2864 100644 --- a/internal/web/actions/default/servers/serverutils/menu.go +++ b/internal/web/actions/default/servers/serverutils/menu.go @@ -1,6 +1,5 @@ // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. //go:build !plus -// +build !plus package serverutils diff --git a/internal/web/actions/default/settings/settingutils/advanced_helper.go b/internal/web/actions/default/settings/settingutils/advanced_helper.go index ec1a7628..70d0351d 100644 --- a/internal/web/actions/default/settings/settingutils/advanced_helper.go +++ b/internal/web/actions/default/settings/settingutils/advanced_helper.go @@ -1,5 +1,4 @@ //go:build !plus -// +build !plus package settingutils diff --git a/internal/web/helpers/menu.go b/internal/web/helpers/menu.go index 275fab03..c0e0f59d 100644 --- a/internal/web/helpers/menu.go +++ b/internal/web/helpers/menu.go @@ -1,6 +1,5 @@ // Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. //go:build !plus -// +build !plus package helpers diff --git a/web/public/js/components.js b/web/public/js/components.js index c17936cb..b6014353 100644 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -4325,14 +4325,14 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio 更多选项收起选项 -`}),Vue.component("download-link",{props:["v-element","v-file","v-value"],created:function(){let e=this;setTimeout(function(){e.url=e.composeURL()},1e3)},data:function(){let e=this.vFile;return{file:e=null!=e&&0!=e.length?e:"unknown-file",url:this.composeURL()}},methods:{composeURL:function(){let e="";if(null!=this.vValue)e=this.vValue;else{var t=document.getElementById(this.vElement);if(null==t)return void teaweb.warn("找不到要下载的内容");null==(e=t.innerText)&&(e=t.textContent)}return Tea.url("/ui/download",{file:this.file,text:e})}},template:''}),Vue.component("values-box",{props:["values","size","maxlength","name","placeholder"],data:function(){let e=this.values;return{vValues:e=null==e?[]:e,isUpdating:!1,isAdding:!1,index:0,value:"",isEditing:!1}},methods:{create:function(){this.isAdding=!0;var e=this;setTimeout(function(){e.$refs.value.focus()},200)},update:function(e){this.cancel(),this.isUpdating=!0,this.index=e,this.value=this.vValues[e];var t=this;setTimeout(function(){t.$refs.value.focus()},200)},confirm:function(){0!=this.value.length&&(this.isUpdating?Vue.set(this.vValues,this.index,this.value):this.vValues.push(this.value),this.cancel(),this.$emit("change",this.vValues))},remove:function(e){this.vValues.$remove(e),this.$emit("change",this.vValues)},cancel:function(){this.isUpdating=!1,this.isAdding=!1,this.value=""},updateAll:function(e){this.vValeus=e},addValue:function(e){this.vValues.push(e)},startEditing:function(){this.isEditing=!this.isEditing}},template:`
-
-
{{value}}
+`}),Vue.component("download-link",{props:["v-element","v-file","v-value"],created:function(){let e=this;setTimeout(function(){e.url=e.composeURL()},1e3)},data:function(){let e=this.vFile;return{file:e=null!=e&&0!=e.length?e:"unknown-file",url:this.composeURL()}},methods:{composeURL:function(){let e="";if(null!=this.vValue)e=this.vValue;else{var t=document.getElementById(this.vElement);if(null==t)return void teaweb.warn("找不到要下载的内容");null==(e=t.innerText)&&(e=t.textContent)}return Tea.url("/ui/download",{file:this.file,text:e})}},template:''}),Vue.component("values-box",{props:["values","v-values","size","maxlength","name","placeholder"],data:function(){let e=this.values;return null==e&&(e=[]),{realValues:e=null!=this.vValues&&"object"==typeof this.vValues?this.vValues:e,isUpdating:!1,isAdding:!1,index:0,value:"",isEditing:!1}},methods:{create:function(){this.isAdding=!0;var e=this;setTimeout(function(){e.$refs.value.focus()},200)},update:function(e){this.cancel(),this.isUpdating=!0,this.index=e,this.value=this.realValues[e];var t=this;setTimeout(function(){t.$refs.value.focus()},200)},confirm:function(){0!=this.value.length&&(this.isUpdating?Vue.set(this.realValues,this.index,this.value):this.realValues.push(this.value),this.cancel(),this.$emit("change",this.realValues))},remove:function(e){this.realValues.$remove(e),this.$emit("change",this.realValues)},cancel:function(){this.isUpdating=!1,this.isAdding=!1,this.value=""},updateAll:function(e){this.realValues=e},addValue:function(e){this.realValues.push(e)},startEditing:function(){this.isEditing=!this.isEditing}},template:`
+
+
{{value}}
[修改]
-
-
-
{{value}} +
+
+
{{value}}   diff --git a/web/public/js/components.src.js b/web/public/js/components.src.js index b3c059af..1dcb378e 100755 --- a/web/public/js/components.src.js +++ b/web/public/js/components.src.js @@ -12695,14 +12695,19 @@ Vue.component("download-link", { }) Vue.component("values-box", { - props: ["values", "size", "maxlength", "name", "placeholder"], + props: ["values", "v-values", "size", "maxlength", "name", "placeholder"], data: function () { let values = this.values; if (values == null) { values = []; } + + if (this.vValues != null && typeof this.vValues == "object") { + values = this.vValues + } + return { - "vValues": values, + "realValues": values, "isUpdating": false, "isAdding": false, "index": 0, @@ -12722,7 +12727,7 @@ Vue.component("values-box", { this.cancel() this.isUpdating = true; this.index = index; - this.value = this.vValues[index]; + this.value = this.realValues[index]; var that = this; setTimeout(function () { that.$refs.value.focus(); @@ -12734,16 +12739,16 @@ Vue.component("values-box", { } if (this.isUpdating) { - Vue.set(this.vValues, this.index, this.value); + Vue.set(this.realValues, this.index, this.value); } else { - this.vValues.push(this.value); + this.realValues.push(this.value); } this.cancel() - this.$emit("change", this.vValues) + this.$emit("change", this.realValues) }, remove: function (index) { - this.vValues.$remove(index) - this.$emit("change", this.vValues) + this.realValues.$remove(index) + this.$emit("change", this.realValues) }, cancel: function () { this.isUpdating = false; @@ -12751,10 +12756,10 @@ Vue.component("values-box", { this.value = ""; }, updateAll: function (values) { - this.vValeus = values + this.realValues = values }, addValue: function (v) { - this.vValues.push(v) + this.realValues.push(v) }, startEditing: function () { @@ -12762,13 +12767,13 @@ Vue.component("values-box", { } }, template: `
-
-
{{value}}
+
+
{{value}}
[修改]
-
-
-
{{value}} +
+
+
{{value}}