diff --git a/streamx-console/streamx-console-service/pom.xml b/streamx-console/streamx-console-service/pom.xml
index 84db1e02fd..ee27dcc47b 100644
--- a/streamx-console/streamx-console-service/pom.xml
+++ b/streamx-console/streamx-console-service/pom.xml
@@ -202,6 +202,18 @@
1.7.2
+
+ org.freemarker
+ freemarker
+ 2.3.30
+
+
+
+ org.apache.commons
+ commons-email
+ 1.5
+
+
com.auth0
diff --git a/streamx-console/streamx-console-service/src/assembly/conf/streamx.sql b/streamx-console/streamx-console-service/src/assembly/conf/streamx.sql
index 7783d83254..c8dba139a2 100644
--- a/streamx-console/streamx-console-service/src/assembly/conf/streamx.sql
+++ b/streamx-console/streamx-console-service/src/assembly/conf/streamx.sql
@@ -1,4 +1,3 @@
-
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
@@ -12,11 +11,11 @@ CREATE TABLE `t_app_backup` (
`SQL_ID` bigint(20) DEFAULT NULL,
`CONFIG_ID` bigint(20) DEFAULT NULL,
`VERSION` int(10) DEFAULT NULL,
- `PATH` varchar(255) DEFAULT NULL,
- `DESCRIPTION` varchar(255) DEFAULT NULL,
+ `PATH` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `DESCRIPTION` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`CREATE_TIME` datetime DEFAULT NULL,
PRIMARY KEY (`ID`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- ----------------------------
-- Records of t_app_backup
@@ -31,13 +30,13 @@ DROP TABLE IF EXISTS `t_flame_graph`;
CREATE TABLE `t_flame_graph` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`APP_ID` bigint(20) DEFAULT NULL,
- `PROFILER` varchar(255) DEFAULT NULL,
+ `PROFILER` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`TIMELINE` datetime DEFAULT NULL,
- `CONTENT` varchar(2000) DEFAULT NULL,
+ `CONTENT` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
PRIMARY KEY (`ID`) USING BTREE,
KEY `INX_TIME` (`TIMELINE`) USING BTREE,
KEY `INX_APPID` (`APP_ID`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- ----------------------------
-- Records of t_flame_graph
@@ -53,23 +52,25 @@ CREATE TABLE `t_flink_app` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`JOB_TYPE` int(1) DEFAULT NULL,
`EXECUTION_MODE` int(10) DEFAULT NULL,
- `PROJECT_ID` varchar(64) DEFAULT NULL,
- `JOB_NAME` varchar(255) DEFAULT NULL,
- `MODULE` varchar(255) DEFAULT NULL,
- `JAR` varchar(255) DEFAULT NULL,
- `MAIN_CLASS` varchar(255) DEFAULT NULL,
- `ARGS` varchar(255) DEFAULT NULL,
- `OPTIONS` text,
+ `PROJECT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `JOB_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `MODULE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `JAR` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `MAIN_CLASS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `ARGS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `OPTIONS` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
`USER_ID` int(25) DEFAULT NULL,
- `APP_ID` varchar(255) DEFAULT NULL,
+ `APP_ID` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`APP_TYPE` int(1) DEFAULT NULL,
`DURATION` bigint(20) DEFAULT NULL,
- `JOB_ID` varchar(64) DEFAULT NULL,
- `STATE` varchar(50) DEFAULT NULL,
- `DYNAMIC_OPTIONS` text,
- `DESCRIPTION` varchar(255) DEFAULT NULL,
+ `JOB_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `STATE` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `DYNAMIC_OPTIONS` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
+ `DESCRIPTION` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `ALERT_EMAIL` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`RESOLVE_ORDER` smallint(1) DEFAULT NULL,
`FLAME_GRAPH` tinyint(1) DEFAULT '0',
+ `CP_THRESHOLD` int(10) DEFAULT NULL,
`JM_MEMORY` int(10) DEFAULT NULL,
`TM_MEMORY` int(255) DEFAULT NULL,
`TOTAL_TASK` int(10) DEFAULT NULL,
@@ -85,13 +86,12 @@ CREATE TABLE `t_flink_app` (
PRIMARY KEY (`ID`) USING BTREE,
KEY `INX_STATE` (`STATE`) USING BTREE,
KEY `INX_TRACK` (`TRACKING`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=1383720958407139331 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- ----------------------------
-- Records of t_flink_app
-- ----------------------------
BEGIN;
-INSERT INTO `t_flink_app` VALUES (1383720958407139330, 2, 4, NULL, 'Flink Sql', NULL, NULL, NULL, '', '{\"jobmanager.memory.process.size\":\"1024mb\",\"taskmanager.memory.process.size\":\"1024mb\",\"parallelism.default\":1,\"taskmanager.numberOfTaskSlots\":1}', 1, 'application_1608425563635_146822', 1, 6609957, 'fee72e948e804b8e2aeec20db6a19183', '7', '', 'Flink Sql', 0, 0, 1024, 1024, 1, 1, 1, 0, 0, 1, '2021-04-18 17:55:59', 3, '2021-04-18 18:31:56', NULL);
COMMIT;
-- ----------------------------
@@ -104,10 +104,10 @@ CREATE TABLE `t_flink_config` (
`FORMAT` tinyint(1) NOT NULL DEFAULT '0',
`VERSION` int(10) NOT NULL,
`LATEST` tinyint(1) NOT NULL DEFAULT '0',
- `CONTENT` text NOT NULL,
+ `CONTENT` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`CREATE_TIME` datetime DEFAULT NULL,
PRIMARY KEY (`ID`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=1383318218421993474 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- ----------------------------
-- Records of t_flink_config
@@ -127,7 +127,7 @@ CREATE TABLE `t_flink_effective` (
`CREATE_TIME` datetime DEFAULT NULL,
PRIMARY KEY (`ID`) USING BTREE,
UNIQUE KEY `UN_INX` (`APP_ID`,`TARGET_TYPE`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- ----------------------------
-- Records of t_flink_effective
@@ -142,12 +142,12 @@ DROP TABLE IF EXISTS `t_flink_log`;
CREATE TABLE `t_flink_log` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`APP_ID` bigint(20) DEFAULT NULL,
- `YARN_APP_ID` varchar(50) DEFAULT NULL,
+ `YARN_APP_ID` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`SUCCESS` tinyint(1) DEFAULT NULL,
- `EXCEPTION` text,
+ `EXCEPTION` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
`START_TIME` datetime DEFAULT NULL,
PRIMARY KEY (`ID`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- ----------------------------
-- Records of t_flink_log
@@ -161,20 +161,20 @@ COMMIT;
DROP TABLE IF EXISTS `t_flink_project`;
CREATE TABLE `t_flink_project` (
`ID` bigint(64) NOT NULL AUTO_INCREMENT,
- `NAME` varchar(255) DEFAULT NULL,
- `URL` varchar(1000) DEFAULT NULL,
- `BRANCHES` varchar(1000) DEFAULT NULL,
- `USERNAME` varchar(255) DEFAULT NULL,
- `PASSWORD` varchar(255) DEFAULT NULL,
- `POM` varchar(255) DEFAULT NULL,
+ `NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `URL` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `BRANCHES` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `USERNAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `PASSWORD` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `POM` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`TYPE` int(1) DEFAULT NULL,
`REPOSITORY` int(1) DEFAULT NULL,
`DATE` datetime DEFAULT NULL,
`LASTBUILD` datetime DEFAULT NULL,
- `DESCRIPTION` varchar(255) DEFAULT NULL,
+ `DESCRIPTION` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`BUILDSTATE` int(1) DEFAULT '-1',
PRIMARY KEY (`ID`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- ----------------------------
-- Records of t_flink_project
@@ -190,8 +190,10 @@ DROP TABLE IF EXISTS `t_flink_savepoint`;
CREATE TABLE `t_flink_savepoint` (
`ID` bigint(50) NOT NULL AUTO_INCREMENT,
`APP_ID` bigint(50) NOT NULL,
- `LASTEST` tinyint(4) NOT NULL,
- `SAVE_POINT` varchar(255) DEFAULT NULL,
+ `TYPE` int(1) DEFAULT NULL,
+ `PATH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
+ `LATEST` tinyint(4) NOT NULL,
+ `TRIGGER_TIME` datetime DEFAULT NULL,
`CREATE_TIME` datetime DEFAULT NULL,
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -209,13 +211,13 @@ DROP TABLE IF EXISTS `t_flink_sql`;
CREATE TABLE `t_flink_sql` (
`ID` bigint(20) NOT NULL,
`APP_ID` bigint(20) DEFAULT NULL,
- `SQL` text,
- `DEPENDENCY` text,
+ `SQL` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
+ `DEPENDENCY` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
`VERSION` int(20) DEFAULT NULL,
- `CANDIDATE` int(1) NOT NULL DEFAULT '0',
+ `Candidate` int(1) NOT NULL DEFAULT '0',
`CREATE_TIME` datetime DEFAULT NULL,
PRIMARY KEY (`ID`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- ----------------------------
-- Records of t_flink_sql
@@ -230,11 +232,11 @@ DROP TABLE IF EXISTS `t_flink_tutorial`;
CREATE TABLE `t_flink_tutorial` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`TYPE` int(11) DEFAULT NULL,
- `NAME` varchar(255) DEFAULT NULL,
- `CONTENT` text,
+ `NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `CONTENT` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
`CREATE_TIME` date DEFAULT NULL,
PRIMARY KEY (`ID`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- ----------------------------
-- Records of t_flink_tutorial
@@ -250,18 +252,18 @@ DROP TABLE IF EXISTS `t_menu`;
CREATE TABLE `t_menu` (
`MENU_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单/按钮ID',
`PARENT_ID` bigint(20) NOT NULL COMMENT '上级菜单ID',
- `MENU_NAME` varchar(50) NOT NULL COMMENT '菜单/按钮名称',
- `PATH` varchar(255) DEFAULT NULL COMMENT '对应路由path',
- `COMPONENT` varchar(255) DEFAULT NULL COMMENT '对应路由组件component',
- `PERMS` varchar(50) DEFAULT NULL COMMENT '权限标识',
- `ICON` varchar(50) DEFAULT NULL COMMENT '图标',
- `TYPE` char(2) NOT NULL COMMENT '类型 0菜单 1按钮',
- `DISPLAY` char(2) NOT NULL DEFAULT '1' COMMENT '菜单是否显示',
+ `MENU_NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '菜单/按钮名称',
+ `PATH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '对应路由path',
+ `COMPONENT` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '对应路由组件component',
+ `PERMS` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '权限标识',
+ `ICON` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图标',
+ `TYPE` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类型 0菜单 1按钮',
+ `DISPLAY` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '1' COMMENT '菜单是否显示',
`ORDER_NUM` double(20,0) DEFAULT NULL COMMENT '排序',
`CREATE_TIME` datetime NOT NULL COMMENT '创建时间',
`MODIFY_TIME` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`MENU_ID`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=210 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=211 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_menu
@@ -316,11 +318,11 @@ COMMIT;
DROP TABLE IF EXISTS `t_role`;
CREATE TABLE `t_role` (
`ROLE_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '角色ID',
- `ROLE_NAME` varchar(50) NOT NULL COMMENT '角色名称',
- `REMARK` varchar(100) DEFAULT NULL COMMENT '角色描述',
+ `ROLE_NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色名称',
+ `REMARK` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '角色描述',
`CREATE_TIME` datetime NOT NULL COMMENT '创建时间',
`MODIFY_TIME` datetime DEFAULT NULL COMMENT '修改时间',
- `ROLE_CODE` varchar(255) DEFAULT NULL COMMENT '角色标识',
+ `ROLE_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '角色标识',
PRIMARY KEY (`ROLE_ID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=143 DEFAULT CHARSET=utf8;
@@ -328,7 +330,7 @@ CREATE TABLE `t_role` (
-- Records of t_role
-- ----------------------------
BEGIN;
-INSERT INTO `t_role` VALUES (1, 'admin', 'admin', '2017-12-27 16:23:11', '2021-04-11 23:59:52', 'admin');
+INSERT INTO `t_role` VALUES (1, 'admin', 'admin', '2017-12-27 16:23:11', '2021-04-22 09:35:44', 'admin');
INSERT INTO `t_role` VALUES (142, 'developer', '普通开发者', '2021-04-11 19:02:56', '2021-04-12 00:00:14', NULL);
COMMIT;
@@ -345,6 +347,24 @@ CREATE TABLE `t_role_menu` (
-- Records of t_role_menu
-- ----------------------------
BEGIN;
+INSERT INTO `t_role_menu` VALUES (142, 197);
+INSERT INTO `t_role_menu` VALUES (142, 198);
+INSERT INTO `t_role_menu` VALUES (142, 199);
+INSERT INTO `t_role_menu` VALUES (142, 200);
+INSERT INTO `t_role_menu` VALUES (142, 185);
+INSERT INTO `t_role_menu` VALUES (142, 201);
+INSERT INTO `t_role_menu` VALUES (142, 202);
+INSERT INTO `t_role_menu` VALUES (142, 203);
+INSERT INTO `t_role_menu` VALUES (142, 205);
+INSERT INTO `t_role_menu` VALUES (142, 206);
+INSERT INTO `t_role_menu` VALUES (142, 204);
+INSERT INTO `t_role_menu` VALUES (142, 188);
+INSERT INTO `t_role_menu` VALUES (142, 191);
+INSERT INTO `t_role_menu` VALUES (142, 192);
+INSERT INTO `t_role_menu` VALUES (142, 193);
+INSERT INTO `t_role_menu` VALUES (142, 194);
+INSERT INTO `t_role_menu` VALUES (142, 183);
+INSERT INTO `t_role_menu` VALUES (142, 209);
INSERT INTO `t_role_menu` VALUES (1, 1);
INSERT INTO `t_role_menu` VALUES (1, 3);
INSERT INTO `t_role_menu` VALUES (1, 11);
@@ -386,24 +406,6 @@ INSERT INTO `t_role_menu` VALUES (1, 206);
INSERT INTO `t_role_menu` VALUES (1, 207);
INSERT INTO `t_role_menu` VALUES (1, 208);
INSERT INTO `t_role_menu` VALUES (1, 209);
-INSERT INTO `t_role_menu` VALUES (142, 197);
-INSERT INTO `t_role_menu` VALUES (142, 198);
-INSERT INTO `t_role_menu` VALUES (142, 199);
-INSERT INTO `t_role_menu` VALUES (142, 200);
-INSERT INTO `t_role_menu` VALUES (142, 185);
-INSERT INTO `t_role_menu` VALUES (142, 201);
-INSERT INTO `t_role_menu` VALUES (142, 202);
-INSERT INTO `t_role_menu` VALUES (142, 203);
-INSERT INTO `t_role_menu` VALUES (142, 205);
-INSERT INTO `t_role_menu` VALUES (142, 206);
-INSERT INTO `t_role_menu` VALUES (142, 204);
-INSERT INTO `t_role_menu` VALUES (142, 188);
-INSERT INTO `t_role_menu` VALUES (142, 191);
-INSERT INTO `t_role_menu` VALUES (142, 192);
-INSERT INTO `t_role_menu` VALUES (142, 193);
-INSERT INTO `t_role_menu` VALUES (142, 194);
-INSERT INTO `t_role_menu` VALUES (142, 183);
-INSERT INTO `t_role_menu` VALUES (142, 209);
COMMIT;
-- ----------------------------
@@ -411,21 +413,27 @@ COMMIT;
-- ----------------------------
DROP TABLE IF EXISTS `t_setting`;
CREATE TABLE `t_setting` (
- `KEY` varchar(50) NOT NULL,
- `VALUE` varchar(255) DEFAULT NULL,
- `TITLE` varchar(255) DEFAULT NULL,
- `DESCRIPTION` varchar(255) DEFAULT NULL,
+ `NUM` int(10) DEFAULT NULL,
+ `KEY` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+ `VALUE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `TITLE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `DESCRIPTION` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
PRIMARY KEY (`KEY`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- ----------------------------
-- Records of t_setting
-- ----------------------------
BEGIN;
-INSERT INTO `t_setting` VALUES ('env.flink.home', NULL, 'Flink Home', 'Flink Home');
-INSERT INTO `t_setting` VALUES ('maven.central.repository', '', 'Maven Central Repository', 'Maven 私服地址');
-INSERT INTO `t_setting` VALUES ('streamx.console.webapp.address', 'http://test-hadoop-2:10000', 'StreamX Webapp address', 'StreamX Console Web 应用程序 HTTP 端口');
-INSERT INTO `t_setting` VALUES ('streamx.console.workspace', '/streamx/workspace', 'StreamX Console Workspace', 'StreamX Console 的工作空间,用于存放项目源码,编译后的项目等');
+INSERT INTO `t_setting` VALUES (7, 'alert.email.address', NULL, 'Alert Email Sender', '用来发送告警邮箱的mail');
+INSERT INTO `t_setting` VALUES (5, 'alert.email.host', NULL, 'Alert Email Smtp Host', '告警邮箱Smtp Host');
+INSERT INTO `t_setting` VALUES (8, 'alert.email.password', NULL, 'Alert Email Password', '发送告警的邮箱的密码');
+INSERT INTO `t_setting` VALUES (6, 'alert.email.port', NULL, 'Alert Email Smtp Port', '告警邮箱的Smtp Port');
+INSERT INTO `t_setting` VALUES (9, 'alert.email.ssl', NULL, 'Alert Email Is SSL', '发送告警的邮箱是否开启SSL');
+INSERT INTO `t_setting` VALUES (1, 'env.flink.home', '/usr/local/flink-1.12.0', 'Flink Home', 'Flink Home');
+INSERT INTO `t_setting` VALUES (2, 'maven.central.repository', '', 'Maven Central Repository', 'Maven 私服地址');
+INSERT INTO `t_setting` VALUES (4, 'streamx.console.webapp.address', 'http://test-hadoop-2:10000', 'StreamX Webapp address', 'StreamX Console Web 应用程序 HTTP 端口');
+INSERT INTO `t_setting` VALUES (3, 'streamx.console.workspace', '/streamx/workspace', 'StreamX Console Workspace', 'StreamX Console 的工作空间,用于存放项目源码,编译后的项目等');
COMMIT;
-- ----------------------------
@@ -434,21 +442,21 @@ COMMIT;
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
`USER_ID` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
- `USERNAME` varchar(255) DEFAULT NULL COMMENT '登录用户名',
- `NICK_NAME` varchar(50) NOT NULL COMMENT '昵称',
- `SALT` varchar(255) DEFAULT NULL COMMENT '密码加盐',
- `PASSWORD` varchar(128) NOT NULL COMMENT '密码',
+ `USERNAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '登录用户名',
+ `NICK_NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '昵称',
+ `SALT` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '密码加盐',
+ `PASSWORD` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',
`DEPT_ID` bigint(20) DEFAULT NULL COMMENT '部门ID',
- `EMAIL` varchar(128) DEFAULT NULL COMMENT '邮箱',
- `MOBILE` varchar(20) DEFAULT NULL COMMENT '联系电话',
- `STATUS` char(1) NOT NULL COMMENT '状态 0锁定 1有效',
+ `EMAIL` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '邮箱',
+ `MOBILE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '联系电话',
+ `STATUS` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '状态 0锁定 1有效',
`CREATE_TIME` datetime NOT NULL COMMENT '创建时间',
`MODIFY_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`LAST_LOGIN_TIME` datetime DEFAULT NULL COMMENT '最近访问时间',
- `SEX` char(1) DEFAULT NULL COMMENT '性别 0男 1女 2保密',
- `DESCRIPTION` varchar(100) DEFAULT NULL COMMENT '描述',
- `AVATAR` varchar(100) DEFAULT NULL COMMENT '用户头像',
- `USER_TYPE` char(1) NOT NULL DEFAULT '2' COMMENT '用户类型 1内部用户 2外部用户',
+ `SEX` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '性别 0男 1女 2保密',
+ `DESCRIPTION` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '描述',
+ `AVATAR` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户头像',
+ `USER_TYPE` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '2' COMMENT '用户类型 1内部用户 2外部用户',
PRIMARY KEY (`USER_ID`) USING BTREE,
UNIQUE KEY `UN_USERNAME` (`NICK_NAME`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8;
@@ -457,7 +465,7 @@ CREATE TABLE `t_user` (
-- Records of t_user
-- ----------------------------
BEGIN;
-INSERT INTO `t_user` VALUES (1, 'admin', '', 'ats6sdxdqf8vsqjtz0utj461wr', '829b009a6b9cc8ea486a4abbc38e56529f3c6f4c9c6fcd3604b41b1d6eca1a57', 1, 'benjobs@qq.com', '18500193260', '1', '2017-12-27 15:47:19', '2019-08-09 15:42:57', '2021-04-18 09:57:19', '0', 'author。', 'ubnKSIfAJTxIgXOKlciN.png', '1');
+INSERT INTO `t_user` VALUES (1, 'admin', '', 'ats6sdxdqf8vsqjtz0utj461wr', '829b009a6b9cc8ea486a4abbc38e56529f3c6f4c9c6fcd3604b41b1d6eca1a57', 1, 'benjobs@qq.com', '18500193260', '1', '2017-12-27 15:47:19', '2019-08-09 15:42:57', '2021-04-22 09:37:13', '0', 'author。', 'ubnKSIfAJTxIgXOKlciN.png', '1');
COMMIT;
-- ----------------------------
diff --git a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/controller/SettingController.java b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/controller/SettingController.java
index 30b0016f1d..2c31f07059 100644
--- a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/controller/SettingController.java
+++ b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/controller/SettingController.java
@@ -20,6 +20,8 @@
*/
package com.streamxhub.streamx.console.core.controller;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.streamxhub.streamx.console.base.controller.BaseController;
import com.streamxhub.streamx.console.base.domain.RestResponse;
import com.streamxhub.streamx.console.core.entity.Setting;
@@ -49,7 +51,8 @@ public class SettingController extends BaseController {
@PostMapping("all")
@RequiresPermissions("setting:view")
public RestResponse all() {
- List setting = settingService.list();
+ LambdaQueryWrapper query = new QueryWrapper().lambda().orderByAsc(Setting::getNum);
+ List setting = settingService.list(query);
return RestResponse.create().data(setting);
}
diff --git a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/Application.java b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/Application.java
index 7652d9925c..14115bdcda 100644
--- a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/Application.java
+++ b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/Application.java
@@ -92,6 +92,14 @@ public class Application implements Serializable {
private Integer optionState;
+ /**
+ * checkPoint 保留的最大条数
+ */
+ private Integer cpThreshold;
+
+ //失败告警的通知邮箱
+ private String alertEmail;
+
private String args;
/**
* 应用程序模块
@@ -104,6 +112,7 @@ public class Application implements Serializable {
private String dynamicOptions;
private Integer appType;
private Boolean flameGraph;
+
/**
* 是否需要跟踪监控状态
*/
@@ -127,7 +136,6 @@ public class Application implements Serializable {
@TableField("TOTAL_TM")
private Integer totalTM;
-
private Integer totalSlot;
private Integer availableSlot;
private Integer jmMemory;
diff --git a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/SavePoint.java b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/SavePoint.java
index e382e99766..2e8c0e4154 100644
--- a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/SavePoint.java
+++ b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/SavePoint.java
@@ -52,4 +52,6 @@ public class SavePoint {
private Date triggerTime;
private Date createTime;
+
+ private transient Integer cpThreshold;
}
diff --git a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/SenderEmail.java b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/SenderEmail.java
new file mode 100644
index 0000000000..34ce8c1c76
--- /dev/null
+++ b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/SenderEmail.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2019 The StreamX Project
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.streamxhub.streamx.console.core.entity;
+
+import lombok.Data;
+
+@Data
+public class SenderEmail {
+
+ private String smtpHost;
+ private Integer smtpPort;
+ private String email;
+ private String password;
+ private boolean ssl;
+
+}
diff --git a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/Setting.java b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/Setting.java
index dd27aefe4e..0e59383c51 100644
--- a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/Setting.java
+++ b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/entity/Setting.java
@@ -35,6 +35,10 @@
@TableName("t_setting")
@Slf4j
public class Setting implements Serializable {
+
+ @TableField("`NUM`")
+ private Integer num;
+
@TableField("`TITLE`")
private String title;
diff --git a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/AlertService.java b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/AlertService.java
new file mode 100644
index 0000000000..931ce8569f
--- /dev/null
+++ b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/AlertService.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2019 The StreamX Project
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.streamxhub.streamx.console.core.service;
+
+import com.streamxhub.streamx.console.core.entity.Application;
+import com.streamxhub.streamx.console.core.enums.FlinkAppState;
+
+/**
+ * @author benjobs
+ */
+public interface AlertService {
+
+ /**
+ * alert
+ *
+ * @param application
+ */
+ void alert(Application application, FlinkAppState appState);
+
+}
diff --git a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/SettingService.java b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/SettingService.java
index f5ddc9a741..53a7c3559a 100644
--- a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/SettingService.java
+++ b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/SettingService.java
@@ -22,6 +22,7 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.streamxhub.streamx.console.base.domain.RestResponse;
+import com.streamxhub.streamx.console.core.entity.SenderEmail;
import com.streamxhub.streamx.console.core.entity.Setting;
/**
@@ -32,8 +33,14 @@ public interface SettingService extends IService {
String KEY_MAVEN_REPOSITORY = "maven.central.repository";
String KEY_STREAMX_ADDRESS = "streamx.console.webapp.address";
String KEY_STREAMX_WORKSPACE = "streamx.console.workspace";
+
+ String KEY_ALERT_EMAIL_HOST = "alert.email.host";
+ String KEY_ALERT_EMAIL_PORT = "alert.email.port";
+ String KEY_ALERT_EMAIL_ADDRESS = "alert.email.address";
+ String KEY_ALERT_EMAIL_PASSWORD = "alert.email.password";
+ String KEY_ALERT_EMAIL_SSL = "alert.email.ssl";
+
String KEY_ENV_FLINK_HOME = "env.flink.home";
- String KEY_CHECKPOINT_THRESHOLD = "streamx.console.checkpoint.threshold";
/**
* @param key
@@ -57,6 +64,5 @@ public interface SettingService extends IService {
boolean checkWorkspace();
- Integer getCheckpointThreshold();
-
+ SenderEmail getSenderEmail();
}
diff --git a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/impl/AlertServiceImpl.java b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/impl/AlertServiceImpl.java
new file mode 100644
index 0000000000..464ee53e73
--- /dev/null
+++ b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/impl/AlertServiceImpl.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2019 The StreamX Project
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *