From 7d8edeaafafd02bb0a3fd2d80eb78e246ac8f607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=9D=B0?= Date: Thu, 1 Nov 2018 09:00:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E6=88=90WebSocket=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E6=97=A5=E5=BF=97=E5=88=B0=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E6=9B=B4=E6=96=B0SQl=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.MD | 17 ++-- pom.xml | 6 ++ src/main/java/me/aurora/AuroraRun.java | 3 +- .../app/rest/common/CommonController.java | 23 ++++- .../aurora/config/logMessage/LogFilter.java | 38 +++++++++ .../aurora/config/logMessage/LoggerQueue.java | 52 ++++++++++++ .../config/logMessage/WebSocketConfig.java | 59 +++++++++++++ .../me/aurora/config/redis/RedisConfig.java | 3 + .../me/aurora/domain/utils/LogMessage.java | 19 +++++ .../java/me/aurora/util/AddressUtils.java | 3 - src/main/resources/application.yml | 2 +- src/main/resources/logback.xml | 9 ++ src/main/resources/sql/aurora.sql | 53 ++++++++---- src/main/resources/static/css/logMsg.css | 38 +++++++++ src/main/resources/templates/common/app.html | 2 +- .../templates/system/logMessage/index.html | 84 +++++++++++++++++++ .../templates/system/redis/terminal.html | 10 ++- 17 files changed, 385 insertions(+), 36 deletions(-) create mode 100644 src/main/java/me/aurora/config/logMessage/LogFilter.java create mode 100644 src/main/java/me/aurora/config/logMessage/LoggerQueue.java create mode 100644 src/main/java/me/aurora/config/logMessage/WebSocketConfig.java create mode 100644 src/main/java/me/aurora/domain/utils/LogMessage.java create mode 100644 src/main/resources/static/css/logMsg.css create mode 100644 src/main/resources/templates/system/logMessage/index.html diff --git a/README.MD b/README.MD index 9dd7fd8..a243144 100644 --- a/README.MD +++ b/README.MD @@ -10,7 +10,7 @@ Aurora是一个简单高效的后台管理系统。项目基础框架采用全 - 用户个人中心 - 部门管理,组织结构 -- 短信模块 +- 阿里短信 - 站内信模块 - 工作流 @@ -48,6 +48,7 @@ Aurora是一个简单高效的后台管理系统。项目基础框架采用全 │ ├─字典管理 │ └─接口文档 ├─系统监控 +│ ├─实时控制台 │ ├─Redis终端 │ ├─SQL监控 │ ├─在线用户 @@ -115,11 +116,7 @@ Aurora是一个简单高效的后台管理系统。项目基础框架采用全 - 系统首页 -![](https://i.loli.net/2018/10/25/5bd11baaa7b02.png) - -- 用户管理 - -![](https://i.imgur.com/Ms6F5mk.png) +![](https://i.imgur.com/gJIZ1J6.png) - 组织结构 @@ -137,10 +134,6 @@ Aurora是一个简单高效的后台管理系统。项目基础框架采用全 ![](https://i.imgur.com/2spz8q3.png) -- swagger文档 - -![](https://i.imgur.com/3bBeSTt.png) - - Redis终端 ![](https://i.imgur.com/TvKl5SH.png) @@ -149,9 +142,9 @@ Aurora是一个简单高效的后台管理系统。项目基础框架采用全 ![](https://i.imgur.com/3rBMJ6d.png) -- 发送邮件功能 +- 实时控制台 -![](https://i.imgur.com/ByfMmkR.png) +![](https://i.imgur.com/mnZqxUF.png) ### 开发与部署 账号:aurora 密码:123456 diff --git a/pom.xml b/pom.xml index d72128b..2068422 100644 --- a/pom.xml +++ b/pom.xml @@ -76,6 +76,12 @@ org.springframework.boot spring-boot-starter-aop + + + + org.springframework.boot + spring-boot-starter-websocket + diff --git a/src/main/java/me/aurora/AuroraRun.java b/src/main/java/me/aurora/AuroraRun.java index 9be2f0e..d36d102 100644 --- a/src/main/java/me/aurora/AuroraRun.java +++ b/src/main/java/me/aurora/AuroraRun.java @@ -3,19 +3,20 @@ package me.aurora; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.cache.annotation.EnableCaching; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; @Controller @EnableCaching @EnableScheduling @SpringBootApplication @EnableTransactionManagement +@EnableWebSocketMessageBroker /** * @author 郑杰 * @date 2018/08/21 11:54:10 diff --git a/src/main/java/me/aurora/app/rest/common/CommonController.java b/src/main/java/me/aurora/app/rest/common/CommonController.java index 902392d..fbcb1b2 100644 --- a/src/main/java/me/aurora/app/rest/common/CommonController.java +++ b/src/main/java/me/aurora/app/rest/common/CommonController.java @@ -1,10 +1,14 @@ package me.aurora.app.rest.common; +import lombok.extern.slf4j.Slf4j; import me.aurora.annotation.Log; import me.aurora.domain.ResponseEntity; +import me.aurora.domain.User; import me.aurora.service.SysLogService; import me.aurora.service.WebCountService; +import org.apache.shiro.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; @@ -18,6 +22,7 @@ import java.util.Map; * @author 郑杰 * @date 2018/09/25 19:08:41 */ +@Slf4j @RestController public class CommonController { @@ -37,7 +42,7 @@ public class CommonController { * 访问量计数 * @return */ - @GetMapping("/pageviews/plusCount") + @GetMapping(value = "/pageviews/plusCount") public ResponseEntity plusCount(){ webCountService.save(); return ResponseEntity.ok(); @@ -47,7 +52,7 @@ public class CommonController { * 访问量查询 * @return */ - @GetMapping("/pageviews/get") + @GetMapping(value = "/pageviews/get") public Map getCount(){ Map map = new HashMap(); map.put("pv",webCountService.findByDate(LocalDate.now().toString()).getCounts()); @@ -56,4 +61,18 @@ public class CommonController { map.put("weekIp",sysLogService.getWeekIP()); return map; } + + /** + * 去实时日志页面 + * @param model + * @return + */ + @GetMapping(value = "/logMsg/index") + public ModelAndView logMsgIndex(Model model){ + User user = (User) SecurityUtils.getSubject().getPrincipal(); + String osName = System.getProperty("os.name"); + model.addAttribute("osName", osName); + model.addAttribute("userName", user.getUsername()); + return new ModelAndView("/system/logMessage/index"); + } } diff --git a/src/main/java/me/aurora/config/logMessage/LogFilter.java b/src/main/java/me/aurora/config/logMessage/LogFilter.java new file mode 100644 index 0000000..eaf16d0 --- /dev/null +++ b/src/main/java/me/aurora/config/logMessage/LogFilter.java @@ -0,0 +1,38 @@ +package me.aurora.config.logMessage; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.classic.spi.IThrowableProxy; +import ch.qos.logback.core.spi.FilterReply; +import me.aurora.domain.utils.LogMessage; +import ch.qos.logback.core.filter.Filter; +import java.text.DateFormat; +import java.util.Date; + +/** + * 定义Logfilter拦截输出日志 + * @author 郑杰 + * @date 2018/10/30 20:49:16 + */ +public class LogFilter extends Filter{ + + @Override + public FilterReply decide(ILoggingEvent event) { + String exception = ""; + IThrowableProxy iThrowableProxy1 = event.getThrowableProxy(); + if(iThrowableProxy1!=null){ + exception = ""+iThrowableProxy1.getClassName()+" "+iThrowableProxy1.getMessage()+"
"; + for(int i=0; i
"; + } + } + LogMessage loggerMessage = new LogMessage( + event.getMessage() + , DateFormat.getDateTimeInstance().format(new Date(event.getTimeStamp())), + event.getThreadName(), + event.getLoggerName(), + event.getLevel().levelStr + ); + LoggerQueue.getInstance().push(loggerMessage); + return FilterReply.ACCEPT; + } +} \ No newline at end of file diff --git a/src/main/java/me/aurora/config/logMessage/LoggerQueue.java b/src/main/java/me/aurora/config/logMessage/LoggerQueue.java new file mode 100644 index 0000000..90a9114 --- /dev/null +++ b/src/main/java/me/aurora/config/logMessage/LoggerQueue.java @@ -0,0 +1,52 @@ +package me.aurora.config.logMessage; + +import me.aurora.domain.utils.LogMessage; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; + +/** + * 创建一个阻塞队列,作为日志系统输出的日志的一个临时载体 + * @author 郑杰 + * @date 2018/10/30 19:56:37 + */ +public class LoggerQueue { + + //队列大小 + public static final int QUEUE_MAX_SIZE = 10000; + + private static LoggerQueue alarmMessageQueue = new LoggerQueue(); + //阻塞队列 + private BlockingQueue blockingQueue = new LinkedBlockingQueue<>(QUEUE_MAX_SIZE); + + private LoggerQueue() { + } + + public static LoggerQueue getInstance() { + return alarmMessageQueue; + } + + /** + * 消息入队 + * + * @param log + * @return + */ + public boolean push(LogMessage log) { + return this.blockingQueue.add(log);//队列满了就抛出异常,不阻塞 + } + + /** + * 消息出队 + * + * @return + */ + public LogMessage poll() { + LogMessage result = null; + try { + result = (LogMessage) this.blockingQueue.take(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + return result; + } +} diff --git a/src/main/java/me/aurora/config/logMessage/WebSocketConfig.java b/src/main/java/me/aurora/config/logMessage/WebSocketConfig.java new file mode 100644 index 0000000..95ded37 --- /dev/null +++ b/src/main/java/me/aurora/config/logMessage/WebSocketConfig.java @@ -0,0 +1,59 @@ +package me.aurora.config.logMessage; + + +import lombok.extern.slf4j.Slf4j; +import me.aurora.domain.utils.LogMessage; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.messaging.simp.SimpMessagingTemplate; +import org.springframework.web.socket.config.annotation.StompEndpointRegistry; +import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; +import javax.annotation.PostConstruct; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +/** + * 配置WebSocket消息代理端点,即stomp服务端 + * @author 郑杰 + */ +@Slf4j +@Configuration +public class WebSocketConfig implements WebSocketMessageBrokerConfigurer { + + @Autowired + private SimpMessagingTemplate messagingTemplate; + + @Override + public void registerStompEndpoints(StompEndpointRegistry registry) { + registry.addEndpoint("/websocket") + .setAllowedOrigins("*") + .withSockJS(); + } + + /** + * 推送日志到/topic/pullLogger + */ + @PostConstruct + public void pushLogger(){ + ExecutorService executorService= Executors.newFixedThreadPool(2); + Runnable runnable=new Runnable() { + + @Override + public void run() { + while (true) { + try { + LogMessage log = LoggerQueue.getInstance().poll(); + if(log!=null && !log.getClassName().equals("jdbc.resultsettable")){ + if(messagingTemplate!=null) + messagingTemplate.convertAndSend("/topic/pullLogger",log); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + }; + executorService.submit(runnable); + executorService.submit(runnable); + } +} \ No newline at end of file diff --git a/src/main/java/me/aurora/config/redis/RedisConfig.java b/src/main/java/me/aurora/config/redis/RedisConfig.java index d48affb..43cdd81 100644 --- a/src/main/java/me/aurora/config/redis/RedisConfig.java +++ b/src/main/java/me/aurora/config/redis/RedisConfig.java @@ -3,6 +3,7 @@ package me.aurora.config.redis; import afu.org.checkerframework.checker.oigj.qual.O; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.serializer.SerializerFeature; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -34,6 +35,7 @@ import java.time.Duration; * @author 郑杰 * @date 2018/09/18 11:29:01 */ +@Slf4j @Configuration public class RedisConfig extends CachingConfigurerSupport { @@ -143,6 +145,7 @@ public class RedisConfig extends CachingConfigurerSupport { for (Object obj : params) { sb.append(obj.toString()); } + log.info(sb.toString()); return sb.toString(); }; } diff --git a/src/main/java/me/aurora/domain/utils/LogMessage.java b/src/main/java/me/aurora/domain/utils/LogMessage.java new file mode 100644 index 0000000..0f9cec2 --- /dev/null +++ b/src/main/java/me/aurora/domain/utils/LogMessage.java @@ -0,0 +1,19 @@ +package me.aurora.domain.utils; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @author 郑杰 + * @date 2018/10/30 19:55:46 + */ +@Data +@AllArgsConstructor +public class LogMessage { + + private String body; + private String timestamp; + private String threadName; + private String className; + private String level; +} diff --git a/src/main/java/me/aurora/util/AddressUtils.java b/src/main/java/me/aurora/util/AddressUtils.java index 7742958..964026f 100644 --- a/src/main/java/me/aurora/util/AddressUtils.java +++ b/src/main/java/me/aurora/util/AddressUtils.java @@ -72,9 +72,6 @@ public class AddressUtils { break; } DataBlock dataBlock = null; - if (!Util.isIpAddress(ip)) { - log.error("Error: Invalid ip address"); - } dataBlock = (DataBlock) method.invoke(searcher, ip); String address = dataBlock.getRegion().replace("0|",""); if(address.charAt(address.length()-1) == '|'){ diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 6e65b20..57a70f7 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -123,7 +123,7 @@ aurora: # rememberMe cookie有效时长,默认86400秒,即一天 cookieTimeout: 86400 # 免认证的路径配置,如静态资源,注册页面,验证码请求,swagger等~ - anonUrls: /css/**,/js/**,/my/**,/images/**,/user/regist,/plugins/**,/test/**,/signUp.html,/logout,/login + anonUrls: /css/**,/js/**,/my/**,/images/**,/user/regist,/plugins/**,/test/**,/signUp.html,/logout,/login,/websocket,/topic/pullLogger # 登录 url loginUrl: /login.html # 登录成功mvc后跳转的 url diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index 8ba341f..01b69ff 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -9,6 +9,9 @@ %black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %gray(%msg%n) utf-8 + + + @@ -21,6 +24,8 @@ + + @@ -39,6 +44,10 @@ + + + + diff --git a/src/main/resources/sql/aurora.sql b/src/main/resources/sql/aurora.sql index 82434eb..526539f 100644 --- a/src/main/resources/sql/aurora.sql +++ b/src/main/resources/sql/aurora.sql @@ -11,7 +11,7 @@ Target Server Version : 50559 File Encoding : 65001 - Date: 27/10/2018 18:34:02 + Date: 01/11/2018 08:52:51 */ SET NAMES utf8mb4; @@ -41,6 +41,19 @@ CREATE TABLE `zj_alipay_config` ( -- ---------------------------- INSERT INTO `zj_alipay_config` VALUES (1, '2016091700532697', 'utf-8', 'JSON', 'https://openapi.alipaydev.com/gateway.do', 'http://xiswl.xyz/aliPay/notify', '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', 'http://xiswl.xyz/aliPay/return', 'RSA2', '2088102176044281'); +-- ---------------------------- +-- Table structure for zj_alisms_config +-- ---------------------------- +DROP TABLE IF EXISTS `zj_alisms_config`; +CREATE TABLE `zj_alisms_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `accessKeyId` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `accessKeySecret` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `signName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `templateCode` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + -- ---------------------------- -- Table structure for zj_department -- ---------------------------- @@ -104,7 +117,7 @@ CREATE TABLE `zj_dict` ( `table_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `updateTime` datetime NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; +) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Records of zj_dict @@ -157,7 +170,7 @@ CREATE TABLE `zj_job` ( `status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `updateTime` datetime NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; +) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Records of zj_job @@ -184,33 +197,35 @@ CREATE TABLE `zj_menu` ( `sys` bit(1) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `UK_cbhg0bi3f1emxkhqqtvca9btx`(`soft`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 36 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; +) ENGINE = InnoDB AUTO_INCREMENT = 34 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Records of zj_menu -- ---------------------------- -INSERT INTO `zj_menu` VALUES (5, 'layui-icon-chart', 0, 1, '系统监控', 10, '', '2018-08-29 11:40:17', '2018-10-26 12:45:17', 4, b'0', b'1'); +INSERT INTO `zj_menu` VALUES (5, 'layui-icon-chart', 0, 1, '系统监控', 10, '', '2018-08-29 11:40:17', '2018-10-30 20:24:33', 5, b'0', b'1'); INSERT INTO `zj_menu` VALUES (6, 'layui-icon-username', 7, 2, '用户管理', 1, '/user/index', '2018-08-29 11:40:17', '2018-10-25 12:14:30', 0, b'0', b'1'); INSERT INTO `zj_menu` VALUES (7, 'layui-icon-set-sm', 0, 1, '系统管理', 0, '', '2018-08-29 11:40:17', '2018-10-26 13:18:15', 7, b'0', b'1'); INSERT INTO `zj_menu` VALUES (8, 'layui-icon-template', 7, 2, '菜单管理', 5, '/menu/index', '2018-08-29 11:40:17', '2018-10-05 14:02:44', 0, b'0', b'1'); INSERT INTO `zj_menu` VALUES (9, 'layui-icon-survey', 5, 2, '系统日志', 13, '/sysLog/index', '2018-08-29 11:40:17', '2018-10-03 09:04:22', 0, b'0', b'1'); INSERT INTO `zj_menu` VALUES (10, 'layui-icon-password', 7, 2, '权限管理', 4, '/permission/index', '2018-08-29 11:40:17', '2018-10-03 08:59:50', 0, b'0', b'1'); INSERT INTO `zj_menu` VALUES (11, 'layui-icon-top', 7, 2, '角色管理', 3, '/role/index', '2018-08-29 11:40:17', '2018-10-03 08:59:23', 0, b'0', b'1'); -INSERT INTO `zj_menu` VALUES (13, 'layui-icon-picture-fine', 18, 2, 'SM.MS图床', 44, '/picture/index', '2018-09-20 11:40:53', '2018-10-03 08:56:50', 0, b'0', b'1'); +INSERT INTO `zj_menu` VALUES (13, 'layui-icon-picture-fine', 18, 2, 'SM.MS图床', 45, '/picture/index', '2018-09-20 11:40:53', '2018-10-03 08:56:50', 0, b'0', b'1'); INSERT INTO `zj_menu` VALUES (14, 'layui-icon-username', 5, 2, '在线用户', 12, '/online/index', '2018-09-21 16:09:38', '2018-10-03 09:01:22', 0, b'0', b'1'); -INSERT INTO `zj_menu` VALUES (16, 'layui-icon-console', 5, 2, 'Redis终端', 16, '/redis/terminal', '2018-09-22 11:18:21', '2018-10-03 09:05:11', 0, b'0', b'1'); +INSERT INTO `zj_menu` VALUES (16, 'layui-icon-circle', 5, 2, 'Redis终端', 16, '/redis/terminal', '2018-09-22 11:18:21', '2018-10-31 23:00:53', 0, b'0', b'1'); INSERT INTO `zj_menu` VALUES (17, 'layui-icon-file', 7, 2, '接口文档', 7, '/swagger/index', '2018-09-23 09:16:17', '2018-10-03 08:57:26', 0, b'0', b'1'); -INSERT INTO `zj_menu` VALUES (18, 'layui-icon-util', 0, 1, '第三方工具', 40, '', '2018-09-24 23:46:02', '2018-10-03 09:21:46', 5, b'0', b'1'); -INSERT INTO `zj_menu` VALUES (19, 'layui-icon-code-circle', 18, 2, '百度UEditor', 45, '/ueditor/index', '2018-09-24 23:46:47', '2018-10-03 08:54:27', 0, b'0', b'1'); +INSERT INTO `zj_menu` VALUES (18, 'layui-icon-util', 0, 1, '第三方工具', 40, '', '2018-09-24 23:46:02', '2018-10-29 19:00:50', 6, b'0', b'1'); +INSERT INTO `zj_menu` VALUES (19, 'layui-icon-code-circle', 18, 2, '百度UEditor', 46, '/ueditor/index', '2018-09-24 23:46:47', '2018-10-03 08:54:27', 0, b'0', b'1'); INSERT INTO `zj_menu` VALUES (21, 'layui-icon-chart', 5, 2, 'SQL监控', 15, '/druid/index.html', '2018-09-27 13:24:25', '2018-10-03 08:57:49', 0, b'1', b'1'); INSERT INTO `zj_menu` VALUES (22, 'layui-icon-edit', 18, 2, '邮件工具', 41, '/email/index', '2018-09-28 07:32:57', '2018-10-02 16:26:01', 0, b'0', b'1'); -INSERT INTO `zj_menu` VALUES (24, 'layui-icon-dollar', 18, 2, '支付宝工具', 42, '/aliPay/index', '2018-09-30 15:16:43', '2018-10-02 16:27:09', 0, b'0', b'1'); -INSERT INTO `zj_menu` VALUES (25, 'layui-icon-upload', 18, 2, '七牛云存储', 43, '/qiNiu/index', '2018-10-02 11:03:27', '2018-10-02 16:26:42', 0, b'0', b'1'); +INSERT INTO `zj_menu` VALUES (24, 'layui-icon-dollar', 18, 2, '支付宝工具', 43, '/aliPay/index', '2018-09-30 15:16:43', '2018-10-02 16:27:09', 0, b'0', b'1'); +INSERT INTO `zj_menu` VALUES (25, 'layui-icon-upload', 18, 2, '七牛云存储', 44, '/qiNiu/index', '2018-10-02 11:03:27', '2018-10-02 16:26:42', 0, b'0', b'1'); INSERT INTO `zj_menu` VALUES (27, 'layui-icon-read', 7, 2, '字典管理', 6, '/dict/index', '2018-10-05 14:03:40', '2018-10-05 14:03:40', 0, b'0', b'0'); INSERT INTO `zj_menu` VALUES (28, 'layui-icon-log', 0, 1, '任务调度', 20, '', '2018-10-06 10:37:11', '2018-10-06 11:55:59', 2, b'0', b'0'); INSERT INTO `zj_menu` VALUES (29, 'layui-icon-radio', 28, 2, '定时任务', 21, '/job/index', '2018-10-06 10:38:06', '2018-10-06 10:38:06', 0, b'0', b'0'); INSERT INTO `zj_menu` VALUES (30, 'layui-icon-survey', 28, 2, '调度日志', 22, '/jobLog/index', '2018-10-06 11:55:59', '2018-10-06 11:55:59', 0, b'0', b'0'); INSERT INTO `zj_menu` VALUES (31, 'layui-icon-tree', 7, 2, '组织架构', 2, '/department/index', '2018-10-25 12:13:54', '2018-10-25 12:36:21', 0, b'0', b'0'); +INSERT INTO `zj_menu` VALUES (32, 'layui-icon-dialogue', 18, 2, '阿里云通信', 42, '/aliSms/index', '2018-10-29 19:00:50', '2018-10-29 22:39:25', 0, b'0', b'0'); +INSERT INTO `zj_menu` VALUES (33, 'layui-icon-console', 5, 2, '实时控制台', 17, '/logMsg/index', '2018-10-30 20:24:33', '2018-10-31 18:03:40', 0, b'0', b'0'); -- ---------------------------- -- Table structure for zj_menus_roles @@ -250,6 +265,8 @@ INSERT INTO `zj_menus_roles` VALUES (28, 1); INSERT INTO `zj_menus_roles` VALUES (29, 1); INSERT INTO `zj_menus_roles` VALUES (30, 1); INSERT INTO `zj_menus_roles` VALUES (31, 1); +INSERT INTO `zj_menus_roles` VALUES (32, 1); +INSERT INTO `zj_menus_roles` VALUES (33, 1); INSERT INTO `zj_menus_roles` VALUES (5, 3); INSERT INTO `zj_menus_roles` VALUES (6, 3); INSERT INTO `zj_menus_roles` VALUES (7, 3); @@ -278,7 +295,7 @@ CREATE TABLE `zj_permission` ( `pid` int(11) NOT NULL, PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `UK_djtxn2vldlgrkfk21d155b48i`(`perms`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 51 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; +) ENGINE = InnoDB AUTO_INCREMENT = 50 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Records of zj_permission @@ -373,6 +390,11 @@ CREATE TABLE `zj_picture` ( CONSTRAINT `FK5qtt7wql9517j0e2read2pdus` FOREIGN KEY (`user_id`) REFERENCES `zj_user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; +-- ---------------------------- +-- Records of zj_picture +-- ---------------------------- +INSERT INTO `zj_picture` VALUES (1, '2018-10-29 09:27:06', '\"\"', '200', '8.49KB ', 'https://i.loli.net/2018/10/29/5bd661eac0e5f.jpg', '200', 1, '1'); + -- ---------------------------- -- Table structure for zj_qiniu_config -- ---------------------------- @@ -406,7 +428,7 @@ CREATE TABLE `zj_qiniu_content` ( `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `updateTime` datetime NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; +) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Records of zj_qiniu_content @@ -415,6 +437,7 @@ INSERT INTO `zj_qiniu_content` VALUES (1, 'aurora', '189.97KB ', '120181025163 INSERT INTO `zj_qiniu_content` VALUES (2, 'aurora', '48.11KB ', 'dsp20181026135347.jpg', '公开', 'http://pfywktugt.bkt.clouddn.com/dsp20181026135347.jpg', '2018-10-26 15:47:23'); INSERT INTO `zj_qiniu_content` VALUES (3, 'aurora', '48.11KB ', 'dsp20181026135403.jpg', '公开', 'http://pfywktugt.bkt.clouddn.com/dsp20181026135403.jpg', '2018-10-26 15:47:23'); INSERT INTO `zj_qiniu_content` VALUES (4, 'aurora', '8.36KB ', 'qsc-logo-new20181025150100.png', '公开', 'http://pfywktugt.bkt.clouddn.com/qsc-logo-new20181025150100.png', '2018-10-26 15:47:23'); +INSERT INTO `zj_qiniu_content` VALUES (5, 'aurora', '292.27KB ', '谷歌上网助手1.2.020181027200432.crx', '公开', 'http://pfywktugt.bkt.clouddn.com/谷歌上网助手1.2.020181027200432.crx', '2018-10-28 09:39:37'); -- ---------------------------- -- Table structure for zj_role @@ -427,7 +450,7 @@ CREATE TABLE `zj_role` ( `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `updateDateTime` datetime NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Records of zj_role @@ -454,7 +477,7 @@ CREATE TABLE `zj_user` ( UNIQUE INDEX `UK_kpubos9gc2cvtkb0thktkbkes`(`email`) USING BTREE, INDEX `FKqfitoyy9x1gctukdi020j4224`(`department_id`) USING BTREE, CONSTRAINT `FKqfitoyy9x1gctukdi020j4224` FOREIGN KEY (`department_id`) REFERENCES `zj_department` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; +) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Records of zj_user diff --git a/src/main/resources/static/css/logMsg.css b/src/main/resources/static/css/logMsg.css new file mode 100644 index 0000000..c3c87f1 --- /dev/null +++ b/src/main/resources/static/css/logMsg.css @@ -0,0 +1,38 @@ +.handle { + height: 38px; + background: #f9f9f9; + border: 1px solid #eee; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + color: rgba(0,0,0,0.7); + font-family: 'consolas'; + font-size: 13px; + line-height: 38px; + text-align: center; +} +.closes,.minimize,.maximize{ + float: left; + width: 12px; + height: 12px; + background-color: gainsboro; + border: 1px solid rgba(0,0,0,0); + border-radius: 6px; + color: rgba(0,0,0,0.5); + margin:12px 8px; +} +.closes { + background-color: #fc625d; +} +.minimize { + background-color: #fdbc40; +} +.maximize { + background-color: #35cd4b; +} +#log-container{ + font-family: 'consolas'; + overflow-y: scroll; + background: #494949; + color: #f7f7f7; + padding: 10px; +} \ No newline at end of file diff --git a/src/main/resources/templates/common/app.html b/src/main/resources/templates/common/app.html index ec56e11..a8f7e0d 100644 --- a/src/main/resources/templates/common/app.html +++ b/src/main/resources/templates/common/app.html @@ -111,7 +111,7 @@
  • 用户个人中心
  • 部门管理,组织结构
  • -
  • 短信模块
  • +
  • 阿里短信
  • 站内信模块
  • 工作流
diff --git a/src/main/resources/templates/system/logMessage/index.html b/src/main/resources/templates/system/logMessage/index.html new file mode 100644 index 0000000..4135abd --- /dev/null +++ b/src/main/resources/templates/system/logMessage/index.html @@ -0,0 +1,84 @@ + + + + + + 控制台实时打印 + + + + + + + + + +
+ + + + [[${userName}]]@[[${osName}]]: ~ (logback) +
+
+
+
+ + + + \ No newline at end of file diff --git a/src/main/resources/templates/system/redis/terminal.html b/src/main/resources/templates/system/redis/terminal.html index 638db6f..a98d15a 100644 --- a/src/main/resources/templates/system/redis/terminal.html +++ b/src/main/resources/templates/system/redis/terminal.html @@ -1,5 +1,5 @@
@@ -19,6 +19,14 @@ textarea,input,button{outline:none}.window-button,.window .buttons .closes,.wind
+