Merge remote-tracking branch 'upstream/dev-db' into dev-db
This commit is contained in:
commit
67660ab2bb
|
|
@ -1,25 +0,0 @@
|
|||
name: CI
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
Compile-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: check
|
||||
run: mvn -U -B clean package assembly:assembly -Dmaven.test.skip=true
|
||||
License-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: check
|
||||
run: mvn -B apache-rat:check
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
name: Backend
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/ci_backend.yml'
|
||||
- 'package.xml'
|
||||
- 'pom.xml'
|
||||
- 'dolphinscheduler-alert/**'
|
||||
- 'dolphinscheduler-api/**'
|
||||
- 'dolphinscheduler-common/**'
|
||||
- 'dolphinscheduler-dao/**'
|
||||
- 'dolphinscheduler-rpc/**'
|
||||
- 'dolphinscheduler-server/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/ci_backend.yml'
|
||||
- 'package.xml'
|
||||
- 'pom.xml'
|
||||
- 'dolphinscheduler-alert/**'
|
||||
- 'dolphinscheduler-api/**'
|
||||
- 'dolphinscheduler-common/**'
|
||||
- 'dolphinscheduler-dao/**'
|
||||
- 'dolphinscheduler-rpc/**'
|
||||
- 'dolphinscheduler-server/**'
|
||||
|
||||
jobs:
|
||||
Compile-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Compile
|
||||
run: mvn -U -B -T 1C clean package assembly:assembly -Dmaven.compile.fork=true -Dmaven.test.skip=true
|
||||
License-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Check
|
||||
run: mvn -B apache-rat:check
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
name: Frontend
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/ci_frontend.yml'
|
||||
- 'dolphinscheduler-ui/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/ci_frontend.yml'
|
||||
- 'dolphinscheduler-ui/**'
|
||||
|
||||
jobs:
|
||||
Compile-check:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
version: 8
|
||||
- name: Compile
|
||||
run: |
|
||||
cd dolphinscheduler-ui
|
||||
npm install node-sass --unsafe-perm
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
License-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Check
|
||||
run: mvn -B apache-rat:check
|
||||
|
|
@ -1,19 +1,88 @@
|
|||
# server port
|
||||
server.port=12345
|
||||
# mysql
|
||||
# url=jdbc:postgresql://192.168.220.154:5432/dolphinscheduler
|
||||
# base spring data source configuration
|
||||
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
||||
#spring.datasource.driver-class-name=org.postgresql.Driver
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root@123
|
||||
|
||||
# session config
|
||||
server.servlet.session.timeout=7200
|
||||
# connection configuration
|
||||
spring.datasource.initialSize=5
|
||||
# min connection number
|
||||
spring.datasource.minIdle=5
|
||||
# max connection number
|
||||
spring.datasource.maxActive=50
|
||||
|
||||
server.servlet.context-path=/dolphinscheduler/
|
||||
# max wait time for get a connection in milliseconds. if configuring maxWait, fair locks are enabled by default and concurrency efficiency decreases.
|
||||
# If necessary, unfair locks can be used by configuring the useUnfairLock attribute to true.
|
||||
spring.datasource.maxWait=60000
|
||||
|
||||
# file size limit for upload
|
||||
spring.servlet.multipart.max-file-size=1024MB
|
||||
spring.servlet.multipart.max-request-size=1024MB
|
||||
# milliseconds for check to close free connections
|
||||
spring.datasource.timeBetweenEvictionRunsMillis=60000
|
||||
|
||||
#post content
|
||||
server.jetty.max-http-post-size=5000000
|
||||
# the Destroy thread detects the connection interval and closes the physical connection in milliseconds if the connection idle time is greater than or equal to minEvictableIdleTimeMillis.
|
||||
spring.datasource.timeBetweenConnectErrorMillis=60000
|
||||
|
||||
spring.messages.encoding=UTF-8
|
||||
# the longest time a connection remains idle without being evicted, in milliseconds
|
||||
spring.datasource.minEvictableIdleTimeMillis=300000
|
||||
|
||||
#i18n classpath folder , file prefix messages, if have many files, use "," seperator
|
||||
spring.messages.basename=i18n/messages
|
||||
#the SQL used to check whether the connection is valid requires a query statement. If validation Query is null, testOnBorrow, testOnReturn, and testWhileIdle will not work.
|
||||
spring.datasource.validationQuery=SELECT 1 FROM DUAL
|
||||
|
||||
#check whether the connection is valid for timeout, in seconds
|
||||
spring.datasource.validationQueryTimeout=3
|
||||
|
||||
# when applying for a connection, if it is detected that the connection is idle longer than time Between Eviction Runs Millis,
|
||||
# validation Query is performed to check whether the connection is valid
|
||||
spring.datasource.testWhileIdle=true
|
||||
|
||||
#execute validation to check if the connection is valid when applying for a connection
|
||||
spring.datasource.testOnBorrow=true
|
||||
#execute validation to check if the connection is valid when the connection is returned
|
||||
spring.datasource.testOnReturn=false
|
||||
spring.datasource.defaultAutoCommit=true
|
||||
spring.datasource.keepAlive=true
|
||||
|
||||
# open PSCache, specify count PSCache for every connection
|
||||
spring.datasource.poolPreparedStatements=true
|
||||
spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
|
||||
|
||||
spring.datasource.spring.datasource.filters=stat,wall,log4j
|
||||
spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
||||
|
||||
#mybatis
|
||||
mybatis-plus.mapper-locations=classpath*:/org.apache.dolphinscheduler.dao.mapper/*.xml
|
||||
|
||||
mybatis-plus.typeEnumsPackage=org.apache.dolphinscheduler.*.enums
|
||||
|
||||
#实体扫描,多个package用逗号或者分号分隔
|
||||
mybatis-plus.typeAliasesPackage=org.apache.dolphinscheduler.dao.entity
|
||||
|
||||
#主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
|
||||
mybatis-plus.global-config.db-config.id-type=AUTO
|
||||
|
||||
#字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断"
|
||||
mybatis-plus.global-config.db-config.field-strategy=NOT_NULL
|
||||
|
||||
#驼峰下划线转换
|
||||
mybatis-plus.global-config.db-config.column-underline=true
|
||||
mybatis-plus.global-config.db-config.logic-delete-value=-1
|
||||
mybatis-plus.global-config.db-config.logic-not-delete-value=0
|
||||
mybatis-plus.global-config.db-config.banner=false
|
||||
#原生配置
|
||||
mybatis-plus.configuration.map-underscore-to-camel-case=true
|
||||
mybatis-plus.configuration.cache-enabled=false
|
||||
mybatis-plus.configuration.call-setters-on-nulls=true
|
||||
mybatis-plus.configuration.jdbc-type-for-null=null
|
||||
|
||||
# data quality analysis is not currently in use. please ignore the following configuration
|
||||
# task record flag
|
||||
task.record.flag=false
|
||||
task.record.datasource.url=jdbc:mysql://127.0.0.1:3306/etl?characterEncoding=UTF-8
|
||||
task.record.datasource.username=xx
|
||||
task.record.datasource.password=xx
|
||||
|
||||
# Logger Config
|
||||
logging.level.org.apache.dolphinscheduler.dao=debug
|
||||
|
|
|
|||
|
|
@ -1,91 +0,0 @@
|
|||
# mysql
|
||||
spring:
|
||||
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8
|
||||
username: root
|
||||
password: root@123
|
||||
#
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
initialSize: 5
|
||||
minIdle: 5
|
||||
maxActive: 20
|
||||
maxWait: 60000
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
poolPreparedStatements: true
|
||||
maxPoolPreparedStatementPerConnectionSize: 20
|
||||
spring.datasource.filters: stat,wall,log4j
|
||||
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
||||
|
||||
# jpa:
|
||||
# hibernate:
|
||||
# ddl-auto : update
|
||||
# datasource:
|
||||
# platform:
|
||||
# continue-on-error: true
|
||||
# druid:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# url: jdbc:postgresql://192.168.220.154:5432/escheduler
|
||||
|
||||
|
||||
|
||||
#mybatis
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:/org.apache.dolphinscheduler.dao.mapper/*.xml
|
||||
typeEnumsPackage: org.apache.dolphinscheduler.*.enums
|
||||
#实体扫描,多个package用逗号或者分号分隔
|
||||
typeAliasesPackage: org.apache.dolphinscheduler.dao.entity
|
||||
global-config:
|
||||
#数据库相关配置
|
||||
db-config:
|
||||
#主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
|
||||
id-type: AUTO
|
||||
#字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断"
|
||||
field-strategy: NOT_NULL
|
||||
#驼峰下划线转换
|
||||
column-underline: true
|
||||
logic-delete-value: -1
|
||||
logic-not-delete-value: 0
|
||||
banner: false
|
||||
#原生配置
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
cache-enabled: false
|
||||
call-setters-on-nulls: true
|
||||
jdbc-type-for-null: 'null'
|
||||
|
||||
|
||||
# Logger Config
|
||||
logging:
|
||||
level:
|
||||
org.apache.dolphinscheduler.dao: debug
|
||||
|
||||
---
|
||||
# master settings
|
||||
spring:
|
||||
profiles: master
|
||||
|
||||
server:
|
||||
port: 5566
|
||||
|
||||
---
|
||||
# worker settings
|
||||
spring:
|
||||
profiles: worker
|
||||
|
||||
server:
|
||||
port: 7788
|
||||
|
||||
---
|
||||
# alert settings
|
||||
spring:
|
||||
profiles: alert
|
||||
|
||||
server:
|
||||
port: 7789
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
logging.config=classpath:alert_logback.xml
|
||||
|
||||
# server port
|
||||
server.port=7789
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
logging.config=classpath:master_logback.xml
|
||||
|
||||
# server port
|
||||
server.port=5566
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
logging.config=classpath:worker_logback.xml
|
||||
|
||||
# server port
|
||||
server.port=7788
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# base spring data source configuration
|
||||
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/escheduler?characterEncoding=UTF-8
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/dolphinscheduler?characterEncoding=UTF-8
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root@123
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ master.task.commit.interval=100
|
|||
|
||||
|
||||
# only less than cpu avg load, master server can work. default value : the number of cpu cores * 2
|
||||
master.max.cpuload.avg=100
|
||||
#master.max.cpuload.avg=100
|
||||
|
||||
# only larger than reserved memory, master server can work. default value : physical memory * 1/10, unit is G.
|
||||
master.reserved.memory=0.1
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
package org.apache.dolphinscheduler.alert.runner;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.dolphinscheduler.alert.manager.EmailManager;
|
||||
import org.apache.dolphinscheduler.alert.manager.EnterpriseWeChatManager;
|
||||
import org.apache.dolphinscheduler.alert.utils.Constants;
|
||||
|
|
@ -25,8 +27,6 @@ import org.apache.dolphinscheduler.common.enums.AlertType;
|
|||
import org.apache.dolphinscheduler.dao.AlertDao;
|
||||
import org.apache.dolphinscheduler.dao.entity.Alert;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
@ -63,8 +63,6 @@ public class AlertSender{
|
|||
for(Alert alert:alertList){
|
||||
users = alertDao.listUserByAlertgroupId(alert.getAlertGroupId());
|
||||
|
||||
|
||||
|
||||
// receiving group list
|
||||
List<String> receviersList = new ArrayList<String>();
|
||||
for(User user:users){
|
||||
|
|
@ -109,18 +107,22 @@ public class AlertSender{
|
|||
}
|
||||
|
||||
boolean flag = Boolean.parseBoolean(String.valueOf(retMaps.get(Constants.STATUS)));
|
||||
if (flag){
|
||||
if (flag) {
|
||||
alertDao.updateAlert(AlertStatus.EXECUTION_SUCCESS, "execution success", alert.getId());
|
||||
logger.info("alert send success");
|
||||
try {
|
||||
String token = EnterpriseWeChatUtils.getToken();
|
||||
weChatManager.send(alert,token);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
if (EnterpriseWeChatUtils.isEnable()) {
|
||||
logger.info("Enterprise WeChat is enable!");
|
||||
try {
|
||||
String token = EnterpriseWeChatUtils.getToken();
|
||||
weChatManager.send(alert, token);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
alertDao.updateAlert(AlertStatus.EXECUTION_FAILURE,String.valueOf(retMaps.get(Constants.MESSAGE)),alert.getId());
|
||||
logger.info("alert send error : {}" , String.valueOf(retMaps.get(Constants.MESSAGE)));
|
||||
|
||||
} else {
|
||||
alertDao.updateAlert(AlertStatus.EXECUTION_FAILURE, String.valueOf(retMaps.get(Constants.MESSAGE)), alert.getId());
|
||||
logger.info("alert send error : {}", String.valueOf(retMaps.get(Constants.MESSAGE)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -139,6 +139,8 @@ public class Constants {
|
|||
|
||||
public static final String MARKDOWN_ENTER = "\n";
|
||||
|
||||
public static final String ENTERPRISE_WECHAT_ENABLE = "enterprise.wechat.enable";
|
||||
|
||||
public static final String ENTERPRISE_WECHAT_CORP_ID = "enterprise.wechat.corp.id";
|
||||
|
||||
public static final String ENTERPRISE_WECHAT_SECRET = "enterprise.wechat.secret";
|
||||
|
|
|
|||
|
|
@ -62,6 +62,21 @@ public class EnterpriseWeChatUtils {
|
|||
|
||||
public static final String enterpriseWeChatUsers = PropertyUtils.getString(Constants.ENTERPRISE_WECHAT_USERS);
|
||||
|
||||
/**
|
||||
* get Enterprise WeChat is enable
|
||||
* @return isEnable
|
||||
*/
|
||||
public static Boolean isEnable(){
|
||||
Boolean isEnable = false;
|
||||
try {
|
||||
isEnable = PropertyUtils.getBoolean(Constants.ENTERPRISE_WECHAT_ENABLE);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
return isEnable;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* get Enterprise WeChat token info
|
||||
* @return token string info
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ mail.smtp.ssl.trust=xxx.xxx.com
|
|||
xls.file.path=/tmp/xls
|
||||
|
||||
# Enterprise WeChat configuration
|
||||
enterprise.wechat.enable=false
|
||||
enterprise.wechat.corp.id=xxxxxxx
|
||||
enterprise.wechat.secret=xxxxxxx
|
||||
enterprise.wechat.agent.id=xxxxxxx
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.service.AccessTokenService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
package org.apache.dolphinscheduler.api.controller;
|
||||
|
||||
import org.apache.dolphinscheduler.api.service.AlertGroupService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.AlertType;
|
||||
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
|
|
@ -56,25 +56,25 @@ public class AlertGroupController extends BaseController{
|
|||
* @param loginUser
|
||||
* @param groupName
|
||||
* @param groupType
|
||||
* @param desc
|
||||
* @param description
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "createAlertgroup", notes= "CREATE_ALERT_GROUP_NOTES")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "groupName", value = "GROUP_NAME", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "groupType", value = "GROUP_TYPE", required = true, dataType ="AlertType"),
|
||||
@ApiImplicitParam(name = "desc", value = "DESC", dataType ="String")
|
||||
@ApiImplicitParam(name = "description", value = "DESC", dataType ="String")
|
||||
})
|
||||
@PostMapping(value = "/create")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public Result createAlertgroup(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
|
||||
@RequestParam(value = "groupName") String groupName,
|
||||
@RequestParam(value = "groupType") AlertType groupType,
|
||||
@RequestParam(value = "desc",required = false) String desc) {
|
||||
@RequestParam(value = "description",required = false) String description) {
|
||||
logger.info("loginUser user {}, create alertgroup, groupName: {}, groupType: {}, desc: {}",
|
||||
loginUser.getUserName(), groupName, groupType,desc);
|
||||
loginUser.getUserName(), groupName, groupType,description);
|
||||
try {
|
||||
Map<String, Object> result = alertGroupService.createAlertgroup(loginUser, groupName, groupType,desc);
|
||||
Map<String, Object> result = alertGroupService.createAlertgroup(loginUser, groupName, groupType,description);
|
||||
return returnDataList(result);
|
||||
}catch (Exception e){
|
||||
logger.error(Status.CREATE_ALERT_GROUP_ERROR.getMsg(),e);
|
||||
|
|
@ -146,7 +146,7 @@ public class AlertGroupController extends BaseController{
|
|||
* @param id
|
||||
* @param groupName
|
||||
* @param groupType
|
||||
* @param desc
|
||||
* @param description
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "updateAlertgroup", notes= "UPDATE_ALERT_GROUP_NOTES")
|
||||
|
|
@ -154,7 +154,7 @@ public class AlertGroupController extends BaseController{
|
|||
@ApiImplicitParam(name = "id", value = "ALERT_GROUP_ID", required = true, dataType = "Int",example = "100"),
|
||||
@ApiImplicitParam(name = "groupName", value = "GROUP_NAME", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "groupType", value = "GROUP_TYPE", required = true, dataType ="AlertType"),
|
||||
@ApiImplicitParam(name = "desc", value = "DESC", dataType ="String")
|
||||
@ApiImplicitParam(name = "description", value = "DESC", dataType ="String")
|
||||
})
|
||||
@PostMapping(value = "/update")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
|
|
@ -162,11 +162,11 @@ public class AlertGroupController extends BaseController{
|
|||
@RequestParam(value = "id") int id,
|
||||
@RequestParam(value = "groupName") String groupName,
|
||||
@RequestParam(value = "groupType") AlertType groupType,
|
||||
@RequestParam(value = "desc",required = false) String desc) {
|
||||
@RequestParam(value = "description",required = false) String description) {
|
||||
logger.info("login user {}, updateProcessInstance alertgroup, groupName: {}, groupType: {}, desc: {}",
|
||||
loginUser.getUserName(), groupName, groupType,desc);
|
||||
loginUser.getUserName(), groupName, groupType,description);
|
||||
try {
|
||||
Map<String, Object> result = alertGroupService.updateAlertgroup(loginUser, id, groupName, groupType, desc);
|
||||
Map<String, Object> result = alertGroupService.updateAlertgroup(loginUser, id, groupName, groupType, description);
|
||||
return returnDataList(result);
|
||||
|
||||
}catch (Exception e){
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
package org.apache.dolphinscheduler.api.controller;
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.dao.entity.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
|
||||
|
||||
import org.apache.dolphinscheduler.api.service.DataAnalysisService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.service.DataSourceService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.DbType;
|
||||
import org.apache.dolphinscheduler.common.utils.CommonUtils;
|
||||
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
import org.apache.dolphinscheduler.api.enums.ExecuteType;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.service.ExecutorService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.dolphinscheduler.common.enums.*;
|
||||
|
|
@ -95,7 +95,7 @@ public class ExecutorController extends BaseController {
|
|||
workerGroupId, timeout);
|
||||
|
||||
if (timeout == null) {
|
||||
timeout = org.apache.dolphinscheduler.common.Constants.MAX_TASK_TIMEOUT;
|
||||
timeout = Constants.MAX_TASK_TIMEOUT;
|
||||
}
|
||||
|
||||
Map<String, Object> result = execService.execProcessInstance(loginUser, projectName, processDefinitionId, scheduleTime, execType, failureStrategy,
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
|
||||
|
||||
import org.apache.dolphinscheduler.api.service.LoggerService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.service.SessionService;
|
||||
import org.apache.dolphinscheduler.api.service.UsersService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
|
||||
|
||||
import org.apache.dolphinscheduler.api.service.MonitorService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.service.ProcessDefinitionService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import io.swagger.annotations.*;
|
||||
|
|
@ -54,7 +54,7 @@ public class ProcessDefinitionController extends BaseController{
|
|||
* @param projectName
|
||||
* @param name
|
||||
* @param json process definition json
|
||||
* @param desc
|
||||
* @param description
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "save", notes= "CREATE_PROCESS_DEFINITION_NOTES")
|
||||
|
|
@ -63,7 +63,7 @@ public class ProcessDefinitionController extends BaseController{
|
|||
@ApiImplicitParam(name = "processDefinitionJson", value = "PROCESS_DEFINITION_JSON", required = true, type ="String"),
|
||||
@ApiImplicitParam(name = "locations", value = "PROCESS_DEFINITION_LOCATIONS", required = true, type ="String"),
|
||||
@ApiImplicitParam(name = "connects", value = "PROCESS_DEFINITION_CONNECTS", required = true, type ="String"),
|
||||
@ApiImplicitParam(name = "desc", value = "PROCESS_DEFINITION_DESC", required = false, type ="String"),
|
||||
@ApiImplicitParam(name = "description", value = "PROCESS_DEFINITION_DESC", required = false, type ="String"),
|
||||
})
|
||||
@PostMapping(value = "/save")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
|
|
@ -73,14 +73,14 @@ public class ProcessDefinitionController extends BaseController{
|
|||
@RequestParam(value = "processDefinitionJson", required = true) String json,
|
||||
@RequestParam(value = "locations", required = true) String locations,
|
||||
@RequestParam(value = "connects", required = true) String connects,
|
||||
@RequestParam(value = "desc", required = false) String desc) {
|
||||
@RequestParam(value = "description", required = false) String description) {
|
||||
|
||||
try {
|
||||
logger.info("login user {}, create process definition, project name: {}, process definition name: {}, " +
|
||||
"process_definition_json: {}, desc: {} locations:{}, connects:{}",
|
||||
loginUser.getUserName(), projectName, name, json, desc, locations, connects);
|
||||
loginUser.getUserName(), projectName, name, json, description, locations, connects);
|
||||
Map<String, Object> result = processDefinitionService.createProcessDefinition(loginUser, projectName, name, json,
|
||||
desc, locations, connects);
|
||||
description, locations, connects);
|
||||
return returnDataList(result);
|
||||
} catch (Exception e) {
|
||||
logger.error(Status.CREATE_PROCESS_DEFINITION.getMsg(), e);
|
||||
|
|
@ -124,7 +124,7 @@ public class ProcessDefinitionController extends BaseController{
|
|||
* @param name
|
||||
* @param id
|
||||
* @param processDefinitionJson
|
||||
* @param desc
|
||||
* @param description
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "updateProccessDefinition", notes= "UPDATE_PROCCESS_DEFINITION_NOTES")
|
||||
|
|
@ -134,7 +134,7 @@ public class ProcessDefinitionController extends BaseController{
|
|||
@ApiImplicitParam(name = "processDefinitionJson", value = "PROCESS_DEFINITION_JSON", required = true, type ="String"),
|
||||
@ApiImplicitParam(name = "locations", value = "PROCESS_DEFINITION_LOCATIONS", required = true, type ="String"),
|
||||
@ApiImplicitParam(name = "connects", value = "PROCESS_DEFINITION_CONNECTS", required = true, type ="String"),
|
||||
@ApiImplicitParam(name = "desc", value = "PROCESS_DEFINITION_DESC", required = false, type ="String"),
|
||||
@ApiImplicitParam(name = "description", value = "PROCESS_DEFINITION_DESC", required = false, type ="String"),
|
||||
})
|
||||
@PostMapping(value = "/update")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
|
|
@ -145,14 +145,14 @@ public class ProcessDefinitionController extends BaseController{
|
|||
@RequestParam(value = "processDefinitionJson", required = true) String processDefinitionJson,
|
||||
@RequestParam(value = "locations", required = false) String locations,
|
||||
@RequestParam(value = "connects", required = false) String connects,
|
||||
@RequestParam(value = "desc", required = false) String desc) {
|
||||
@RequestParam(value = "description", required = false) String description) {
|
||||
|
||||
try {
|
||||
logger.info("login user {}, update process define, project name: {}, process define name: {}, " +
|
||||
"process_definition_json: {}, desc: {}, locations:{}, connects:{}",
|
||||
loginUser.getUserName(), projectName, name, processDefinitionJson,desc, locations, connects);
|
||||
loginUser.getUserName(), projectName, name, processDefinitionJson,description, locations, connects);
|
||||
Map<String, Object> result = processDefinitionService.updateProcessDefinition(loginUser, projectName, id, name,
|
||||
processDefinitionJson, desc, locations, connects);
|
||||
processDefinitionJson, description, locations, connects);
|
||||
return returnDataList(result);
|
||||
}catch (Exception e){
|
||||
logger.error(Status.UPDATE_PROCESS_DEFINITION_ERROR.getMsg(),e);
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.service.ProcessInstanceService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
|
||||
import org.apache.dolphinscheduler.common.enums.Flag;
|
||||
import org.apache.dolphinscheduler.common.queue.ITaskQueue;
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.service.ProcessDefinitionService;
|
||||
import org.apache.dolphinscheduler.api.service.ProjectService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -61,23 +61,23 @@ public class ProjectController extends BaseController {
|
|||
*
|
||||
* @param loginUser
|
||||
* @param projectName
|
||||
* @param desc
|
||||
* @param description
|
||||
* @return returns an error if it exists
|
||||
*/
|
||||
@ApiOperation(value = "createProject", notes= "CREATE_PROJECT_NOTES")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectName", value = "PROJECT_NAME", dataType ="String"),
|
||||
@ApiImplicitParam(name = "desc", value = "PROJECT_DESC", dataType = "String")
|
||||
@ApiImplicitParam(name = "description", value = "PROJECT_DESC", dataType = "String")
|
||||
})
|
||||
@PostMapping(value = "/create")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public Result createProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
|
||||
@RequestParam("projectName") String projectName,
|
||||
@RequestParam(value = "desc", required = false) String desc) {
|
||||
@RequestParam(value = "description", required = false) String description) {
|
||||
|
||||
try {
|
||||
logger.info("login user {}, create project name: {}, desc: {}", loginUser.getUserName(), projectName, desc);
|
||||
Map<String, Object> result = projectService.createProject(loginUser, projectName, desc);
|
||||
logger.info("login user {}, create project name: {}, desc: {}", loginUser.getUserName(), projectName, description);
|
||||
Map<String, Object> result = projectService.createProject(loginUser, projectName, description);
|
||||
return returnDataList(result);
|
||||
} catch (Exception e) {
|
||||
logger.error(CREATE_PROJECT_ERROR.getMsg(), e);
|
||||
|
|
@ -91,24 +91,24 @@ public class ProjectController extends BaseController {
|
|||
* @param loginUser
|
||||
* @param projectId
|
||||
* @param projectName
|
||||
* @param desc
|
||||
* @param description
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "updateProject", notes= "UPDATE_PROJECT_NOTES")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectId", value = "PROJECT_ID", dataType ="Int", example = "100"),
|
||||
@ApiImplicitParam(name = "projectName",value = "PROJECT_NAME",dataType = "String"),
|
||||
@ApiImplicitParam(name = "desc", value = "PROJECT_DESC", dataType = "String")
|
||||
@ApiImplicitParam(name = "description", value = "PROJECT_DESC", dataType = "String")
|
||||
})
|
||||
@PostMapping(value = "/update")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public Result updateProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
|
||||
@RequestParam("projectId") Integer projectId,
|
||||
@RequestParam("projectName") String projectName,
|
||||
@RequestParam(value = "desc", required = false) String desc) {
|
||||
@RequestParam(value = "description", required = false) String description) {
|
||||
try {
|
||||
logger.info("login user {} , updateProcessInstance project name: {}, desc: {}", loginUser.getUserName(), projectName, desc);
|
||||
Map<String, Object> result = projectService.update(loginUser, projectId, projectName, desc);
|
||||
logger.info("login user {} , updateProcessInstance project name: {}, desc: {}", loginUser.getUserName(), projectName, description);
|
||||
Map<String, Object> result = projectService.update(loginUser, projectId, projectName, description);
|
||||
return returnDataList(result);
|
||||
} catch (Exception e) {
|
||||
logger.error(UPDATE_PROJECT_ERROR.getMsg(), e);
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.service.QueueService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.service.ResourcesService;
|
||||
import org.apache.dolphinscheduler.api.service.UdfFuncService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.ResourceType;
|
||||
import org.apache.dolphinscheduler.common.enums.UdfType;
|
||||
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
|
||||
|
|
@ -65,26 +65,26 @@ public class ResourcesController extends BaseController{
|
|||
*
|
||||
* @param loginUser
|
||||
* @param alias
|
||||
* @param desc
|
||||
* @param description
|
||||
* @param file
|
||||
*/
|
||||
@ApiOperation(value = "createResource", notes= "CREATE_RESOURCE_NOTES")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType ="ResourceType"),
|
||||
@ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataType ="String"),
|
||||
@ApiImplicitParam(name = "des", value = "RESOURCE_DESC", dataType ="String"),
|
||||
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType ="String"),
|
||||
@ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true, dataType = "MultipartFile")
|
||||
})
|
||||
@PostMapping(value = "/create")
|
||||
public Result createResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
|
||||
@RequestParam(value = "type") ResourceType type,
|
||||
@RequestParam(value ="name")String alias,
|
||||
@RequestParam(value = "desc", required = false) String desc,
|
||||
@RequestParam(value = "description", required = false) String description,
|
||||
@RequestParam("file") MultipartFile file) {
|
||||
try {
|
||||
logger.info("login user {}, create resource, type: {}, resource alias: {}, desc: {}, file: {},{}",
|
||||
loginUser.getUserName(),type, alias, desc, file.getName(), file.getOriginalFilename());
|
||||
return resourceService.createResource(loginUser,alias, desc,type ,file);
|
||||
loginUser.getUserName(),type, alias, description, file.getName(), file.getOriginalFilename());
|
||||
return resourceService.createResource(loginUser,alias, description,type ,file);
|
||||
} catch (Exception e) {
|
||||
logger.error(CREATE_RESOURCE_ERROR.getMsg(),e);
|
||||
return error(CREATE_RESOURCE_ERROR.getCode(), CREATE_RESOURCE_ERROR.getMsg());
|
||||
|
|
@ -96,14 +96,14 @@ public class ResourcesController extends BaseController{
|
|||
*
|
||||
* @param loginUser
|
||||
* @param alias
|
||||
* @param desc
|
||||
* @param description
|
||||
*/
|
||||
@ApiOperation(value = "createResource", notes= "CREATE_RESOURCE_NOTES")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType ="Int", example = "100"),
|
||||
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType ="ResourceType"),
|
||||
@ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataType ="String"),
|
||||
@ApiImplicitParam(name = "des", value = "RESOURCE_DESC", dataType ="String"),
|
||||
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType ="String"),
|
||||
@ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true,dataType = "MultipartFile")
|
||||
})
|
||||
@PostMapping(value = "/update")
|
||||
|
|
@ -111,11 +111,11 @@ public class ResourcesController extends BaseController{
|
|||
@RequestParam(value ="id") int resourceId,
|
||||
@RequestParam(value = "type") ResourceType type,
|
||||
@RequestParam(value ="name")String alias,
|
||||
@RequestParam(value = "desc", required = false) String desc) {
|
||||
@RequestParam(value = "description", required = false) String description) {
|
||||
try {
|
||||
logger.info("login user {}, update resource, type: {}, resource alias: {}, desc: {}",
|
||||
loginUser.getUserName(),type, alias, desc);
|
||||
return resourceService.updateResource(loginUser,resourceId,alias, desc,type);
|
||||
loginUser.getUserName(),type, alias, description);
|
||||
return resourceService.updateResource(loginUser,resourceId,alias, description,type);
|
||||
} catch (Exception e) {
|
||||
logger.error(UPDATE_RESOURCE_ERROR.getMsg(),e);
|
||||
return error(Status.UPDATE_RESOURCE_ERROR.getCode(), Status.UPDATE_RESOURCE_ERROR.getMsg());
|
||||
|
|
@ -280,7 +280,7 @@ public class ResourcesController extends BaseController{
|
|||
* @param type
|
||||
* @param fileName
|
||||
* @param fileSuffix
|
||||
* @param desc
|
||||
* @param description
|
||||
* @param content
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -289,7 +289,7 @@ public class ResourcesController extends BaseController{
|
|||
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType ="ResourceType"),
|
||||
@ApiImplicitParam(name = "fileName", value = "RESOURCE_NAME",required = true, dataType ="String"),
|
||||
@ApiImplicitParam(name = "suffix", value = "SUFFIX", required = true, dataType ="String"),
|
||||
@ApiImplicitParam(name = "des", value = "RESOURCE_DESC", dataType ="String"),
|
||||
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType ="String"),
|
||||
@ApiImplicitParam(name = "content", value = "CONTENT",required = true, dataType ="String")
|
||||
})
|
||||
@PostMapping(value = "/online-create")
|
||||
|
|
@ -297,17 +297,17 @@ public class ResourcesController extends BaseController{
|
|||
@RequestParam(value = "type") ResourceType type,
|
||||
@RequestParam(value ="fileName")String fileName,
|
||||
@RequestParam(value ="suffix")String fileSuffix,
|
||||
@RequestParam(value = "desc", required = false) String desc,
|
||||
@RequestParam(value = "description", required = false) String description,
|
||||
@RequestParam(value = "content") String content
|
||||
) {
|
||||
try{
|
||||
logger.info("login user {}, online create resource! fileName : {}, type : {}, suffix : {},desc : {},content : {}",
|
||||
loginUser.getUserName(),type,fileName,fileSuffix,desc,content);
|
||||
loginUser.getUserName(),type,fileName,fileSuffix,description,content);
|
||||
if(StringUtils.isEmpty(content)){
|
||||
logger.error("resource file contents are not allowed to be empty");
|
||||
return error(Status.RESOURCE_FILE_IS_EMPTY.getCode(), RESOURCE_FILE_IS_EMPTY.getMsg());
|
||||
}
|
||||
return resourceService.onlineCreateResource(loginUser,type,fileName,fileSuffix,desc,content);
|
||||
return resourceService.onlineCreateResource(loginUser,type,fileName,fileSuffix,description,content);
|
||||
}catch (Exception e){
|
||||
logger.error(CREATE_RESOURCE_FILE_ON_LINE_ERROR.getMsg(),e);
|
||||
return error(Status.CREATE_RESOURCE_FILE_ON_LINE_ERROR.getCode(), Status.CREATE_RESOURCE_FILE_ON_LINE_ERROR.getMsg());
|
||||
|
|
@ -383,7 +383,7 @@ public class ResourcesController extends BaseController{
|
|||
* @param funcName
|
||||
* @param argTypes
|
||||
* @param database
|
||||
* @param desc
|
||||
* @param description
|
||||
* @param resourceId
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -394,7 +394,7 @@ public class ResourcesController extends BaseController{
|
|||
@ApiImplicitParam(name = "suffix", value = "CLASS_NAME", required = true, dataType ="String"),
|
||||
@ApiImplicitParam(name = "argTypes", value = "ARG_TYPES", dataType ="String"),
|
||||
@ApiImplicitParam(name = "database", value = "DATABASE_NAME", dataType ="String"),
|
||||
@ApiImplicitParam(name = "desc", value = "UDF_DESC", dataType ="String"),
|
||||
@ApiImplicitParam(name = "description", value = "UDF_DESC", dataType ="String"),
|
||||
@ApiImplicitParam(name = "resourceId", value = "RESOURCE_ID", required = true, dataType ="Int", example = "100")
|
||||
|
||||
})
|
||||
|
|
@ -406,14 +406,14 @@ public class ResourcesController extends BaseController{
|
|||
@RequestParam(value ="className")String className,
|
||||
@RequestParam(value ="argTypes", required = false)String argTypes,
|
||||
@RequestParam(value ="database", required = false)String database,
|
||||
@RequestParam(value = "desc", required = false) String desc,
|
||||
@RequestParam(value = "description", required = false) String description,
|
||||
@RequestParam(value = "resourceId") int resourceId) {
|
||||
logger.info("login user {}, create udf function, type: {}, funcName: {},argTypes: {} ,database: {},desc: {},resourceId: {}",
|
||||
loginUser.getUserName(),type, funcName, argTypes,database,desc, resourceId);
|
||||
loginUser.getUserName(),type, funcName, argTypes,database,description, resourceId);
|
||||
Result result = new Result();
|
||||
|
||||
try {
|
||||
return udfFuncService.createUdfFunction(loginUser,funcName,className,argTypes,database,desc,type,resourceId);
|
||||
return udfFuncService.createUdfFunction(loginUser,funcName,className,argTypes,database,description,type,resourceId);
|
||||
} catch (Exception e) {
|
||||
logger.error(CREATE_UDF_FUNCTION_ERROR.getMsg(),e);
|
||||
return error(Status.CREATE_UDF_FUNCTION_ERROR.getCode(), Status.CREATE_UDF_FUNCTION_ERROR.getMsg());
|
||||
|
|
@ -457,7 +457,7 @@ public class ResourcesController extends BaseController{
|
|||
* @param funcName
|
||||
* @param argTypes
|
||||
* @param database
|
||||
* @param desc
|
||||
* @param description
|
||||
* @param resourceId
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -468,7 +468,7 @@ public class ResourcesController extends BaseController{
|
|||
@ApiImplicitParam(name = "suffix", value = "CLASS_NAME", required = true, dataType ="String"),
|
||||
@ApiImplicitParam(name = "argTypes", value = "ARG_TYPES", dataType ="String"),
|
||||
@ApiImplicitParam(name = "database", value = "DATABASE_NAME", dataType ="String"),
|
||||
@ApiImplicitParam(name = "desc", value = "UDF_DESC", dataType ="String"),
|
||||
@ApiImplicitParam(name = "description", value = "UDF_DESC", dataType ="String"),
|
||||
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType ="Int", example = "100")
|
||||
|
||||
})
|
||||
|
|
@ -480,12 +480,12 @@ public class ResourcesController extends BaseController{
|
|||
@RequestParam(value ="className")String className,
|
||||
@RequestParam(value ="argTypes", required = false)String argTypes,
|
||||
@RequestParam(value ="database", required = false)String database,
|
||||
@RequestParam(value = "desc", required = false) String desc,
|
||||
@RequestParam(value = "description", required = false) String description,
|
||||
@RequestParam(value = "resourceId") int resourceId) {
|
||||
try {
|
||||
logger.info("login user {}, updateProcessInstance udf function id: {},type: {}, funcName: {},argTypes: {} ,database: {},desc: {},resourceId: {}",
|
||||
loginUser.getUserName(),udfFuncId,type, funcName, argTypes,database,desc, resourceId);
|
||||
Map<String, Object> result = udfFuncService.updateUdfFunc(udfFuncId,funcName,className,argTypes,database,desc,type,resourceId);
|
||||
loginUser.getUserName(),udfFuncId,type, funcName, argTypes,database,description, resourceId);
|
||||
Map<String, Object> result = udfFuncService.updateUdfFunc(udfFuncId,funcName,className,argTypes,database,description,type,resourceId);
|
||||
return returnDataList(result);
|
||||
} catch (Exception e) {
|
||||
logger.error(UPDATE_UDF_FUNCTION_ERROR.getMsg(),e);
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ import springfox.documentation.annotations.ApiIgnore;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import static org.apache.dolphinscheduler.api.utils.Constants.SESSION_USER;
|
||||
import static org.apache.dolphinscheduler.api.enums.Status.*;
|
||||
import static org.apache.dolphinscheduler.common.Constants.SESSION_USER;
|
||||
|
||||
/**
|
||||
* schedule controller
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
|
||||
|
||||
import org.apache.dolphinscheduler.api.service.TaskInstanceService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
|
||||
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
|
||||
|
||||
import org.apache.dolphinscheduler.api.service.TaskRecordService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.slf4j.Logger;
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.service.TenantService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -58,7 +58,7 @@ public class TenantController extends BaseController{
|
|||
* @param tenantCode
|
||||
* @param tenantName
|
||||
* @param queueId
|
||||
* @param desc
|
||||
* @param description
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "createTenant", notes= "CREATE_TENANT_NOTES")
|
||||
|
|
@ -66,7 +66,7 @@ public class TenantController extends BaseController{
|
|||
@ApiImplicitParam(name = "tenantCode", value = "TENANT_CODE", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "tenantName", value = "TENANT_NAME", required = true, dataType ="String"),
|
||||
@ApiImplicitParam(name = "queueId", value = "QUEUE_ID", required = true, dataType ="Int",example = "100"),
|
||||
@ApiImplicitParam(name = "desc", value = "TENANT_DESC", dataType ="String")
|
||||
@ApiImplicitParam(name = "description", value = "TENANT_DESC", dataType ="String")
|
||||
|
||||
})
|
||||
@PostMapping(value = "/create")
|
||||
|
|
@ -75,11 +75,11 @@ public class TenantController extends BaseController{
|
|||
@RequestParam(value = "tenantCode") String tenantCode,
|
||||
@RequestParam(value = "tenantName") String tenantName,
|
||||
@RequestParam(value = "queueId") int queueId,
|
||||
@RequestParam(value = "desc",required = false) String desc) {
|
||||
@RequestParam(value = "description",required = false) String description) {
|
||||
logger.info("login user {}, create tenant, tenantCode: {}, tenantName: {}, queueId: {}, desc: {}",
|
||||
loginUser.getUserName(), tenantCode, tenantName, queueId,desc);
|
||||
loginUser.getUserName(), tenantCode, tenantName, queueId,description);
|
||||
try {
|
||||
Map<String, Object> result = tenantService.createTenant(loginUser,tenantCode,tenantName,queueId,desc);
|
||||
Map<String, Object> result = tenantService.createTenant(loginUser,tenantCode,tenantName,queueId,description);
|
||||
return returnDataList(result);
|
||||
|
||||
}catch (Exception e){
|
||||
|
|
@ -156,7 +156,7 @@ public class TenantController extends BaseController{
|
|||
* @param tenantCode
|
||||
* @param tenantName
|
||||
* @param queueId
|
||||
* @param desc
|
||||
* @param description
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "updateTenant", notes= "UPDATE_TENANT_NOTES")
|
||||
|
|
@ -165,7 +165,7 @@ public class TenantController extends BaseController{
|
|||
@ApiImplicitParam(name = "tenantCode", value = "TENANT_CODE", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "tenantName", value = "TENANT_NAME", required = true, dataType ="String"),
|
||||
@ApiImplicitParam(name = "queueId", value = "QUEUE_ID", required = true, dataType ="Int", example = "100"),
|
||||
@ApiImplicitParam(name = "desc", value = "TENANT_DESC", type ="String")
|
||||
@ApiImplicitParam(name = "description", value = "TENANT_DESC", type ="String")
|
||||
|
||||
})
|
||||
@PostMapping(value = "/update")
|
||||
|
|
@ -175,11 +175,11 @@ public class TenantController extends BaseController{
|
|||
@RequestParam(value = "tenantCode") String tenantCode,
|
||||
@RequestParam(value = "tenantName") String tenantName,
|
||||
@RequestParam(value = "queueId") int queueId,
|
||||
@RequestParam(value = "desc",required = false) String desc) {
|
||||
logger.info("login user {}, updateProcessInstance tenant, tenantCode: {}, tenantName: {}, queueId: {}, desc: {}",
|
||||
loginUser.getUserName(), tenantCode, tenantName, queueId,desc);
|
||||
@RequestParam(value = "description",required = false) String description) {
|
||||
logger.info("login user {}, updateProcessInstance tenant, tenantCode: {}, tenantName: {}, queueId: {}, description: {}",
|
||||
loginUser.getUserName(), tenantCode, tenantName, queueId,description);
|
||||
try {
|
||||
Map<String, Object> result = tenantService.updateTenant(loginUser,id,tenantCode, tenantName, queueId, desc);
|
||||
Map<String, Object> result = tenantService.updateTenant(loginUser,id,tenantCode, tenantName, queueId, description);
|
||||
return returnDataList(result);
|
||||
}catch (Exception e){
|
||||
logger.error(Status.UPDATE_TENANT_ERROR.getMsg(),e);
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.service.UsersService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@ package org.apache.dolphinscheduler.api.controller;
|
|||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.service.WorkerGroupService;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
|||
|
|
@ -165,6 +165,10 @@ public enum Status {
|
|||
PARSE_TO_CRON_EXPRESSION_ERROR(10140,"parse cron to cron expression error"),
|
||||
SCHEDULE_START_TIME_END_TIME_SAME(10141,"The start time must not be the same as the end"),
|
||||
DELETE_TENANT_BY_ID_FAIL(100142,"delete tenant by id fail, for there are {0} process instances in executing using it"),
|
||||
DELETE_TENANT_BY_ID_FAIL_DEFINES(100143,"delete tenant by id fail, for there are {0} process definitions using it"),
|
||||
DELETE_TENANT_BY_ID_FAIL_USERS(100144,"delete tenant by id fail, for there are {0} users using it"),
|
||||
|
||||
DELETE_WORKER_GROUP_BY_ID_FAIL(100143,"delete worker group by id fail, for there are {0} process instances in executing using it"),
|
||||
|
||||
UDF_FUNCTION_NOT_EXIST(20001, "UDF function not found"),
|
||||
UDF_FUNCTION_EXISTS(20002, "UDF function already exists"),
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
package org.apache.dolphinscheduler.api.interceptor;
|
||||
|
||||
import org.apache.dolphinscheduler.api.service.SessionService;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.dao.entity.Session;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import org.apache.dolphinscheduler.dao.mapper.UserMapper;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
package org.apache.dolphinscheduler.api.service;
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.dao.entity.AccessToken;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
|
|
@ -57,9 +57,6 @@ public class AccessTokenService extends BaseService {
|
|||
*/
|
||||
public Map<String, Object> queryAccessTokenList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) {
|
||||
Map<String, Object> result = new HashMap<>(5);
|
||||
if (checkAdmin(loginUser, result)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
PageInfo<AccessToken> pageInfo = new PageInfo<>(pageNo, pageSize);
|
||||
Page<AccessToken> page = new Page(pageNo, pageSize);
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
package org.apache.dolphinscheduler.api.service;
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.AlertType;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.dao.entity.AlertGroup;
|
||||
|
|
@ -44,7 +44,7 @@ import java.util.Map;
|
|||
* alert group service
|
||||
*/
|
||||
@Service
|
||||
public class AlertGroupService {
|
||||
public class AlertGroupService extends BaseService{
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AlertGroupService.class);
|
||||
|
||||
|
|
@ -269,29 +269,4 @@ public class AlertGroupService {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* is admin?
|
||||
* @param loginUser
|
||||
* @param result
|
||||
* @return
|
||||
*/
|
||||
private boolean checkAdmin(User loginUser, Map<String, Object> result) {
|
||||
if (!isAdmin(loginUser)) {
|
||||
putMsg(result, Status.USER_NO_OPERATION_PERM);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* put message
|
||||
*
|
||||
* @param result
|
||||
* @param status
|
||||
*/
|
||||
private void putMsg(Map<String, Object> result, Status status) {
|
||||
result.put(Constants.STATUS, status);
|
||||
result.put(Constants.MSG, status.getMsg());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
package org.apache.dolphinscheduler.api.service;
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.common.utils.HadoopUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
|
|
@ -127,4 +127,8 @@ public class BaseService {
|
|||
HadoopUtils.getInstance().mkdir(resourcePath);
|
||||
HadoopUtils.getInstance().mkdir(udfsPath);
|
||||
}
|
||||
|
||||
protected boolean hasPerm(User operateUser, int createUserId){
|
||||
return operateUser.getId() == createUserId || isAdmin(operateUser);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,9 +21,8 @@ import org.apache.dolphinscheduler.api.dto.CommandStateCount;
|
|||
import org.apache.dolphinscheduler.api.dto.DefineUserDto;
|
||||
import org.apache.dolphinscheduler.api.dto.TaskCountDto;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.CommandType;
|
||||
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.common.queue.ITaskQueue;
|
||||
import org.apache.dolphinscheduler.common.queue.TaskQueueFactory;
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
package org.apache.dolphinscheduler.api.service;
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.DbType;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.common.job.db.*;
|
||||
|
|
@ -65,7 +65,7 @@ public class DataSourceService extends BaseService{
|
|||
public static final String PRINCIPAL = "principal";
|
||||
public static final String DATABASE = "database";
|
||||
public static final String USER_NAME = "userName";
|
||||
public static final String PASSWORD = org.apache.dolphinscheduler.common.Constants.PASSWORD;
|
||||
public static final String PASSWORD = Constants.PASSWORD;
|
||||
public static final String OTHER = "other";
|
||||
|
||||
|
||||
|
|
@ -90,7 +90,8 @@ public class DataSourceService extends BaseService{
|
|||
|
||||
Map<String, Object> result = new HashMap<>(5);
|
||||
// check name can use or not
|
||||
if (checkName(name, result)) {
|
||||
if (checkName(name)) {
|
||||
putMsg(result, Status.DATASOURCE_EXIST);
|
||||
return result;
|
||||
}
|
||||
Boolean isConnection = checkConnection(type, parameter);
|
||||
|
|
@ -146,8 +147,14 @@ public class DataSourceService extends BaseService{
|
|||
return result;
|
||||
}
|
||||
|
||||
if(!hasPerm(loginUser, dataSource.getUserId())){
|
||||
putMsg(result, Status.USER_NO_OPERATION_PERM);
|
||||
return result;
|
||||
}
|
||||
|
||||
//check name can use or not
|
||||
if(!name.trim().equals(dataSource.getName()) && checkName(name, result)){
|
||||
if(!name.trim().equals(dataSource.getName()) && checkName(name)){
|
||||
putMsg(result, Status.DATASOURCE_EXIST);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -170,10 +177,9 @@ public class DataSourceService extends BaseService{
|
|||
return result;
|
||||
}
|
||||
|
||||
private boolean checkName(String name, Map<String, Object> result) {
|
||||
private boolean checkName(String name) {
|
||||
List<DataSource> queryDataSource = dataSourceMapper.queryDataSourceByName(name.trim());
|
||||
if (queryDataSource != null && queryDataSource.size() > 0) {
|
||||
putMsg(result, Status.DATASOURCE_EXIST);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -321,7 +327,7 @@ public class DataSourceService extends BaseService{
|
|||
|
||||
String connectionParams = dataSource.getConnectionParams();
|
||||
JSONObject object = JSONObject.parseObject(connectionParams);
|
||||
object.put(org.apache.dolphinscheduler.common.Constants.PASSWORD, org.apache.dolphinscheduler.common.Constants.XXXXXX);
|
||||
object.put(Constants.PASSWORD, Constants.XXXXXX);
|
||||
dataSource.setConnectionParams(JSONUtils.toJson(object));
|
||||
|
||||
}
|
||||
|
|
@ -587,7 +593,7 @@ public class DataSourceService extends BaseService{
|
|||
putMsg(result, Status.RESOURCE_NOT_EXIST);
|
||||
return result;
|
||||
}
|
||||
if(loginUser.getId() != dataSource.getUserId() && loginUser.getUserType() != UserType.ADMIN_USER){
|
||||
if(!hasPerm(loginUser, dataSource.getUserId())){
|
||||
putMsg(result, Status.USER_NO_OPERATION_PERM);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.enums.ExecuteType;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.*;
|
||||
import org.apache.dolphinscheduler.common.utils.DateUtils;
|
||||
import org.apache.dolphinscheduler.common.utils.JSONUtils;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
package org.apache.dolphinscheduler.api.service;
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.ZookeeperMonitor;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.ZKNodeType;
|
||||
import org.apache.dolphinscheduler.dao.MonitorDBDao;
|
||||
import org.apache.dolphinscheduler.common.model.MasterServer;
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ package org.apache.dolphinscheduler.api.service;
|
|||
import org.apache.dolphinscheduler.api.dto.treeview.Instance;
|
||||
import org.apache.dolphinscheduler.api.dto.treeview.TreeViewDto;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.*;
|
||||
import org.apache.dolphinscheduler.common.graph.DAG;
|
||||
import org.apache.dolphinscheduler.common.model.TaskNode;
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ package org.apache.dolphinscheduler.api.service;
|
|||
import org.apache.dolphinscheduler.api.dto.gantt.GanttDto;
|
||||
import org.apache.dolphinscheduler.api.dto.gantt.Task;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.DependResult;
|
||||
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
|
||||
import org.apache.dolphinscheduler.common.enums.Flag;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
package org.apache.dolphinscheduler.api.service;
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
|
||||
import org.apache.dolphinscheduler.dao.entity.Project;
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
package org.apache.dolphinscheduler.api.service;
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.dao.entity.Queue;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import org.apache.dolphinscheduler.dao.mapper.QueueMapper;
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
package org.apache.dolphinscheduler.api.service;
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.ResourceType;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.common.utils.FileUtils;
|
||||
|
|
@ -208,7 +208,7 @@ public class ResourcesService extends BaseService {
|
|||
putMsg(result, Status.RESOURCE_NOT_EXIST);
|
||||
return result;
|
||||
}
|
||||
if (loginUser.getId() != resource.getUserId()) {
|
||||
if (!hasPerm(loginUser, resource.getUserId())) {
|
||||
putMsg(result, Status.USER_NO_OPERATION_PERM);
|
||||
return result;
|
||||
}
|
||||
|
|
@ -408,7 +408,7 @@ public class ResourcesService extends BaseService {
|
|||
putMsg(result, Status.RESOURCE_NOT_EXIST);
|
||||
return result;
|
||||
}
|
||||
if (loginUser.getId() != resource.getUserId() && loginUser.getUserType() != UserType.ADMIN_USER) {
|
||||
if (!hasPerm(loginUser, resource.getUserId())) {
|
||||
putMsg(result, Status.USER_NO_OPERATION_PERM);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.dto.ScheduleParam;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.FailureStrategy;
|
||||
import org.apache.dolphinscheduler.common.enums.Priority;
|
||||
import org.apache.dolphinscheduler.common.enums.ReleaseState;
|
||||
|
|
@ -304,9 +304,10 @@ public class SchedulerService extends BaseService {
|
|||
if(scheduleStatus == ReleaseState.ONLINE){
|
||||
// check process definition release state
|
||||
if(processDefinition.getReleaseState() != ReleaseState.ONLINE){
|
||||
ProcessDefinition definition = processDefinitionMapper.selectById(scheduleObj.getProcessDefinitionId());
|
||||
logger.info("not release process definition id: {} , name : {}",
|
||||
processDefinition.getId(), processDefinition.getName());
|
||||
putMsg(result, Status.PROCESS_DEFINE_NOT_RELEASE, scheduleObj.getProcessDefinitionId());
|
||||
putMsg(result, Status.PROCESS_DEFINE_NOT_RELEASE, definition.getName());
|
||||
return result;
|
||||
}
|
||||
// check sub process definition release state
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
|
||||
import org.apache.dolphinscheduler.api.controller.BaseController;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.utils.CollectionUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.Session;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
|
||||
import org.apache.dolphinscheduler.common.utils.CollectionUtils;
|
||||
import org.apache.dolphinscheduler.common.utils.DateUtils;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
package org.apache.dolphinscheduler.api.service;
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.dao.TaskRecordDao;
|
||||
import org.apache.dolphinscheduler.dao.entity.TaskRecord;
|
||||
import org.slf4j.Logger;
|
||||
|
|
|
|||
|
|
@ -20,18 +20,20 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.utils.CollectionUtils;
|
||||
import org.apache.dolphinscheduler.common.utils.HadoopUtils;
|
||||
import org.apache.dolphinscheduler.common.utils.PropertyUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
|
||||
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
|
||||
import org.apache.dolphinscheduler.dao.entity.Tenant;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
|
||||
import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper;
|
||||
import org.apache.dolphinscheduler.dao.mapper.TenantMapper;
|
||||
import org.apache.dolphinscheduler.dao.mapper.UserMapper;
|
||||
import org.apache.hadoop.fs.FileStatus;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -58,6 +60,14 @@ public class TenantService extends BaseService{
|
|||
@Autowired
|
||||
private ProcessInstanceMapper processInstanceMapper;
|
||||
|
||||
@Autowired
|
||||
private ProcessDefinitionMapper processDefinitionMapper;
|
||||
|
||||
@Autowired
|
||||
private UserMapper userMapper;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* create tenant
|
||||
*
|
||||
|
|
@ -228,45 +238,34 @@ public class TenantService extends BaseService{
|
|||
}
|
||||
|
||||
Tenant tenant = tenantMapper.queryById(id);
|
||||
|
||||
if (tenant == null){
|
||||
putMsg(result, Status.TENANT_NOT_EXIST);
|
||||
return result;
|
||||
}
|
||||
|
||||
int[] states = new int[]{
|
||||
ExecutionStatus.SUBMITTED_SUCCESS.ordinal(),
|
||||
ExecutionStatus.RUNNING_EXEUTION.ordinal(),
|
||||
ExecutionStatus.READY_PAUSE.ordinal(),
|
||||
ExecutionStatus.READY_STOP.ordinal(),
|
||||
ExecutionStatus.NEED_FAULT_TOLERANCE.ordinal(),
|
||||
ExecutionStatus.WAITTING_THREAD.ordinal(),
|
||||
ExecutionStatus.WAITTING_DEPEND.ordinal()
|
||||
};
|
||||
|
||||
List<ProcessInstance> processInstances = processInstanceMapper.queryByTenantIdAndStatus(tenant.getId(), states);
|
||||
List<ProcessInstance> processInstances = getProcessInstancesByTenant(tenant);
|
||||
if(CollectionUtils.isNotEmpty(processInstances)){
|
||||
putMsg(result, Status.DELETE_TENANT_BY_ID_FAIL, processInstances.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
List<ProcessDefinition> processDefinitions = processDefinitionMapper.queryDefinitionListByTenant(tenant.getId());
|
||||
if(CollectionUtils.isNotEmpty(processDefinitions)){
|
||||
putMsg(result, Status.DELETE_TENANT_BY_ID_FAIL_DEFINES, processDefinitions.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
List<User> userList = userMapper.queryUserListByTenant(tenant.getId());
|
||||
if(CollectionUtils.isNotEmpty(userList)){
|
||||
putMsg(result, Status.DELETE_TENANT_BY_ID_FAIL_USERS, userList.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
// if resource upload startup
|
||||
if (PropertyUtils.getResUploadStartupState()){
|
||||
String tenantPath = HadoopUtils.getHdfsDataBasePath() + "/" + tenant.getTenantCode();
|
||||
|
||||
if (HadoopUtils.getInstance().exists(tenantPath)){
|
||||
String resourcePath = HadoopUtils.getHdfsResDir(tenant.getTenantCode());
|
||||
FileStatus[] fileStatus = HadoopUtils.getInstance().listFileStatus(resourcePath);
|
||||
if (fileStatus.length > 0) {
|
||||
putMsg(result, Status.HDFS_TERANT_RESOURCES_FILE_EXISTS);
|
||||
return result;
|
||||
}
|
||||
fileStatus = HadoopUtils.getInstance().listFileStatus(HadoopUtils.getHdfsUdfDir(tenant.getTenantCode()));
|
||||
if (fileStatus.length > 0) {
|
||||
putMsg(result, Status.HDFS_TERANT_UDFS_FILE_EXISTS);
|
||||
return result;
|
||||
}
|
||||
|
||||
HadoopUtils.getInstance().delete(tenantPath, true);
|
||||
}
|
||||
}
|
||||
|
|
@ -277,6 +276,10 @@ public class TenantService extends BaseService{
|
|||
return result;
|
||||
}
|
||||
|
||||
private List<ProcessInstance> getProcessInstancesByTenant(Tenant tenant) {
|
||||
return processInstanceMapper.queryByTenantIdAndStatus(tenant.getId(), org.apache.dolphinscheduler.common.Constants.NOT_TERMINATED_STATES);
|
||||
}
|
||||
|
||||
/**
|
||||
* query tenant list
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
package org.apache.dolphinscheduler.api.service;
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.UdfType;
|
||||
import org.apache.dolphinscheduler.common.utils.PropertyUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.Resource;
|
||||
|
|
@ -112,7 +112,7 @@ public class UdfFuncService extends BaseService{
|
|||
if (StringUtils.isNotEmpty(argTypes)) {
|
||||
udf.setArgTypes(argTypes);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(argTypes)) {
|
||||
if (StringUtils.isNotEmpty(database)) {
|
||||
udf.setDatabase(database);
|
||||
}
|
||||
udf.setDescription(desc);
|
||||
|
|
@ -214,19 +214,13 @@ public class UdfFuncService extends BaseService{
|
|||
Date now = new Date();
|
||||
udf.setFuncName(funcName);
|
||||
udf.setClassName(className);
|
||||
if (StringUtils.isNotEmpty(argTypes)) {
|
||||
udf.setArgTypes(argTypes);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(argTypes)) {
|
||||
udf.setDatabase(database);
|
||||
}
|
||||
udf.setArgTypes(argTypes);
|
||||
udf.setDatabase(database);
|
||||
udf.setDescription(desc);
|
||||
udf.setResourceId(resourceId);
|
||||
udf.setResourceName(resource.getAlias());
|
||||
udf.setType(type);
|
||||
|
||||
|
||||
udf.setCreateTime(now);
|
||||
udf.setUpdateTime(now);
|
||||
|
||||
udfFuncMapper.updateById(udf);
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.CheckUtils;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.api.utils.Result;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.ResourceType;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.common.utils.CollectionUtils;
|
||||
|
|
@ -94,15 +94,17 @@ public class UsersService extends BaseService {
|
|||
String queue) throws Exception {
|
||||
|
||||
Map<String, Object> result = new HashMap<>(5);
|
||||
result = CheckUtils.checkUserParams(userName, userPassword, email, phone);
|
||||
if (result.get(Constants.STATUS) != Status.SUCCESS) {
|
||||
if (!CheckUtils.checkUserParams(userName, userPassword, email, phone)) {
|
||||
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR);
|
||||
return result;
|
||||
}
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM, Constants.STATUS)) {
|
||||
if (!isAdmin(loginUser)) {
|
||||
putMsg(result, Status.USER_NO_OPERATION_PERM);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (check(result, checkTenant(tenantId), Status.TENANT_NOT_EXIST, Constants.STATUS)) {
|
||||
if (checkTenant(tenantId)) {
|
||||
putMsg(result, Status.TENANT_NOT_EXIST);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +178,7 @@ public class UsersService extends BaseService {
|
|||
public Map<String, Object> queryUserList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) {
|
||||
Map<String, Object> result = new HashMap<>(5);
|
||||
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM, Constants.STATUS)) {
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -352,14 +354,14 @@ public class UsersService extends BaseService {
|
|||
result.put(Constants.STATUS, false);
|
||||
|
||||
//only admin can operate
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM, Constants.STATUS)) {
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
//if the selected projectIds are empty, delete all items associated with the user
|
||||
projectUserMapper.deleteProjectRelation(0, userId);
|
||||
|
||||
if (check(result, StringUtils.isEmpty(projectIds), Status.SUCCESS, Constants.MSG)) {
|
||||
if (check(result, StringUtils.isEmpty(projectIds), Status.SUCCESS)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -393,7 +395,7 @@ public class UsersService extends BaseService {
|
|||
public Map<String, Object> grantResources(User loginUser, int userId, String resourceIds) {
|
||||
Map<String, Object> result = new HashMap<>(5);
|
||||
//only admin can operate
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM, Constants.STATUS)) {
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
|
||||
return result;
|
||||
}
|
||||
User user = userMapper.selectById(userId);
|
||||
|
|
@ -404,7 +406,7 @@ public class UsersService extends BaseService {
|
|||
|
||||
resourcesUserMapper.deleteResourceUser(userId, 0);
|
||||
|
||||
if (check(result, StringUtils.isEmpty(resourceIds), Status.SUCCESS, Constants.MSG)) {
|
||||
if (check(result, StringUtils.isEmpty(resourceIds), Status.SUCCESS)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -439,13 +441,13 @@ public class UsersService extends BaseService {
|
|||
Map<String, Object> result = new HashMap<>(5);
|
||||
|
||||
//only admin can operate
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM, Constants.STATUS)) {
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
udfUserMapper.deleteByUserId(userId);
|
||||
|
||||
if (check(result, StringUtils.isEmpty(udfIds), Status.SUCCESS, Constants.MSG)) {
|
||||
if (check(result, StringUtils.isEmpty(udfIds), Status.SUCCESS)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -481,13 +483,13 @@ public class UsersService extends BaseService {
|
|||
result.put(Constants.STATUS, false);
|
||||
|
||||
//only admin can operate
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM, Constants.STATUS)) {
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
datasourceUserMapper.deleteByUserId(userId);
|
||||
|
||||
if (check(result, StringUtils.isEmpty(datasourceIds), Status.SUCCESS, Constants.MSG)) {
|
||||
if (check(result, StringUtils.isEmpty(datasourceIds), Status.SUCCESS)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -554,7 +556,7 @@ public class UsersService extends BaseService {
|
|||
public Map<String, Object> queryAllGeneralUsers(User loginUser) {
|
||||
Map<String, Object> result = new HashMap<>(5);
|
||||
//only admin can operate
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM, Constants.STATUS)) {
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -575,7 +577,7 @@ public class UsersService extends BaseService {
|
|||
public Map<String, Object> queryUserList(User loginUser) {
|
||||
Map<String, Object> result = new HashMap<>(5);
|
||||
//only admin can operate
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM, Constants.STATUS)) {
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -619,11 +621,11 @@ public class UsersService extends BaseService {
|
|||
|
||||
Map<String, Object> result = new HashMap<>(5);
|
||||
//only admin can operate
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM, Constants.STATUS)) {
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
List<User> userList = userMapper.selectList(null);
|
||||
List<User> userList = userMapper.queryAllGeneralUser();
|
||||
List<User> resultUsers = new ArrayList<>();
|
||||
Set<User> userSet = null;
|
||||
if (userList != null && userList.size() > 0) {
|
||||
|
|
@ -655,7 +657,7 @@ public class UsersService extends BaseService {
|
|||
public Map<String, Object> authorizedUser(User loginUser, Integer alertgroupId) {
|
||||
Map<String, Object> result = new HashMap<>(5);
|
||||
//only admin can operate
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM, Constants.STATUS)) {
|
||||
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
|
||||
return result;
|
||||
}
|
||||
List<User> userList = userMapper.queryUserListByAlertGroupId(alertgroupId);
|
||||
|
|
@ -671,14 +673,13 @@ public class UsersService extends BaseService {
|
|||
* @param result
|
||||
* @param bool
|
||||
* @param userNoOperationPerm
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
private boolean check(Map<String, Object> result, boolean bool, Status userNoOperationPerm, String status) {
|
||||
private boolean check(Map<String, Object> result, boolean bool, Status userNoOperationPerm) {
|
||||
//only admin can operate
|
||||
if (bool) {
|
||||
result.put(Constants.STATUS, userNoOperationPerm);
|
||||
result.put(status, userNoOperationPerm.getMsg());
|
||||
result.put(Constants.MSG, userNoOperationPerm.getMsg());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -17,10 +17,13 @@
|
|||
package org.apache.dolphinscheduler.api.service;
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.utils.CollectionUtils;
|
||||
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import org.apache.dolphinscheduler.dao.entity.WorkerGroup;
|
||||
import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper;
|
||||
import org.apache.dolphinscheduler.dao.mapper.WorkerGroupMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
|
@ -43,6 +46,9 @@ public class WorkerGroupService extends BaseService {
|
|||
@Autowired
|
||||
WorkerGroupMapper workerGroupMapper;
|
||||
|
||||
@Autowired
|
||||
ProcessInstanceMapper processInstanceMapper;
|
||||
|
||||
/**
|
||||
* create or update a worker group
|
||||
* @param id
|
||||
|
|
@ -142,7 +148,13 @@ public class WorkerGroupService extends BaseService {
|
|||
|
||||
Map<String, Object> result = new HashMap<>(5);
|
||||
|
||||
List<ProcessInstance> processInstances = processInstanceMapper.queryByWorkerGroupIdAndStatus(id, org.apache.dolphinscheduler.common.Constants.NOT_TERMINATED_STATES);
|
||||
if(CollectionUtils.isNotEmpty(processInstances)){
|
||||
putMsg(result, Status.DELETE_WORKER_GROUP_BY_ID_FAIL, processInstances.size());
|
||||
return result;
|
||||
}
|
||||
workerGroupMapper.deleteById(id);
|
||||
processInstanceMapper.updateProcessInstanceByWorkerGroupId(id, org.apache.dolphinscheduler.common.Constants.DEFAULT_WORKER_ID);
|
||||
putMsg(result, Status.SUCCESS);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package org.apache.dolphinscheduler.api.utils;
|
|||
|
||||
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.task.AbstractParameters;
|
||||
import org.apache.dolphinscheduler.common.utils.JSONUtils;
|
||||
import org.apache.dolphinscheduler.common.utils.TaskParametersUtils;
|
||||
|
|
@ -41,7 +42,7 @@ public class CheckUtils {
|
|||
* @param userName
|
||||
*/
|
||||
public static boolean checkUserName(String userName) {
|
||||
return regexChecks(userName, org.apache.dolphinscheduler.common.Constants.REGEX_USER_NAME);
|
||||
return regexChecks(userName, Constants.REGEX_USER_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -50,7 +51,7 @@ public class CheckUtils {
|
|||
* @param email
|
||||
*/
|
||||
public static boolean checkEmail(String email) {
|
||||
return email.length() > 5 && email.length() <= 40 && regexChecks(email, org.apache.dolphinscheduler.common.Constants.REGEX_MAIL_NAME) ;
|
||||
return email.length() > 5 && email.length() <= 40 && regexChecks(email, Constants.REGEX_MAIL_NAME) ;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -122,26 +123,13 @@ public class CheckUtils {
|
|||
* @param phone
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, Object> checkUserParams(String userName, String password, String email, String phone){
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try{
|
||||
CheckUtils.checkUserName(userName);
|
||||
CheckUtils.checkEmail(email);
|
||||
CheckUtils.checkPassword(password);
|
||||
CheckUtils.checkPhone(phone);
|
||||
result.put(Constants.STATUS, Status.SUCCESS);
|
||||
result.put(Constants.MSG, Status.SUCCESS.getMsg());
|
||||
}catch (Exception e){
|
||||
result.put(Constants.STATUS, Status.REQUEST_PARAMS_NOT_VALID_ERROR);
|
||||
result.put(Constants.MSG, e.getMessage());
|
||||
}
|
||||
return result;
|
||||
public static boolean checkUserParams(String userName, String password, String email, String phone){
|
||||
return CheckUtils.checkUserName(userName) &&
|
||||
CheckUtils.checkEmail(email) &&
|
||||
CheckUtils.checkPassword(password) &&
|
||||
CheckUtils.checkPhone(phone);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 正则匹配
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,129 +0,0 @@
|
|||
/*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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 org.apache.dolphinscheduler.api.utils;
|
||||
|
||||
/**
|
||||
* web application constants
|
||||
*/
|
||||
public class Constants {
|
||||
|
||||
/**
|
||||
* status
|
||||
*/
|
||||
public static final String STATUS = "status";
|
||||
|
||||
/**
|
||||
* message
|
||||
*/
|
||||
public static final String MSG = "msg";
|
||||
|
||||
/**
|
||||
* data total
|
||||
* 数据总数
|
||||
*/
|
||||
public static final String COUNT = "count";
|
||||
|
||||
/**
|
||||
* page size
|
||||
* 每页数据条数
|
||||
*/
|
||||
public static final String PAGE_SIZE = "pageSize";
|
||||
|
||||
/**
|
||||
* current page no
|
||||
* 当前页码
|
||||
*/
|
||||
public static final String PAGE_NUMBER = "pageNo";
|
||||
|
||||
/**
|
||||
* result
|
||||
*/
|
||||
public static final String RESULT = "result";
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static final String DATA_LIST = "data";
|
||||
|
||||
public static final String TOTAL_LIST = "totalList";
|
||||
|
||||
public static final String CURRENT_PAGE = "currentPage";
|
||||
|
||||
public static final String TOTAL_PAGE = "totalPage";
|
||||
|
||||
public static final String TOTAL = "total";
|
||||
|
||||
/**
|
||||
* session user
|
||||
*/
|
||||
public static final String SESSION_USER = "session.user";
|
||||
|
||||
public static final String SESSION_ID = "sessionId";
|
||||
|
||||
public static final String PASSWORD_DEFAULT = "******";
|
||||
|
||||
/**
|
||||
* driver
|
||||
*/
|
||||
public static final String ORG_POSTGRESQL_DRIVER = "org.postgresql.Driver";
|
||||
public static final String COM_MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver";
|
||||
public static final String ORG_APACHE_HIVE_JDBC_HIVE_DRIVER = "org.apache.hive.jdbc.HiveDriver";
|
||||
public static final String COM_CLICKHOUSE_JDBC_DRIVER = "ru.yandex.clickhouse.ClickHouseDriver";
|
||||
public static final String COM_ORACLE_JDBC_DRIVER = "oracle.jdbc.driver.OracleDriver";
|
||||
public static final String COM_SQLSERVER_JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
|
||||
|
||||
/**
|
||||
* database type
|
||||
*/
|
||||
public static final String MYSQL = "MYSQL";
|
||||
public static final String POSTGRESQL = "POSTGRESQL";
|
||||
public static final String HIVE = "HIVE";
|
||||
public static final String SPARK = "SPARK";
|
||||
public static final String CLICKHOUSE = "CLICKHOUSE";
|
||||
public static final String ORACLE = "ORACLE";
|
||||
public static final String SQLSERVER = "SQLSERVER";
|
||||
|
||||
/**
|
||||
* jdbc url
|
||||
*/
|
||||
public static final String JDBC_MYSQL = "jdbc:mysql://";
|
||||
public static final String JDBC_POSTGRESQL = "jdbc:postgresql://";
|
||||
public static final String JDBC_HIVE_2 = "jdbc:hive2://";
|
||||
public static final String JDBC_CLICKHOUSE = "jdbc:clickhouse://";
|
||||
public static final String JDBC_ORACLE = "jdbc:oracle:thin:@//";
|
||||
public static final String JDBC_SQLSERVER = "jdbc:sqlserver://";
|
||||
|
||||
|
||||
public static final String ADDRESS = "address";
|
||||
public static final String DATABASE = "database";
|
||||
public static final String JDBC_URL = "jdbcUrl";
|
||||
public static final String PRINCIPAL = "principal";
|
||||
public static final String USER = "user";
|
||||
public static final String PASSWORD = "password";
|
||||
public static final String OTHER = "other";
|
||||
|
||||
|
||||
/**
|
||||
* session timeout
|
||||
*/
|
||||
public static final int SESSION_TIME_OUT = 7200;
|
||||
public static final int maxFileSize = 1024 * 1024 * 1024;
|
||||
public static final String UDF = "UDF";
|
||||
public static final String CLASS = "class";
|
||||
public static final String RECEIVERS = "receivers";
|
||||
public static final String RECEIVERS_CC = "receiversCc";
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.ApiApplicationServer;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import org.junit.Assert;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.ApiApplicationServer;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.DbType;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.ApiApplicationServer;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.ApiApplicationServer;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.ApiApplicationServer;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.DependResult;
|
||||
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.ApiApplicationServer;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.ResourceType;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.ApiApplicationServer;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.ReleaseState;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.dao.entity.Project;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.ApiApplicationServer;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import org.junit.Assert;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.ApiApplicationServer;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import org.junit.Assert;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.ApiApplicationServer;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.api.utils.PageInfo;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import org.junit.Assert;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.api.service;
|
|||
|
||||
import org.apache.dolphinscheduler.api.ApiApplicationServer;
|
||||
import org.apache.dolphinscheduler.api.enums.Status;
|
||||
import org.apache.dolphinscheduler.api.utils.Constants;
|
||||
import org.apache.dolphinscheduler.common.Constants;
|
||||
import org.apache.dolphinscheduler.common.enums.UserType;
|
||||
import org.apache.dolphinscheduler.dao.entity.User;
|
||||
import org.junit.Assert;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.dolphinscheduler.common;
|
||||
|
||||
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
|
||||
import org.apache.dolphinscheduler.common.utils.OSUtils;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
|
@ -490,9 +491,6 @@ public final class Constants {
|
|||
|
||||
public static String TASK_RECORD_TABLE_HISTORY_HIVE_LOG = "eamp_hive_hist_log_hd";
|
||||
|
||||
public static final String STATUS = "status";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* command parameter keys
|
||||
|
|
@ -664,7 +662,7 @@ public final class Constants {
|
|||
/**
|
||||
* --class CLASS_NAME
|
||||
*/
|
||||
public static final String CLASS = "--class";
|
||||
public static final String MAIN_CLASS = "--class";
|
||||
|
||||
/**
|
||||
* --driver-cores NUM
|
||||
|
|
@ -925,4 +923,117 @@ public final class Constants {
|
|||
public static final String FLINK_MAIN_CLASS = "-c";
|
||||
|
||||
|
||||
public static final int[] NOT_TERMINATED_STATES = new int[]{
|
||||
ExecutionStatus.SUBMITTED_SUCCESS.ordinal(),
|
||||
ExecutionStatus.RUNNING_EXEUTION.ordinal(),
|
||||
ExecutionStatus.READY_PAUSE.ordinal(),
|
||||
ExecutionStatus.READY_STOP.ordinal(),
|
||||
ExecutionStatus.NEED_FAULT_TOLERANCE.ordinal(),
|
||||
ExecutionStatus.WAITTING_THREAD.ordinal(),
|
||||
ExecutionStatus.WAITTING_DEPEND.ordinal()
|
||||
};
|
||||
|
||||
/**
|
||||
* status
|
||||
*/
|
||||
public static final String STATUS = "status";
|
||||
|
||||
/**
|
||||
* message
|
||||
*/
|
||||
public static final String MSG = "msg";
|
||||
|
||||
/**
|
||||
* data total
|
||||
* 数据总数
|
||||
*/
|
||||
public static final String COUNT = "count";
|
||||
|
||||
/**
|
||||
* page size
|
||||
* 每页数据条数
|
||||
*/
|
||||
public static final String PAGE_SIZE = "pageSize";
|
||||
|
||||
/**
|
||||
* current page no
|
||||
* 当前页码
|
||||
*/
|
||||
public static final String PAGE_NUMBER = "pageNo";
|
||||
|
||||
/**
|
||||
* result
|
||||
*/
|
||||
public static final String RESULT = "result";
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static final String DATA_LIST = "data";
|
||||
|
||||
public static final String TOTAL_LIST = "totalList";
|
||||
|
||||
public static final String CURRENT_PAGE = "currentPage";
|
||||
|
||||
public static final String TOTAL_PAGE = "totalPage";
|
||||
|
||||
public static final String TOTAL = "total";
|
||||
|
||||
/**
|
||||
* session user
|
||||
*/
|
||||
public static final String SESSION_USER = "session.user";
|
||||
|
||||
public static final String SESSION_ID = "sessionId";
|
||||
|
||||
public static final String PASSWORD_DEFAULT = "******";
|
||||
|
||||
/**
|
||||
* driver
|
||||
*/
|
||||
public static final String ORG_POSTGRESQL_DRIVER = "org.postgresql.Driver";
|
||||
public static final String COM_MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver";
|
||||
public static final String ORG_APACHE_HIVE_JDBC_HIVE_DRIVER = "org.apache.hive.jdbc.HiveDriver";
|
||||
public static final String COM_CLICKHOUSE_JDBC_DRIVER = "ru.yandex.clickhouse.ClickHouseDriver";
|
||||
public static final String COM_ORACLE_JDBC_DRIVER = "oracle.jdbc.driver.OracleDriver";
|
||||
public static final String COM_SQLSERVER_JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
|
||||
|
||||
/**
|
||||
* database type
|
||||
*/
|
||||
public static final String MYSQL = "MYSQL";
|
||||
public static final String POSTGRESQL = "POSTGRESQL";
|
||||
public static final String HIVE = "HIVE";
|
||||
public static final String SPARK = "SPARK";
|
||||
public static final String CLICKHOUSE = "CLICKHOUSE";
|
||||
public static final String ORACLE = "ORACLE";
|
||||
public static final String SQLSERVER = "SQLSERVER";
|
||||
|
||||
/**
|
||||
* jdbc url
|
||||
*/
|
||||
public static final String JDBC_MYSQL = "jdbc:mysql://";
|
||||
public static final String JDBC_POSTGRESQL = "jdbc:postgresql://";
|
||||
public static final String JDBC_HIVE_2 = "jdbc:hive2://";
|
||||
public static final String JDBC_CLICKHOUSE = "jdbc:clickhouse://";
|
||||
public static final String JDBC_ORACLE = "jdbc:oracle:thin:@//";
|
||||
public static final String JDBC_SQLSERVER = "jdbc:sqlserver://";
|
||||
|
||||
|
||||
public static final String ADDRESS = "address";
|
||||
public static final String DATABASE = "database";
|
||||
public static final String JDBC_URL = "jdbcUrl";
|
||||
public static final String PRINCIPAL = "principal";
|
||||
public static final String OTHER = "other";
|
||||
|
||||
|
||||
/**
|
||||
* session timeout
|
||||
*/
|
||||
public static final int SESSION_TIME_OUT = 7200;
|
||||
public static final int maxFileSize = 1024 * 1024 * 1024;
|
||||
public static final String UDF = "UDF";
|
||||
public static final String CLASS = "class";
|
||||
public static final String RECEIVERS = "receivers";
|
||||
public static final String RECEIVERS_CC = "receiversCc";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ public interface ProcessDefinitionMapper extends BaseMapper<ProcessDefinition> {
|
|||
|
||||
List<ProcessDefinition> queryDefinitionListByIdList(@Param("ids") Integer[] ids);
|
||||
|
||||
List<ProcessDefinition> queryDefinitionListByTenant(@Param("tenantId") int tenantId);
|
||||
|
||||
List<DefinitionGroupByUser> countDefinitionGroupByUser(
|
||||
@Param("userId") Integer userId,
|
||||
@Param("projectIds") Integer[] projectIds);
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@ public interface ProcessInstanceMapper extends BaseMapper<ProcessInstance> {
|
|||
List<ProcessInstance> queryByTenantIdAndStatus(@Param("tenantId") int tenantId,
|
||||
@Param("states") int[] states);
|
||||
|
||||
List<ProcessInstance> queryByWorkerGroupIdAndStatus(@Param("workerGroupId") int workerGroupId,
|
||||
@Param("states") int[] states);
|
||||
|
||||
IPage<ProcessInstance> queryProcessInstanceListPaging(Page<ProcessInstance> page,
|
||||
@Param("projectId") int projectId,
|
||||
@Param("processDefinitionId") Integer processDefinitionId,
|
||||
|
|
@ -55,6 +58,8 @@ public interface ProcessInstanceMapper extends BaseMapper<ProcessInstance> {
|
|||
|
||||
int updateProcessInstanceByTenantId(@Param("originTenantId") int originTenantId, @Param("destTenantId") int destTenantId);
|
||||
|
||||
int updateProcessInstanceByWorkerGroupId(@Param("originWorkerGroupId") int originWorkerGroupId, @Param("destWorkerGroupId") int destWorkerGroupId);
|
||||
|
||||
List<ExecuteStatusCount> countInstanceStateByUser(
|
||||
@Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime,
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ public interface UserMapper extends BaseMapper<User> {
|
|||
|
||||
List<User> queryUserListByAlertGroupId(@Param("alertgroupId") int alertgroupId);
|
||||
|
||||
List<User> queryUserListByTenant(@Param("tenantId") int tenantId);
|
||||
|
||||
User queryTenantCodeByUserId(@Param("userId") int userId);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,11 @@
|
|||
where project_id = #{projectId}
|
||||
order by create_time desc
|
||||
</select>
|
||||
<select id="queryDefinitionListByTenant" resultType="org.apache.dolphinscheduler.dao.entity.ProcessDefinition">
|
||||
select *
|
||||
from t_ds_process_definition
|
||||
where tenant_id = #{tenantId}
|
||||
</select>
|
||||
<select id="queryDefinitionListByIdList" resultType="org.apache.dolphinscheduler.dao.entity.ProcessDefinition">
|
||||
select *
|
||||
from t_ds_process_definition
|
||||
|
|
@ -51,7 +56,6 @@
|
|||
</if>
|
||||
group by td.user_id,tu.user_name
|
||||
</select>
|
||||
|
||||
<select id="queryByDefineId" resultType="org.apache.dolphinscheduler.dao.entity.ProcessDefinition">
|
||||
SELECT
|
||||
pd.*, u.user_name,
|
||||
|
|
@ -64,6 +68,4 @@
|
|||
pd.user_id = u.id AND pd.project_id = p.id
|
||||
AND pd.id = #{processDefineId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -34,6 +34,20 @@
|
|||
order by id asc
|
||||
</select>
|
||||
|
||||
<select id="queryByWorkerGroupIdAndStatus" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance">
|
||||
select *
|
||||
from t_ds_process_instance
|
||||
where 1=1
|
||||
<if test="workerGroupId != -1">
|
||||
and worker_group_id =#{workerGroupId}
|
||||
</if>
|
||||
and state in
|
||||
<foreach collection="states" item="i" open="(" close=")" separator=",">
|
||||
#{i}
|
||||
</foreach>
|
||||
order by id asc
|
||||
</select>
|
||||
|
||||
<select id="queryProcessInstanceListPaging" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance">
|
||||
select instance.*
|
||||
from t_ds_process_instance instance
|
||||
|
|
@ -81,6 +95,12 @@
|
|||
where tenant_id = #{originTenantId}
|
||||
</update>
|
||||
|
||||
<update id="updateProcessInstanceByWorkerGroupId">
|
||||
update t_ds_process_instance
|
||||
set worker_group_id = #{destWorkerGroupId}
|
||||
where worker_group_id = #{originWorkerGroupId}
|
||||
</update>
|
||||
|
||||
<select id="countInstanceStateByUser" resultType="org.apache.dolphinscheduler.dao.entity.ExecuteStatusCount">
|
||||
select t.state, count(0) as count
|
||||
from t_ds_process_instance t
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="org.apache.dolphinscheduler.dao.mapper.UserMapper">
|
||||
|
||||
<select id="queryAllGeneralUser" resultType="org.apache.dolphinscheduler.dao.entity.User">
|
||||
select * from t_ds_user
|
||||
where user_type=1;
|
||||
|
|
@ -14,7 +13,6 @@
|
|||
select * from t_ds_user
|
||||
where user_name=#{userName} and user_password = #{password}
|
||||
</select>
|
||||
|
||||
<select id="queryUserPaging" resultType="org.apache.dolphinscheduler.dao.entity.User">
|
||||
select u.id,u.user_name,u.user_password,u.user_type,u.email,u.phone,u.tenant_id,u.create_time,
|
||||
u.update_time,t.tenant_name,
|
||||
|
|
@ -28,20 +26,22 @@
|
|||
</if>
|
||||
order by u.update_time desc
|
||||
</select>
|
||||
|
||||
<select id="queryDetailsById" resultType="org.apache.dolphinscheduler.dao.entity.User">
|
||||
select u.*, t.tenant_name,
|
||||
case when u.queue <![CDATA[ <> ]]> '' then u.queue else q.queue_name end as queue_name
|
||||
from t_ds_user u,t_ds_tenant t,t_ds_queue q
|
||||
WHERE u.tenant_id = t.id and t.queue_id = q.id and u.id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="queryUserListByAlertGroupId" resultType="org.apache.dolphinscheduler.dao.entity.User">
|
||||
select u.*
|
||||
from t_ds_user u, t_ds_relation_user_alertgroup rel
|
||||
where u.id = rel.user_id AND u.user_type = 1 AND rel.alertgroup_id = #{alertgroupId}
|
||||
</select>
|
||||
|
||||
<select id="queryUserListByTenant" resultType="org.apache.dolphinscheduler.dao.entity.User">
|
||||
select *
|
||||
from t_ds_user
|
||||
where tenant_id = #{tenantId}
|
||||
</select>
|
||||
<select id="queryTenantCodeByUserId" resultType="org.apache.dolphinscheduler.dao.entity.User">
|
||||
SELECT u.*,t.tenant_code
|
||||
FROM t_ds_user u, t_ds_tenant t
|
||||
|
|
|
|||
|
|
@ -820,7 +820,7 @@ public class MasterExecThread implements Runnable {
|
|||
errorTaskList.put(task.getName(), task);
|
||||
completeTaskList.put(task.getName(), task);
|
||||
if(processInstance.getFailureStrategy() == FailureStrategy.END){
|
||||
kill();
|
||||
killTheOtherTasks();
|
||||
}
|
||||
}
|
||||
continue;
|
||||
|
|
@ -885,17 +885,22 @@ public class MasterExecThread implements Runnable {
|
|||
|
||||
|
||||
/**
|
||||
* close the ongoing tasks
|
||||
* close the on going tasks
|
||||
*/
|
||||
private void kill() {
|
||||
private void killTheOtherTasks() {
|
||||
|
||||
logger.info("kill called on process instance id: {}, num: {}", processInstance.getId(),
|
||||
activeTaskNode.size());
|
||||
for (Map.Entry<MasterBaseTaskExecThread, Future<Boolean>> entry : activeTaskNode.entrySet()) {
|
||||
|
||||
MasterBaseTaskExecThread taskExecThread = entry.getKey();
|
||||
Future<Boolean> future = entry.getValue();
|
||||
|
||||
TaskInstance taskInstance = taskExecThread.getTaskInstance();
|
||||
taskInstance = processDao.findTaskInstanceById(taskInstance.getId());
|
||||
if(taskInstance.getState().typeIsFinished()){
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!future.isDone()) {
|
||||
// record kill info
|
||||
logger.info("kill process instance, id: {}, task: {}", processInstance.getId(), taskExecThread.getTaskInstance().getId());
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class SparkArgsUtils {
|
|||
if(param.getProgramType() !=null ){
|
||||
if(param.getProgramType()!=ProgramType.PYTHON){
|
||||
if (StringUtils.isNotEmpty(param.getMainClass())) {
|
||||
args.add(Constants.CLASS);
|
||||
args.add(Constants.MAIN_CLASS);
|
||||
args.add(param.getMainClass());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ public class FetchTaskThread implements Runnable{
|
|||
taskInstId = getTaskInstanceId(taskQueueStr);
|
||||
|
||||
// mainly to wait for the master insert task to succeed
|
||||
waitForMasterEnterQueue();
|
||||
waitForTaskInstance();
|
||||
|
||||
taskInstance = processDao.getTaskInstanceDetailByTaskId(taskInstId);
|
||||
|
||||
|
|
@ -304,10 +304,10 @@ public class FetchTaskThread implements Runnable{
|
|||
}
|
||||
|
||||
/**
|
||||
* mainly to wait for the master insert task to succeed
|
||||
* wait for task instance exists, because of db action would be delayed.
|
||||
* @throws Exception
|
||||
*/
|
||||
private void waitForMasterEnterQueue()throws Exception{
|
||||
private void waitForTaskInstance()throws Exception{
|
||||
int retryTimes = 30;
|
||||
while (taskInstance == null && retryTimes > 0) {
|
||||
Thread.sleep(Constants.SLEEP_TIME_MILLIS);
|
||||
|
|
|
|||
|
|
@ -14,53 +14,21 @@
|
|||
"build:combined": "npm run clean && cross-env NODE_ENV=production PUBLIC_PATH=/dolphinscheduler/ui webpack --config ./build/webpack.config.combined.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"autoprefixer": "^9.1.0",
|
||||
"babel-core": "^6.25.0",
|
||||
"babel-eslint": "^8.2.2",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.2",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-plugin-transform-runtime": "^6.23.0",
|
||||
"babel-plugin-transform-vue-jsx": "^3.5.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"jquery": "1.12.4",
|
||||
"vue": "^2.5.17",
|
||||
"vue-router": "2.7.0",
|
||||
"vuex": "^3.0.0",
|
||||
"bootstrap": "3.3.7",
|
||||
"canvg": "1.5",
|
||||
"clipboard": "^2.0.1",
|
||||
"codemirror": "^5.43.0",
|
||||
"copy-webpack-plugin": "^4.5.2",
|
||||
"cross-env": "^5.2.0",
|
||||
"css-loader": "^0.28.8",
|
||||
"cssnano": "4.1.10",
|
||||
"d3": "^3.5.17",
|
||||
"dayjs": "^1.7.8",
|
||||
"echarts": "^4.1.0",
|
||||
"env-parse": "^1.0.5",
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"file-loader": "^1.1.11",
|
||||
"globby": "^8.0.1",
|
||||
"html-loader": "^0.5.5",
|
||||
"html-webpack-ext-plugin": "^1.0.0",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"html2canvas": "^0.5.0-beta4",
|
||||
"jsplumb": "^2.8.6",
|
||||
"lodash": "^4.17.11",
|
||||
"node-sass": "^4.9.2",
|
||||
"optimize-css-assets-webpack-plugin": "3.2.0",
|
||||
"postcss-loader": "^2.1.6",
|
||||
"rimraf": "^2.6.2",
|
||||
"sass-loader": "^7.1.0",
|
||||
"uglifyjs-webpack-plugin": "^1.2.7",
|
||||
"url-loader": "^0.5.9",
|
||||
"vue-loader": "^13.7.0",
|
||||
"vue-style-loader": "^4.1.1",
|
||||
"vue-template-compiler": "^2.5.16",
|
||||
"vuex-router-sync": "^4.1.2",
|
||||
"webpack": "^3.12.0",
|
||||
"webpack-dev-server": "^2.11.2",
|
||||
"webpack-merge": "^4.1.4"
|
||||
"vuex-router-sync": "^4.1.2"
|
||||
},
|
||||
"standard": {
|
||||
"parser": "babel-eslint",
|
||||
|
|
@ -75,9 +43,41 @@
|
|||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"jquery": "1.12.4",
|
||||
"vue": "^2.5.17",
|
||||
"vue-router": "2.7.0",
|
||||
"vuex": "^3.0.0"
|
||||
"autoprefixer": "^9.1.0",
|
||||
"babel-core": "^6.25.0",
|
||||
"babel-eslint": "^8.2.2",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.2",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-plugin-transform-runtime": "^6.23.0",
|
||||
"babel-plugin-transform-vue-jsx": "^3.5.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"css-loader": "^0.28.8",
|
||||
"html-loader": "^0.5.5",
|
||||
"html-webpack-ext-plugin": "^1.0.0",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"env-parse": "^1.0.5",
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"file-loader": "^1.1.11",
|
||||
"node-sass": "^4.9.2",
|
||||
"optimize-css-assets-webpack-plugin": "3.2.0",
|
||||
"postcss-loader": "^2.1.6",
|
||||
"rimraf": "^2.6.2",
|
||||
"sass-loader": "^7.1.0",
|
||||
"uglifyjs-webpack-plugin": "^1.2.7",
|
||||
"url-loader": "^0.5.9",
|
||||
"vue-loader": "^13.7.0",
|
||||
"vue-style-loader": "^4.1.1",
|
||||
"vue-template-compiler": "^2.5.16",
|
||||
"webpack": "^3.12.0",
|
||||
"webpack-dev-server": "^2.11.2",
|
||||
"webpack-merge": "^4.1.4",
|
||||
"globby": "^8.0.1",
|
||||
"cssnano": "4.1.10",
|
||||
"cross-env": "^5.2.0",
|
||||
"copy-webpack-plugin": "^4.5.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
background: url("../img/toolbar_SPARK.png") no-repeat 50% 50%;
|
||||
}
|
||||
.icos-FLINK {
|
||||
background: url("../img/toobar_flink.png") no-repeat 50% 50%;
|
||||
background: url("../img/toobar_FLINK.png") no-repeat 50% 50%;
|
||||
}
|
||||
.icos-MR {
|
||||
background: url("../img/toolbar_MR.png") no-repeat 50% 50%;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
:id="v"
|
||||
v-for="(item,v) in tasksTypeList"
|
||||
@mousedown="_getDagId(v)">
|
||||
<div data-toggle="tooltip" :title="item.desc">
|
||||
<div data-toggle="tooltip" :title="item.description">
|
||||
<div class="icos" :class="'icos-' + v" ></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
:class="_operationClass(item)"
|
||||
:id="item.code"
|
||||
@click="_ckOperation(item,$event)">
|
||||
<i class="iconfont" v-html="item.icon" data-toggle="tooltip" :title="item.desc" ></i>
|
||||
<i class="iconfont" v-html="item.icon" data-toggle="tooltip" :title="item.description" ></i>
|
||||
</a>
|
||||
</div>
|
||||
<x-button
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- desc -->
|
||||
<!-- description -->
|
||||
<div class="clearfix list">
|
||||
<div class="text-box">
|
||||
<span>{{$t('Description')}}</span>
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
:autosize="{minRows:2}"
|
||||
type="textarea"
|
||||
:disabled="isDetails"
|
||||
v-model="desc"
|
||||
v-model="description"
|
||||
:placeholder="$t('Please enter description')"
|
||||
autocomplete="off">
|
||||
</x-input>
|
||||
|
|
@ -229,8 +229,8 @@
|
|||
spinnerLoading: false,
|
||||
// node name
|
||||
name: ``,
|
||||
// desc
|
||||
desc: '',
|
||||
// description
|
||||
description: '',
|
||||
// Node echo data
|
||||
backfillItem: {},
|
||||
// Resource(list)
|
||||
|
|
@ -377,7 +377,7 @@
|
|||
id: this.id,
|
||||
name: this.name,
|
||||
params: this.params,
|
||||
desc: this.desc,
|
||||
description: this.description,
|
||||
runFlag: this.runFlag,
|
||||
dependence: this.dependence,
|
||||
maxRetryTimes: this.maxRetryTimes,
|
||||
|
|
@ -452,7 +452,7 @@
|
|||
this.name = o.name
|
||||
this.taskInstancePriority = o.taskInstancePriority
|
||||
this.runFlag = o.runFlag || 'NORMAL'
|
||||
this.desc = o.desc
|
||||
this.description = o.description
|
||||
this.maxRetryTimes = o.maxRetryTimes
|
||||
this.retryInterval = o.retryInterval
|
||||
this.workerGroupId = o.workerGroupId
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ DownChart.prototype.maxVal = function () {
|
|||
let x = parseInt(_.maxBy(tasksAllList, 'x').x + 100)
|
||||
|
||||
resolve({
|
||||
width: x > 600 ? x : dom.width(),
|
||||
width: (x > 600 ? x : dom.width()) + 100,
|
||||
height: (y > 500 ? y : dom.height()) + 100
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -48,10 +48,20 @@
|
|||
prop: 'value',
|
||||
event: 'tenantSelectEvent'
|
||||
},
|
||||
mounted() {
|
||||
let result = this.itemList.some(item=>{
|
||||
if(item.id == this.value) {
|
||||
return true
|
||||
}
|
||||
})
|
||||
if(!result) {
|
||||
this.value = -1
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
_onChange (o) {
|
||||
this.value = o.value
|
||||
this.$emit('tenantSelectEvent', o.value)
|
||||
// this.$emit('tenantSelectEvent', o.value)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<div style="padding-top: 12px;">
|
||||
<x-input
|
||||
type="textarea"
|
||||
v-model="desc"
|
||||
v-model="description"
|
||||
:autosize="{minRows:2}"
|
||||
:placeholder="$t('Please enter description(optional)')"
|
||||
autocomplete="off">
|
||||
|
|
@ -101,8 +101,8 @@
|
|||
return {
|
||||
// dag name
|
||||
name: '',
|
||||
// dag desc
|
||||
desc: '',
|
||||
// dag description
|
||||
description: '',
|
||||
// Global custom parameters
|
||||
udpList: [],
|
||||
// Global custom parameters
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
this.store.commit('dag/setName', _.cloneDeep(this.name))
|
||||
this.store.commit('dag/setTimeout', _.cloneDeep(this.timeout))
|
||||
this.store.commit('dag/setTenantId', _.cloneDeep(this.tenantId))
|
||||
this.store.commit('dag/setDesc', _.cloneDeep(this.desc))
|
||||
this.store.commit('dag/setDesc', _.cloneDeep(this.description))
|
||||
this.store.commit('dag/setSyncDefine', this.syncDefine)
|
||||
},
|
||||
/**
|
||||
|
|
@ -201,7 +201,7 @@
|
|||
this.udpList = dag.globalParams
|
||||
this.udpListCache = dag.globalParams
|
||||
this.name = dag.name
|
||||
this.desc = dag.desc
|
||||
this.description = dag.description
|
||||
this.syncDefine = dag.syncDefine
|
||||
this.timeout = dag.timeout || 0
|
||||
this.checkedTimeout = this.timeout !== 0
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@
|
|||
type: 'MYSQL',
|
||||
// name
|
||||
name: '',
|
||||
// desc
|
||||
// description
|
||||
note: '',
|
||||
// host
|
||||
host: '',
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
</m-tooltips-JSON>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="item.note" class="ellipsis" v-tooltip="item.note">{{item.note}}</span>
|
||||
<span v-if="item.note" class="ellipsis" v-tooltip.large.top.start="{text: item.note, maxWidth: '500px'}">{{item.note}}</span>
|
||||
<span v-else>-</span>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@
|
|||
<span v-else>-</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="item.desc" class="ellipsis" v-tooltip="item.desc">{{item.desc}}</span>
|
||||
<span v-if="item.description" class="ellipsis" v-tooltip.large.top.start="{text: item.description, maxWidth: '500px'}">{{item.description}}</span>
|
||||
<span v-else>-</span>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import { tasksState } from '@/conf/home/pages/dag/_source/config'
|
|||
* Node prompt dom
|
||||
*/
|
||||
const rtInstancesTooltip = (data) => {
|
||||
let str = `<div style="text-align: left;">`
|
||||
let str = `<div style="text-align: left;word-break:break-all">`
|
||||
str += `id : ${data.id}</br>`
|
||||
str += `host : ${data.host}</br>`
|
||||
str += `name : ${data.name}</br>`
|
||||
|
|
@ -30,8 +30,8 @@ const rtInstancesTooltip = (data) => {
|
|||
if (data.type) {
|
||||
str += `type : ${data.type}</br>`
|
||||
}
|
||||
str += `startTime : ${data.startTime ? formatDate(data.startTime) : 'null'}</br>`
|
||||
str += `endTime : ${data.endTime ? formatDate(data.endTime) : 'null'}</br>`
|
||||
str += `startTime : ${data.startTime ? formatDate(data.startTime) : '-'}</br>`
|
||||
str += `endTime : ${data.endTime ? formatDate(data.endTime) : '-'}</br>`
|
||||
str += `duration : ${data.duration}</br>`
|
||||
str += `</div>`
|
||||
return str
|
||||
|
|
|
|||
|
|
@ -166,15 +166,12 @@ Gantt.prototype.drawChart = function () {
|
|||
* tip提示
|
||||
*/
|
||||
Gantt.prototype.tip = function (d) {
|
||||
let str = ''
|
||||
str += `<div class="d3-toottip">`
|
||||
str += `<ul>`
|
||||
str += `<li><span class="sp1">taskName :</span><span>${d.taskName}</span></li>`
|
||||
str += `<li><span class="sp1">status :</span><span>${tasksState[d.status].desc} (${d.status})</span></li>`
|
||||
str += `<li><span class="sp1">startTime :</span><span>${formatDate(d.isoStart)}</span></li>`
|
||||
str += `<li><span class="sp1">endTime :</span><span>${formatDate(d.isoEnd)}</span></li>`
|
||||
str += `<li><span class="sp1">duration :</span><span>${d.duration}</span></li>`
|
||||
str += `</ul>`
|
||||
let str = `<div style="text-align: left;word-break:break-all">`
|
||||
str += `taskName : ${d.taskName}</br>`
|
||||
str += `status : ${tasksState[d.status].desc} (${d.status})</br>`
|
||||
str += `startTime : ${formatDate(d.isoStart)}</br>`
|
||||
str += `endTime : ${formatDate(d.isoEnd)}</br>`
|
||||
str += `duration : ${d.duration}</br>`
|
||||
str += `</div>`
|
||||
return str
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@
|
|||
shape="circle"
|
||||
size="xsmall"
|
||||
data-toggle="tooltip"
|
||||
:disabled="item.state === 'RUNNING_EXEUTION'"
|
||||
:disabled="item.state !== 'SUCCESS' && item.state !== 'FAILURE' && item.state !== 'STOP' && item.state !== 'PAUSE'"
|
||||
:title="$t('delete')">
|
||||
</x-button>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<template slot="content">
|
||||
<x-input
|
||||
type="textarea"
|
||||
v-model="desc"
|
||||
v-model="description"
|
||||
:placeholder="$t('Please enter description')"
|
||||
autocomplete="off">
|
||||
</x-input>
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
data () {
|
||||
return {
|
||||
store,
|
||||
desc: '',
|
||||
description: '',
|
||||
projectName: ''
|
||||
}
|
||||
},
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
|
||||
let param = {
|
||||
projectName: _.trim(this.projectName),
|
||||
desc: _.trim(this.desc)
|
||||
description: _.trim(this.description)
|
||||
}
|
||||
|
||||
// edit
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
created () {
|
||||
if (this.item) {
|
||||
this.projectName = this.item.name
|
||||
this.desc = this.item.desc
|
||||
this.description = this.item.description
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<template>
|
||||
<div class="list-model">
|
||||
<div class="table-box">
|
||||
<table>
|
||||
<table class="fixed">
|
||||
<tr>
|
||||
<th>
|
||||
<span>{{$t('#')}}</span>
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
<span>{{item.instRunningCount}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="item.desc" class="ellipsis" v-tooltip="item.desc">{{item.desc}}</span>
|
||||
<span v-if="item.description" class="ellipsis" v-tooltip.large.top.start="{text: item.description, maxWidth: '500px'}">{{item.description}}</span>
|
||||
<span v-else>-</span>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
<span>{{parseInt(pageNo === 1 ? ($index + 1) : (($index + 1) + (pageSize * (pageNo - 1))))}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="ellipsis">{{item.name}}</span>
|
||||
<span class="ellipsis" :title="item.name">{{item.name}}</span>
|
||||
</td>
|
||||
<td><a href="javascript:" class="links" @click="_go(item)"><span class="ellipsis">{{item.processInstanceName}}</span></a></td>
|
||||
<td><span>{{item.taskType}}</span></td>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
<template slot="content">
|
||||
<x-input
|
||||
type="textarea"
|
||||
v-model="desc"
|
||||
v-model="description"
|
||||
style="width: 430px;"
|
||||
:placeholder="$t('Please enter description')"
|
||||
autocomplete="off">
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
return {
|
||||
suffix: 'sh',
|
||||
fileName: '',
|
||||
desc: '',
|
||||
description: '',
|
||||
fileTypeList: filtTypeArr,
|
||||
content: '',
|
||||
spinnerLoading: false
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
type: 'FILE',
|
||||
fileName: this.fileName,
|
||||
suffix: this.suffix,
|
||||
desc: this.desc,
|
||||
description: this.description,
|
||||
content: editor.getValue()
|
||||
}).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
</td>
|
||||
<td><span class="ellipsis">{{item.fileName}}</span></td>
|
||||
<td>
|
||||
<span v-if="item.description" class="ellipsis" v-tooltip="item.description">{{item.description}}</span>
|
||||
<span v-if="item.description" class="ellipsis" v-tooltip.large.top.start="{text: item.description, maxWidth: '500px'}">{{item.description}}</span>
|
||||
<span v-else>-</span>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<template slot="content">
|
||||
<x-input
|
||||
type="textarea"
|
||||
v-model="desc"
|
||||
v-model="description"
|
||||
:placeholder="$t('Please enter description')"
|
||||
autocomplete="off">
|
||||
</x-input>
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
data () {
|
||||
return {
|
||||
store,
|
||||
desc: '',
|
||||
description: '',
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
this._verification().then(res => {
|
||||
if (this.name === this.item.alias) {
|
||||
return new Promise((resolve,reject) => {
|
||||
this.desc === this.item.desc ? reject({msg:'内容未修改'}) : resolve()
|
||||
this.description === this.item.description ? reject({msg:'内容未修改'}) : resolve()
|
||||
})
|
||||
}else{
|
||||
return this.store.dispatch('resource/resourceVerifyName', {
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
}).then(res => {
|
||||
return this.store.dispatch('resource/resourceRename', {
|
||||
name: this.name,
|
||||
desc: this.desc,
|
||||
description: this.description,
|
||||
id: this.item.id,
|
||||
type: 'FILE'
|
||||
})
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
let item = this.item || {}
|
||||
if (item) {
|
||||
this.name = item.alias
|
||||
this.desc = item.desc
|
||||
this.description = item.description
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@
|
|||
<template slot="content">
|
||||
<x-input
|
||||
type="textarea"
|
||||
v-model="desc"
|
||||
v-model="description"
|
||||
:placeholder="$t('Please enter a instructions')">
|
||||
</x-input>
|
||||
</template>
|
||||
|
|
@ -128,7 +128,7 @@
|
|||
className: '',
|
||||
argTypes: '',
|
||||
database: '',
|
||||
desc: '',
|
||||
description: '',
|
||||
resourceId: {},
|
||||
udfResourceList: [],
|
||||
isUpdate: false,
|
||||
|
|
@ -164,7 +164,7 @@
|
|||
className: this.className,
|
||||
argTypes: this.argTypes, // Can not pass this parameter
|
||||
database: this.database, // Can not pass this parameter
|
||||
desc: this.desc,
|
||||
description: this.description,
|
||||
resourceId: this.resourceId.id
|
||||
}
|
||||
|
||||
|
|
@ -267,7 +267,7 @@
|
|||
this.className = this.item.className || ''
|
||||
this.argTypes = this.item.argTypes || ''
|
||||
this.database = this.item.database || ''
|
||||
this.desc = this.item.desc || ''
|
||||
this.description = this.item.description || ''
|
||||
this.resourceId = _.filter(this.udfResourceList, v => v.id === this.item.resourceId)[0]
|
||||
} else {
|
||||
this.resourceId = this.udfResourceList.length && this.udfResourceList[0] || []
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ v-ps<template>
|
|||
<span>{{item.type}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="item.description" class="ellipsis" v-tooltip="item.description">{{item.description}}</span>
|
||||
<span v-if="item.description" class="ellipsis" v-tooltip.large.top.start="{text: item.description, maxWidth: '500px'}">{{item.description}}</span>
|
||||
<span v-else>-</span>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue