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 { public class Locations extends BaseEntity {
/** /**
* SERVICE_ID - * SERVICES_ID -
*/ */
@ExcelProperty("服务主键") @ExcelProperty("服务主键")
@ExcelNote("") @ExcelNote("")
private Long serviceId; private Long servicesId;
/** /**
* LOCAL_TITLE - * LOCAL_TITLE -
*/ */
@ -61,12 +61,12 @@ public class Locations extends BaseEntity {
@ExcelNote("") @ExcelNote("")
private String filterConf; private String filterConf;
public Long getServiceId() { public Long getServicesId() {
return this.serviceId; return this.servicesId;
} }
public void setServiceId(Long serviceId) { public void setServicesId(Long servicesId) {
this.serviceId = serviceId; this.servicesId = servicesId;
} }
public String getLocalTitle() { public String getLocalTitle() {

@ -52,41 +52,16 @@ public class ServicesManagerImpl implements ServicesManager {
return response; 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 servicesFindRequest = new ServicesFindRequest();
servicesFindRequest.setDomain(request.getDomain()); 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()); servicesFindRequest.setPort(request.getPort());
ServicesFindResponse servicesFindResponse = this.find(servicesFindRequest, token); ServicesFindResponse servicesFindResponse = this.find(servicesFindRequest, token);
if (servicesFindResponse.hasError()) { if (servicesFindResponse.hasError()) {
response.addErrors(servicesFindResponse.getErrors()); response.addErrors(servicesFindResponse.getErrors());
return response; return response;
} else if (servicesFindResponse.getTotalCount() > 0) { } else if (servicesFindResponse.getTotalCount() > 0) {
response.addError(ErrorType.UNIQUENESS_ERROR, "[port]服务端口已存在,请检查!"); response.addError(ErrorType.UNIQUENESS_ERROR, "虚拟主机已存在,请检查!");
return response; return response;
} }
} }

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

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

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

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

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

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

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

@ -26,7 +26,7 @@
</table> </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"> <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="" 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="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="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"/> <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 () { toHome: function () {
location.href = this.context + "/" location.href = this.context + "/"
}, },
// 打开一个新Tab // 打开新标签 nav.openTab({title:"",name:"",url:""})
tabOpen: function (tab) { openTab: function (tab) {
if (window.index) { if (window.index) {
window.index.addTab(tab) window.index.openTab(tab)
} else if (window.parent.index) { } else if (window.parent.index) {
window.parent.index.addTab(tab) window.parent.index.openTab(tab)
} }
}, },
// 关闭Tab // 关闭标签tabName为空时关闭当前
tabClose: function (tabName) { closeTab: function (tabName) {
if (!tabName) {
tabName = window.index.activeTabName
}
if (window.index) { if (window.index) {
window.index.removeTab(tabName) window.index.removeTab(tabName)
} else if (window.parent.index) { } else if (window.parent.index) {
window.parent.index.removeTab(tabName) 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 () { screenFull: function () {
if (window.isFull)return; 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 id="app" v-cloak>
<div class="form-search"> <div class="form-search">
<el-form ref="vm" :model="vm" :inline="true" :label-width="'70px'"> <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-form-item label="配置标题" prop="localTitle" size="mini">
<el-input v-model="vm.localTitle" @keyup.enter.native="onSearch" clearable size="mini" placeholder="请输入配置标题"></el-input> <el-input v-model="vm.localTitle" @keyup.enter.native="onSearch" clearable size="mini" placeholder="请输入配置标题"></el-input>
</el-form-item> </el-form-item>
@ -100,12 +97,6 @@
prop="id" prop="id"
label="主键"> label="主键">
</el-table-column> </el-table-column>
<el-table-column
align="center"
min-width="100"
prop="serviceId"
label="服务主键">
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
min-width="180" min-width="180"
@ -116,15 +107,15 @@
<el-table-column <el-table-column
align="center" align="center"
min-width="180" min-width="180"
prop="localNote" prop="localPath"
label="配置备注" label="配置路径"
show-overflow-tooltip> show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
min-width="180" min-width="180"
prop="localPath" prop="localNote"
label="配置路径" label="配置备注"
show-overflow-tooltip> show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -209,12 +200,12 @@
:rules="formRules" :rules="formRules"
:label-width="'85px'" :label-width="'85px'"
:label-position="'right'"> :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-form-item label="配置标题" prop="localTitle" size="mini">
<el-input v-model="form.localTitle" clearable size="mini" placeholder="请输入配置标题" maxlength="50"></el-input> <el-input v-model="form.localTitle" clearable size="mini" placeholder="请输入配置标题" maxlength="50"></el-input>
</el-form-item> </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-form-item label="配置备注" prop="localNote" size="mini" class="full">
<el-input v-model="form.localNote" <el-input v-model="form.localNote"
rows="7" rows="7"
@ -225,9 +216,6 @@
show-word-limit show-word-limit
placeholder="请输入配置备注"></el-input> placeholder="请输入配置备注"></el-input>
</el-form-item> </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-form-item label="是否启用" prop="localValid" size="mini">
<el-select v-model="form.localValid" clearable size="mini" placeholder="请选择是否启用"> <el-select v-model="form.localValid" clearable size="mini" placeholder="请选择是否启用">
<el-option key="true" label="是" :value="true"></el-option> <el-option key="true" label="是" :value="true"></el-option>
@ -266,7 +254,7 @@
module: 'admin', module: 'admin',
target: 'locations', target: 'locations',
vm: {//条件及分页参数 vm: {//条件及分页参数
serviceId: null, servicesId: $w.getSearchParam("servicesId"),
localTitle: null, localTitle: null,
localTitleLike: null, localTitleLike: null,
localNoteLike: null, localNoteLike: null,
@ -286,7 +274,7 @@
formTitle: "", formTitle: "",
formShow: false, formShow: false,
id: null, id: null,
serviceId: null, servicesId: null,
localTitle: null, localTitle: null,
localNote: null, localNote: null,
localPath: null, localPath: null,
@ -296,9 +284,6 @@
rowVersion: null rowVersion: null
}, },
formRules: { formRules: {
serviceId: [
{required: true, message: '服务主键不能为空', trigger: 'blur'},
],
localTitle: [ localTitle: [
{required: true, message: '配置标题不能为空', trigger: 'blur'}, {required: true, message: '配置标题不能为空', trigger: 'blur'},
{min: 1, max: 50, message: '配置标题长度在 1 到 50 个字符', trigger: 'blur'} {min: 1, max: 50, message: '配置标题长度在 1 到 50 个字符', trigger: 'blur'}
@ -326,19 +311,19 @@
this.form.formTitle = "路径配置新增"; this.form.formTitle = "路径配置新增";
this.form.formShow = true; this.form.formShow = true;
this.form.id = ""; this.form.id = "";
this.form.serviceId = ""; this.form.servicesId = $w.getSearchParam("servicesId");
this.form.localTitle = ""; this.form.localTitle = "";
this.form.localNote = ""; this.form.localNote = "";
this.form.localPath = ""; this.form.localPath = "/";
this.form.localValid = ""; this.form.localValid = true;
this.form.filter = ""; this.form.filter = false;
this.form.filterConf = ""; this.form.filterConf = "";
}, },
onEdit: function (item) { onEdit: function (item) {
this.form.formTitle = "路径配置编辑"; this.form.formTitle = "路径配置编辑";
this.form.formShow = true; this.form.formShow = true;
this.form.id = item.id; this.form.id = item.id;
this.form.serviceId = item.serviceId; this.form.servicesId = item.servicesId;
this.form.localTitle = item.localTitle; this.form.localTitle = item.localTitle;
this.form.localNote = item.localNote; this.form.localNote = item.localNote;
this.form.localPath = item.localPath; this.form.localPath = item.localPath;

@ -170,14 +170,14 @@
<template slot-scope="scope"> <template slot-scope="scope">
<wb-table-ops :arg="scope.row"> <wb-table-ops :arg="scope.row">
<#if token.hasRes("/ajax/admin/location.html")> <#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>
<#if token.hasRes("/ajax/admin/services/update")> <#if token.hasRes("/ajax/admin/services/update")>
<wb-table-op slot="menu" icon="el-icon-edit" @click="onEdit">编辑</wb-table-op> <wb-table-op slot="menu" icon="el-icon-edit" @click="onEdit">编辑</wb-table-op>
</#if> </#if>
<#if token.hasRes("/ajax/admin/services/delete")> <#if token.hasRes("/ajax/admin/services/delete")>
<wb-table-op slot="menu" icon="el-icon-delete" @click="onDelete">删除</wb-table-op> <wb-table-op slot="menu" icon="el-icon-delete" @click="onDelete">删除</wb-table-op>
</#if> </#if>
</wb-table-ops> </wb-table-ops>
</template> </template>
</el-table-column> </el-table-column>
@ -314,6 +314,7 @@
{required: true, message: '服务端口不能为空', trigger: 'blur'}, {required: true, message: '服务端口不能为空', trigger: 'blur'},
], ],
valid: [ valid: [
{required: true, message: '是否启用不能为空', trigger: 'blur'},
], ],
filter: [ filter: [
{required: true, message: '启用过滤不能为空', trigger: 'blur'}, {required: true, message: '启用过滤不能为空', trigger: 'blur'},
@ -332,8 +333,8 @@
this.form.domain = "localhost"; this.form.domain = "localhost";
this.form.type = ""; this.form.type = "";
this.form.port = 80; this.form.port = 80;
this.form.valid = ""; this.form.valid = true;
this.form.filter = ""; this.form.filter = false;
this.form.filterConf = ""; this.form.filterConf = "";
}, },
onEdit: function (item) { onEdit: function (item) {

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

@ -16,23 +16,32 @@
:unique-opened="prop.open" :unique-opened="prop.open"
:collapse="prop.coll" :collapse="prop.coll"
:collapse-transition="prop.tran"> :collapse-transition="prop.tran">
<#if token.hasRes("ADMIN")> <#if token.hasRes("ADMIN")>
<el-submenu index="37730a50-4f13-4835-bf3f-65af82ca2d98"> <el-submenu index="37730a50-4f13-4835-bf3f-65af82ca2d98">
<template slot="title"> <template slot="title">
<i class="el-icon-document-copy"></i> <i class="el-icon-document-copy"></i>
<span slot="title">配置模块</span> <span slot="title">配置模块</span>
</template> </template>
<#if token.hasRes("ADMIN_SERVICES")> <#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>
<#if token.hasRes("ADMIN_LOCATIONS")> <#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>
<#if token.hasRes("ADMIN_CONFIG")> <#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> </#if>
</el-submenu> </el-submenu>
</#if> </#if>
</el-menu> </el-menu>
</div> </div>
@ -60,8 +69,14 @@
<el-link :underline="false" @click="onHome" icon="el-icon-warning-outline">关于</el-link> <el-link :underline="false" @click="onHome" icon="el-icon-warning-outline">关于</el-link>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="addTab({title: '开发指导', name: 'helpDev', url: context + '/helpDev.htm'})">开发指导</el-dropdown-item> <el-dropdown-item
<el-dropdown-item @click.native="addTab({title: '使用指导', name: 'help', url: context + '/help.htm'})">使用指导</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-menu>
</el-dropdown> </el-dropdown>
</li> </li>
@ -94,13 +109,16 @@
:visible.sync="form.formShow"> :visible.sync="form.formShow">
<el-form class="form" :model="form" :rules="formRules" ref="form" label-position="right" label-width="90px"> <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-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>
<el-form-item label="新设密码" prop="newPassword" size="mini"> <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>
<el-form-item label="密码确认" prop="newPassword_" size="mini"> <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>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -145,18 +163,18 @@
z-index: 99; z-index: 99;
} }
#loadingBar div[role=progressbar] .el-progress-bar__outer{ #loadingBar div[role=progressbar] .el-progress-bar__outer {
background-color: transparent; background-color: transparent;
} }
#devMarker{ #devMarker {
position: absolute; position: absolute;
bottom: 50px; bottom: 50px;
right: 50px; right: 50px;
} }
#devMarker:after{ #devMarker:after {
pointer-events:none; pointer-events: none;
content: attr(marker-value); content: attr(marker-value);
font-size: 100px; font-size: 100px;
color: rgba(188, 188, 188, 0.5); color: rgba(188, 188, 188, 0.5);
@ -257,18 +275,18 @@
line-height: 20px; line-height: 20px;
} }
#content,#content .el-tabs__content { #content, #content .el-tabs__content {
padding: 0; padding: 0;
height: calc(100% - 40px); height: calc(100% - 40px);
} }
#content > div,#content .el-tab-pane { #content > div, #content .el-tab-pane {
padding: 0; padding: 0;
border: 0; border: 0;
height: 100%; height: 100%;
} }
#content div[role=tab]{ #content div[role=tab] {
padding: 0 10px; padding: 0 10px;
} }
</style> </style>
@ -282,19 +300,19 @@
prop: { prop: {
menu: '', menu: '',
tabName: '', tabName: '',
open: <#if prop.open>true<#else>false</#if>, open: <#if prop.open>true<#else>false</#if>,
coll: <#if prop.coll>true<#else>false</#if>, coll: <#if prop.coll>true<#else>false</#if>,
tran: <#if prop.tran>true<#else>false</#if>, tran: <#if prop.tran>true<#else>false</#if>,
full: <#if prop.full>true<#else>false</#if> full: <#if prop.full>true<#else>false</#if>
}, },
barStatus:null, barStatus: null,
barPercent: 0, barPercent: 0,
barInterval: null, barInterval: null,
form:{ form: {
formShow:false, formShow: false,
password:'', password: '',
newPassword:'', newPassword: '',
newPassword_:'' newPassword_: ''
}, },
formRules: { formRules: {
password: [ password: [
@ -306,22 +324,24 @@
], ],
newPassword_: [ newPassword_: [
{required: true, message: '密码确认不能为空', trigger: 'blur'}, {required: true, message: '密码确认不能为空', trigger: 'blur'},
{ validator: function (rule, value, callback) { {
if (value === '') { validator: function (rule, value, callback) {
callback(new Error('请再次输入密码')); if (value === '') {
} else if (value !== index.form.newPassword) { callback(new Error('请再次输入密码'));
callback(new Error('两次输入密码不一致!')); } else if (value !== index.form.newPassword) {
} else { callback(new Error('两次输入密码不一致!'));
callback(); } else {
} callback();
}, trigger: 'blur' } }
}, trigger: 'blur'
}
] ]
}, },
resultUnRead:[] resultUnRead: []
}, },
methods: { methods: {
onHome: function () { onHome: function () {
this.addTab({ this.openTab({
title: '首页', title: '首页',
name: 'home', name: 'home',
url: this.context + '/home.htm' url: this.context + '/home.htm'
@ -357,11 +377,15 @@
handleSelect: function (index) { handleSelect: function (index) {
this.prop.menu = index; this.prop.menu = index;
}, },
addTab: function (tab) { openTab: function (tab) {
//查找是否存在该tab //查找是否存在该tab
var tempTabs = this.tabs.filter(function (tab_) { var tempTabs = this.tabs.filter(function (tab_) {
return tab_.name === tab.name; return tab_.name === tab.name;
}) });
//检查url
if (!tab.url.startsWith(this.context)) {
this.tab.url = this.context + this.tab.url;
};
//不存在则添加 //不存在则添加
if (tempTabs.length <= 0) { if (tempTabs.length <= 0) {
this.tabs.push(tab) this.tabs.push(tab)
@ -387,7 +411,7 @@
return tab.name !== tabName return tab.name !== tabName
}) })
}, },
onChangePwd:function () { onChangePwd: function () {
this.$refs['form'].validate(function (valid) { this.$refs['form'].validate(function (valid) {
if (valid) { if (valid) {
new Ajax("wadmin", "user", "changePwd").post(this.form, function (response) { new Ajax("wadmin", "user", "changePwd").post(this.form, function (response) {
@ -400,9 +424,9 @@
} }
}.bind(this)) }.bind(this))
}, },
onLogout: function() { onLogout: function () {
nav.boxYesNo("退出提示", "是否退出当前登录账户?" ,function (result) { nav.boxYesNo("退出提示", "是否退出当前登录账户?", function (result) {
if (result){ if (result) {
new Ajax("wframe", "auth", "logout").post({}, function (response) { new Ajax("wframe", "auth", "logout").post({}, function (response) {
if (response.errors.length > 0) { if (response.errors.length > 0) {
nav.e(response.errors[0].message); nav.e(response.errors[0].message);
@ -415,7 +439,7 @@
}.bind(this)) }.bind(this))
}, },
onLogoutForChangePwd: function () { onLogoutForChangePwd: function () {
nav.boxYes("退出提示", "密码修改成功立即重新登录?" ,function (result) { nav.boxYes("退出提示", "密码修改成功立即重新登录?", function (result) {
new Ajax("wadmin", "user").method("logout").post({}, function (response) { new Ajax("wadmin", "user").method("logout").post({}, function (response) {
if (response.errors.length > 0) { if (response.errors.length > 0) {
nav.e(response.errors[0].message); nav.e(response.errors[0].message);
@ -426,7 +450,7 @@
}.bind(this)); }.bind(this));
}.bind(this)) }.bind(this))
}, },
switchFullScreen:function(){ switchFullScreen: function () {
this.prop.full = !this.prop.full; this.prop.full = !this.prop.full;
if (this.prop.full) { if (this.prop.full) {
nav.screenFull() nav.screenFull()
@ -455,14 +479,14 @@
var tabs = $.getSessionStorage("tabs"); var tabs = $.getSessionStorage("tabs");
if (tabs) { if (tabs) {
this.tabs = JSON.parse(tabs); this.tabs = JSON.parse(tabs);
}else { } else {
this.onHome(); this.onHome();
// 开发模式,默认打开指导页 // 开发模式,默认打开指导页
if (this.active === 'dev') { if (this.active === 'dev') {
this.addTab({ this.openTab({
title: '开发指导', title: '开发指导',
name: 'helpDev', name: 'helpDev',
url: this.context + '/helpDev.htm' url: '/helpDev.htm'
}) })
} }
} }
@ -479,7 +503,7 @@
}.bind(this)); }.bind(this));
}, },
watch: { watch: {
"prop.tabName":function () { "prop.tabName": function () {
this.onSaveState(); this.onSaveState();
} }
} }

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

Loading…
Cancel
Save

Powered by TurnKey Linux.