管理端全部功能跑通

This commit is contained in:
robin
2026-02-27 10:35:22 +08:00
parent 4d275c921d
commit 150799f41d
263 changed files with 22664 additions and 4053 deletions

View File

@@ -20,7 +20,7 @@
<label>所属集群 *</label>
<select class="ui dropdown" name="clusterId" v-model="request.clusterId">
<option value="">[请选择所属集群]</option>
<option v-for="cluster in clusters" :value="String(cluster.id)">{{cluster.name}}</option>
<option v-for="cluster in currentClusters" :value="String(cluster.id)">{{cluster.name}}</option>
</select>
</div>
<div class="field">

View File

@@ -22,6 +22,7 @@ Tea.context(function () {
this.isRequesting = false
this.currentDomains = []
this.currentClusters = []
if (typeof this.apps === "undefined") {
this.apps = []
@@ -41,6 +42,7 @@ Tea.context(function () {
if (selectedApp == null) {
this.currentDomains = []
this.currentClusters = []
this.request.domain = ""
this.request.clusterId = ""
return
@@ -56,8 +58,28 @@ Tea.context(function () {
this.request.domain = ""
}
if (typeof selectedApp.clusterId !== "undefined" && selectedApp.clusterId !== null) {
this.request.clusterId = String(selectedApp.clusterId)
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 allowed = []
for (let i = 0; i < this.clusters.length; i++) {
let cluster = this.clusters[i]
let clusterId = Number(cluster.id)
if (clusterId <= 0) {
continue
}
if (clusterId === primaryClusterId || clusterId === backupClusterId) {
allowed.push(cluster)
}
}
this.currentClusters = allowed
if (allowed.length > 0) {
if (!allowed.some((c) => String(c.id) === String(this.request.clusterId))) {
this.request.clusterId = String(allowed[0].id)
}
} else {
this.request.clusterId = ""
}
}
@@ -94,15 +116,15 @@ Tea.context(function () {
this.sendTestRequest = function () {
if (this.request.appId.length === 0) {
teaweb.warn("Please select target app")
teaweb.warn("请选择目标应用")
return
}
if (this.request.clusterId.length === 0) {
teaweb.warn("Please select cluster")
teaweb.warn("当前应用未绑定可用集群,请先在应用设置中配置主集群/备集群")
return
}
if (this.request.domain.length === 0) {
teaweb.warn("Please select domain")
teaweb.warn("请选择要解析的域名")
return
}
@@ -126,6 +148,7 @@ Tea.context(function () {
this.resetForm = function () {
this.request = this.newRequest()
this.currentDomains = []
this.currentClusters = []
this.response = {
hasResult: false,
code: -1,