增加用户系统界面管理、用户可以设置关联集群

This commit is contained in:
刘祥超
2020-12-16 15:49:15 +08:00
parent 5313ed1b7c
commit 5c4d3c31f0
30 changed files with 411 additions and 312 deletions

View File

@@ -0,0 +1,28 @@
Vue.component("cluster-selector", {
mounted: function () {
let that = this
Tea.action("/clusters/options")
.post()
.success(function (resp) {
that.clusters = resp.data.clusters
})
},
props: ["v-cluster-id"],
data: function () {
let clusterId = this.vClusterId
if (clusterId == null) {
clusterId = 0
}
return {
clusters: [],
clusterId: clusterId
}
},
template: `<div>
<select class="ui dropdown auto-width" name="clusterId" v-model="clusterId">
<option value="0">[选择集群]</option>
<option v-for="cluster in clusters" :value="cluster.id">{{cluster.name}}</option>
</select>
</div>`
})

View File

@@ -213,9 +213,6 @@ body .ui.menu .item .blink {
body.expanded .main-menu {
display: none;
}
body.expanded .sub-menu {
display: none;
}
body.expanded .main {
left: 1em;
}
@@ -226,6 +223,7 @@ body.expanded .main {
width: 100%;
z-index: 1000;
overflow-x: auto;
border: 0 !important;
background: #276ac6 !important;
}
.top-nav::-webkit-scrollbar {
@@ -362,6 +360,8 @@ body.expanded .main {
}
.main-menu .menu {
background: #276ac6 !important;
border: 0 !important;
box-shadow: none !important;
}
.main-menu::-webkit-scrollbar {
width: 2px;
@@ -401,113 +401,6 @@ body.expanded .main {
z-index: 999999;
background: white;
}
/** 子菜单 **/
.main.without-menu .sub-menu {
display: none;
}
.sub-menu {
position: fixed;
left: 8em;
width: 12.5em;
top: 3em;
bottom: 2.8em;
}
.sub-menu .menus-box {
overflow-y: auto;
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
padding-right: 0.4em !important;
}
.sub-menu .menus-box::-webkit-scrollbar {
width: 4px;
height: 4px;
}
.sub-menu .menu {
max-width: 12em !important;
border-right: 0 !important;
}
@media screen and (max-width: 512px) {
.sub-menu {
position: relative;
width: 100%;
left: 0;
top: 0;
}
.sub-menu .menus-box {
position: relative !important;
}
.sub-menu .menu {
width: 100% !important;
max-width: 30em !important;
}
.sub-menu .menus-box .menu .item {
width: 100% !important;
max-width: 30em !important;
}
}
.sub-menu .menu .item.active {
font-weight: normal !important;
outline: none !important;
}
.sub-menu .menu .item:not(.header) {
padding-top: 0.7em !important;
padding-bottom: 0.7em !important;
}
.sub-menu .menu .item:not(.header) span {
font-size: 0.8em;
display: block;
margin-top: 0.6em !important;
line-height: 1.5;
}
.sub-menu .menu .item:not(.active):hover {
background: rgba(0, 0, 0, 0.05) !important;
border-top: 1px white solid !important;
border-bottom: 1px white solid !important;
margin-top: -1px !important;
margin-bottom: -1px !important;
}
.sub-menu .menu .item.active {
background: rgba(0, 0, 0, 0.05) !important;
}
.sub-menu .menu .item var {
font-style: normal;
}
.sub-menu .menu .item:not(.active) var.grey {
color: grey;
}
.sub-menu .menu .item span:not(.green) {
color: grey;
}
.sub-menu .menu .item span.red {
color: #db2828 !important;
}
.sub-menu .menus-box .menu .item.header {
padding-right: 0.2em !important;
cursor: pointer;
}
.sub-menu .menus-box .menu .item.header span {
font-weight: normal;
color: grey;
font-size: 0.8em;
}
.sub-menu .menus-box .menu a {
display: block;
word-break: break-all;
line-height: 1.6 !important;
}
.sub-menu .menus-box .menu .item .menu {
margin-top: 0 !important;
}
.sub-menu .fourth-menu {
margin-left: 1.2em;
}
.sub-menu .fourth-menu .icon,
.sub-menu .third-menu .icon {
float: left !important;
}
/** 右侧文本子菜单 **/
.text.menu {
overflow-x: auto;

File diff suppressed because one or more lines are too long

View File

@@ -171,10 +171,6 @@ body.expanded .main-menu {
display: none;
}
body.expanded .sub-menu {
display: none;
}
body.expanded .main {
left: 1em;
}
@@ -186,6 +182,7 @@ body.expanded .main {
width: 100%;
z-index: 1000;
overflow-x: auto;
border: 0 !important;
background: #276ac6 !important;
}
@@ -349,10 +346,12 @@ body.expanded .main {
overflow-y: auto;
background: #276ac6 !important;
z-index: 10;
}
.main-menu .menu {
background: #276ac6 !important;
.menu {
background: #276ac6 !important;
border: 0 !important;
box-shadow: none !important;
}
}
.main-menu::-webkit-scrollbar {
@@ -405,136 +404,6 @@ body.expanded .main {
background: white;
}
/** 子菜单 **/
.main.without-menu .sub-menu {
display: none;
}
.sub-menu {
position: fixed;
left: 8em;
width: 12.5em;
top: 3em;
bottom: 2.8em;
}
.sub-menu .menus-box {
overflow-y: auto;
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
padding-right: 0.4em !important;
}
.sub-menu .menus-box::-webkit-scrollbar {
width: 4px;
height: 4px;
}
.sub-menu .menu {
max-width: 12em !important;
border-right: 0 !important;
}
@media screen and (max-width: 512px) {
.sub-menu {
position: relative;
width: 100%;
left: 0;
top: 0;
}
.sub-menu .menus-box {
position: relative !important;
}
.sub-menu .menu {
width: 100% !important;
max-width: 30em !important;
}
.sub-menu .menus-box .menu .item {
width: 100% !important;
max-width: 30em !important;
}
}
.sub-menu .menu .item.active {
font-weight: normal !important;
outline: none !important;
}
.sub-menu .menu .item:not(.header) {
padding-top: 0.7em !important;
padding-bottom: 0.7em !important;
}
.sub-menu .menu .item:not(.header) span {
font-size: 0.8em;
display: block;
margin-top: 0.6em !important;
line-height: 1.5;
}
.sub-menu .menu .item:not(.active):hover {
background: rgba(0, 0, 0, 0.05) !important;
border-top: 1px white solid !important;
border-bottom: 1px white solid !important;
margin-top: -1px !important;
margin-bottom: -1px !important;
}
.sub-menu .menu .item.active {
background: rgba(0, 0, 0, 0.05) !important;
}
.sub-menu .menu .item var {
font-style: normal;
}
.sub-menu .menu .item:not(.active) var.grey {
color: grey;
}
.sub-menu .menu .item span:not(.green) {
color: grey;
}
.sub-menu .menu .item span.red {
color: #db2828 !important;
}
.sub-menu .menus-box .menu .item.header {
padding-right: 0.2em !important;
cursor: pointer;
}
.sub-menu .menus-box .menu .item.header span {
font-weight: normal;
color: grey;
font-size: 0.8em;
}
.sub-menu .menus-box .menu a {
display: block;
word-break: break-all;
line-height: 1.6 !important;
}
.sub-menu .menus-box .menu .item .menu {
margin-top: 0 !important;
}
.sub-menu .fourth-menu {
margin-left: 1.2em;
}
.sub-menu .fourth-menu .icon, .sub-menu .third-menu .icon {
float: left !important;
}
/** 右侧文本子菜单 **/
.text.menu {
overflow-x: auto;

View File

@@ -0,0 +1,41 @@
{$layout}
<form class="ui form" method="post" 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="productName" v-model="config.productName" maxlength="100"/>
</td>
</tr>
<tr>
<td>用户系统名称 *</td>
<td>
<input type="text" name="userSystemName" v-model="config.userSystemName" maxlength="100"/>
</td>
</tr>
<tr>
<td>是否显示底部开源信息</td>
<td>
<checkbox name="showOpenSourceInfo" v-model="config.showOpenSourceInfo"></checkbox>
</td>
</tr>
<tr>
<td>是否显示版本号</td>
<td>
<checkbox name="showVersion" v-model="config.showVersion"></checkbox>
</td>
</tr>
<tr v-show="config.showVersion">
<td>定制版本号</td>
<td>
<input type="text" name="version" v-model="config.version" maxlength="100"/>
<p class="comment">定制自己的版本号,留空表示使用系统自带的版本号。</p>
</td>
</tr>
</table>
<submit-btn></submit-btn>
</form>

View File

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

View File

@@ -31,6 +31,13 @@
<p class="comment">用户姓名或者公司名称等等。</p>
</td>
</tr>
<tr>
<td>关联集群 *</td>
<td>
<cluster-selector></cluster-selector>
<p class="comment">用户发布的网站服务会自动部署到此集群。</p>
</td>
</tr>
<tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>

View File

@@ -10,6 +10,7 @@
<tr>
<th>用户名</th>
<th>全名</th>
<th>关联集群</th>
<th>手机号</th>
<th>注册时间</th>
<th class="center width10">状态</th>
@@ -19,6 +20,10 @@
<tr v-for="user in users">
<td :class="{disabled:!user.isOn}">{{user.username}}</td>
<td :class="{disabled:!user.isOn}">{{user.fullname}}</td>
<td>
<span v-if="user.cluster != null">{{user.cluster.name}} <link-icon :href="'/clusters/cluster?clusterId=' + user.cluster.id"></link-icon></span>
<span v-else class="disabled">-</span>
</td>
<td :class="{disabled:!user.isOn}">
<span v-if="user.mobile.length > 0">{{user.mobile}}</span>
<span v-else class="disabled">-</span>

View File

@@ -1,6 +1,7 @@
Tea.context(function () {
this.createUser = function () {
teaweb.popup(Tea.url(".createPopup"), {
height: "30em",
callback: function () {
teaweb.success("保存成功", function () {
teaweb.reload()

View File

@@ -38,6 +38,13 @@
<p class="comment">用户姓名或者公司名称等等。</p>
</td>
</tr>
<tr>
<td>关联集群 *</td>
<td>
<cluster-selector :v-cluster-id="clusterId"></cluster-selector>
<p class="comment">用户发布的网站服务会自动部署到此集群。</p>
</td>
</tr>
<tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>

View File

@@ -20,6 +20,13 @@
{{user.fullname}}
</td>
</tr>
<tr>
<td>关联集群</td>
<td>
<span v-if="user.cluster != null">{{user.cluster.name}} <link-icon :href="'/clusters/cluster?clusterId=' + user.cluster.id"></link-icon></span>
<span v-else class="disabled">-</span>
</td>
</tr>
<tr>
<td>手机号</td>
<td>