换成单集群模式
This commit is contained in:
@@ -17,10 +17,11 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>HTTPDNS服务域名 *</label>
|
||||
<label>API服务地址 *</label>
|
||||
<select class="ui dropdown" name="clusterId" v-model="request.clusterId">
|
||||
<option value="">[请选择HTTPDNS服务域名]</option>
|
||||
<option v-for="cluster in currentClusters" :value="String(cluster.id)">{{cluster.displayName || cluster.name}}</option>
|
||||
<option value="">[请选择API服务地址]</option>
|
||||
<option v-for="cluster in currentClusters" :value="String(cluster.id)">{{cluster.displayName
|
||||
|| cluster.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
@@ -98,7 +99,8 @@
|
||||
<div class="ui segment">
|
||||
<div class="grey">客户端 IP</div>
|
||||
<div style="margin-top:.4em;">
|
||||
<code>{{response.data.client_ip || request.clientIp || '-'}}</code></div>
|
||||
<code>{{response.data.client_ip || request.clientIp || '-'}}</code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
@@ -144,4 +146,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -58,8 +58,7 @@
|
||||
this.request.domain = ""
|
||||
}
|
||||
|
||||
let primaryClusterId = (typeof selectedApp.primaryClusterId !== "undefined" && selectedApp.primaryClusterId !== null) ? Number(selectedApp.primaryClusterId) : 0
|
||||
let backupClusterId = (typeof selectedApp.backupClusterId !== "undefined" && selectedApp.backupClusterId !== null) ? Number(selectedApp.backupClusterId) : 0
|
||||
let appClusterIds = Array.isArray(selectedApp.clusterIds) ? selectedApp.clusterIds.map(Number) : []
|
||||
|
||||
let allowed = []
|
||||
for (let i = 0; i < this.clusters.length; i++) {
|
||||
@@ -68,7 +67,7 @@
|
||||
if (clusterId <= 0) {
|
||||
continue
|
||||
}
|
||||
if (clusterId === primaryClusterId || clusterId === backupClusterId) {
|
||||
if (appClusterIds.indexOf(clusterId) >= 0) {
|
||||
allowed.push(cluster)
|
||||
}
|
||||
}
|
||||
@@ -120,7 +119,7 @@
|
||||
return
|
||||
}
|
||||
if (this.request.clusterId.length === 0) {
|
||||
teaweb.warn("当前应用未绑定可用的 HTTPDNS 服务域名,请先在应用设置中配置主/备集群")
|
||||
teaweb.warn("当前应用未绑定可用集群,请先在应用设置中配置所属集群")
|
||||
return
|
||||
}
|
||||
if (this.request.domain.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user