mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-10 01:10:29 +08:00
集群支持使用域名搜索
This commit is contained in:
@@ -14,8 +14,14 @@ func (this *IndexAction) Init() {
|
|||||||
this.Nav("dns", "dns", "")
|
this.Nav("dns", "dns", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *IndexAction) RunGet(params struct{}) {
|
func (this *IndexAction) RunGet(params struct {
|
||||||
countResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClusters(this.AdminContext(), &pb.CountAllEnabledNodeClustersRequest{})
|
Keyword string
|
||||||
|
}) {
|
||||||
|
this.Data["keyword"] = params.Keyword
|
||||||
|
|
||||||
|
countResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClusters(this.AdminContext(), &pb.CountAllEnabledNodeClustersRequest{
|
||||||
|
Keyword: params.Keyword,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
@@ -24,8 +30,9 @@ func (this *IndexAction) RunGet(params struct{}) {
|
|||||||
this.Data["page"] = page.AsHTML()
|
this.Data["page"] = page.AsHTML()
|
||||||
|
|
||||||
clustersResp, err := this.RPC().NodeClusterRPC().ListEnabledNodeClusters(this.AdminContext(), &pb.ListEnabledNodeClustersRequest{
|
clustersResp, err := this.RPC().NodeClusterRPC().ListEnabledNodeClusters(this.AdminContext(), &pb.ListEnabledNodeClustersRequest{
|
||||||
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)
|
||||||
|
|||||||
@@ -2,7 +2,18 @@
|
|||||||
|
|
||||||
<div class="margin"></div>
|
<div class="margin"></div>
|
||||||
|
|
||||||
<p class="comment" v-if="clusters.length == 0">暂时还没有集群。</p>
|
<form class="ui form" method="get" action="/dns">
|
||||||
|
<div class="ui fields inline">
|
||||||
|
<div class="ui field">
|
||||||
|
<input type="text" name="keyword" placeholder="集群、域名..." v-model="keyword"/>
|
||||||
|
</div>
|
||||||
|
<div class="ui field">
|
||||||
|
<button class="ui button" type="submit">搜索</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<p class="comment" v-if="clusters.length == 0" style="margin-top: 1em">暂时还没有集群。</p>
|
||||||
<table class="ui table selectable celled" v-if="clusters.length > 0">
|
<table class="ui table selectable celled" v-if="clusters.length > 0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -15,10 +26,10 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tr v-for="cluster in clusters">
|
<tr v-for="cluster in clusters">
|
||||||
<td>
|
<td>
|
||||||
<a :href="'/dns/clusters/cluster?clusterId=' + cluster.id">{{cluster.name}}</a><link-icon :href="'/clusters/cluster?clusterId=' + cluster.id"></link-icon>
|
<a :href="'/dns/clusters/cluster?clusterId=' + cluster.id"><keyword :v-word="keyword">{{cluster.name}}</keyword></a><link-icon :href="'/clusters/cluster?clusterId=' + cluster.id"></link-icon>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span v-if="cluster.dnsName.length > 0 && cluster.domainName.length > 0"><em class="italic">{{cluster.dnsName}}</em>.{{cluster.domainName}}</span>
|
<span v-if="cluster.dnsName.length > 0 && cluster.domainName.length > 0"><em class="italic"><keyword :v-word="keyword">{{cluster.dnsName}}</keyword></em>.<keyword :v-word="keyword">{{cluster.domainName}}</keyword></span>
|
||||||
<span v-else="" class="disabled">-</span>
|
<span v-else="" class="disabled">-</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -34,6 +45,6 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<p class="comment">这里列出了所有集群对应的域名设置。</p>
|
<p class="comment" v-if="clusters.length > 0">这里列出了所有集群对应的域名设置。</p>
|
||||||
|
|
||||||
<div class="page" v-html="page"></div>
|
<div class="page" v-html="page"></div>
|
||||||
Reference in New Issue
Block a user