mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-09 07:20:26 +08:00
阶段性提交
This commit is contained in:
6
web/views/@default/clusters/cluster/@menu.html
Normal file
6
web/views/@default/clusters/cluster/@menu.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<second-menu>
|
||||
<menu-item :href="'/clusters/cluster?clusterId=' + clusterId" code="index">节点列表</menu-item>
|
||||
<menu-item :href="'/clusters/cluster/node/create?clusterId=' + clusterId" code="create">添加节点</menu-item>
|
||||
<!--<menu-item :href="'/clusters/cluster/node/import?clusterId=' + clusterId" code="import">批量导入</menu-item>-->
|
||||
<!--<menu-item :href="'/clusters/cluster/node/install?clusterId=' + clusterId" code="install">安装节点</menu-item>-->
|
||||
</second-menu>
|
||||
@@ -1,4 +1,7 @@
|
||||
.table .label {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
a .red {
|
||||
border-bottom: 1px #db2828 dashed;
|
||||
}
|
||||
/*# sourceMappingURL=index.css.map */
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,MAAO;EACN,oBAAA","file":"index.css"}
|
||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,MAAO;EACN,oBAAA;;AAGD,CACC;EACC,iCAAA","file":"index.css"}
|
||||
@@ -2,36 +2,29 @@
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
<second-menu>
|
||||
<menu-item :href="'/clusters/cluster/node/create?clusterId=' + clusterId">添加节点</menu-item>
|
||||
<menu-item>安装节点</menu-item>
|
||||
</second-menu>
|
||||
{$template "menu"}
|
||||
|
||||
<h3>节点列表</h3>
|
||||
<form class="ui form segment" action="/clusters/cluster">
|
||||
<input type="hidden" name="clusterId" :value="clusterId"/>
|
||||
<div class="ui fields inline">
|
||||
<div class="ui field">
|
||||
安装状态:
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<select class="ui dropdown" name="installedState" v-model="installState">
|
||||
<option value="0">[全部]</option>
|
||||
<option value="1">已安装</option>
|
||||
<option value="2">未安装</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<button class="ui button" type="submit">搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<p class="comment" v-if="nodes.length == 0">暂时还没有节点。</p>
|
||||
|
||||
<div v-show="nodes.length > 0">
|
||||
<form class="ui form segment" action="/clusters/cluster">
|
||||
<input type="hidden" name="clusterId" :value="clusterId"/>
|
||||
<div class="ui fields inline">
|
||||
<div class="ui field">
|
||||
安装状态:
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<select class="ui dropdown" name="installedState">
|
||||
<option value="0">[全部]</option>
|
||||
<option value="1">已安装</option>
|
||||
<option value="2">未安装</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<button class="ui button" type="submit">搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="ui table selectable" v-if="nodes.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -74,7 +67,11 @@
|
||||
<span v-else-if="node.status.updatedAt > 0" class="red">已断开</span>
|
||||
<span v-else-if="node.status.updatedAt == 0" class="red">未连接</span>
|
||||
</div>
|
||||
<span v-else class="red">未安装</span>
|
||||
<div v-else>
|
||||
<span v-if="node.installStatus.isRunning" class="red">安装中</span>
|
||||
<a v-if="node.installStatus.isFinished && !node.installStatus.isOk" :href="'/clusters/cluster/node/install?clusterId=' + clusterId + '&nodeId=' + node.id" title="点击看安装错误"><span class="red">安装出错</span></a>
|
||||
<a v-else class="red" :href="'/clusters/cluster/node/install?clusterId=' + clusterId + '&nodeId=' + node.id" title="点击进安装界面"><span class="red">未安装</span></a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a :href="'/clusters/cluster/node?clusterId=' + clusterId + '&nodeId=' + node.id">详情</a> <a href="" @click.prevent="deleteNode(node.id)">删除</a>
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
.table .label {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
a {
|
||||
.red {
|
||||
border-bottom: 1px #db2828 dashed;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
<h3>添加节点</h3>
|
||||
{$template "/clusters/cluster/menu"}
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="clusterId" :value="clusterId"/>
|
||||
|
||||
7
web/views/@default/clusters/cluster/node/install.css
Normal file
7
web/views/@default/clusters/cluster/node/install.css
Normal file
@@ -0,0 +1,7 @@
|
||||
.installing-box {
|
||||
line-height: 1.8;
|
||||
}
|
||||
.installing-box .blue {
|
||||
color: #2185d0;
|
||||
}
|
||||
/*# sourceMappingURL=install.css.map */
|
||||
1
web/views/@default/clusters/cluster/node/install.css.map
Normal file
1
web/views/@default/clusters/cluster/node/install.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["install.less"],"names":[],"mappings":"AAAA;EACC,gBAAA;;AADD,eAGC;EACC,cAAA","file":"install.css"}
|
||||
@@ -14,13 +14,28 @@
|
||||
<div v-if="!node.isInstalled">
|
||||
<h3>方法1:自动安装</h3>
|
||||
|
||||
<div v-if="installStatus != null && (installStatus.isRunning || installStatus.isFinished)"
|
||||
class="ui segment installing-box">
|
||||
<div v-if="installStatus.isRunning" class="blue">安装中...</div>
|
||||
<div v-if="installStatus.isFinished">
|
||||
<span v-if="installStatus.isOk" class="green">已安装成功</span>
|
||||
<span v-if="!installStatus.isOk" class="red">安装过程中发生错误:{{installStatus.error}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="installStatus != null && installStatus.isFinished">
|
||||
<button class="ui button small" type="button" @click.prevent="install()">重新安装</button>
|
||||
</div>
|
||||
<div v-if="installStatus == null || (!installStatus.isFinished && !installStatus.isRunning)">
|
||||
<button class="ui button small" type="button" @click.prevent="install()">开始安装</button>
|
||||
</div>
|
||||
|
||||
<h3>方法2:手动安装</h3>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td>配置文件<em>(configs/api.yaml)</em></td>
|
||||
<td>
|
||||
<pre>rpc:
|
||||
endpoints: [ "${endpoint}" ]
|
||||
endpoints: [ {{apiEndpoints}} ]
|
||||
nodeId: "{{node.uniqueId}}"
|
||||
secret: "{{node.secret}}"</pre>
|
||||
</td>
|
||||
@@ -28,10 +43,14 @@ secret: "{{node.secret}}"</pre>
|
||||
<tr>
|
||||
<td class="title">安装目录</td>
|
||||
<td>
|
||||
<div v-if="node.installDir.length == 0">使用集群设置<span v-if="node.cluster != null && node.cluster.installDir.length > 0">({{node.cluster.installDir}})</span></div>
|
||||
<div v-if="node.installDir.length == 0">使用集群设置<span
|
||||
v-if="node.cluster != null && node.cluster.installDir.length > 0">({{node.cluster.installDir}})</span>
|
||||
</div>
|
||||
<span v-else>{{node.installDir}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a href="" @click.prevent="updateNodeIsInstalled(true)">[修改为已安装状态]</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,4 +1,20 @@
|
||||
Tea.context(function () {
|
||||
this.$delay(function () {
|
||||
this.reloadStatus(this.nodeId)
|
||||
})
|
||||
|
||||
// 开始安装
|
||||
this.install = function () {
|
||||
this.$post("$")
|
||||
.params({
|
||||
nodeId: this.nodeId
|
||||
})
|
||||
.success(function () {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
// 设置节点安装状态
|
||||
this.updateNodeIsInstalled = function (isInstalled) {
|
||||
teaweb.confirm("确定要将当前节点修改为未安装状态?", function () {
|
||||
this.$post("/clusters/cluster/node/updateInstallStatus")
|
||||
@@ -9,4 +25,21 @@ Tea.context(function () {
|
||||
.refresh()
|
||||
})
|
||||
}
|
||||
|
||||
// 刷新状态
|
||||
this.reloadStatus = function (nodeId) {
|
||||
this.$post("/clusters/cluster/node/status")
|
||||
.params({
|
||||
nodeId: nodeId
|
||||
})
|
||||
.success(function (resp) {
|
||||
this.installStatus = resp.data.installStatus
|
||||
this.node.isInstalled = resp.data.isInstalled
|
||||
})
|
||||
.done(function () {
|
||||
this.$delay(function () {
|
||||
this.reloadStatus(nodeId)
|
||||
}, 1000)
|
||||
});
|
||||
}
|
||||
})
|
||||
7
web/views/@default/clusters/cluster/node/install.less
Normal file
7
web/views/@default/clusters/cluster/node/install.less
Normal file
@@ -0,0 +1,7 @@
|
||||
.installing-box {
|
||||
line-height: 1.8;
|
||||
|
||||
.blue {
|
||||
color: #2185d0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user