mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 13:10:26 +08:00 
			
		
		
		
	可以使用集群搜索WAF策略、缓存策略
This commit is contained in:
		@@ -17,12 +17,15 @@ func (this *IndexAction) Init() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (this *IndexAction) RunGet(params struct {
 | 
					func (this *IndexAction) RunGet(params struct {
 | 
				
			||||||
	Keyword string
 | 
						ClusterId int64
 | 
				
			||||||
 | 
						Keyword   string
 | 
				
			||||||
}) {
 | 
					}) {
 | 
				
			||||||
	this.Data["keyword"] = params.Keyword
 | 
						this.Data["keyword"] = params.Keyword
 | 
				
			||||||
 | 
						this.Data["clusterId"] = params.ClusterId
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	countResp, err := this.RPC().HTTPCachePolicyRPC().CountAllEnabledHTTPCachePolicies(this.AdminContext(), &pb.CountAllEnabledHTTPCachePoliciesRequest{
 | 
						countResp, err := this.RPC().HTTPCachePolicyRPC().CountAllEnabledHTTPCachePolicies(this.AdminContext(), &pb.CountAllEnabledHTTPCachePoliciesRequest{
 | 
				
			||||||
		Keyword: params.Keyword,
 | 
							NodeClusterId: params.ClusterId,
 | 
				
			||||||
 | 
							Keyword:       params.Keyword,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		this.ErrorPage(err)
 | 
							this.ErrorPage(err)
 | 
				
			||||||
@@ -33,9 +36,10 @@ func (this *IndexAction) RunGet(params struct {
 | 
				
			|||||||
	this.Data["page"] = page.AsHTML()
 | 
						this.Data["page"] = page.AsHTML()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	listResp, err := this.RPC().HTTPCachePolicyRPC().ListEnabledHTTPCachePolicies(this.AdminContext(), &pb.ListEnabledHTTPCachePoliciesRequest{
 | 
						listResp, err := this.RPC().HTTPCachePolicyRPC().ListEnabledHTTPCachePolicies(this.AdminContext(), &pb.ListEnabledHTTPCachePoliciesRequest{
 | 
				
			||||||
		Keyword: params.Keyword,
 | 
							Keyword:       params.Keyword,
 | 
				
			||||||
		Offset:  page.Offset,
 | 
							NodeClusterId: params.ClusterId,
 | 
				
			||||||
		Size:    page.Size,
 | 
							Offset:        page.Offset,
 | 
				
			||||||
 | 
							Size:          page.Size,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		this.ErrorPage(err)
 | 
							this.ErrorPage(err)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,12 +17,15 @@ func (this *IndexAction) Init() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (this *IndexAction) RunGet(params struct {
 | 
					func (this *IndexAction) RunGet(params struct {
 | 
				
			||||||
	Keyword string
 | 
						Keyword   string
 | 
				
			||||||
 | 
						ClusterId int64
 | 
				
			||||||
}) {
 | 
					}) {
 | 
				
			||||||
	this.Data["keyword"] = params.Keyword
 | 
						this.Data["keyword"] = params.Keyword
 | 
				
			||||||
 | 
						this.Data["clusterId"] = params.ClusterId
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	countResp, err := this.RPC().HTTPFirewallPolicyRPC().CountAllEnabledHTTPFirewallPolicies(this.AdminContext(), &pb.CountAllEnabledHTTPFirewallPoliciesRequest{
 | 
						countResp, err := this.RPC().HTTPFirewallPolicyRPC().CountAllEnabledHTTPFirewallPolicies(this.AdminContext(), &pb.CountAllEnabledHTTPFirewallPoliciesRequest{
 | 
				
			||||||
		Keyword: params.Keyword,
 | 
							NodeClusterId: params.ClusterId,
 | 
				
			||||||
 | 
							Keyword:       params.Keyword,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		this.ErrorPage(err)
 | 
							this.ErrorPage(err)
 | 
				
			||||||
@@ -32,9 +35,10 @@ func (this *IndexAction) RunGet(params struct {
 | 
				
			|||||||
	page := this.NewPage(count)
 | 
						page := this.NewPage(count)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	listResp, err := this.RPC().HTTPFirewallPolicyRPC().ListEnabledHTTPFirewallPolicies(this.AdminContext(), &pb.ListEnabledHTTPFirewallPoliciesRequest{
 | 
						listResp, err := this.RPC().HTTPFirewallPolicyRPC().ListEnabledHTTPFirewallPolicies(this.AdminContext(), &pb.ListEnabledHTTPFirewallPoliciesRequest{
 | 
				
			||||||
		Keyword: params.Keyword,
 | 
							NodeClusterId: params.ClusterId,
 | 
				
			||||||
		Offset:  page.Offset,
 | 
							Keyword:       params.Keyword,
 | 
				
			||||||
		Size:    page.Size,
 | 
							Offset:        page.Offset,
 | 
				
			||||||
 | 
							Size:          page.Size,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		this.ErrorPage(err)
 | 
							this.ErrorPage(err)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,13 +10,16 @@
 | 
				
			|||||||
<div class="margin"></div>
 | 
					<div class="margin"></div>
 | 
				
			||||||
<form class="ui form" method="get" action="/servers/components/cache">
 | 
					<form class="ui form" method="get" action="/servers/components/cache">
 | 
				
			||||||
    <div class="ui fields inline">
 | 
					    <div class="ui fields inline">
 | 
				
			||||||
 | 
					        <div class="ui field">
 | 
				
			||||||
 | 
					            <node-cluster-combo-box :v-cluster-id="clusterId"></node-cluster-combo-box>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
        <div class="ui field">
 | 
					        <div class="ui field">
 | 
				
			||||||
            <input type="text" name="keyword" v-model="keyword" placeholder="策略名称..."/>
 | 
					            <input type="text" name="keyword" v-model="keyword" placeholder="策略名称..."/>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="ui field">
 | 
					        <div class="ui field">
 | 
				
			||||||
            <button type="submit" class="ui button">搜索</button>
 | 
					            <button type="submit" class="ui button">搜索</button>
 | 
				
			||||||
             
 | 
					             
 | 
				
			||||||
            <a :href="Tea.url('.')" v-if="keyword.length > 0">[清除条件]</a>
 | 
					            <a :href="Tea.url('.')" v-if="keyword.length > 0 || clusterId > 0">[清除条件]</a>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</form>
 | 
					</form>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,13 +10,16 @@
 | 
				
			|||||||
<div class="margin"></div>
 | 
					<div class="margin"></div>
 | 
				
			||||||
<form class="ui form" method="get" action="/servers/components/waf">
 | 
					<form class="ui form" method="get" action="/servers/components/waf">
 | 
				
			||||||
    <div class="ui fields inline">
 | 
					    <div class="ui fields inline">
 | 
				
			||||||
 | 
					        <div class="ui field">
 | 
				
			||||||
 | 
					            <node-cluster-combo-box :v-cluster-id="clusterId"></node-cluster-combo-box>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
        <div class="ui field">
 | 
					        <div class="ui field">
 | 
				
			||||||
            <input type="text" name="keyword" v-model="keyword" placeholder="策略名称..."/>
 | 
					            <input type="text" name="keyword" v-model="keyword" placeholder="策略名称..."/>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="ui field">
 | 
					        <div class="ui field">
 | 
				
			||||||
            <button type="submit" class="ui button">搜索</button>
 | 
					            <button type="submit" class="ui button">搜索</button>
 | 
				
			||||||
             
 | 
					             
 | 
				
			||||||
            <a :href="Tea.url('.')" v-if="keyword.length > 0">[清除条件]</a>
 | 
					            <a :href="Tea.url('.')" v-if="keyword.length > 0 || clusterId > 0">[清除条件]</a>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</form>
 | 
					</form>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user