Browse Source

[Improvement-5094][UI] Improve to add a main switch for refresh_in_switched_tab (#5095)

pull/3/MERGE
Shiwen Cheng 4 years ago committed by GitHub
parent
commit
91c29e6ca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-ui/src/js/conf/home/App.vue
  2. 83
      dolphinscheduler-ui/src/js/conf/home/router/index.js
  3. 4
      dolphinscheduler-ui/src/lib/external/config.js

2
dolphinscheduler-ui/src/js/conf/home/App.vue

@ -42,7 +42,7 @@
}, },
mounted () { mounted () {
visibility.change((evt, hidden) => { visibility.change((evt, hidden) => {
if (hidden === false && this.$route.meta.refresh_in_switched_tab) { if (hidden === false && this.$route.meta.refreshInSwitchedTab) {
this.reload() this.reload()
} }
}) })

83
dolphinscheduler-ui/src/js/conf/home/router/index.js

@ -17,6 +17,7 @@
import Vue from 'vue' import Vue from 'vue'
import i18n from '@/module/i18n/index.js' import i18n from '@/module/i18n/index.js'
import config from '~/external/config'
import Router from 'vue-router' import Router from 'vue-router'
Vue.use(Router) Vue.use(Router)
@ -36,7 +37,7 @@ const router = new Router({
component: resolve => require(['../pages/home/index'], resolve), component: resolve => require(['../pages/home/index'], resolve),
meta: { meta: {
title: `${i18n.$t('Home')} - DolphinScheduler`, title: `${i18n.$t('Home')} - DolphinScheduler`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -50,13 +51,22 @@ const router = new Router({
name: 'projects-list' name: 'projects-list'
}, },
children: [ children: [
{
path: '/projects/list',
name: 'projects-list',
component: resolve => require(['../pages/projects/pages/list/index'], resolve),
meta: {
title: `${i18n.$t('Project')}`,
refreshInSwitchedTab: config.refreshInSwitchedTab
}
},
{ {
path: '/projects/index', path: '/projects/index',
name: 'projects-index', name: 'projects-index',
component: resolve => require(['../pages/projects/pages/index/index'], resolve), component: resolve => require(['../pages/projects/pages/index/index'], resolve),
meta: { meta: {
title: `${i18n.$t('Project Home')}`, title: `${i18n.$t('Project Home')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -65,16 +75,7 @@ const router = new Router({
component: resolve => require(['../pages/projects/pages/kinship/index'], resolve), component: resolve => require(['../pages/projects/pages/kinship/index'], resolve),
meta: { meta: {
title: `${i18n.$t('Kinship')}`, title: `${i18n.$t('Kinship')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
}
},
{
path: '/projects/list',
name: 'projects-list',
component: resolve => require(['../pages/projects/pages/list/index'], resolve),
meta: {
title: `${i18n.$t('Project')}`,
refresh_in_switched_tab: true
} }
}, },
{ {
@ -83,7 +84,7 @@ const router = new Router({
component: resolve => require(['../pages/projects/pages/definition/index'], resolve), component: resolve => require(['../pages/projects/pages/definition/index'], resolve),
meta: { meta: {
title: `${i18n.$t('Process definition')}`, title: `${i18n.$t('Process definition')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
}, },
redirect: { redirect: {
name: 'projects-definition-list' name: 'projects-definition-list'
@ -95,7 +96,7 @@ const router = new Router({
component: resolve => require(['../pages/projects/pages/definition/pages/list/index'], resolve), component: resolve => require(['../pages/projects/pages/definition/pages/list/index'], resolve),
meta: { meta: {
title: `${i18n.$t('Process definition')}`, title: `${i18n.$t('Process definition')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -104,7 +105,7 @@ const router = new Router({
component: resolve => require(['../pages/projects/pages/definition/pages/details/index'], resolve), component: resolve => require(['../pages/projects/pages/definition/pages/details/index'], resolve),
meta: { meta: {
title: `${i18n.$t('Process definition details')}`, title: `${i18n.$t('Process definition details')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -121,7 +122,7 @@ const router = new Router({
component: resolve => require(['../pages/projects/pages/definition/pages/tree/index'], resolve), component: resolve => require(['../pages/projects/pages/definition/pages/tree/index'], resolve),
meta: { meta: {
title: `${i18n.$t('TreeView')}`, title: `${i18n.$t('TreeView')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -130,7 +131,7 @@ const router = new Router({
component: resolve => require(['../pages/projects/pages/definition/timing/index'], resolve), component: resolve => require(['../pages/projects/pages/definition/timing/index'], resolve),
meta: { meta: {
title: `${i18n.$t('Scheduled task list')}`, title: `${i18n.$t('Scheduled task list')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
} }
] ]
@ -152,7 +153,7 @@ const router = new Router({
component: resolve => require(['../pages/projects/pages/instance/pages/list/index'], resolve), component: resolve => require(['../pages/projects/pages/instance/pages/list/index'], resolve),
meta: { meta: {
title: `${i18n.$t('Process Instance')}`, title: `${i18n.$t('Process Instance')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -161,7 +162,7 @@ const router = new Router({
component: resolve => require(['../pages/projects/pages/instance/pages/details/index'], resolve), component: resolve => require(['../pages/projects/pages/instance/pages/details/index'], resolve),
meta: { meta: {
title: `${i18n.$t('Process instance details')}`, title: `${i18n.$t('Process instance details')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -170,7 +171,7 @@ const router = new Router({
component: resolve => require(['../pages/projects/pages/instance/pages/gantt/index'], resolve), component: resolve => require(['../pages/projects/pages/instance/pages/gantt/index'], resolve),
meta: { meta: {
title: `${i18n.$t('Gantt')}`, title: `${i18n.$t('Gantt')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
} }
] ]
@ -181,7 +182,7 @@ const router = new Router({
component: resolve => require(['../pages/projects/pages/taskInstance'], resolve), component: resolve => require(['../pages/projects/pages/taskInstance'], resolve),
meta: { meta: {
title: `${i18n.$t('Task Instance')}`, title: `${i18n.$t('Task Instance')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
@ -191,7 +192,7 @@ const router = new Router({
component: resolve => require(['../pages/projects/pages/taskRecord'], resolve), component: resolve => require(['../pages/projects/pages/taskRecord'], resolve),
meta: { meta: {
title: `${i18n.$t('Task record')}`, title: `${i18n.$t('Task record')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -200,7 +201,7 @@ const router = new Router({
component: resolve => require(['../pages/projects/pages/historyTaskRecord'], resolve), component: resolve => require(['../pages/projects/pages/historyTaskRecord'], resolve),
meta: { meta: {
title: `${i18n.$t('History task record')}`, title: `${i18n.$t('History task record')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
} }
@ -215,7 +216,7 @@ const router = new Router({
}, },
meta: { meta: {
title: `${i18n.$t('Resources')}`, title: `${i18n.$t('Resources')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
}, },
children: [ children: [
{ {
@ -224,7 +225,7 @@ const router = new Router({
component: resolve => require(['../pages/resource/pages/file/pages/list/index'], resolve), component: resolve => require(['../pages/resource/pages/file/pages/list/index'], resolve),
meta: { meta: {
title: `${i18n.$t('File Manage')}`, title: `${i18n.$t('File Manage')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -249,7 +250,7 @@ const router = new Router({
component: resolve => require(['../pages/resource/pages/file/pages/subFileFolder/index'], resolve), component: resolve => require(['../pages/resource/pages/file/pages/subFileFolder/index'], resolve),
meta: { meta: {
title: `${i18n.$t('Create Resource')}`, title: `${i18n.$t('Create Resource')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -258,7 +259,7 @@ const router = new Router({
component: resolve => require(['../pages/resource/pages/file/pages/subFile/index'], resolve), component: resolve => require(['../pages/resource/pages/file/pages/subFile/index'], resolve),
meta: { meta: {
title: `${i18n.$t('Create Resource')}`, title: `${i18n.$t('Create Resource')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -267,7 +268,7 @@ const router = new Router({
component: resolve => require(['../pages/resource/pages/file/pages/details/index'], resolve), component: resolve => require(['../pages/resource/pages/file/pages/details/index'], resolve),
meta: { meta: {
title: `${i18n.$t('File Details')}`, title: `${i18n.$t('File Details')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -276,7 +277,7 @@ const router = new Router({
component: resolve => require(['../pages/resource/pages/file/pages/subdirectory/index'], resolve), component: resolve => require(['../pages/resource/pages/file/pages/subdirectory/index'], resolve),
meta: { meta: {
title: `${i18n.$t('File Manage')}`, title: `${i18n.$t('File Manage')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -293,7 +294,7 @@ const router = new Router({
component: resolve => require(['../pages/resource/pages/udf/index'], resolve), component: resolve => require(['../pages/resource/pages/udf/index'], resolve),
meta: { meta: {
title: `${i18n.$t('UDF manage')}`, title: `${i18n.$t('UDF manage')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
}, },
children: [ children: [
{ {
@ -302,7 +303,7 @@ const router = new Router({
component: resolve => require(['../pages/resource/pages/udf/pages/resource/index'], resolve), component: resolve => require(['../pages/resource/pages/udf/pages/resource/index'], resolve),
meta: { meta: {
title: `${i18n.$t('UDF Resources')}`, title: `${i18n.$t('UDF Resources')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -311,7 +312,7 @@ const router = new Router({
component: resolve => require(['../pages/resource/pages/udf/pages/subUdfDirectory/index'], resolve), component: resolve => require(['../pages/resource/pages/udf/pages/subUdfDirectory/index'], resolve),
meta: { meta: {
title: `${i18n.$t('UDF Resources')}`, title: `${i18n.$t('UDF Resources')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -388,7 +389,7 @@ const router = new Router({
component: resolve => require(['../pages/security/pages/users/index'], resolve), component: resolve => require(['../pages/security/pages/users/index'], resolve),
meta: { meta: {
title: `${i18n.$t('User Manage')}`, title: `${i18n.$t('User Manage')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -487,7 +488,7 @@ const router = new Router({
component: resolve => require(['../pages/monitor/pages/servers/master'], resolve), component: resolve => require(['../pages/monitor/pages/servers/master'], resolve),
meta: { meta: {
title: `${i18n.$t('Service-Master')}`, title: `${i18n.$t('Service-Master')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -496,7 +497,7 @@ const router = new Router({
component: resolve => require(['../pages/monitor/pages/servers/worker'], resolve), component: resolve => require(['../pages/monitor/pages/servers/worker'], resolve),
meta: { meta: {
title: `${i18n.$t('Service-Worker')}`, title: `${i18n.$t('Service-Worker')}`,
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -505,7 +506,7 @@ const router = new Router({
component: resolve => require(['../pages/monitor/pages/servers/alert'], resolve), component: resolve => require(['../pages/monitor/pages/servers/alert'], resolve),
meta: { meta: {
title: 'Alert', title: 'Alert',
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -514,7 +515,7 @@ const router = new Router({
component: resolve => require(['../pages/monitor/pages/servers/rpcserver'], resolve), component: resolve => require(['../pages/monitor/pages/servers/rpcserver'], resolve),
meta: { meta: {
title: 'Rpcserver', title: 'Rpcserver',
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -523,7 +524,7 @@ const router = new Router({
component: resolve => require(['../pages/monitor/pages/servers/zookeeper'], resolve), component: resolve => require(['../pages/monitor/pages/servers/zookeeper'], resolve),
meta: { meta: {
title: 'Zookeeper', title: 'Zookeeper',
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -532,7 +533,7 @@ const router = new Router({
component: resolve => require(['../pages/monitor/pages/servers/apiserver'], resolve), component: resolve => require(['../pages/monitor/pages/servers/apiserver'], resolve),
meta: { meta: {
title: 'Apiserver', title: 'Apiserver',
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -541,7 +542,7 @@ const router = new Router({
component: resolve => require(['../pages/monitor/pages/servers/db'], resolve), component: resolve => require(['../pages/monitor/pages/servers/db'], resolve),
meta: { meta: {
title: 'DB', title: 'DB',
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
}, },
{ {
@ -550,7 +551,7 @@ const router = new Router({
component: resolve => require(['../pages/monitor/pages/servers/statistics'], resolve), component: resolve => require(['../pages/monitor/pages/servers/statistics'], resolve),
meta: { meta: {
title: 'statistics', title: 'statistics',
refresh_in_switched_tab: true refreshInSwitchedTab: config.refreshInSwitchedTab
} }
} }
] ]

4
dolphinscheduler-ui/src/lib/external/config.js vendored

@ -19,5 +19,7 @@
*/ */
export default { export default {
// task record switch // task record switch
recordSwitch: false recordSwitch: false,
// refresh in switched tab
refreshInSwitchedTab: false
} }

Loading…
Cancel
Save