实现域名服务器集群管理

This commit is contained in:
GoEdgeLab
2021-05-25 15:47:40 +08:00
parent f69d49d92b
commit 35e93baebf
31 changed files with 581 additions and 8 deletions

View File

@@ -0,0 +1,4 @@
<first-menu>
<menu-item href="/ns/clusters" code="index">集群列表</menu-item>
<menu-item href="/ns/clusters/create" code="create">创建集群</menu-item>
</first-menu>

View File

@@ -0,0 +1,8 @@
.buttons-box {
text-align: center;
margin-top: 2em;
}
.buttons-box button {
width: 20em;
}
/*# sourceMappingURL=delete.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["delete.less"],"names":[],"mappings":"AAAA;EACC,kBAAA;EACA,eAAA;;AAFD,YAIC;EACC,WAAA","file":"delete.css"}

View File

@@ -0,0 +1,5 @@
{$layout}
<div class="buttons-box">
<button class="ui button red" type="button" @click.prevent="deleteCluster(clusterId)">删除当前集群</button>
</div>

View File

@@ -0,0 +1,16 @@
Tea.context(function () {
this.deleteCluster = function (clusterId) {
let that = this
teaweb.confirm("确定要删除此集群吗?", function () {
that.$post("/ns/clusters/cluster/delete")
.params({
clusterId: clusterId
})
.success(function () {
teaweb.success("删除成功", function () {
window.location = "/ns/clusters"
})
})
})
}
})

View File

@@ -0,0 +1,8 @@
.buttons-box {
text-align: center;
margin-top: 2em;
button {
width: 20em;
}
}

View File

@@ -0,0 +1 @@
{$layout}

View File

@@ -0,0 +1,28 @@
{$layout}
{$template "/left_menu"}
<div class="right-box">
<h3>基础设置</h3>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<input type="hidden" name="clusterId" :value="cluster.id"/>
<table class="ui table selectable definition">
<tr>
<td class="title">集群名称 *</td>
<td><input type="text" name="name" maxlength="50" ref="focus" v-model="cluster.name"/></td>
</tr>
<tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>
<tbody v-show="moreOptionsVisible">
<tr>
<td>是否启用</td>
<td>
<checkbox name="isOn" value="1" v-model="cluster.isOn"></checkbox>
</td>
</tr>
</tbody>
</table>
<submit-btn></submit-btn>
</form>
</div>

View File

@@ -0,0 +1,3 @@
Tea.context(function () {
this.success = NotifyReloadSuccess("保存成功")
})

View File

@@ -0,0 +1,16 @@
{$layout}
{$template "menu"}
<div class="ui margin"></div>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<table class="ui table definition selectable">
<tr>
<td class="title">集群名称 *</td>
<td>
<input type="text" name="name" maxlength="50" ref="focus"/>
</td>
</tr>
</table>
<submit-btn></submit-btn>
</form>

View File

@@ -0,0 +1,3 @@
Tea.context(function () {
this.success = NotifySuccess("保存成功", "/ns/clusters")
})

View File

@@ -0,0 +1,25 @@
{$layout}
{$template "menu"}
<p class="comment" v-if="clusters.length == 0">暂时还没有集群。</p>
<table class="ui table selectable celled" v-if="clusters.length > 0">
<thead>
<tr>
<th>集群名称</th>
<th class="two wide">集群状态</th>
<th class="two op">操作</th>
</tr>
</thead>
<tr v-for="cluster in clusters">
<td>{{cluster.name}}</td>
<td>
<label-on :v-is-on="cluster.isOn"></label-on>
</td>
<td>
<a :href="'/ns/clusters/cluster?clusterId=' + cluster.id">详情</a>
</td>
</tr>
</table>
<div class="page" v-html="page"></div>