mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-10 09:20:25 +08:00
集群DNS设置中增加”包含Ln节点“选项
This commit is contained in:
@@ -26,6 +26,7 @@ func (this *DetailAction) Init() {
|
|||||||
|
|
||||||
func (this *DetailAction) RunGet(params struct {
|
func (this *DetailAction) RunGet(params struct {
|
||||||
NodeId int64
|
NodeId int64
|
||||||
|
ClusterId int64
|
||||||
}) {
|
}) {
|
||||||
this.Data["nodeId"] = params.NodeId
|
this.Data["nodeId"] = params.NodeId
|
||||||
|
|
||||||
@@ -43,13 +44,13 @@ func (this *DetailAction) RunGet(params struct {
|
|||||||
// 主集群
|
// 主集群
|
||||||
var clusterMap maps.Map = nil
|
var clusterMap maps.Map = nil
|
||||||
if node.NodeCluster != nil {
|
if node.NodeCluster != nil {
|
||||||
clusterId := node.NodeCluster.Id
|
var clusterId = node.NodeCluster.Id
|
||||||
clusterResp, err := this.RPC().NodeClusterRPC().FindEnabledNodeCluster(this.AdminContext(), &pb.FindEnabledNodeClusterRequest{NodeClusterId: clusterId})
|
clusterResp, err := this.RPC().NodeClusterRPC().FindEnabledNodeCluster(this.AdminContext(), &pb.FindEnabledNodeClusterRequest{NodeClusterId: clusterId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cluster := clusterResp.NodeCluster
|
var cluster = clusterResp.NodeCluster
|
||||||
if cluster != nil {
|
if cluster != nil {
|
||||||
clusterMap = maps.Map{
|
clusterMap = maps.Map{
|
||||||
"id": cluster.Id,
|
"id": cluster.Id,
|
||||||
@@ -69,6 +70,14 @@ func (this *DetailAction) RunGet(params struct {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 当前访问集群的DNS设置
|
||||||
|
clusterDNSInfo, err := this.RPC().NodeClusterRPC().FindEnabledNodeClusterDNS(this.AdminContext(), &pb.FindEnabledNodeClusterDNSRequest{NodeClusterId: params.ClusterId})
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.Data["dnsIsExcludingLnNode"] = clusterDNSInfo != nil && !clusterDNSInfo.IncludingLnNodes && node.Level > 1
|
||||||
|
|
||||||
// IP地址
|
// IP地址
|
||||||
ipAddressesResp, err := this.RPC().NodeIPAddressRPC().FindAllEnabledNodeIPAddressesWithNodeId(this.AdminContext(), &pb.FindAllEnabledNodeIPAddressesWithNodeIdRequest{
|
ipAddressesResp, err := this.RPC().NodeIPAddressRPC().FindAllEnabledNodeIPAddressesWithNodeId(this.AdminContext(), &pb.FindAllEnabledNodeIPAddressesWithNodeIdRequest{
|
||||||
NodeId: params.NodeId,
|
NodeId: params.NodeId,
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
}
|
}
|
||||||
this.Data["ttl"] = dnsInfoResp.Ttl
|
this.Data["ttl"] = dnsInfoResp.Ttl
|
||||||
this.Data["cnameAsDomain"] = dnsInfoResp.CnameAsDomain
|
this.Data["cnameAsDomain"] = dnsInfoResp.CnameAsDomain
|
||||||
|
this.Data["includingLnNodes"] = dnsInfoResp.IncludingLnNodes
|
||||||
|
|
||||||
this.Show()
|
this.Show()
|
||||||
}
|
}
|
||||||
@@ -67,6 +68,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
CnameRecords []string
|
CnameRecords []string
|
||||||
Ttl int32
|
Ttl int32
|
||||||
CnameAsDomain bool
|
CnameAsDomain bool
|
||||||
|
IncludingLnNodes bool
|
||||||
|
|
||||||
ConfirmResetDomain bool // 是否确认重置域名
|
ConfirmResetDomain bool // 是否确认重置域名
|
||||||
|
|
||||||
@@ -115,6 +117,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
CnameRecords: params.CnameRecords,
|
CnameRecords: params.CnameRecords,
|
||||||
Ttl: params.Ttl,
|
Ttl: params.Ttl,
|
||||||
CnameAsDomain: params.CnameAsDomain,
|
CnameAsDomain: params.CnameAsDomain,
|
||||||
|
IncludingLnNodes: params.IncludingLnNodes,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -23,36 +23,38 @@ func (this *UpdateClusterPopupAction) RunGet(params struct {
|
|||||||
}) {
|
}) {
|
||||||
this.Data["clusterId"] = params.ClusterId
|
this.Data["clusterId"] = params.ClusterId
|
||||||
|
|
||||||
dnsResp, err := this.RPC().NodeClusterRPC().FindEnabledNodeClusterDNS(this.AdminContext(), &pb.FindEnabledNodeClusterDNSRequest{NodeClusterId: params.ClusterId})
|
dnsInfoResp, err := this.RPC().NodeClusterRPC().FindEnabledNodeClusterDNS(this.AdminContext(), &pb.FindEnabledNodeClusterDNSRequest{NodeClusterId: params.ClusterId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.Data["dnsName"] = dnsResp.Name
|
this.Data["dnsName"] = dnsInfoResp.Name
|
||||||
this.Data["nodesAutoSync"] = dnsResp.NodesAutoSync
|
this.Data["nodesAutoSync"] = dnsInfoResp.NodesAutoSync
|
||||||
this.Data["serversAutoSync"] = dnsResp.ServersAutoSync
|
this.Data["serversAutoSync"] = dnsInfoResp.ServersAutoSync
|
||||||
if dnsResp.Domain != nil {
|
if dnsInfoResp.Domain != nil {
|
||||||
this.Data["domainId"] = dnsResp.Domain.Id
|
this.Data["domainId"] = dnsInfoResp.Domain.Id
|
||||||
this.Data["domain"] = dnsResp.Domain.Name
|
this.Data["domain"] = dnsInfoResp.Domain.Name
|
||||||
} else {
|
} else {
|
||||||
this.Data["domainId"] = 0
|
this.Data["domainId"] = 0
|
||||||
this.Data["domain"] = ""
|
this.Data["domain"] = ""
|
||||||
}
|
}
|
||||||
if dnsResp.Provider != nil {
|
if dnsInfoResp.Provider != nil {
|
||||||
this.Data["providerType"] = dnsResp.Provider.Type
|
this.Data["providerType"] = dnsInfoResp.Provider.Type
|
||||||
this.Data["providerId"] = dnsResp.Provider.Id
|
this.Data["providerId"] = dnsInfoResp.Provider.Id
|
||||||
} else {
|
} else {
|
||||||
this.Data["providerType"] = ""
|
this.Data["providerType"] = ""
|
||||||
this.Data["providerId"] = 0
|
this.Data["providerId"] = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(dnsResp.CnameRecords) == 0 {
|
if len(dnsInfoResp.CnameRecords) == 0 {
|
||||||
this.Data["cnameRecords"] = []string{}
|
this.Data["cnameRecords"] = []string{}
|
||||||
} else {
|
} else {
|
||||||
this.Data["cnameRecords"] = dnsResp.CnameRecords
|
this.Data["cnameRecords"] = dnsInfoResp.CnameRecords
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Data["ttl"] = dnsResp.Ttl
|
this.Data["ttl"] = dnsInfoResp.Ttl
|
||||||
|
this.Data["cnameAsDomain"] = dnsInfoResp.CnameAsDomain
|
||||||
|
this.Data["includingLnNodes"] = dnsInfoResp.IncludingLnNodes
|
||||||
|
|
||||||
// 所有服务商
|
// 所有服务商
|
||||||
providerTypesResp, err := this.RPC().DNSProviderRPC().FindAllDNSProviderTypes(this.AdminContext(), &pb.FindAllDNSProviderTypesRequest{})
|
providerTypesResp, err := this.RPC().DNSProviderRPC().FindAllDNSProviderTypes(this.AdminContext(), &pb.FindAllDNSProviderTypesRequest{})
|
||||||
@@ -80,6 +82,8 @@ func (this *UpdateClusterPopupAction) RunPost(params struct {
|
|||||||
ServersAutoSync bool
|
ServersAutoSync bool
|
||||||
CnameRecords []string
|
CnameRecords []string
|
||||||
Ttl int32
|
Ttl int32
|
||||||
|
CnameAsDomain bool
|
||||||
|
IncludingLnNodes bool
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
CSRF *actionutils.CSRF
|
CSRF *actionutils.CSRF
|
||||||
@@ -115,6 +119,8 @@ func (this *UpdateClusterPopupAction) RunPost(params struct {
|
|||||||
ServersAutoSync: params.ServersAutoSync,
|
ServersAutoSync: params.ServersAutoSync,
|
||||||
CnameRecords: params.CnameRecords,
|
CnameRecords: params.CnameRecords,
|
||||||
Ttl: params.Ttl,
|
Ttl: params.Ttl,
|
||||||
|
CnameAsDomain: params.CnameAsDomain,
|
||||||
|
IncludingLnNodes: params.IncludingLnNodes,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
<tr v-if="node.records.length > 0">
|
<tr v-if="node.records.length > 0">
|
||||||
<td>DNS记录</td>
|
<td>DNS记录</td>
|
||||||
<td>
|
<td>
|
||||||
|
<div :style="{opacity: dnsIsExcludingLnNode ? 0.5 : 1.0}">
|
||||||
<table class="ui table celled">
|
<table class="ui table celled">
|
||||||
<thead class="full-width">
|
<thead class="full-width">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -67,7 +68,9 @@
|
|||||||
<td>{{record.value}}</td>
|
<td>{{record.value}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<p class="comment">通过设置A记录可以将集群上的服务请求转发到不同线路的节点上。</p>
|
<p class="comment" v-if="!dnsIsExcludingLnNode">通过设置A记录可以将集群上的服务请求转发到不同线路的节点上。</p>
|
||||||
|
</div>
|
||||||
|
<p class="comment" v-if="dnsIsExcludingLnNode"><span class="red">当前集群DNS已设置不解析Ln节点,所以当前节点不会加入DNS解析;如需加入,请修改"集群设置" -- "DNS设置" -- "更多选项" -- "包含Ln节点"。</span></p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -52,6 +52,13 @@
|
|||||||
<p class="comment">选中后,表示允许使用CNAME直接访问网站服务;如果取消选中,则表示CNAME只作为DNS解析记录使用。</p>
|
<p class="comment">选中后,表示允许使用CNAME直接访问网站服务;如果取消选中,则表示CNAME只作为DNS解析记录使用。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr v-show="teaIsPlus">
|
||||||
|
<td>包含Ln节点</td>
|
||||||
|
<td>
|
||||||
|
<checkbox name="includingLnNodes" v-model="includingLnNodes"></checkbox>
|
||||||
|
<p class="comment">选中后,表示域名解析中包含L2及以上级别节点。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>记录TTL</td>
|
<td>记录TTL</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -55,6 +55,20 @@
|
|||||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tbody v-show="moreOptionsVisible">
|
<tbody v-show="moreOptionsVisible">
|
||||||
|
<tr>
|
||||||
|
<td>允许通过CNAME访问网站服务</td>
|
||||||
|
<td>
|
||||||
|
<checkbox name="cnameAsDomain" v-model="cnameAsDomain"></checkbox>
|
||||||
|
<p class="comment">选中后,表示允许使用CNAME直接访问网站服务;如果取消选中,则表示CNAME只作为DNS解析记录使用。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr v-show="teaIsPlus">
|
||||||
|
<td>包含Ln节点</td>
|
||||||
|
<td>
|
||||||
|
<checkbox name="includingLnNodes" v-model="includingLnNodes"></checkbox>
|
||||||
|
<p class="comment">选中后,表示域名解析中包含L2及以上级别节点。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>记录TTL</td>
|
<td>记录TTL</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user