master
王兵 4 years ago
parent 6c430e7835
commit 538b2711e8

Binary file not shown.

@ -17,11 +17,11 @@ import xyz.wbsite.frame.base.BaseEntity;
public class Locations extends BaseEntity {
/**
* SERVICE_ID -
* SERVICES_ID -
*/
@ExcelProperty("服务主键")
@ExcelNote("")
private Long serviceId;
private Long servicesId;
/**
* LOCAL_TITLE -
*/
@ -61,12 +61,12 @@ public class Locations extends BaseEntity {
@ExcelNote("")
private String filterConf;
public Long getServiceId() {
return this.serviceId;
public Long getServicesId() {
return this.servicesId;
}
public void setServiceId(Long serviceId) {
this.serviceId = serviceId;
public void setServicesId(Long servicesId) {
this.servicesId = servicesId;
}
public String getLocalTitle() {

@ -52,41 +52,16 @@ public class ServicesManagerImpl implements ServicesManager {
return response;
}
{// 主机标题唯一检查
ServicesFindRequest servicesFindRequest = new ServicesFindRequest();
servicesFindRequest.setTitle(request.getTitle());
ServicesFindResponse servicesFindResponse = this.find(servicesFindRequest, token);
if (servicesFindResponse.hasError()) {
response.addErrors(servicesFindResponse.getErrors());
return response;
} else if (servicesFindResponse.getTotalCount() > 0) {
response.addError(ErrorType.UNIQUENESS_ERROR, "[title]主机标题已存在,请检查!");
return response;
}
}
{// 主机域名唯一检查
ServicesFindRequest servicesFindRequest = new ServicesFindRequest();
servicesFindRequest.setDomain(request.getDomain());
ServicesFindResponse servicesFindResponse = this.find(servicesFindRequest, token);
if (servicesFindResponse.hasError()) {
response.addErrors(servicesFindResponse.getErrors());
return response;
} else if (servicesFindResponse.getTotalCount() > 0) {
response.addError(ErrorType.UNIQUENESS_ERROR, "[domain]主机域名已存在,请检查!");
return response;
}
}
{// 服务端口唯一检查
ServicesFindRequest servicesFindRequest = new ServicesFindRequest();
servicesFindRequest.setPort(request.getPort());
ServicesFindResponse servicesFindResponse = this.find(servicesFindRequest, token);
if (servicesFindResponse.hasError()) {
response.addErrors(servicesFindResponse.getErrors());
return response;
} else if (servicesFindResponse.getTotalCount() > 0) {
response.addError(ErrorType.UNIQUENESS_ERROR, "[port]服务端口已存在,请检查!");
response.addError(ErrorType.UNIQUENESS_ERROR, "虚拟主机已存在,请检查!");
return response;
}
}

@ -7,12 +7,12 @@
<sql id="table">"NA_LOCATIONS"</sql>
<sql id="entityColumnList">
"ID","SERVICE_ID","LOCAL_TITLE","LOCAL_NOTE","LOCAL_PATH","LOCAL_VALID","FILTER","FILTER_CONF","ROW_VERSION","IS_DELETED","CREATE_BY","CREATE_TIME","LAST_UPDATE_BY","LAST_UPDATE_TIME"
"ID","SERVICES_ID","LOCAL_TITLE","LOCAL_NOTE","LOCAL_PATH","LOCAL_VALID","FILTER","FILTER_CONF","ROW_VERSION","IS_DELETED","CREATE_BY","CREATE_TIME","LAST_UPDATE_BY","LAST_UPDATE_TIME"
</sql>
<resultMap id="locations" type="xyz.wbsite.module.admin.ent.Locations">
<result column="ID" jdbcType="BIGINT" property="id"/>
<result column="SERVICE_ID" jdbcType="BIGINT" property="serviceId"/>
<result column="SERVICES_ID" jdbcType="BIGINT" property="servicesId"/>
<result column="LOCAL_TITLE" jdbcType="VARCHAR" property="localTitle"/>
<result column="LOCAL_NOTE" jdbcType="VARCHAR" property="localNote"/>
<result column="LOCAL_PATH" jdbcType="VARCHAR" property="localPath"/>
@ -36,7 +36,7 @@
VALUES
(
#{request.id},
#{request.serviceId,jdbcType=BIGINT},
#{request.servicesId,jdbcType=BIGINT},
#{request.localTitle,jdbcType=VARCHAR},
#{request.localNote,jdbcType=VARCHAR},
#{request.localPath,jdbcType=VARCHAR},
@ -61,7 +61,7 @@
VALUES
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
#{item.id},
#{item.serviceId,jdbcType=BIGINT},
#{item.servicesId,jdbcType=BIGINT},
#{item.localTitle,jdbcType=VARCHAR},
#{item.localNote,jdbcType=VARCHAR},
#{item.localPath,jdbcType=VARCHAR},
@ -100,7 +100,7 @@
UPDATE
<include refid="table"/>
SET
SERVICE_ID = #{request.serviceId,jdbcType=BIGINT},
SERVICES_ID = #{request.servicesId,jdbcType=BIGINT},
LOCAL_TITLE = #{request.localTitle,jdbcType=VARCHAR},
LOCAL_NOTE = #{request.localNote,jdbcType=VARCHAR},
LOCAL_PATH = #{request.localPath,jdbcType=VARCHAR},
@ -121,8 +121,8 @@
FROM
<include refid="table"/>
WHERE "IS_DELETED" = 0
<if test="request.serviceId != null">
AND "SERVICE_ID" = #{request.serviceId}
<if test="request.servicesId != null">
AND "SERVICES_ID" = #{request.servicesId}
</if>
<if test="request.localTitle != null and request.localTitle != ''">
AND "LOCAL_TITLE" = #{request.localTitle}
@ -144,8 +144,8 @@
FROM
<include refid="table"/>
WHERE "IS_DELETED" = 0
<if test="request.serviceId != null">
AND "SERVICE_ID" = #{request.serviceId}
<if test="request.servicesId != null">
AND "SERVICES_ID" = #{request.servicesId}
</if>
<if test="request.localTitle != null and request.localTitle != ''">
AND "LOCAL_TITLE" = #{request.localTitle}

@ -17,8 +17,8 @@ public class LocationsCreateRequest extends BaseRequest {
/**
* .
*/
@NotNull(message = "[serviceId]服务主键不能为NULL")
private Long serviceId;
@NotNull(message = "[servicesId]服务主键不能为NULL")
private Long servicesId;
/**
* .
@ -58,12 +58,12 @@ public class LocationsCreateRequest extends BaseRequest {
@Length(min = 0, max = 500, message = "[filterConf]过滤配置长度不合法(0-500)")
private String filterConf;
public Long getServiceId() {
return this.serviceId;
public Long getServicesId() {
return this.servicesId;
}
public void setServiceId(Long serviceId) {
this.serviceId = serviceId;
public void setServicesId(Long servicesId) {
this.servicesId = servicesId;
}
public String getLocalTitle() {

@ -15,7 +15,7 @@ public class LocationsFindRequest extends BaseFindRequest {
/**
* .
*/
private Long serviceId;
private Long servicesId;
/**
* .
@ -62,12 +62,12 @@ public class LocationsFindRequest extends BaseFindRequest {
*/
private Date endDate;
public Long getServiceId() {
return this.serviceId;
public Long getServicesId() {
return this.servicesId;
}
public void setServiceId(Long serviceId) {
this.serviceId = serviceId;
public void setServicesId(Long servicesId) {
this.servicesId = servicesId;
}
public String getLocalTitle() {

@ -24,8 +24,8 @@ public class LocationsUpdateRequest extends BaseUpdateRequest {
/**
* .
*/
@NotNull(message = "[serviceId]服务主键不能为NULL")
private Long serviceId;
@NotNull(message = "[servicesId]服务主键不能为NULL")
private Long servicesId;
/**
* .
@ -73,12 +73,12 @@ public class LocationsUpdateRequest extends BaseUpdateRequest {
this.id = id;
}
public Long getServiceId() {
return this.serviceId;
public Long getServicesId() {
return this.servicesId;
}
public void setServiceId(Long serviceId) {
this.serviceId = serviceId;
public void setServicesId(Long servicesId) {
this.servicesId = servicesId;
}
public String getLocalTitle() {

@ -50,6 +50,7 @@ public class ServicesCreateRequest extends BaseRequest {
/**
* .
*/
@NotNull(message = "[valid]是否启用不能为NULL")
private Boolean valid;
/**

@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS NA_SERVICES (
"DOMAIN" VARCHAR(50) NOT NULL,
"TYPE" VARCHAR(20) NOT NULL,
"PORT" MEDIUMINT NOT NULL,
"VALID" BOOLEAN,
"VALID" BOOLEAN NOT NULL,
"FILTER" BOOLEAN NOT NULL,
"FILTER_CONF" VARCHAR(500),
"ROW_VERSION" BIGINT NOT NULL,
@ -29,7 +29,7 @@ CREATE TABLE IF NOT EXISTS NA_SERVICES (
-- ----------------------------
CREATE TABLE IF NOT EXISTS NA_LOCATIONS (
"ID" BIGINT PRIMARY KEY NOT NULL,
"SERVICE_ID" BIGINT NOT NULL,
"SERVICES_ID" BIGINT NOT NULL,
"LOCAL_TITLE" VARCHAR(50) NOT NULL,
"LOCAL_NOTE" VARCHAR(250),
"LOCAL_PATH" VARCHAR(50) NOT NULL,

@ -6,7 +6,7 @@
-- ----------------------------
CREATE TABLE IF NOT EXISTS NA_LOCATIONS (
"ID" BIGINT PRIMARY KEY NOT NULL,
"SERVICE_ID" BIGINT NOT NULL,
"SERVICES_ID" BIGINT NOT NULL,
"LOCAL_TITLE" VARCHAR(50) NOT NULL,
"LOCAL_NOTE" VARCHAR(250),
"LOCAL_PATH" VARCHAR(50) NOT NULL,

@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS NA_SERVICES (
"DOMAIN" VARCHAR(50) NOT NULL,
"TYPE" VARCHAR(20) NOT NULL,
"PORT" MEDIUMINT NOT NULL,
"VALID" BOOLEAN,
"VALID" BOOLEAN NOT NULL,
"FILTER" BOOLEAN NOT NULL,
"FILTER_CONF" VARCHAR(500),
"ROW_VERSION" BIGINT NOT NULL,

@ -26,7 +26,7 @@
</table>
<table ajax="true" api="false" create="true" delete="true" find="true" get="false" html="true" methods="[]" msvr="false" pageAdd="true" pageDel="true" pageExp="true" pageImp="true" search="false" sys="true" tableComment="路径配置" tableName="LOCATIONS" update="true">
<field defaultValue="" fieldComment="主键" fieldLength="0" fieldName="ID" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="true" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>
<field defaultValue="NULL" fieldComment="服务主键" fieldLength="0" fieldName="SERVICE_ID" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="NULL" fieldComment="服务主键" fieldLength="0" fieldName="SERVICES_ID" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="NULL" fieldComment="配置标题" fieldLength="50" fieldName="LOCAL_TITLE" fieldType="String_var50" isLike="true" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="true"/>
<field defaultValue="NULL" fieldComment="配置备注" fieldLength="255" fieldName="LOCAL_NOTE" fieldType="String_var255" isLike="true" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="NULL" fieldComment="配置路径" fieldLength="50" fieldName="LOCAL_PATH" fieldType="String_var50" isLike="true" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -1121,30 +1121,25 @@
toHome: function () {
location.href = this.context + "/"
},
// 打开一个新Tab
tabOpen: function (tab) {
// 打开新标签 nav.openTab({title:"",name:"",url:""})
openTab: function (tab) {
if (window.index) {
window.index.addTab(tab)
window.index.openTab(tab)
} else if (window.parent.index) {
window.parent.index.addTab(tab)
window.parent.index.openTab(tab)
}
},
// 关闭Tab
tabClose: function (tabName) {
// 关闭标签tabName为空时关闭当前
closeTab: function (tabName) {
if (!tabName) {
tabName = window.index.activeTabName
}
if (window.index) {
window.index.removeTab(tabName)
} else if (window.parent.index) {
window.parent.index.removeTab(tabName)
}
},
// 关闭当前Tab
tabCloseCur: function () {
if (window.index) {
window.index.removeTab(window.index.activeTabName)
} else if (window.parent.index) {
window.parent.index.removeTab(window.parent.index.activeTabName)
}
},
// 全屏
screenFull: function () {
if (window.isFull)return;

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<title>${title?default("管理系统")}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script src="${context}/static/dist/lib.min.js" type="text/javascript"></script>
<script src="${context}/static/dist/index.min.js" type="text/javascript"></script>
<link href="${context}/static/dist/index.min.css" rel="stylesheet"/>
<link href="${context}/static/css/base.css" rel="stylesheet"/>
</head>
<body>
<#include controlHolder("nav")/>
<#include screenHolder()/>
</body>
</html>

@ -1,9 +1,6 @@
<div id="app" v-cloak>
<div class="form-search">
<el-form ref="vm" :model="vm" :inline="true" :label-width="'70px'">
<el-form-item label="服务主键" prop="serviceId" size="mini">
<el-input v-model="vm.serviceId" @keyup.enter.native="onSearch" type="number" clearable size="mini" placeholder="请输入服务主键" step="1"></el-input>
</el-form-item>
<el-form-item label="配置标题" prop="localTitle" size="mini">
<el-input v-model="vm.localTitle" @keyup.enter.native="onSearch" clearable size="mini" placeholder="请输入配置标题"></el-input>
</el-form-item>
@ -100,12 +97,6 @@
prop="id"
label="主键">
</el-table-column>
<el-table-column
align="center"
min-width="100"
prop="serviceId"
label="服务主键">
</el-table-column>
<el-table-column
align="center"
min-width="180"
@ -116,15 +107,15 @@
<el-table-column
align="center"
min-width="180"
prop="localNote"
label="配置备注"
prop="localPath"
label="配置路径"
show-overflow-tooltip>
</el-table-column>
<el-table-column
align="center"
min-width="180"
prop="localPath"
label="配置路径"
prop="localNote"
label="配置备注"
show-overflow-tooltip>
</el-table-column>
<el-table-column
@ -209,12 +200,12 @@
:rules="formRules"
:label-width="'85px'"
:label-position="'right'">
<el-form-item label="服务主键" prop="serviceId" size="mini">
<el-input-number v-model="form.serviceId" clearable size="mini" placeholder="请输入服务主键" :step="1" step-strictly></el-input-number>
</el-form-item>
<el-form-item label="配置标题" prop="localTitle" size="mini">
<el-input v-model="form.localTitle" clearable size="mini" placeholder="请输入配置标题" maxlength="50"></el-input>
</el-form-item>
<el-form-item label="配置路径" prop="localPath" size="mini">
<el-input v-model="form.localPath" clearable size="mini" placeholder="请输入配置路径" maxlength="50"></el-input>
</el-form-item>
<el-form-item label="配置备注" prop="localNote" size="mini" class="full">
<el-input v-model="form.localNote"
rows="7"
@ -225,9 +216,6 @@
show-word-limit
placeholder="请输入配置备注"></el-input>
</el-form-item>
<el-form-item label="配置路径" prop="localPath" size="mini">
<el-input v-model="form.localPath" clearable size="mini" placeholder="请输入配置路径" maxlength="50"></el-input>
</el-form-item>
<el-form-item label="是否启用" prop="localValid" size="mini">
<el-select v-model="form.localValid" clearable size="mini" placeholder="请选择是否启用">
<el-option key="true" label="是" :value="true"></el-option>
@ -266,7 +254,7 @@
module: 'admin',
target: 'locations',
vm: {//条件及分页参数
serviceId: null,
servicesId: $w.getSearchParam("servicesId"),
localTitle: null,
localTitleLike: null,
localNoteLike: null,
@ -286,7 +274,7 @@
formTitle: "",
formShow: false,
id: null,
serviceId: null,
servicesId: null,
localTitle: null,
localNote: null,
localPath: null,
@ -296,9 +284,6 @@
rowVersion: null
},
formRules: {
serviceId: [
{required: true, message: '服务主键不能为空', trigger: 'blur'},
],
localTitle: [
{required: true, message: '配置标题不能为空', trigger: 'blur'},
{min: 1, max: 50, message: '配置标题长度在 1 到 50 个字符', trigger: 'blur'}
@ -326,19 +311,19 @@
this.form.formTitle = "路径配置新增";
this.form.formShow = true;
this.form.id = "";
this.form.serviceId = "";
this.form.servicesId = $w.getSearchParam("servicesId");
this.form.localTitle = "";
this.form.localNote = "";
this.form.localPath = "";
this.form.localValid = "";
this.form.filter = "";
this.form.localPath = "/";
this.form.localValid = true;
this.form.filter = false;
this.form.filterConf = "";
},
onEdit: function (item) {
this.form.formTitle = "路径配置编辑";
this.form.formShow = true;
this.form.id = item.id;
this.form.serviceId = item.serviceId;
this.form.servicesId = item.servicesId;
this.form.localTitle = item.localTitle;
this.form.localNote = item.localNote;
this.form.localPath = item.localPath;

@ -170,7 +170,7 @@
<template slot-scope="scope">
<wb-table-ops :arg="scope.row">
<#if token.hasRes("/ajax/admin/location.html")>
<wb-table-op slot="menu" icon="el-icon-edit" @click="addTab({title: '路径配置', name: 'LOCATIONS', url: '${context}/admin/locations.htm'})">配置</wb-table-op>
<wb-table-op slot="menu" icon="el-icon-edit" @click="nav.openTab({title: '路径配置', name: 'LOCATIONS', url: '/admin/locations.htm?servicesId=' + scope.row.id})">配置</wb-table-op>
</#if>
<#if token.hasRes("/ajax/admin/services/update")>
<wb-table-op slot="menu" icon="el-icon-edit" @click="onEdit">编辑</wb-table-op>
@ -314,6 +314,7 @@
{required: true, message: '服务端口不能为空', trigger: 'blur'},
],
valid: [
{required: true, message: '是否启用不能为空', trigger: 'blur'},
],
filter: [
{required: true, message: '启用过滤不能为空', trigger: 'blur'},
@ -332,8 +333,8 @@
this.form.domain = "localhost";
this.form.type = "";
this.form.port = 80;
this.form.valid = "";
this.form.filter = "";
this.form.valid = true;
this.form.filter = false;
this.form.filterConf = "";
},
onEdit: function (item) {

@ -1024,7 +1024,7 @@
<pre> name: 'home',</pre>
<pre> url: '/home.htm'</pre>
<pre>}</pre>
<pre>index.addTab(tab)</pre>
<pre>index.openTab(tab)</pre>
</el-card>
<el-card class="card" style="width: 600px;margin: 20px">

@ -0,0 +1,232 @@
<div id="app" v-cloak>
<el-card class="box-card control">
<el-row>
<el-col :span="3">
<a>Nginx 控制中心</a>
</el-col>
<el-col :span="5">
<a @click="nginxStart">
<el-image v-if="run" :src="'${UrlUtil.getUrl('/static/img/start_.png')}'"
style="width: 50px; height: 50px"
fit="fill"></el-image>
<el-image v-if="!run" :src="'${UrlUtil.getUrl('/static/img/start.png')}'"
style="width: 50px; height: 50px"
fit="fill"></el-image>
</a>
<a @click="nginxStop">
<el-image v-if="run" :src="'${UrlUtil.getUrl('/static/img/stop.png')}'"
style="width: 50px; height: 50px"
fit="fill"></el-image>
<el-image v-if="!run" :src="'${UrlUtil.getUrl('/static/img/stop_.png')}'"
style="width: 50px; height: 50px"
fit="fill"></el-image>
</a>
<a @click="nginxReload">
<el-image v-if="run" :src="'${UrlUtil.getUrl('/static/img/reload.png')}'"
style="width: 50px; height: 50px"
fit="fill"></el-image>
<el-image v-if="!run" :src="'${UrlUtil.getUrl('/static/img/reload_.png')}'"
style="width: 50px; height: 50px"
fit="fill"></el-image>
</a>
</el-col>
</el-row>
</el-card>
<el-card class="box-card pane-list" style="width: 260px;height: 140px" v-for="item in services">
<div class="pane">
<div class="img">
<el-image style="width: 60px;height:60px" src="/static/img/http.png"></el-image>
<a>{{item.title}}</a>
</div>
<div class="info">
<el-switch
v-model="item.valid"
active-color="#13ce66"
active-text="启用"
inactive-text="暂停">
inactive-color="#ff4949">
</el-switch>
</div>
<div class="more" @click="toSet(item)">
<el-button type="text" size="mini"><i class="el-icon-s-operation"></i></el-button>
</div>
</div>
</el-card>
</div>
<style>
#app {
padding: 10px;
margin: 0 auto;
width: 1080px;
}
.box-card {
margin: 10px;
}
.control a:first-child {
padding-right: 10px;
}
.control a {
display: inline-block;
line-height: 50px;
height: 50px;
vertical-align: top;
}
.control a:hover {
background: #e7e7e7;
}
.control a:first-child:hover {
background: #ffffff;
}
.pane-list {
box-shadow: 0 0 0 0 inset !important;
-webkit-box-shadow: 0 0 0 0 inset !important;
}
.pane-list:hover {
box-shadow: 0 0 70px -40px inset !important;
-webkit-box-shadow: 0 0 70px -40px inset !important;
}
.pane {
width: 240px;
height: 120px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 15px;
position: relative;
}
.pane .img {
display: flex;
align-items: center;
flex-direction: column;
}
.pane a {
font-size: 14px;
line-height: 28px;
font-family: "微软雅黑";
font-weight: bold;
}
.pane .info {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.pane .more {
position: absolute;
right: 0;
top: 0;
width: 20px;
height: 20px;
display: flex;
justify-content: center;
align-items: center;
}
</style>
<script>
var app = new Vue({
mixins: [mixinBase, mixinForMgr],
el: "#app",
data: {
services: [],
run: ${run?default('false')}
},
methods: {
onLoadService: function () {
var param = {
pageSize: 0
};
new Ajax("admin", "services", "find").post(param, function (response) {
if (response.errors.length > 0) {
nav.e(response.errors[0].message);
} else {
this.services = response.result;
}
}.bind(this))
},
toSet: function (item) {
nav.openTab({
title: '映射配置',
name: 'mapping' + item.id,
url: '/admin/locations.htm?servicesId=' + item.id
})
},
startMonitor: function () {
if (window.EventSource) {
window.evtSource = new EventSource('${UrlUtil.getUrl("/sse/1")}');
window.evtSource.addEventListener('message', function (e) {
var msg = JSON.parse(e.data);
if (msg.type == 'NGINX_STATE') {//状态推送
if (this.run != msg.object.run) {
this.$notify.info({
title: '提示',
message: "Nginx 运行状态发生变化。",
duration: 5000
});
this.run = msg.object.run;
}
}
}.bind(this))
}
},
nginxStart: function () {
new Ajax("conf", "nginx", "start").post(function (response) {
if (response.errors.length > 0) {
nav.e(response.errors[0].message);
} else {
this.onFind();
this.form.dialog = false;
}
}.bind(this))
},
nginxStop: function () {
new Ajax("conf", "nginx", "stop").post(function (response) {
if (response.errors.length > 0) {
nav.e(response.errors[0].message);
} else {
this.onFind();
this.form.dialog = false;
}
}.bind(this))
},
configFlush: function () {
ajax.configFlush();
},
onRefresh: function () {
this.configFlush();
this.onFind();
},
nginxReload: function () {
new Ajax("conf", "nginx", "reload").post(function (response) {
if (response.errors.length > 0) {
nav.e(response.errors[0].message);
} else {
}
}.bind(this))
}
},
mounted: function () {
this.onLoadService();
this.startMonitor();
}
})
</script>

@ -23,13 +23,22 @@
<span slot="title">配置模块</span>
</template>
<#if token.hasRes("ADMIN_SERVICES")>
<el-menu-item index="56799af2-df08-44fa-a97c-faccc0963dd9" @click="addTab({title: '虚拟主机', name: 'SERVICES', url: '${context}/admin/services.htm'})">虚拟主机</el-menu-item>
<el-menu-item index="56799af2-df08-44fa-a97c-faccc0963dd9"
@click="openTab({title: '虚拟主机', name: 'SERVICES', url: '/admin/services.htm'})">
虚拟主机
</el-menu-item>
</#if>
<#if token.hasRes("ADMIN_LOCATIONS")>
<el-menu-item index="03bcbb6e-7a2a-430e-998c-ce512c52b506" @click="addTab({title: '路径配置', name: 'LOCATIONS', url: '${context}/admin/locations.htm'})">路径配置</el-menu-item>
<el-menu-item index="03bcbb6e-7a2a-430e-998c-ce512c52b506"
@click="openTab({title: '路径配置', name: 'LOCATIONS', url: '/admin/locations.htm'})">
路径配置
</el-menu-item>
</#if>
<#if token.hasRes("ADMIN_CONFIG")>
<el-menu-item index="60701dea-1083-4a85-b83f-77ea1c099577" @click="addTab({title: '配置预设', name: 'CONFIG', url: '${context}/admin/config.htm'})">配置预设</el-menu-item>
<el-menu-item index="60701dea-1083-4a85-b83f-77ea1c099577"
@click="openTab({title: '配置预设', name: 'CONFIG', url: '/admin/config.htm'})">
配置预设
</el-menu-item>
</#if>
</el-submenu>
</#if>
@ -60,8 +69,14 @@
<el-link :underline="false" @click="onHome" icon="el-icon-warning-outline">关于</el-link>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="addTab({title: '开发指导', name: 'helpDev', url: context + '/helpDev.htm'})">开发指导</el-dropdown-item>
<el-dropdown-item @click.native="addTab({title: '使用指导', name: 'help', url: context + '/help.htm'})">使用指导</el-dropdown-item>
<el-dropdown-item
@click.native="openTab({title: '开发指导', name: 'helpDev', url: '/helpDev.htm'})">
开发指导
</el-dropdown-item>
<el-dropdown-item
@click.native="openTab({title: '使用指导', name: 'help', url: '/help.htm'})">
使用指导
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</li>
@ -94,13 +109,16 @@
:visible.sync="form.formShow">
<el-form class="form" :model="form" :rules="formRules" ref="form" label-position="right" label-width="90px">
<el-form-item label="当前密码" prop="password" size="mini">
<el-input v-model="form.password" type="password" clearable size="mini" placeholder="请输入当前密码"></el-input>
<el-input v-model="form.password" type="password" clearable size="mini"
placeholder="请输入当前密码"></el-input>
</el-form-item>
<el-form-item label="新设密码" prop="newPassword" size="mini">
<el-input v-model="form.newPassword" type="password" clearable size="mini" placeholder="请输入新设密码"></el-input>
<el-input v-model="form.newPassword" type="password" clearable size="mini"
placeholder="请输入新设密码"></el-input>
</el-form-item>
<el-form-item label="密码确认" prop="newPassword_" size="mini">
<el-input v-model="form.newPassword_" type="password" clearable size="mini" placeholder="请输入密码确认"></el-input>
<el-input v-model="form.newPassword_" type="password" clearable size="mini"
placeholder="请输入密码确认"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -306,7 +324,8 @@
],
newPassword_: [
{required: true, message: '密码确认不能为空', trigger: 'blur'},
{ validator: function (rule, value, callback) {
{
validator: function (rule, value, callback) {
if (value === '') {
callback(new Error('请再次输入密码'));
} else if (value !== index.form.newPassword) {
@ -314,14 +333,15 @@
} else {
callback();
}
}, trigger: 'blur' }
}, trigger: 'blur'
}
]
},
resultUnRead: []
},
methods: {
onHome: function () {
this.addTab({
this.openTab({
title: '首页',
name: 'home',
url: this.context + '/home.htm'
@ -357,11 +377,15 @@
handleSelect: function (index) {
this.prop.menu = index;
},
addTab: function (tab) {
openTab: function (tab) {
//查找是否存在该tab
var tempTabs = this.tabs.filter(function (tab_) {
return tab_.name === tab.name;
})
});
//检查url
if (!tab.url.startsWith(this.context)) {
this.tab.url = this.context + this.tab.url;
};
//不存在则添加
if (tempTabs.length <= 0) {
this.tabs.push(tab)
@ -459,10 +483,10 @@
this.onHome();
// 开发模式,默认打开指导页
if (this.active === 'dev') {
this.addTab({
this.openTab({
title: '开发指导',
name: 'helpDev',
url: this.context + '/helpDev.htm'
url: '/helpDev.htm'
})
}
}

@ -40,7 +40,7 @@ public class LocationsTest {
@Test
public void testCreate() {
LocationsCreateRequest request = new LocationsCreateRequest();
request.setServiceId(1L);
request.setServicesId(1L);
request.setLocalTitle("配置标题");
request.setLocalNote("配置备注");
request.setLocalPath("配置路径");
@ -58,7 +58,7 @@ public class LocationsTest {
//创建数据
LocationsCreateRequest createRequest = new LocationsCreateRequest();
createRequest.setServiceId(1L);
createRequest.setServicesId(1L);
createRequest.setLocalTitle("配置标题");
createRequest.setLocalNote("配置备注");
createRequest.setLocalPath("配置路径");
@ -82,7 +82,7 @@ public class LocationsTest {
public void testUpdate() {
//创建数据
LocationsCreateRequest createRequest = new LocationsCreateRequest();
createRequest.setServiceId(1L);
createRequest.setServicesId(1L);
createRequest.setLocalTitle("配置标题");
createRequest.setLocalNote("配置备注");
createRequest.setLocalPath("配置路径");
@ -97,7 +97,7 @@ public class LocationsTest {
//更新数据
LocationsUpdateRequest request = new LocationsUpdateRequest();
request.setId(createResponse.getId());
request.setServiceId(1L);
request.setServicesId(1L);
request.setLocalTitle("配置标题");
request.setLocalNote("配置备注");
request.setLocalPath("配置路径");
@ -113,7 +113,7 @@ public class LocationsTest {
@Test
public void testFind() {
LocationsFindRequest request = new LocationsFindRequest();
request.setServiceId(1L);
request.setServicesId(1L);
request.setLocalTitle("配置标题");
request.setLocalPath("配置路径");
request.setLocalValid(true);

Loading…
Cancel
Save

Powered by TurnKey Linux.