mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-04 05:00:25 +08:00
初步实现多集群共享节点
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<second-menu>
|
||||
<menu-item :href="'/clusters/cluster/nodes?clusterId=' + clusterId">节点列表</menu-item>
|
||||
<menu-item :href="'/clusters/cluster/nodes?clusterId=' + clusterId">节点列表</menu-item>
|
||||
<span class="item disabled">|</span>
|
||||
<menu-item :href="'/clusters/cluster/node?clusterId=' + clusterId + '&nodeId=' + node.id" code="node"
|
||||
v-if="!teaIsPlus">"{{node.name}}"节点详情</menu-item>
|
||||
@@ -7,6 +7,6 @@
|
||||
<menu-item :href="'/clusters/cluster/node/detail?clusterId=' + clusterId + '&nodeId=' + node.id" code="node" v-if="teaIsPlus">节点详情</menu-item>
|
||||
<menu-item :href="'/clusters/cluster/node/thresholds?clusterId=' + clusterId + '&nodeId=' + node.id" code="threshold" v-if="teaIsPlus">阈值设置</menu-item>
|
||||
<menu-item :href="'/clusters/cluster/node/logs?clusterId=' + clusterId + '&nodeId=' + node.id" code="log">运行日志</menu-item>
|
||||
<menu-item :href="'/clusters/cluster/node/install?clusterId=' + clusterId + '&nodeId=' + node.id" code="install">安装节点</menu-item>
|
||||
<menu-item :href="'/clusters/cluster/node/update?clusterId=' + clusterId + '&nodeId=' + node.id" code="update">修改设置</menu-item>
|
||||
<menu-item :href="'/clusters/cluster/node/install?clusterId=' + clusterId + '&nodeId=' + node.id" code="install">安装节点</menu-item>
|
||||
</second-menu>
|
||||
@@ -12,6 +12,12 @@
|
||||
<td>状态</td>
|
||||
<td><label-on :v-is-on="node.isOn"></label-on></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>所属集群</td>
|
||||
<td>
|
||||
<node-clusters-labels :v-primary-cluster="node.cluster" :v-secondary-clusters="node.secondaryClusters"></node-clusters-labels>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IP地址</td>
|
||||
<td>
|
||||
@@ -29,38 +35,34 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="dnsRoutes.length > 0 && dnsRoutes[0].name.length > 0">
|
||||
<tr v-if="node.routes.length > 0">
|
||||
<td>DNS线路</td>
|
||||
<td>
|
||||
<span class="ui label tiny basic" v-for="route in dnsRoutes">{{route.name}}</span>
|
||||
<span class="ui label tiny basic" v-for="route in node.routes">{{route.name}} <span class="grey small">({{route.domainName}})</span></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="dnsRecordName.length > 0 && dnsRecordValue.length > 0">
|
||||
<tr v-if="node.records.length > 0">
|
||||
<td>DNS记录</td>
|
||||
<td>
|
||||
<table class="ui table celled">
|
||||
<thead class="full-width">
|
||||
<tr>
|
||||
<th>记录名</th>
|
||||
<th>记录类型</th>
|
||||
<th>线路</th>
|
||||
<th>记录值</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>记录名</th>
|
||||
<th>记录类型</th>
|
||||
<th>线路</th>
|
||||
<th>记录值</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody v-for="address in node.ipAddresses" v-if="address.canAccess">
|
||||
<tr v-for="route in dnsRoutes">
|
||||
<td>{{dnsRecordName}}</td>
|
||||
<td>
|
||||
<span v-if="address.ip.indexOf(':') > -1">AAAA</span>
|
||||
<span v-else>A</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="route.name.length > 0">{{route.name}}</span>
|
||||
<span v-else class="disabled">默认</span>
|
||||
</td>
|
||||
<td>{{address.ip}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr v-for="record in node.records">
|
||||
<td>{{record.name}}</td>
|
||||
<td>{{record.type}}</td>
|
||||
<td>
|
||||
<span v-if="record.route.length > 0">{{record.route}}</span>
|
||||
<span v-else class="disabled">默认</span>
|
||||
</td>
|
||||
<td>{{record.value}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="comment">通过设置A记录可以将集群上的服务请求转发到不同线路的节点上。</p>
|
||||
</td>
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
<input type="text" name="name" maxlength="50" ref="focus" v-model="node.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>所属集群</td>
|
||||
<td>
|
||||
<node-clusters-selector :v-primary-cluster="node.primaryCluster" :v-secondary-clusters="node.secondaryClusters" @change="changeClusters"></node-clusters-selector>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IP地址 *</td>
|
||||
<td>
|
||||
@@ -20,22 +26,13 @@
|
||||
<p class="comment">用于访问节点和域名解析等。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="allDNSRoutes.length > 0">
|
||||
<tr v-if="allDNSRoutes.length > 0">
|
||||
<td>DNS线路</td>
|
||||
<td>
|
||||
<input type="hidden" name="dnsDomainId" :value="dnsDomainId"/>
|
||||
<dns-route-selector :v-all-routes="allDNSRoutes" :v-routes="dnsRoutes"></dns-route-selector>
|
||||
<p class="comment">当前节点对应的DNS线路,可用线路是根据集群设置的域名获取的,注意DNS服务商可能对这些线路有其他限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>所属集群</td>
|
||||
<td>
|
||||
<select class="ui dropdown" name="clusterId" style="width:10em" v-model="clusterId">
|
||||
<option v-for="cluster in clusters" :value="cluster.id">{{cluster.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>所属区域</td>
|
||||
<td>
|
||||
|
||||
@@ -1,27 +1,32 @@
|
||||
Tea.context(function () {
|
||||
this.clusterId = 0;
|
||||
this.clusterId = 0
|
||||
if (this.node.cluster != null && this.node.cluster.id > 0) {
|
||||
this.clusterId = this.node.cluster.id;
|
||||
this.clusterId = this.node.cluster.id
|
||||
}
|
||||
|
||||
this.success = NotifySuccess("保存成功", "/clusters/cluster/node?clusterId=" + this.clusterId + "&nodeId=" + this.node.id);
|
||||
this.success = function () {
|
||||
let that = this
|
||||
teaweb.success("保存成功", function () {
|
||||
window.location = "/clusters/cluster/node/detail?clusterId=" + that.clusterId + "&nodeId=" + that.node.id
|
||||
})
|
||||
}
|
||||
|
||||
// IP地址相关
|
||||
this.ipAddresses = this.node.ipAddresses;
|
||||
this.ipAddresses = this.node.ipAddresses
|
||||
|
||||
// 认证相关
|
||||
this.grant = null;
|
||||
this.grant = null
|
||||
|
||||
this.sshHost = "";
|
||||
this.sshPort = "";
|
||||
this.loginId = 0;
|
||||
this.sshHost = ""
|
||||
this.sshPort = ""
|
||||
this.loginId = 0
|
||||
if (this.node.login != null) {
|
||||
this.loginId = this.node.login.id;
|
||||
this.loginId = this.node.login.id
|
||||
|
||||
if (this.node.login.params != null) {
|
||||
this.sshHost = this.node.login.params.host;
|
||||
this.sshHost = this.node.login.params.host
|
||||
if (this.node.login.params.port > 0) {
|
||||
this.sshPort = this.node.login.params.port;
|
||||
this.sshPort = this.node.login.params.port
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +36,11 @@ Tea.context(function () {
|
||||
name: this.node.login.grant.name,
|
||||
method: this.node.login.grant.method,
|
||||
methodName: this.node.login.grant.methodName
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.changeClusters = function (info) {
|
||||
this.clusterId = info.clusterId
|
||||
}
|
||||
})
|
||||
@@ -68,10 +68,13 @@
|
||||
<tr v-for="node in nodes">
|
||||
<td>{{node.name}}
|
||||
<div style="margin-top: 0.5em" v-if="node.region != null">
|
||||
<tiny-basic-label>区域:{{node.region.name}}</tiny-basic-label>
|
||||
<tiny-basic-label class="olive">区域:{{node.region.name}}</tiny-basic-label>
|
||||
</div>
|
||||
<div style="margin-top: 0.5em" v-if="node.group != null">
|
||||
<tiny-basic-label>分组:{{node.group.name}}</tiny-basic-label>
|
||||
<tiny-basic-label class="olive">分组:{{node.group.name}}</tiny-basic-label>
|
||||
</div>
|
||||
<div style="margin-top: 0.5em">
|
||||
<node-clusters-labels :v-primary-cluster="node.cluster" :v-secondary-clusters="node.secondaryClusters" size="tiny"></node-clusters-labels>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -2,9 +2,10 @@ Tea.context(function () {
|
||||
this.teaweb = teaweb
|
||||
|
||||
this.deleteNode = function (nodeId) {
|
||||
teaweb.confirm("确定要删除这个节点吗?", function () {
|
||||
teaweb.confirm("确定要从当前集群中删除这个节点吗?", function () {
|
||||
this.$post("/nodes/delete")
|
||||
.params({
|
||||
clusterId: this.clusterId,
|
||||
nodeId: nodeId
|
||||
})
|
||||
.refresh();
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr v-if="hasDomains">
|
||||
<td>选择主域名</td>
|
||||
<td>选择主域名 *</td>
|
||||
<td>
|
||||
<dns-domain-selector :v-domain-id="domainId" :v-domain-name="domainName"></dns-domain-selector>
|
||||
<p class="comment">用于生成集群节点和网站服务的DNS解析记录。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">DNS子域名</td>
|
||||
<td class="title">DNS子域名 *</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<input type="text" name="dnsName" maxlength="64" style="width:10em" v-model="dnsName"/>
|
||||
|
||||
Reference in New Issue
Block a user