mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 12:20:28 +08:00
阶段性提交
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
* 一级菜单
|
||||
*/
|
||||
Vue.component("first-menu", {
|
||||
props: [],
|
||||
template: ' \
|
||||
<div class="first-menu"> \
|
||||
<div class="ui menu text blue small">\
|
||||
<slot></slot>\
|
||||
</div> \
|
||||
<div class="ui divider"></div> \
|
||||
<div class="margin"></div> \
|
||||
</div>'
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
<div class="margin"></div>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
|
||||
3
web/views/@default/nodes/create.js
Normal file
3
web/views/@default/nodes/create.js
Normal file
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifySuccess("保存成功", "/nodes");
|
||||
});
|
||||
4
web/views/@default/nodes/grants/@menu.html
Normal file
4
web/views/@default/nodes/grants/@menu.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<first-menu>
|
||||
<menu-item href="/nodes/grants" code="index">认证列表</menu-item>
|
||||
<menu-item href="/nodes/grants/create" code="create">创建认证</menu-item>
|
||||
</first-menu>
|
||||
58
web/views/@default/nodes/grants/create.html
Normal file
58
web/views/@default/nodes/grants/create.html
Normal file
@@ -0,0 +1,58 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
<div class="margin"></div>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td>名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" ref="focus"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="title">认证方式</td>
|
||||
<td>
|
||||
<select class="ui dropdown" style="width:10em" name="method" v-model="method">
|
||||
<option v-for="method in methods" :value="method.value">{{method.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 用户名/密码 -->
|
||||
<tbody v-if="method == 'user'">
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SSH密码</td>
|
||||
<td><input type="password" name="password" maxlength="100"/>
|
||||
<p class="comment">SSH登录用户密码。</p> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 私钥 -->
|
||||
<tbody v-if="method == 'privateKey'">
|
||||
<tr>
|
||||
<td>RSA私钥 *</td>
|
||||
<td>
|
||||
<textarea name="privateKey"></textarea>
|
||||
<p class="comment">用来生成登录SSH公钥的私钥</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
<textarea name="description" rows="3"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
5
web/views/@default/nodes/grants/create.js
Normal file
5
web/views/@default/nodes/grants/create.js
Normal file
@@ -0,0 +1,5 @@
|
||||
Tea.context(function () {
|
||||
this.method = "user";
|
||||
|
||||
this.success = NotifySuccess("保存成功", "/nodes/grants");
|
||||
});
|
||||
58
web/views/@default/nodes/grants/grant.html
Normal file
58
web/views/@default/nodes/grants/grant.html
Normal file
@@ -0,0 +1,58 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
<second-menu>
|
||||
<menu-item :href="'/nodes/grants/grant?grantId=' + grant.id" active="true">详情</menu-item>
|
||||
<menu-item :href="'/nodes/grants/update?grantId=' + grant.id">修改</menu-item>
|
||||
</second-menu>
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td>名称</td>
|
||||
<td>
|
||||
{{grant.name}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="title">认证方式</td>
|
||||
<td>
|
||||
{{grant.methodName}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 用户名/密码 -->
|
||||
<tbody v-if="grant.method == 'user'">
|
||||
<tr>
|
||||
<td>SSH用户名</td>
|
||||
<td>
|
||||
{{grant.username}}
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SSH密码</td>
|
||||
<td>{{grant.password}}
|
||||
<p class="comment">SSH登录用户密码。</p> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 私钥 -->
|
||||
<tbody v-if="grant.method == 'privateKey'">
|
||||
<tr>
|
||||
<td>RSA私钥</td>
|
||||
<td>
|
||||
{{grant.privateKey}}
|
||||
<p class="comment">用来生成登录SSH公钥的私钥</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
<span v-if="grant.description.length > 0">{{grant.description}}</span>
|
||||
<span v-if="grant.description.length == 0">-</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
25
web/views/@default/nodes/grants/index.html
Normal file
25
web/views/@default/nodes/grants/index.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
<div class="ui message" v-if="grants.length == 0">暂时还没有认证信息。</div>
|
||||
|
||||
<table class="ui table selectable" v-if="grants.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>名称</th>
|
||||
<th>类型</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="grant in grants">
|
||||
<td>{{grant.id}}</td>
|
||||
<td>{{grant.name}}</td>
|
||||
<td>{{grant.method.name}}</td>
|
||||
<td>
|
||||
<a :href="'/nodes/grants/grant?grantId=' + grant.id">详情</a> <a href="" @click.prevent="deleteGrant(grant.id)">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="page" v-html="page"></div>
|
||||
11
web/views/@default/nodes/grants/index.js
Normal file
11
web/views/@default/nodes/grants/index.js
Normal file
@@ -0,0 +1,11 @@
|
||||
Tea.context(function () {
|
||||
this.deleteGrant = function (grantId) {
|
||||
teaweb.confirm("确定要删除此认证吗?", function () {
|
||||
this.$post(".delete")
|
||||
.params({
|
||||
"grantId": grantId
|
||||
})
|
||||
.refresh();
|
||||
});
|
||||
};
|
||||
});
|
||||
64
web/views/@default/nodes/grants/update.html
Normal file
64
web/views/@default/nodes/grants/update.html
Normal file
@@ -0,0 +1,64 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
<second-menu>
|
||||
<menu-item :href="'/nodes/grants/grant?grantId=' + grant.id">详情</menu-item>
|
||||
<menu-item :href="'/nodes/grants/update?grantId=' + grant.id" active="true">修改</menu-item>
|
||||
</second-menu>
|
||||
|
||||
<div class="margin"></div>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="grantId" :value="grant.id"/>
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td>名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" ref="focus" v-model="grant.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="title">认证方式</td>
|
||||
<td>
|
||||
<select class="ui dropdown" style="width:10em" name="method" v-model="method">
|
||||
<option v-for="method in methods" :value="method.value">{{method.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 用户名/密码 -->
|
||||
<tbody v-if="method == 'user'">
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100" v-model="grant.username"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SSH密码</td>
|
||||
<td><input type="password" name="password" maxlength="100" v-model="grant.password"/>
|
||||
<p class="comment">SSH登录用户密码。</p> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 私钥 -->
|
||||
<tbody v-if="method == 'privateKey'">
|
||||
<tr>
|
||||
<td>RSA私钥 *</td>
|
||||
<td>
|
||||
<textarea name="privateKey" v-model="grant.privateKey"></textarea>
|
||||
<p class="comment">用来生成登录SSH公钥的私钥</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
<textarea name="description" rows="3" v-model="grant.description"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
5
web/views/@default/nodes/grants/update.js
Normal file
5
web/views/@default/nodes/grants/update.js
Normal file
@@ -0,0 +1,5 @@
|
||||
Tea.context(function () {
|
||||
this.method = this.grant.method;
|
||||
|
||||
this.success = NotifySuccess("保存成功", "/nodes/grants/grant?grantId=" + this.grant.id);
|
||||
});
|
||||
@@ -1,6 +1,30 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
<table class="ui table selectable">
|
||||
<p class="comment" v-if="nodes.length == 0">暂时还没有节点。</p>
|
||||
|
||||
</table>
|
||||
<table class="ui table selectable" v-if="nodes.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>节点名称</th>
|
||||
<th>所属集群</th>
|
||||
<th>状态</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="node in nodes">
|
||||
<td>{{node.id}}</td>
|
||||
<td>{{node.name}}</td>
|
||||
<td>{{node.cluster.name}}</td>
|
||||
<td>
|
||||
已安装|安装中|安装错误|运行中|失去连接
|
||||
</td>
|
||||
<td>
|
||||
<a href="">详情</a> <a href="">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<div class="page" v-html="page"></div>
|
||||
@@ -1,4 +1,4 @@
|
||||
<first-menu>
|
||||
<menu-item code="index">服务列表</menu-item>
|
||||
<menu-item code="create">创建服务</menu-item>
|
||||
<menu-item href="/servers" code="index">服务列表</menu-item>
|
||||
<menu-item href="/servers/create" code="create">创建服务</menu-item>
|
||||
</first-menu>
|
||||
22
web/views/@default/servers/create.html
Normal file
22
web/views/@default/servers/create.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">服务名称</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="60" ref="focus"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>部署的集群</td>
|
||||
<td>
|
||||
<select class="ui dropdown" name="clusterId" style="width:10em">
|
||||
<option v-for="cluster in clusters" :value="cluster.id">{{cluster.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
3
web/views/@default/servers/create.js
Normal file
3
web/views/@default/servers/create.js
Normal file
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifySuccess("保存成功", "/servers");
|
||||
});
|
||||
@@ -1,3 +1,25 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
<p class="ui message" v-if="servers.length == 0">暂时还没有服务。</p>
|
||||
|
||||
<table class="ui table selectable" v-if="servers.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>服务名称</th>
|
||||
<th>部署集群</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="server in servers">
|
||||
<td>{{server.id}}</td>
|
||||
<td>{{server.name}}</td>
|
||||
<td>{{server.cluster.name}}</td>
|
||||
<td>
|
||||
<a href="">详情</a> <a href="">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="page" v-html="page"></div>
|
||||
Reference in New Issue
Block a user