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: `
- {{cluster.name}} - {{c.name}} + {{cluster.name}} + {{c.name}}
` }) \ 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: `
@@ -62,16 +88,20 @@ Vue.component("dns-route-selector", {
- + +
+
+ +
+
- +
diff --git a/web/views/@default/clusters/cluster/createNode.css b/web/views/@default/clusters/cluster/createNode.css index 3fca0942..b49f9bab 100644 --- a/web/views/@default/clusters/cluster/createNode.css +++ b/web/views/@default/clusters/cluster/createNode.css @@ -5,7 +5,7 @@ top: 10em; } .row { - line-height: 4; + line-height: 2; } .step.active { font-weight: bold; diff --git a/web/views/@default/clusters/cluster/createNode.html b/web/views/@default/clusters/cluster/createNode.html index e158998f..7a1b6f22 100644 --- a/web/views/@default/clusters/cluster/createNode.html +++ b/web/views/@default/clusters/cluster/createNode.html @@ -140,11 +140,13 @@
-
在边缘节点安装目录下,复制configs/api.template.yamlconfigs/api.yaml,然后修改文件里面的内容为以下内容:
+
上传边缘节点程序到服务器并解压,然后在边缘节点安装目录下,复制configs/api.template.yamlconfigs/api.yaml,然后修改文件里面的内容为以下内容:
+
rpc: endpoints: [ {{apiEndpoints}} ] nodeId: "{{node.uniqueId}}" secret: "{{node.secret}}" +
然后再使用bin/edge-node start命令启动节点。
diff --git a/web/views/@default/clusters/cluster/createNode.less b/web/views/@default/clusters/cluster/createNode.less index 721683e5..fe7cf188 100644 --- a/web/views/@default/clusters/cluster/createNode.less +++ b/web/views/@default/clusters/cluster/createNode.less @@ -7,7 +7,7 @@ } .row { - line-height: 4; + line-height: 2; } .step.active { diff --git a/web/views/@default/dns/clusters/cluster.js b/web/views/@default/dns/clusters/cluster.js index c78a78f7..cd6f8412 100644 --- a/web/views/@default/dns/clusters/cluster.js +++ b/web/views/@default/dns/clusters/cluster.js @@ -12,6 +12,7 @@ Tea.context(function () { this.updateNode = function (clusterId, nodeId) { teaweb.popup("/dns/issues/updateNodePopup?clusterId=" + clusterId + "&nodeId=" + nodeId, { + width: "46em", height: "26em", callback: function () { teaweb.success("保存成功", function () { diff --git a/web/views/@default/dns/issues/index.js b/web/views/@default/dns/issues/index.js index 02a449f6..aa1c813a 100644 --- a/web/views/@default/dns/issues/index.js +++ b/web/views/@default/dns/issues/index.js @@ -20,6 +20,8 @@ Tea.context(function () { this.updateNode = function (clusterId, nodeId) { let that = this teaweb.popup("/dns/issues/updateNodePopup?clusterId=" + clusterId + "&nodeId=" + nodeId, { + width: "46em", + height: "26em", callback: function () { teaweb.success("保存成功", function () { that.reload()