优化代码

This commit is contained in:
GoEdgeLab
2021-10-25 19:01:56 +08:00
parent e0a62b3010
commit b79d13a271
2 changed files with 6 additions and 5 deletions

View File

@@ -41,6 +41,7 @@ func (this *UpgradeTemplateAction) RunPost(params struct {
createGroupResp, err := this.RPC().HTTPFirewallRuleGroupRPC().CreateHTTPFirewallRuleGroup(this.AdminContext(), &pb.CreateHTTPFirewallRuleGroupRequest{
IsOn: true,
Name: group.Name,
Code: group.Code,
Description: group.Description,
})
if err != nil {
@@ -60,8 +61,8 @@ func (this *UpgradeTemplateAction) RunPost(params struct {
return
}
_, err = this.RPC().HTTPFirewallRuleGroupRPC().AddHTTPFirewallRuleGroupSet(this.AdminContext(), &pb.AddHTTPFirewallRuleGroupSetRequest{
FirewallRuleGroupId: groupId,
FirewallRuleSetsConfigJSON: setJSON,
FirewallRuleGroupId: groupId,
FirewallRuleSetConfigJSON: setJSON,
})
if err != nil {
this.ErrorPage(err)
@@ -83,8 +84,8 @@ func (this *UpgradeTemplateAction) RunPost(params struct {
return
}
_, err = this.RPC().HTTPFirewallRuleGroupRPC().AddHTTPFirewallRuleGroupSet(this.AdminContext(), &pb.AddHTTPFirewallRuleGroupSetRequest{
FirewallRuleGroupId: oldGroup.Id,
FirewallRuleSetsConfigJSON: setJSON,
FirewallRuleGroupId: oldGroup.Id,
FirewallRuleSetConfigJSON: setJSON,
})
if err != nil {
this.ErrorPage(err)

View File

@@ -288,7 +288,7 @@ Vue.component("http-firewall-checkpoint-referer-block", {
<td>允许的来源域名</td>
<td>
<values-box :values="allowDomains" @change="changeAllowDomains"></values-box>
<p class="comment">允许的来源域名列表,比如<code-label>example.com</code-label>、<code-label>*.example.com</code-label>。</p>
<p class="comment">允许的来源域名列表,比如<code-label>example.com</code-label>、<code-label>*.example.com</code-label>。单个星号<code-label>*</code-label>表示允许所有域名。</p>
</td>
</tr>
</table>