From 3e467dff2211e6c88a2ecfcf2b851964682881e1 Mon Sep 17 00:00:00 2001 From: break60 <790061044@qq.com> Date: Mon, 25 Jan 2021 15:08:25 +0800 Subject: [PATCH 1/5] [Improvement-4556][ui]Repair the workflow instance, click the browser to return to the previous page, always start the query from the first page --- .../pages/projects/pages/instance/pages/list/index.vue | 1 + dolphinscheduler-ui/src/js/module/util/routerUtil.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/index.vue index 162df69d7e..05b905ac8b 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/index.vue @@ -95,6 +95,7 @@ * Query */ _onQuery (o) { + this.searchParams.pageNo = 1 this.searchParams = _.assign(this.searchParams, o) setUrlParams(this.searchParams) this._debounceGET() diff --git a/dolphinscheduler-ui/src/js/module/util/routerUtil.js b/dolphinscheduler-ui/src/js/module/util/routerUtil.js index a4a70520ae..1274a590cd 100644 --- a/dolphinscheduler-ui/src/js/module/util/routerUtil.js +++ b/dolphinscheduler-ui/src/js/module/util/routerUtil.js @@ -14,9 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import merge from 'webpack-merge' +import router from '@/conf/home/router' export function setUrlParams (o) { - // router.push({ - // query: merge(router.history.current.query, o) - // }) + router.push({ + query: merge(router.history.current.query, o) + }) } From 891df6d5e29ce9c3a09aaf11cdf96ab31f64ff31 Mon Sep 17 00:00:00 2001 From: zhuangchong <37063904+zhuangchong@users.noreply.github.com> Date: Mon, 25 Jan 2021 19:38:53 +0800 Subject: [PATCH 2/5] fix schema 1.4.0 (#4564) --- .../mysql/dolphinscheduler_ddl.sql | 111 +++++++++++++++--- .../postgresql/dolphinscheduler_ddl.sql | 96 ++++++++++++--- 2 files changed, 177 insertions(+), 30 deletions(-) diff --git a/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql b/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql index 60b354fdf7..b92b5cf87f 100644 --- a/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql +++ b/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql @@ -16,6 +16,10 @@ */ SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); + +-- ---------------------------- +-- Table structure for t_ds_plugin_define +-- ---------------------------- DROP TABLE IF EXISTS `t_ds_plugin_define`; CREATE TABLE `t_ds_plugin_define` ( `id` int NOT NULL AUTO_INCREMENT, @@ -28,6 +32,13 @@ CREATE TABLE `t_ds_plugin_define` ( UNIQUE KEY `t_ds_plugin_define_UN` (`plugin_name`,`plugin_type`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +-- ---------------------------- +-- Records of t_ds_plugin_define +-- ---------------------------- + +-- ---------------------------- +-- Table structure for t_ds_alert_plugin_instance +-- ---------------------------- DROP TABLE IF EXISTS `t_ds_alert_plugin_instance`; CREATE TABLE `t_ds_alert_plugin_instance` ( `id` int NOT NULL AUTO_INCREMENT, @@ -39,31 +50,101 @@ CREATE TABLE `t_ds_alert_plugin_instance` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE t_ds_process_definition - ADD COLUMN `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id' AFTER `connects`; +-- ---------------------------- +-- Records of t_ds_alert_plugin_instance +-- ---------------------------- + +-- uc_dolphin_T_t_ds_process_definition_A_warning_group_id +drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_A_warning_group_id; +delimiter d// +CREATE PROCEDURE uc_dolphin_T_t_ds_process_definition_A_warning_group_id() + BEGIN + IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS + WHERE TABLE_NAME='t_ds_process_definition' + AND TABLE_SCHEMA=(SELECT DATABASE()) + AND COLUMN_NAME ='warning_group_id') + THEN + ALTER TABLE t_ds_process_definition ADD COLUMN `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id' AFTER `connects`; + END IF; + END; -ALTER TABLE t_ds_process_definition_version - ADD COLUMN `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id' AFTER `connects`; +d// -ALTER TABLE t_ds_alertgroup - ADD COLUMN `alert_instance_ids` varchar (255) DEFAULT NULL COMMENT 'alert instance ids' AFTER `id`, - ADD COLUMN `create_user_id` int(11) DEFAULT NULL COMMENT 'create user id' AFTER `alert_instance_ids`; +delimiter ; +CALL uc_dolphin_T_t_ds_process_definition_A_warning_group_id(); +DROP PROCEDURE uc_dolphin_T_t_ds_process_definition_A_warning_group_id; +-- uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id +drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id; +delimiter d// +CREATE PROCEDURE uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id() + BEGIN + IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS + WHERE TABLE_NAME='t_ds_process_definition_version' + AND TABLE_SCHEMA=(SELECT DATABASE()) + AND COLUMN_NAME ='warning_group_id') + THEN + ALTER TABLE t_ds_process_definition_version ADD COLUMN `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id' AFTER `connects`; + END IF; + END; + +d// + +delimiter ; +CALL uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id(); +DROP PROCEDURE uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id; + +-- uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids +drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids; +delimiter d// +CREATE PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids() + BEGIN + IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS + WHERE TABLE_NAME='t_ds_alertgroup' + AND TABLE_SCHEMA=(SELECT DATABASE()) + AND COLUMN_NAME ='alert_instance_ids') + THEN + ALTER TABLE t_ds_alertgroup ADD COLUMN `alert_instance_ids` varchar (255) DEFAULT NULL COMMENT 'alert instance ids' AFTER `id`; + END IF; + END; + +d// + +delimiter ; +CALL uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids(); +DROP PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids; + +-- uc_dolphin_T_t_ds_alertgroup_A_create_user_id +drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_alertgroup_A_create_user_id; +delimiter d// +CREATE PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_create_user_id() + BEGIN + IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS + WHERE TABLE_NAME='t_ds_alertgroup' + AND TABLE_SCHEMA=(SELECT DATABASE()) + AND COLUMN_NAME ='create_user_id') + THEN + ALTER TABLE t_ds_alertgroup ADD COLUMN `create_user_id` int(11) DEFAULT NULL COMMENT 'create user id' AFTER `alert_instance_ids`; + END IF; + END; + +d// + +delimiter ; +CALL uc_dolphin_T_t_ds_alertgroup_A_create_user_id(); +DROP PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_create_user_id; -- ---------------------------- -- These columns will not be used in the new version,if you determine that the historical data is useless, you can delete it using the sql below -- ---------------------------- -/* -ALTER TABLE t_ds_process_definition DROP receivers, DROP receivers_cc; -ALTER TABLE t_ds_process_definition_version DROP receivers, DROP receivers_cc; +-- ALTER TABLE t_ds_process_definition DROP receivers, DROP receivers_cc; -ALTER TABLE t_ds_alert DROP show_type,DROP alert_type,DROP receivers,DROP receivers_cc; +-- ALTER TABLE t_ds_process_definition_version DROP receivers, DROP receivers_cc; -ALTER TABLE t_ds_alertgroup DROP group_type; - -DROP TABLE IF EXISTS t_ds_relation_user_alertgroup; -*/ +-- ALTER TABLE t_ds_alert DROP show_type,DROP alert_type,DROP receivers,DROP receivers_cc; +-- ALTER TABLE t_ds_alertgroup DROP group_type; +-- DROP TABLE IF EXISTS t_ds_relation_user_alertgroup; diff --git a/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql b/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql index d7fa51d840..53a8c47d03 100644 --- a/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql +++ b/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql @@ -14,6 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +-- ---------------------------- +-- Table structure for t_ds_plugin_define +-- ---------------------------- DROP TABLE IF EXISTS t_ds_plugin_define; CREATE TABLE t_ds_plugin_define ( id serial NOT NULL, @@ -26,7 +30,9 @@ CREATE TABLE t_ds_plugin_define ( CONSTRAINT t_ds_plugin_define_un UNIQUE (plugin_name, plugin_type) ); - +-- ---------------------------- +-- Table structure for t_ds_alert_plugin_instance +-- ---------------------------- DROP TABLE IF EXISTS t_ds_alert_plugin_instance; CREATE TABLE t_ds_alert_plugin_instance ( id serial NOT NULL, @@ -38,28 +44,88 @@ CREATE TABLE t_ds_alert_plugin_instance ( CONSTRAINT t_ds_alert_plugin_instance_pk PRIMARY KEY (id) ); -ALTER TABLE t_ds_process_definition - ADD COLUMN `warning_group_id` int4 DEFAULT NULL COMMENT 'alert group id' AFTER `connects`; +-- uc_dolphin_T_t_ds_process_definition_A_warning_group_id +delimiter d// +CREATE OR REPLACE FUNCTION uc_dolphin_T_t_ds_process_definition_A_warning_group_id() RETURNS void AS $$ +BEGIN + IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS + WHERE TABLE_NAME='t_ds_process_definition' + AND COLUMN_NAME ='warning_group_id') + THEN + ALTER TABLE t_ds_process_definition ADD COLUMN `warning_group_id` int4 DEFAULT NULL COMMENT 'alert group id' AFTER `connects`; + END IF; +END; +$$ LANGUAGE plpgsql; +d// + +delimiter ; +SELECT uc_dolphin_T_t_ds_process_definition_A_warning_group_id(); +DROP FUNCTION IF EXISTS uc_dolphin_T_t_ds_process_definition_A_warning_group_id(); -ALTER TABLE t_ds_process_definition_version - ADD COLUMN `warning_group_id` int4 DEFAULT NULL COMMENT 'alert group id' AFTER `connects`; +-- uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id +delimiter d// +CREATE OR REPLACE FUNCTION uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id() RETURNS void AS $$ +BEGIN + IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS + WHERE TABLE_NAME='t_ds_process_definition_version' + AND COLUMN_NAME ='warning_group_id') + THEN + ALTER TABLE t_ds_process_definition_version ADD COLUMN `warning_group_id` int4 DEFAULT NULL COMMENT 'alert group id' AFTER `connects`; + END IF; +END; +$$ LANGUAGE plpgsql; +d// -ALTER TABLE t_ds_alertgroup - ADD COLUMN `alert_instance_ids` int4 DEFAULT NULL COMMENT 'alert instance ids' AFTER `id`; - ADD COLUMN `create_user_id` varchar(255) DEFAULT NULL COMMENT 'create user id' AFTER `alert_instance_ids`, +delimiter ; +SELECT uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id(); +DROP FUNCTION IF EXISTS uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id(); +-- uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids +delimiter d// +CREATE OR REPLACE FUNCTION uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids() RETURNS void AS $$ +BEGIN + IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS + WHERE TABLE_NAME='t_ds_alertgroup' + AND COLUMN_NAME ='alert_instance_ids') + THEN + ALTER TABLE t_ds_alertgroup ADD COLUMN `alert_instance_ids` varchar (255) DEFAULT NULL COMMENT 'alert instance ids' AFTER `id`; + END IF; +END; +$$ LANGUAGE plpgsql; +d// + +delimiter ; +SELECT uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids(); +DROP FUNCTION IF EXISTS uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids(); + +-- uc_dolphin_T_t_ds_alertgroup_A_create_user_id +delimiter d// +CREATE OR REPLACE FUNCTION uc_dolphin_T_t_ds_alertgroup_A_create_user_id() RETURNS void AS $$ +BEGIN + IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS + WHERE TABLE_NAME='t_ds_alertgroup' + AND COLUMN_NAME ='create_user_id') + THEN + ALTER TABLE t_ds_alertgroup ADD COLUMN `create_user_id` int4 DEFAULT NULL COMMENT 'create user id' AFTER `alert_instance_ids`; + END IF; +END; +$$ LANGUAGE plpgsql; +d// + +delimiter ; +SELECT uc_dolphin_T_t_ds_alertgroup_A_create_user_id(); +DROP FUNCTION IF EXISTS uc_dolphin_T_t_ds_alertgroup_A_create_user_id(); -- ---------------------------- -- These columns will not be used in the new version,if you determine that the historical data is useless, you can delete it using the sql below -- ---------------------------- -/* -ALTER TABLE t_ds_process_definition DROP COLUMN "receivers", DROP COLUMN "receivers_cc"; -ALTER TABLE t_ds_process_definition_version DROP COLUMN "receivers", DROP COLUMN "receivers_cc"; +-- ALTER TABLE t_ds_process_definition DROP COLUMN "receivers", DROP COLUMN "receivers_cc"; -ALTER TABLE t_ds_alert DROP COLUMN "show_type",DROP COLUMN "alert_type",DROP COLUMN "receivers",DROP COLUMN "receivers_cc"; +-- ALTER TABLE t_ds_process_definition_version DROP COLUMN "receivers", DROP COLUMN "receivers_cc"; -ALTER TABLE t_ds_alertgroup DROP COLUMN "group_type"; +-- ALTER TABLE t_ds_alert DROP COLUMN "show_type",DROP COLUMN "alert_type",DROP COLUMN "receivers",DROP COLUMN "receivers_cc"; -DROP TABLE IF EXISTS t_ds_relation_user_alertgroup; -*/ +-- ALTER TABLE t_ds_alertgroup DROP COLUMN "group_type"; + +-- DROP TABLE IF EXISTS t_ds_relation_user_alertgroup; From 843493804d347e9732ddf7c7dd66e8d5ae0a9d77 Mon Sep 17 00:00:00 2001 From: break60 <790061044@qq.com> Date: Tue, 26 Jan 2021 10:12:03 +0800 Subject: [PATCH 3/5] [fixbug-4570][ui] When deleting a workflow connection, all connections disappear --- .../conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js index 0037af68b6..e3e6a1feeb 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js @@ -627,6 +627,7 @@ JSP.prototype.saveStore = function () { tasks.push(tasksParam) } }) + console.log(store.state.dag.connects.length, this.JspInstance.getConnections().length) if (store.state.dag.connects.length === this.JspInstance.getConnections().length) { _.map(store.state.dag.connects, u => { connects.push({ @@ -658,6 +659,14 @@ JSP.prototype.saveStore = function () { label: v._jsPlumb.overlays.label.canvas.innerText }) }) + } else if (store.state.dag.connects.length > this.JspInstance.getConnections().length) { + _.map(this.JspInstance.getConnections(), v => { + connects.push({ + endPointSourceId: v.sourceId, + endPointTargetId: v.targetId, + label: v._jsPlumb.overlays.label.canvas.innerText + }) + }) } _.map(tasksAll(), v => { From b12e8a5390e913b57fce130d8f38de6af9082a36 Mon Sep 17 00:00:00 2001 From: break60 <790061044@qq.com> Date: Tue, 26 Jan 2021 10:13:02 +0800 Subject: [PATCH 4/5] fix --- .../src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js index e3e6a1feeb..b2772db913 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js @@ -627,7 +627,7 @@ JSP.prototype.saveStore = function () { tasks.push(tasksParam) } }) - console.log(store.state.dag.connects.length, this.JspInstance.getConnections().length) + if (store.state.dag.connects.length === this.JspInstance.getConnections().length) { _.map(store.state.dag.connects, u => { connects.push({ From fdfc9ac21554be3697f1541237cc29d3311a12ed Mon Sep 17 00:00:00 2001 From: break60 <790061044@qq.com> Date: Tue, 26 Jan 2021 10:13:36 +0800 Subject: [PATCH 5/5] fix --- .../src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js index b2772db913..1977a92409 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js @@ -627,7 +627,7 @@ JSP.prototype.saveStore = function () { tasks.push(tasksParam) } }) - + if (store.state.dag.connects.length === this.JspInstance.getConnections().length) { _.map(store.state.dag.connects, u => { connects.push({