diff --git a/internal/web/actions/default/dns/clusters/cluster.go b/internal/web/actions/default/dns/clusters/cluster.go index e7d2b43b..871ec491 100644 --- a/internal/web/actions/default/dns/clusters/cluster.go +++ b/internal/web/actions/default/dns/clusters/cluster.go @@ -40,6 +40,7 @@ func (this *ClusterAction) RunGet(params struct { this.ErrorPage(err) return } + var defaultRoute = dnsResp.DefaultRoute domainName := "" dnsMap := maps.Map{ "dnsName": dnsResp.Name, @@ -106,6 +107,26 @@ func (this *ClusterAction) RunGet(params struct { }) } } else { + // 默认线路 + var isResolved = false + if len(defaultRoute) > 0 { + recordType := "A" + if utils.IsIPv6(node.IpAddr) { + recordType = "AAAA" + } + checkResp, err := this.RPC().DNSDomainRPC().ExistDNSDomainRecord(this.AdminContext(), &pb.ExistDNSDomainRecordRequest{ + DnsDomainId: cluster.DnsDomainId, + Name: cluster.DnsName, + Type: recordType, + Route: defaultRoute, + Value: node.IpAddr, + }) + if err != nil { + this.ErrorPage(err) + return + } + isResolved = checkResp.IsOk + } nodeMaps = append(nodeMaps, maps.Map{ "id": node.Id, "name": node.Name, @@ -115,7 +136,7 @@ func (this *ClusterAction) RunGet(params struct { "code": "", }, "clusterId": node.NodeClusterId, - "isResolved": false, + "isResolved": isResolved, }) } } diff --git a/web/public/js/components/cluster/node-clusters-labels.js b/web/public/js/components/cluster/node-clusters-labels.js index 53c233ab..e4dd51d2 100644 --- a/web/public/js/components/cluster/node-clusters-labels.js +++ b/web/public/js/components/cluster/node-clusters-labels.js @@ -12,9 +12,6 @@ Vue.component("node-clusters-labels", { if (labelSize == null) { labelSize = "small" } - if (labelSize == "tiny") { - labelSize += " olive" - } return { cluster: cluster, secondaryClusters: secondaryClusters, @@ -22,7 +19,7 @@ Vue.component("node-clusters-labels", { } }, template: `
` }) \ No newline at end of file diff --git a/web/public/js/components/dns/dns-route-selector.js b/web/public/js/components/dns/dns-route-selector.js index 7e85cd3f..d864b6fe 100644 --- a/web/public/js/components/dns/dns-route-selector.js +++ b/web/public/js/components/dns/dns-route-selector.js @@ -11,12 +11,21 @@ Vue.component("dns-route-selector", { return v.code + "@" + v.domainId }), isAdding: false, - routeCode: "" + routeCode: "", + keyword: "", + searchingRoutes: this.vAllRoutes.$copy() } }, methods: { add: function () { this.isAdding = true + this.keyword = "" + this.routeCode = "" + + let that = this + setTimeout(function () { + that.$refs.keywordRef.focus() + }, 200) }, cancel: function () { this.isAdding = false @@ -50,6 +59,23 @@ Vue.component("dns-route-selector", { }) } }, + watch: { + keyword: function (keyword) { + if (keyword.length == 0) { + this.searchingRoutes = this.vAllRoutes.$copy() + this.routeCode = "" + return + } + this.searchingRoutes = this.vAllRoutes.filter(function (route) { + return teaweb.match(route.name, keyword) + }) + if (this.searchingRoutes.length > 0) { + this.routeCode = this.searchingRoutes[0].code + "@" + this.searchingRoutes[0].domainId + } else { + this.routeCode = "" + } + } + }, template: `