diff --git a/internal/rpc/rpc_client.go b/internal/rpc/rpc_client.go index b7f90232..7f85676e 100644 --- a/internal/rpc/rpc_client.go +++ b/internal/rpc/rpc_client.go @@ -316,6 +316,10 @@ func (this *RPCClient) IPLibraryRPC() pb.IPLibraryServiceClient { return pb.NewIPLibraryServiceClient(this.pickConn()) } +func (this *RPCClient) IPLibraryFileRPC() pb.IPLibraryFileServiceClient { + return pb.NewIPLibraryFileServiceClient(this.pickConn()) +} + func (this *RPCClient) IPListRPC() pb.IPListServiceClient { return pb.NewIPListServiceClient(this.pickConn()) } diff --git a/internal/web/actions/default/servers/components/waf/ipadmin/provinces.go b/internal/web/actions/default/servers/components/waf/ipadmin/provinces.go index 1a7b1777..2efdf59b 100644 --- a/internal/web/actions/default/servers/components/waf/ipadmin/provinces.go +++ b/internal/web/actions/default/servers/components/waf/ipadmin/provinces.go @@ -42,7 +42,7 @@ func (this *ProvincesAction) RunGet(params struct { selectedProvinceIds = policyConfig.Inbound.Region.DenyProvinceIds } - provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithCountryIdRequest{ + provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithRegionCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithRegionCountryIdRequest{ RegionCountryId: int64(ChinaCountryId), }) if err != nil { diff --git a/internal/web/actions/default/servers/server/settings/waf/ipadmin/provinces.go b/internal/web/actions/default/servers/server/settings/waf/ipadmin/provinces.go index 7bcad9e6..25209490 100644 --- a/internal/web/actions/default/servers/server/settings/waf/ipadmin/provinces.go +++ b/internal/web/actions/default/servers/server/settings/waf/ipadmin/provinces.go @@ -46,7 +46,7 @@ func (this *ProvincesAction) RunGet(params struct { selectedProvinceIds = policyConfig.Inbound.Region.DenyProvinceIds } - provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithCountryIdRequest{ + provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithRegionCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithRegionCountryIdRequest{ RegionCountryId: int64(ChinaCountryId), }) if err != nil { diff --git a/internal/web/actions/default/ui/provinceOptions.go b/internal/web/actions/default/ui/provinceOptions.go index 0ebd9daa..35a20d29 100644 --- a/internal/web/actions/default/ui/provinceOptions.go +++ b/internal/web/actions/default/ui/provinceOptions.go @@ -13,7 +13,7 @@ type ProvinceOptionsAction struct { } func (this *ProvinceOptionsAction) RunPost(params struct{}) { - provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithCountryIdRequest{RegionCountryId: ChinaCountryId}) + provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithRegionCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithRegionCountryIdRequest{RegionCountryId: ChinaCountryId}) if err != nil { this.ErrorPage(err) return diff --git a/internal/web/actions/default/ui/selectProvincesPopup.go b/internal/web/actions/default/ui/selectProvincesPopup.go index ec23a3de..8d2025f6 100644 --- a/internal/web/actions/default/ui/selectProvincesPopup.go +++ b/internal/web/actions/default/ui/selectProvincesPopup.go @@ -24,7 +24,7 @@ func (this *SelectProvincesPopupAction) RunGet(params struct { }) { var selectedProvinceIds = utils.SplitNumbers(params.ProvinceIds) - provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithCountryIdRequest{RegionCountryId: ChinaCountryId}) + provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithRegionCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithRegionCountryIdRequest{RegionCountryId: ChinaCountryId}) if err != nil { this.ErrorPage(err) return diff --git a/web/public/js/components/common/values-box.js b/web/public/js/components/common/values-box.js index 70e85990..30fbd98b 100644 --- a/web/public/js/components/common/values-box.js +++ b/web/public/js/components/common/values-box.js @@ -1,12 +1,17 @@ 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, @@ -26,7 +31,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(); @@ -38,16 +43,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; @@ -55,10 +60,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 () { @@ -66,13 +71,13 @@ Vue.component("values-box", { } }, template: `
-
-
{{value}}
+
+
{{value}}
[修改]
-
-
-
{{value}} +
+
+
{{value}}