diff --git a/src/router/common.js b/src/router/common.js index 3b5576dfb..208bc277d 100644 --- a/src/router/common.js +++ b/src/router/common.js @@ -24,5 +24,16 @@ export default [ title: i18n.t('route.CeleryTaskLog'), permissions: [] } + }, + { + path: '/terminal/sessions/:id', + name: 'OldSessionDetail', + meta: { + permissions: ['terminal.view_session'] + }, + hidden: true, + beforeEnter: (to, from, next) => { + next({ name: 'SessionDetail', params: to.params, query: to.query }) + } } ] diff --git a/src/utils/common.js b/src/utils/common.js index 00670cbb9..68b14aeed 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -105,12 +105,12 @@ export function getApiPath(that) { } else if (pagePathArray.indexOf('gathered-user') !== -1 || pagePathArray.indexOf('change-auth-plan') !== -1) { pagePathArray[pagePathArray.indexOf('accounts')] = 'xpack' } - if (pagePathArray.indexOf('view') !== -1) { - // view console - pagePath = pagePathArray.slice(2, pagePathArray.length).join('/') - } else { + if (pagePathArray.indexOf('tickets') !== -1) { // ticket ... pagePath = pagePathArray.slice(1, pagePathArray.length).join('/') + } else { + // console,audit,workspace + pagePath = pagePathArray.slice(2, pagePathArray.length).join('/') } return `/api/v1/${pagePath}/` }