Initial commit (code only without large binaries)
This commit is contained in:
14
EdgeUser/web/views/@default/servers/groups/createPopup.html
Normal file
14
EdgeUser/web/views/@default/servers/groups/createPopup.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>创建分组</h3>
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<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>
|
||||
@@ -0,0 +1,7 @@
|
||||
<first-menu>
|
||||
<menu-item href="/servers/groups">分组列表</menu-item>
|
||||
<span class="item disabled">|</span>
|
||||
<menu-item :href="'/servers/groups/group?groupId=' + group.id" code="group.index">"{{group.name}}"详情</menu-item>
|
||||
<!--<menu-item :href="'/servers/groups/group/settings?groupId=' + group.id" :active="!firstMenuItem.startsWith('group.')">全局设置 <tip-icon content="这里添加的设置将会自动应用到当前分组下的所有服务。"></tip-icon></menu-item>-->
|
||||
<menu-item :href="'/servers/groups/group/update?groupId=' + group.id" code="group.update">修改</menu-item>
|
||||
</first-menu>
|
||||
11
EdgeUser/web/views/@default/servers/groups/group/index.html
Normal file
11
EdgeUser/web/views/@default/servers/groups/group/index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">分组名称</td>
|
||||
<td>
|
||||
{{group.name}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.checkDNS = false
|
||||
})
|
||||
15
EdgeUser/web/views/@default/servers/groups/group/update.html
Normal file
15
EdgeUser/web/views/@default/servers/groups/group/update.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{$layout "layout"}
|
||||
{$template "menu"}
|
||||
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="groupId" :value="group.id"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">分组名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="50" ref="focus" v-model="group.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
@@ -0,0 +1,5 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifySuccess("保存成功", ".", {
|
||||
groupId: this.group.id
|
||||
})
|
||||
})
|
||||
38
EdgeUser/web/views/@default/servers/groups/index.html
Normal file
38
EdgeUser/web/views/@default/servers/groups/index.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{$layout}
|
||||
{$template "../menu"}
|
||||
|
||||
<second-menu>
|
||||
<menu-item @click.prevent="createGroup">[创建新分组]</menu-item>
|
||||
</second-menu>
|
||||
|
||||
<p class="comment" v-if="groups.length == 0">暂时还没有分组。</p>
|
||||
<div v-show="groups.length > 0">
|
||||
<div class="margin"></div>
|
||||
<table class="ui table selectable celled" id="sortable-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:3em"></th>
|
||||
<th>分组名称</th>
|
||||
<th class="center width10">服务数量</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody v-for="group in groups" :data-group-id="group.id">
|
||||
<tr>
|
||||
<td style="text-align: center;"><i class="icon bars handle grey"></i> </td>
|
||||
<td>
|
||||
<a :href="'/servers/groups/group?groupId=' + group.id">{{group.name}}</a>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a :href="'/servers?groupId=' + group.id" v-if="group.countServers > 0">{{group.countServers}}</a>
|
||||
<span v-else class="disabled">0</span>
|
||||
</td>
|
||||
<td>
|
||||
<a :href="'/servers/groups/group?groupId=' + group.id">详情</a> <a href="" @click.prevent="deleteGroup(group.id)">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p v-if="groups.length > 0" class="comment">可以拖动左侧的<i class="icon bars"></i>排序。</p>
|
||||
</div>
|
||||
43
EdgeUser/web/views/@default/servers/groups/index.js
Normal file
43
EdgeUser/web/views/@default/servers/groups/index.js
Normal file
@@ -0,0 +1,43 @@
|
||||
Tea.context(function () {
|
||||
this.$delay(function () {
|
||||
let that = this
|
||||
sortTable(function () {
|
||||
let groupIds = []
|
||||
document.querySelectorAll("*[data-group-id]").forEach(function (element) {
|
||||
groupIds.push(element.getAttribute("data-group-id"))
|
||||
})
|
||||
that.$post("/servers/groups/sort")
|
||||
.params({
|
||||
groupIds: groupIds
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.successToast("保存成功")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
this.createGroup = function () {
|
||||
teaweb.popup("/servers/groups/createPopup", {
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.deleteGroup = function (groupId) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要删除这个分组吗?", function () {
|
||||
that.$post("/servers/groups/group/delete")
|
||||
.params({
|
||||
groupId: groupId
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.success("删除成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
22
EdgeUser/web/views/@default/servers/groups/selectPopup.html
Normal file
22
EdgeUser/web/views/@default/servers/groups/selectPopup.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>选择分组</h3>
|
||||
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="groupId" :value="groupId"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">选择分组</td>
|
||||
<td>
|
||||
<div v-if="groups.length > 0">
|
||||
<a href="" class="ui label small basic" v-for="group in groups" :class="{blue:group.id == groupId}" style="margin-bottom:0.5em" @click.prevent="selectGroup(group)">{{group.name}}</a>
|
||||
<p class="comment">点击可已选中要使用的分组。</p>
|
||||
</div>
|
||||
<div v-else>
|
||||
<p class="comment">暂时还没有可以使用的分组。</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn>确定</submit-btn>
|
||||
</form>
|
||||
@@ -0,0 +1,8 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
this.groupId = 0
|
||||
|
||||
this.selectGroup = function (group) {
|
||||
this.groupId = group.id
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user