优化代码

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{ createGroupResp, err := this.RPC().HTTPFirewallRuleGroupRPC().CreateHTTPFirewallRuleGroup(this.AdminContext(), &pb.CreateHTTPFirewallRuleGroupRequest{
IsOn: true, IsOn: true,
Name: group.Name, Name: group.Name,
Code: group.Code,
Description: group.Description, Description: group.Description,
}) })
if err != nil { if err != nil {
@@ -61,7 +62,7 @@ func (this *UpgradeTemplateAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPFirewallRuleGroupRPC().AddHTTPFirewallRuleGroupSet(this.AdminContext(), &pb.AddHTTPFirewallRuleGroupSetRequest{ _, err = this.RPC().HTTPFirewallRuleGroupRPC().AddHTTPFirewallRuleGroupSet(this.AdminContext(), &pb.AddHTTPFirewallRuleGroupSetRequest{
FirewallRuleGroupId: groupId, FirewallRuleGroupId: groupId,
FirewallRuleSetsConfigJSON: setJSON, FirewallRuleSetConfigJSON: setJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)
@@ -84,7 +85,7 @@ func (this *UpgradeTemplateAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPFirewallRuleGroupRPC().AddHTTPFirewallRuleGroupSet(this.AdminContext(), &pb.AddHTTPFirewallRuleGroupSetRequest{ _, err = this.RPC().HTTPFirewallRuleGroupRPC().AddHTTPFirewallRuleGroupSet(this.AdminContext(), &pb.AddHTTPFirewallRuleGroupSetRequest{
FirewallRuleGroupId: oldGroup.Id, FirewallRuleGroupId: oldGroup.Id,
FirewallRuleSetsConfigJSON: setJSON, FirewallRuleSetConfigJSON: setJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -288,7 +288,7 @@ Vue.component("http-firewall-checkpoint-referer-block", {
<td>允许的来源域名</td> <td>允许的来源域名</td>
<td> <td>
<values-box :values="allowDomains" @change="changeAllowDomains"></values-box> <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> </td>
</tr> </tr>
</table> </table>