更新图片和调整绝对路径

This commit is contained in:
jiangzeyin 2019-04-10 22:32:10 +08:00
parent 814680cc07
commit 73a4a35942
18 changed files with 123 additions and 169 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 157 KiB

View File

@ -8,6 +8,7 @@ import cn.jiangzeyin.common.JsonMessage;
import cn.keepbx.jpom.common.BaseController;
import cn.keepbx.jpom.common.commander.AbstractCommander;
import cn.keepbx.jpom.common.interceptor.ProjectPermission;
import cn.keepbx.jpom.controller.manage.file.ProjectFileControl;
import cn.keepbx.jpom.model.ProjectInfoModel;
import cn.keepbx.jpom.service.manage.ProjectInfoService;
import com.alibaba.fastjson.JSONArray;
@ -77,7 +78,7 @@ public class LogBackController extends BaseController {
@RequestMapping(value = "logBack_delete", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
@ProjectPermission(checkDelete = true)
public String clear(String id, String name) {
public String clear(String name) {
name = pathSafe(name);
if (StrUtil.isEmpty(name)) {
return JsonMessage.getString(405, "非法操作:" + name);

View File

@ -1,4 +1,4 @@
package cn.keepbx.jpom.controller.manage;
package cn.keepbx.jpom.controller.manage.file;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
@ -31,7 +31,7 @@ import java.io.File;
* @author Administrator
*/
@Controller
@RequestMapping(value = "/file/")
@RequestMapping(value = "/manage/file/")
public class ProjectFileControl extends BaseController {
@Resource
@ -42,7 +42,7 @@ public class ProjectFileControl extends BaseController {
*
* @param id 项目id
*/
@RequestMapping(value = "filemanage", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
@RequestMapping(value = "list.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public String fileManage(String id) {
setAttribute("id", id);
return "manage/filemanage";

View File

@ -1,4 +1,4 @@
package cn.keepbx.jpom.controller.manage;
package cn.keepbx.jpom.controller.manage.recover;
import cn.hutool.core.util.StrUtil;
import cn.jiangzeyin.common.JsonMessage;
@ -22,7 +22,7 @@ import java.util.List;
* @author Administrator
*/
@Controller
@RequestMapping(value = "/manage/")
@RequestMapping(value = "/manage/recover")
public class ProjectRecoverControl extends BaseController {
@Resource
@ -33,9 +33,8 @@ public class ProjectRecoverControl extends BaseController {
*
* @return page
*/
@RequestMapping(value = "project_recover", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public String projectInfo() throws IOException {
@RequestMapping(value = "list.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public String projectInfo() {
UserModel userModel = getUser();
if (userModel.isManage()) {
List<ProjectRecoverModel> projectInfoModels = projectRecoverService.list();
@ -44,7 +43,7 @@ public class ProjectRecoverControl extends BaseController {
return "manage/project_recover";
}
@RequestMapping(value = "recover/project", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "data.json", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public String project(String id) throws IOException {
if (StrUtil.isEmpty(id)) {

View File

@ -1,4 +1,4 @@
package cn.keepbx.jpom.controller.system;
package cn.keepbx.jpom.controller.system.nginx;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.CharsetUtil;
@ -34,7 +34,7 @@ import java.util.List;
* @author Arno
*/
@Controller
@RequestMapping("/system")
@RequestMapping("/system/nginx")
public class NginxController extends BaseController {
@ -46,7 +46,7 @@ public class NginxController extends BaseController {
@Resource
private NginxService nginxService;
@RequestMapping(value = "nginx", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
@RequestMapping(value = "list.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public String ngx() {
JSONArray ngxDirectory = whitelistDirectoryService.getNgxDirectory();
setAttribute("nginx", ngxDirectory);
@ -55,7 +55,17 @@ public class NginxController extends BaseController {
return "system/nginx";
}
@RequestMapping(value = "nginx_setting", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
/**
* 配置列表
*/
@RequestMapping(value = "list_data.json", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public String list() {
JSONArray array = nginxService.list();
return JsonMessage.getString(200, "", array);
}
@RequestMapping(value = "item.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public String setting(String path, String name, String type) {
JSONArray ngxDirectory = whitelistDirectoryService.getNgxDirectory();
setAttribute("nginx", ngxDirectory);
@ -76,15 +86,6 @@ public class NginxController extends BaseController {
return "system/nginxSetting";
}
/**
* 配置列表
*/
@RequestMapping(value = "nginx/list", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
@ResponseBody
public String list() {
JSONArray array = nginxService.list();
return JsonMessage.getString(200, "", array);
}
/**
* 新增或修改配置
@ -92,7 +93,7 @@ public class NginxController extends BaseController {
* @param name 文件名
* @param whitePath 白名单路径
*/
@RequestMapping(value = "nginx/updateNgx", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "updateNgx", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public String updateNgx(String name, String whitePath, String context, String type, String genre) {
if (StrUtil.isEmpty(name)) {
@ -222,7 +223,7 @@ public class NginxController extends BaseController {
*
* @param whitePath 白名单路径
*/
@RequestMapping(value = "nginx/uploadNgx", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "uploadNgx", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public String uploadNgx(String whitePath) {
if (StrUtil.isEmpty(whitePath)) {
@ -249,7 +250,7 @@ public class NginxController extends BaseController {
*
* @param path 文件路径
*/
@RequestMapping(value = "nginx/delete", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "delete", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public String delete(String path, String name) {
if (!whitelistDirectoryService.checkNgxDirectory(path)) {

View File

@ -125,29 +125,30 @@
<div class="layui-side-scroll">
<ul class="layui-nav layui-nav-tree" lay-filter="menu">
<li class="layui-nav-item layui-this">
<a href="javascript:;" data-options="{'id':'welcome', 'title':'首页', 'url':'/welcome'}">首页</a>
<a href="javascript:;" data-options="{'id':'welcome', 'title':'首页', 'url':'./welcome'}">首页</a>
</li>
<li class="layui-nav-item">
<a href="javascript:;" data-options="{'id':'manage', 'title':'项目管理', 'url':'/manage/projectInfo'}">项目管理</a>
<a href="javascript:;" data-options="{'id':'manage', 'title':'项目管理', 'url':'./manage/projectInfo'}">项目管理</a>
</li>
#if($user.isManage())
<li class="layui-nav-item">
<a href="javascript:;" data-options="{'id':'user', 'title':'用户管理', 'url':'/user/list'}">用户管理</a>
<a href="javascript:;"
data-options="{'id':'user', 'title':'用户管理', 'url':'./user/list'}">用户管理</a>
</li>
#end
<li class="layui-nav-item">
<a href="javascript:;"
data-options="{'id':'whitelistDirectory', 'title':'白名单目录', 'url':'/system/whitelistDirectory'}">白名单目录</a>
data-options="{'id':'whitelistDirectory', 'title':'白名单目录', 'url':'./system/whitelistDirectory'}">白名单目录</a>
</li>
#if($user.isSystemUser())
<li class="layui-nav-item">
<a href="javascript:;"
data-options="{'id':'alioss', 'title':'阿里云OSS', 'url':'/system/alioss'}">阿里云OSS</a>
data-options="{'id':'alioss', 'title':'阿里云OSS', 'url':'./system/alioss'}">阿里云OSS</a>
</li>
#end
<li class="layui-nav-item">
<a href="javascript:;"
data-options="{'id':'nginx', 'title':'nginx管理', 'url':'/system/nginx'}">nginx管理</a>
data-options="{'id':'nginx', 'title':'nginx管理', 'url':'./system/nginx/list.html'}">nginx管理</a>
</li>
</ul>
</div>

View File

@ -180,11 +180,11 @@
projectId: "$!projectInfo.id"
};
layer.load(1, {
shade: [0.3, '#fff'] //0.1透明度的白色背景
shade: [0.3, '#fff']
});
ws.send(JSON.stringify(data));
setTimeout(function () {
layer.closeAll();
layer.closeAll('loading');
}, 2000);
}
} else {
@ -251,10 +251,8 @@
});
$("#resetLog").on('click', function () {
$.ajax({
loadingAjax({
url: './resetLog',
type: 'POST',
dataType: 'json',
data: {
id: "$!projectInfo.id"
},
@ -264,9 +262,6 @@
reqLogSize();
}
},
error: function () {
layer.alert("重置日志失败");
}
});
});

View File

@ -44,7 +44,7 @@
table.render({
id: 'table_file',
elem: '#tab_file',
url: '/file/getFileList',
url: './getFileList',
method: 'post',
// height: 'full',
even: true,
@ -86,7 +86,7 @@
id: '$id'
},
multiple: true,
url: '/file/upload',
url: './upload',
before: function () {
layer.load(1, {
shade: [0.5, '#fff'] //0.1透明度的白色背景
@ -129,7 +129,7 @@
multiple: false,
exts: 'zip',
acceptMime: '.zip',
url: '/file/upload',
url: './upload',
before: function () {
layer.load(1, {
shade: [0.5, '#fff'] //0.1透明度的白色背景
@ -162,7 +162,7 @@
}, function (index) {
layer.close(index);
loadingAjax({
url: '/file/clear',
url: './clear',
data: {
id: '$id'
},
@ -194,7 +194,7 @@
//下载文件
function downloadFile(data) {
var url = "/file/download?id=$id&filename=" + encodeURI(data.filename);
var url = "./download?id=$id&filename=" + encodeURI(data.filename);
self.location.href = url;
}
@ -205,7 +205,7 @@
}, function (index) {
layer.close(index);
loadingAjax({
url: '/file/deleteFile',
url: './deleteFile',
data: {
id: '$id',
filename: data.filename

View File

@ -1,53 +1,53 @@
<!DOCTYPE html>
<html>
<head>
#parse("./common/head.vm")
<title>项目管理系统</title>
<style>
body {
padding: 20px;
}
</style>
</head>
<body>
##<div>
## <pre>#if($!port)$!port #else“暂无数据” #end </pre>
##</div>
<table class="layui-table">
<thead>
<tr>
<th>连接协议</th>
<th>接收队列</th>
<th>发送队列</th>
<th>本地地址</th>
<th>远程地址</th>
<th>状态</th>
<th>进程id/项目名称</th>
</tr>
</thead>
<tbody>
#if($port)
#foreach($item in $!port)
<tr>
<td>$!item.protocol</td>
<td>$!item.receive</td>
<td>$!item.send</td>
<td>$!item.local</td>
<td>$!item.foreign</td>
<td>$!item.status</td>
<td>$!item.name</td>
</tr>
#end
#else
<tr>
<td colspan=7 style="text-align:center">无数据</td>
</tr>
#end
</tbody>
</table>
</body>
</html>
##<!DOCTYPE html>
##<html>
##
##<head>
## #parse("./common/head.vm")
## <title>项目管理系统</title>
## <style>
## body {
## padding: 20px;
## }
##
## </style>
##</head>
##
##<body>
####<div>
#### <pre>#if($!port)$!port #else“暂无数据” #end </pre>
####</div>
##<table class="layui-table">
## <thead>
## <tr>
## <th>连接协议</th>
## <th>接收队列</th>
## <th>发送队列</th>
## <th>本地地址</th>
## <th>远程地址</th>
## <th>状态</th>
## <th>进程id/项目名称</th>
## </tr>
## </thead>
## <tbody>
## #if($port)
## #foreach($item in $!port)
## <tr>
## <td>$!item.protocol</td>
## <td>$!item.receive</td>
## <td>$!item.send</td>
## <td>$!item.local</td>
## <td>$!item.foreign</td>
## <td>$!item.status</td>
## <td>$!item.name</td>
## </tr>
## #end
## #else
## <tr>
## <td colspan=7 style="text-align:center">无数据</td>
## </tr>
## #end
## </tbody>
##</table>
##
##</body>
##</html>

View File

@ -285,7 +285,7 @@
var manager = data.manager;
if (manager) {
var lay_id = 'tab_file_' + data.id;
var url = './file/filemanage?id=' + data.id;
var url = './manage/file/list.html?id=' + data.id;
tabChange({
id: data.id,
url: url,
@ -298,7 +298,7 @@
// 管理
function manageApplication(data) {
var url = './console?id=' + data.id;
var url = './manage/console?id=' + data.id;
tabChange({
id: data.id,
url: url,
@ -326,7 +326,7 @@
function projectRecover() {
tabChange({
id: 'projectRecover',
url: './project_recover',
url: './manage/recover/list.html',
title: '回收站',
});
}

View File

@ -129,10 +129,8 @@
function projectDetail(dom) {
var id = dom.getAttribute("data-id");
$.ajax({
url: '/manage/recover/project',
type: 'POST',
dataType: 'json',
loadingAjax({
url: './data.json',
data: {
id: id
},
@ -143,14 +141,11 @@
type: 1,
title: '查看项目',
content: $('#div-project'),
area: ['60%', '45%'],
area: ['60%', '80%'],
});
} else {
layer.msg(data.msg);
}
},
error: function (err) {
layer.msg(err);
}
});
}

View File

@ -66,10 +66,8 @@
<script type="text/javascript">
function loadSuccess() {
form.on('submit(formDemo)', function (data) {
$.ajax({
loadingAjax({
url: './alioss_submit',
type: 'POST',
dataType: 'json',
data: data.field,
success: function (data) {
layer.msg(data.msg);
@ -78,9 +76,6 @@
window.location.reload()
}, 2000);
}
},
error: function (err) {
layer.alert(err.msg);
}
});
return false;

View File

@ -245,10 +245,8 @@
formData.append("key", key);
formData.append("name", name);
formData.append("id", id);
$.ajax({
loadingAjax({
url: data.form.action,
type: 'POST',
dataType: 'json',
contentType: false,
processData: false,
data: formData,
@ -259,9 +257,6 @@
// 刷新表
table.reload('tab_certificate');
}
},
error: function (err) {
layer.alert(err.msg);
}
});
return false;
@ -307,10 +302,8 @@
title: '系统提示'
}, function (index) {
layer.close(index);
$.ajax({
loadingAjax({
url: './delete',
type: 'POST',
dataType: 'json',
data: {id: data.id},
success: function (data) {
if (200 == data.code) {
@ -320,9 +313,6 @@
} else {
layer.msg(data.msg);
}
},
error: function (err) {
layer.msg('删除失败!');
}
});
});

View File

@ -82,7 +82,7 @@
var upload = layui.upload;
uploadConfig = upload.render({
elem: '#selectConfig',
url: '/system/nginx/uploadNgx',
url: './uploadNgx',
multiple: false,
exts: 'conf',
acceptMime: '.conf',
@ -130,7 +130,7 @@
// 新增配置
$('#addNgx').on('click', function () {
var url = '/system/nginx_setting?type=add';
var url = './system/nginx/item.html?type=add';
tabChange({
id: 'nginx_add',
url: url,
@ -140,7 +140,7 @@
// 修改
function updateNgx(data) {
var url = '/system/nginx_setting?type=update&path=' + data.path + "&name=" + data.name;
var url = './system/nginx/item.html?type=update&path=' + data.path + "&name=" + data.name;
tabChange({
id: 'nginx_' + data.path,
url: url,
@ -151,8 +151,8 @@
table.render({
id: 'tab_ngx',
elem: '#tab_ngx',
url: '/system/nginx/list',
// height: 'full-52',
url: './list_data.json',
method: 'POST',
even: true,
cols: [[
{field: 'name', title: '文件名'},
@ -173,25 +173,17 @@
title: '系统提示'
}, function (index) {
layer.close(index);
$.ajax({
url: '/system/nginx/delete',
type: 'POST',
dataType: 'json',
loadingAjax({
url: './delete',
data: {
path: data.path,
name: data.name
},
success: function (data) {
layer.msg(data.msg);
if (200 == data.code) {
layer.msg('删除成功!');
// 刷新项目列表
table.reload('tab_ngx', {});
} else {
layer.msg(data.msg);
}
},
error: function (err) {
layer.msg('删除失败!');
}
});
});
@ -224,7 +216,7 @@
//证书管理
$('#certificate').on('click', function () {
var url = '/system/certificate/list.html';
var url = './system/certificate/list.html';
tabChange({
id: 'certificate',
url: url,

View File

@ -171,10 +171,8 @@
//提交配置信息
form.on('submit(submitNgx)', function (data) {
$.ajax({
url: '/system/nginx/updateNgx',
type: 'POST',
dataType: 'json',
loadingAjax({
url: './updateNgx',
data: data.field,
success: function (data) {
layer.msg(data.msg);
@ -183,9 +181,6 @@
window.location.reload()
}
}
},
error: function (err) {
layer.alert(err.msg);
}
});
return false;
@ -193,10 +188,8 @@
//提交配置信息
form.on('submit(submitFast)', function (data) {
$.ajax({
url: '/system/nginx/updateNgx',
type: 'POST',
dataType: 'json',
loadingAjax({
url: './updateNgx',
data: data.field,
success: function (data) {
layer.msg(data.msg);
@ -205,9 +198,6 @@
window.location.reload()
}
}
},
error: function (err) {
layer.alert(err.msg);
}
});
return false;

View File

@ -57,10 +57,8 @@
<script type="text/javascript">
function loadSuccess() {
form.on('submit(formDemo)', function (data) {
$.ajax({
loadingAjax({
url: './whitelistDirectory_submit',
type: 'POST',
dataType: 'json',
data: data.field,
success: function (data) {
layer.msg(data.msg);
@ -69,9 +67,6 @@
window.location.reload()
}, 2000);
}
},
error: function (err) {
layer.alert(err.msg);
}
});
return false;

View File

@ -128,7 +128,7 @@
table.render({
id: 'tab_user',
elem: '#tab_user',
url: '/user/getUserList',
url: './getUserList',
// height: 'full-52',
method: 'POST',
even: true,
@ -183,7 +183,7 @@
btnAlign: 'c',
btn: ['提交'],
yes: function (index, layero) {
$('#form_user').attr('action', '/user/updateUser');
$('#form_user').attr('action', './updateUser');
$('#user_submit').click();
}
});
@ -208,7 +208,7 @@
btnAlign: 'c',
btn: ['提交'],
yes: function (index, layero) {
$('#form_user').attr('action', '/user/addUser');
$('#form_user').attr('action', './addUser');
$('#user_submit').click();
}
});
@ -296,7 +296,7 @@
}, function (index) {
layer.close(index);
loadingAjax({
url: '/user/deleteUser',
url: './deleteUser',
data: {
id: data.id
},