mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	选择证书时,如果证书列表为空,则提示可以搜索未指定用户证书
This commit is contained in:
		@@ -34,6 +34,8 @@ func (this *SelectPopupAction) RunGet(params struct {
 | 
				
			|||||||
	SelectedCertIds string
 | 
						SelectedCertIds string
 | 
				
			||||||
	Keyword         string
 | 
						Keyword         string
 | 
				
			||||||
}) {
 | 
					}) {
 | 
				
			||||||
 | 
						this.Data["searchingServerId"] = params.ServerId
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// 服务相关
 | 
						// 服务相关
 | 
				
			||||||
	if params.ServerId > 0 {
 | 
						if params.ServerId > 0 {
 | 
				
			||||||
		serverResp, err := this.RPC().ServerRPC().FindEnabledUserServerBasic(this.AdminContext(), &pb.FindEnabledUserServerBasicRequest{ServerId: params.ServerId})
 | 
							serverResp, err := this.RPC().ServerRPC().FindEnabledUserServerBasic(this.AdminContext(), &pb.FindEnabledUserServerBasicRequest{ServerId: params.ServerId})
 | 
				
			||||||
@@ -66,7 +68,8 @@ func (this *SelectPopupAction) RunGet(params struct {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// 用户相关
 | 
						// 用户相关
 | 
				
			||||||
	this.Data["userId"] = params.UserId
 | 
						this.Data["userId"] = params.UserId // 可变
 | 
				
			||||||
 | 
						this.Data["searchingUserId"] = params.UserId
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// 域名搜索相关
 | 
						// 域名搜索相关
 | 
				
			||||||
	var url = this.Request.URL.Path
 | 
						var url = this.Request.URL.Path
 | 
				
			||||||
@@ -82,6 +85,7 @@ func (this *SelectPopupAction) RunGet(params struct {
 | 
				
			|||||||
	if len(searchingDomains) > maxDomains {
 | 
						if len(searchingDomains) > maxDomains {
 | 
				
			||||||
		searchingDomains = searchingDomains[:maxDomains]
 | 
							searchingDomains = searchingDomains[:maxDomains]
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						this.Data["allSearchingDomains"] = params.SearchingDomains
 | 
				
			||||||
	this.Data["searchingDomains"] = searchingDomains
 | 
						this.Data["searchingDomains"] = searchingDomains
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	this.Data["keyword"] = params.Keyword
 | 
						this.Data["keyword"] = params.Keyword
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,9 +24,12 @@ Vue.component("user-selector", {
 | 
				
			|||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				this.$emit("change", 0)
 | 
									this.$emit("change", 0)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							clear: function () {
 | 
				
			||||||
 | 
								this.$refs.comboBox.clear()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	template: `<div>
 | 
						template: `<div>
 | 
				
			||||||
	<combo-box placeholder="选择用户" :data-url="dataURL" :data-key="'users'" data-search="on" name="userId" :v-value="userId" @change="change"></combo-box>
 | 
						<combo-box placeholder="选择用户" :data-url="dataURL" :data-key="'users'" data-search="on" name="userId" :v-value="userId" @change="change" ref="comboBox"></combo-box>
 | 
				
			||||||
</div>`
 | 
					</div>`
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
@@ -3,13 +3,13 @@
 | 
				
			|||||||
<h3>选择证书 <span v-if="searchingDomains.length > 0">(当前服务域名:{{searchingDomains[0]}}<var style="font-style: normal" v-if="searchingDomains.length > 1">等{{searchingDomains.length}}个域名</var>)</span></h3>
 | 
					<h3>选择证书 <span v-if="searchingDomains.length > 0">(当前服务域名:{{searchingDomains[0]}}<var style="font-style: normal" v-if="searchingDomains.length > 1">等{{searchingDomains.length}}个域名</var>)</span></h3>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<!-- 搜索表单 -->
 | 
					<!-- 搜索表单 -->
 | 
				
			||||||
<form class="ui form" action="/servers/certs/selectPopup">
 | 
					<form class="ui form" action="/servers/certs/selectPopup" ref="searchForm">
 | 
				
			||||||
    <input type="hidden" name="selectedCertIds" :value="selectedCertIds"/>
 | 
					    <input type="hidden" name="selectedCertIds" :value="selectedCertIds"/>
 | 
				
			||||||
    <input type="hidden" name="searchingType" :value="searchingType"/>
 | 
					    <input type="hidden" name="searchingType" :value="searchingType"/>
 | 
				
			||||||
    <input type="hidden" name="searchingDomains" :value="searchingDomains.join(',')"/>
 | 
					    <input type="hidden" name="searchingDomains" :value="searchingDomains.join(',')"/>
 | 
				
			||||||
    <div class="ui fields inline">
 | 
					    <div class="ui fields inline">
 | 
				
			||||||
        <div class="ui field">
 | 
					        <div class="ui field">
 | 
				
			||||||
            <user-selector :v-user-id="userId"></user-selector>
 | 
					            <user-selector :v-user-id="userId" ref="userSelector"></user-selector>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="ui field">
 | 
					        <div class="ui field">
 | 
				
			||||||
            <input type="text" name="keyword" v-model="keyword" placeholder="域名、说明文字等" size="30"/>
 | 
					            <input type="text" name="keyword" v-model="keyword" placeholder="域名、说明文字等" size="30"/>
 | 
				
			||||||
@@ -25,6 +25,8 @@
 | 
				
			|||||||
<div v-if="searchingDomains.length > 0">
 | 
					<div v-if="searchingDomains.length > 0">
 | 
				
			||||||
    <div class="ui divider" style="margin-bottom: 0"></div>
 | 
					    <div class="ui divider" style="margin-bottom: 0"></div>
 | 
				
			||||||
    <second-menu>
 | 
					    <second-menu>
 | 
				
			||||||
 | 
					        <span class="item"><span v-if="searchingUserId > 0">当前用户</span><span v-else>未指定用户</span></span>
 | 
				
			||||||
 | 
					        <raquo-item></raquo-item>
 | 
				
			||||||
        <menu-item :active="searchingType == 'all'" :href="baseURL + '&searchingType=all'">所有证书 <span class="small">({{totalAll}})</span></menu-item>
 | 
					        <menu-item :active="searchingType == 'all'" :href="baseURL + '&searchingType=all'">所有证书 <span class="small">({{totalAll}})</span></menu-item>
 | 
				
			||||||
        <span class="disabled item">|</span>
 | 
					        <span class="disabled item">|</span>
 | 
				
			||||||
        <menu-item :active="searchingType == 'match'" :href="baseURL + '&searchingType=match'">域名匹配证书 <span class="small"> ({{totalMatch}})</span></menu-item>
 | 
					        <menu-item :active="searchingType == 'match'" :href="baseURL + '&searchingType=match'">域名匹配证书 <span class="small"> ({{totalMatch}})</span></menu-item>
 | 
				
			||||||
@@ -38,7 +40,9 @@
 | 
				
			|||||||
</div>
 | 
					</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<!-- 证书列表 -->
 | 
					<!-- 证书列表 -->
 | 
				
			||||||
<p class="comment" v-if="certs.length == 0">暂时还没有<span v-if="searchingType == 'match'">跟所添加域名匹配的</span>相关证书。</p>
 | 
					<p class="comment" v-if="certs.length == 0">
 | 
				
			||||||
 | 
					    暂时还没有<span v-if="searchingType == 'match'">跟所添加域名匹配的</span>相关证书<span v-if="searchingUserId > 0">,<a href="" @click.prevent="searchNoneUserCerts">[尝试搜索未指定用户证书]</a></span>。
 | 
				
			||||||
 | 
					</p>
 | 
				
			||||||
<table class="ui table selectable celled" v-if="certs.length > 0">
 | 
					<table class="ui table selectable celled" v-if="certs.length > 0">
 | 
				
			||||||
	<thead>
 | 
						<thead>
 | 
				
			||||||
        <tr>
 | 
					        <tr>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -74,4 +74,11 @@ Tea.context(function () {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						this.searchNoneUserCerts = function () {
 | 
				
			||||||
 | 
							this.$refs.userSelector.clear()
 | 
				
			||||||
 | 
							this.$delay(function () {
 | 
				
			||||||
 | 
								this.$refs.searchForm.submit()
 | 
				
			||||||
 | 
							}, 10)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
		Reference in New Issue
	
	Block a user