diff --git a/internal/web/actions/default/servers/components/waf/ipadmin/index.go b/internal/web/actions/default/servers/components/waf/ipadmin/index.go index 777a8e30..bb5e86d2 100644 --- a/internal/web/actions/default/servers/components/waf/ipadmin/index.go +++ b/internal/web/actions/default/servers/components/waf/ipadmin/index.go @@ -36,7 +36,7 @@ func (this *IndexAction) RunGet(params struct { this.NotFound("firewallPolicy", params.FirewallPolicyId) return } - selectedCountryIds := []int64{} + var selectedCountryIds = []int64{} if policyConfig.Inbound != nil && policyConfig.Inbound.Region != nil { selectedCountryIds = policyConfig.Inbound.Region.DenyCountryIds } @@ -46,11 +46,11 @@ func (this *IndexAction) RunGet(params struct { this.ErrorPage(err) return } - countryMaps := []maps.Map{} + var countryMaps = []maps.Map{} for _, country := range countriesResp.RegionCountries { countryMaps = append(countryMaps, maps.Map{ "id": country.Id, - "name": country.Name, + "name": country.DisplayName, "letter": strings.ToUpper(string(country.Pinyin[0][0])), "isChecked": lists.ContainsInt64(selectedCountryIds, country.Id), }) 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 2efdf59b..abbb4ad3 100644 --- a/internal/web/actions/default/servers/components/waf/ipadmin/provinces.go +++ b/internal/web/actions/default/servers/components/waf/ipadmin/provinces.go @@ -37,7 +37,7 @@ func (this *ProvincesAction) RunGet(params struct { this.NotFound("firewallPolicy", params.FirewallPolicyId) return } - selectedProvinceIds := []int64{} + var selectedProvinceIds = []int64{} if policyConfig.Inbound != nil && policyConfig.Inbound.Region != nil { selectedProvinceIds = policyConfig.Inbound.Region.DenyProvinceIds } @@ -49,11 +49,11 @@ func (this *ProvincesAction) RunGet(params struct { this.ErrorPage(err) return } - provinceMaps := []maps.Map{} + var provinceMaps = []maps.Map{} for _, province := range provincesResp.RegionProvinces { provinceMaps = append(provinceMaps, maps.Map{ "id": province.Id, - "name": province.Name, + "name": province.DisplayName, "isChecked": lists.ContainsInt64(selectedProvinceIds, province.Id), }) } diff --git a/internal/web/actions/default/servers/groups/group/settings/waf/ipadmin/countries.go b/internal/web/actions/default/servers/groups/group/settings/waf/ipadmin/countries.go index 101aa0ac..7e28e32d 100644 --- a/internal/web/actions/default/servers/groups/group/settings/waf/ipadmin/countries.go +++ b/internal/web/actions/default/servers/groups/group/settings/waf/ipadmin/countries.go @@ -55,7 +55,7 @@ func (this *CountriesAction) RunGet(params struct { for _, country := range countriesResp.RegionCountries { countryMaps = append(countryMaps, maps.Map{ "id": country.Id, - "name": country.Name, + "name": country.DisplayName, "letter": strings.ToUpper(string(country.Pinyin[0][0])), "isChecked": lists.ContainsInt64(selectedCountryIds, country.Id), }) diff --git a/internal/web/actions/default/servers/groups/group/settings/waf/ipadmin/provinces.go b/internal/web/actions/default/servers/groups/group/settings/waf/ipadmin/provinces.go index 7bcad9e6..b76d57dd 100644 --- a/internal/web/actions/default/servers/groups/group/settings/waf/ipadmin/provinces.go +++ b/internal/web/actions/default/servers/groups/group/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 { @@ -57,7 +57,7 @@ func (this *ProvincesAction) RunGet(params struct { for _, province := range provincesResp.RegionProvinces { provinceMaps = append(provinceMaps, maps.Map{ "id": province.Id, - "name": province.Name, + "name": province.DisplayName, "isChecked": lists.ContainsInt64(selectedProvinceIds, province.Id), }) } diff --git a/internal/web/actions/default/servers/server/settings/waf/ipadmin/countries.go b/internal/web/actions/default/servers/server/settings/waf/ipadmin/countries.go index 101aa0ac..7e28e32d 100644 --- a/internal/web/actions/default/servers/server/settings/waf/ipadmin/countries.go +++ b/internal/web/actions/default/servers/server/settings/waf/ipadmin/countries.go @@ -55,7 +55,7 @@ func (this *CountriesAction) RunGet(params struct { for _, country := range countriesResp.RegionCountries { countryMaps = append(countryMaps, maps.Map{ "id": country.Id, - "name": country.Name, + "name": country.DisplayName, "letter": strings.ToUpper(string(country.Pinyin[0][0])), "isChecked": lists.ContainsInt64(selectedCountryIds, country.Id), }) 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 25209490..b76d57dd 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 @@ -57,7 +57,7 @@ func (this *ProvincesAction) RunGet(params struct { for _, province := range provincesResp.RegionProvinces { provinceMaps = append(provinceMaps, maps.Map{ "id": province.Id, - "name": province.Name, + "name": province.DisplayName, "isChecked": lists.ContainsInt64(selectedProvinceIds, province.Id), }) } diff --git a/internal/web/actions/default/settings/security/index.go b/internal/web/actions/default/settings/security/index.go index 7ced7d06..506eb753 100644 --- a/internal/web/actions/default/settings/security/index.go +++ b/internal/web/actions/default/settings/security/index.go @@ -40,7 +40,7 @@ func (this *IndexAction) RunGet(params struct{}) { if country != nil { countryMaps = append(countryMaps, maps.Map{ "id": country.Id, - "name": country.Name, + "name": country.DisplayName, }) } } @@ -58,7 +58,7 @@ func (this *IndexAction) RunGet(params struct{}) { if province != nil { provinceMaps = append(provinceMaps, maps.Map{ "id": province.Id, - "name": province.Name, + "name": province.DisplayName, }) } } diff --git a/internal/web/actions/default/ui/provinceOptions.go b/internal/web/actions/default/ui/provinceOptions.go index 35a20d29..4c967d0b 100644 --- a/internal/web/actions/default/ui/provinceOptions.go +++ b/internal/web/actions/default/ui/provinceOptions.go @@ -25,7 +25,7 @@ func (this *ProvinceOptionsAction) RunPost(params struct{}) { } provinceMaps = append(provinceMaps, maps.Map{ "id": province.Id, - "name": province.Name, + "name": province.DisplayName, "codes": province.Codes, }) } diff --git a/internal/web/actions/default/ui/selectCountriesPopup.go b/internal/web/actions/default/ui/selectCountriesPopup.go index a243456c..b53f0f3b 100644 --- a/internal/web/actions/default/ui/selectCountriesPopup.go +++ b/internal/web/actions/default/ui/selectCountriesPopup.go @@ -32,7 +32,7 @@ func (this *SelectCountriesPopupAction) RunGet(params struct { for _, country := range countriesResp.RegionCountries { countryMaps = append(countryMaps, maps.Map{ "id": country.Id, - "name": country.Name, + "name": country.DisplayName, "letter": strings.ToUpper(string(country.Pinyin[0][0])), "isChecked": lists.ContainsInt64(selectedCountryIds, country.Id), }) @@ -61,7 +61,7 @@ func (this *SelectCountriesPopupAction) RunPost(params struct { } countryMaps = append(countryMaps, maps.Map{ "id": country.Id, - "name": country.Name, + "name": country.DisplayName, }) } this.Data["countries"] = countryMaps diff --git a/internal/web/actions/default/ui/selectProvincesPopup.go b/internal/web/actions/default/ui/selectProvincesPopup.go index 8d2025f6..d90be1d8 100644 --- a/internal/web/actions/default/ui/selectProvincesPopup.go +++ b/internal/web/actions/default/ui/selectProvincesPopup.go @@ -33,7 +33,7 @@ func (this *SelectProvincesPopupAction) RunGet(params struct { for _, province := range provincesResp.RegionProvinces { provinceMaps = append(provinceMaps, maps.Map{ "id": province.Id, - "name": province.Name, + "name": province.DisplayName, "isChecked": lists.ContainsInt64(selectedProvinceIds, province.Id), }) } @@ -61,7 +61,7 @@ func (this *SelectProvincesPopupAction) RunPost(params struct { } provinceMaps = append(provinceMaps, maps.Map{ "id": province.Id, - "name": province.Name, + "name": province.DisplayName, }) } this.Data["provinces"] = provinceMaps diff --git a/web/views/@default/@layout.css b/web/views/@default/@layout.css index 5121ee24..718a66c6 100644 --- a/web/views/@default/@layout.css +++ b/web/views/@default/@layout.css @@ -164,7 +164,7 @@ span.disabled { a.enabled, span.enabled, span.green { - color: #21ba45; + color: #2c662d; } span.grey, label.grey, diff --git a/web/views/@default/@layout.less b/web/views/@default/@layout.less index 976f3dea..3a5fb7ee 100644 --- a/web/views/@default/@layout.less +++ b/web/views/@default/@layout.less @@ -19,7 +19,7 @@ a.disabled, a.disabled:hover, a.disabled:active, span.disabled { } a.enabled, span.enabled, span.green { - color: #21ba45; + color: #2c662d; } span.grey, label.grey, p.grey {