fix: 兼容之前的sessiondetail

This commit is contained in:
Jiangjie.Bai
2022-03-17 14:04:02 +08:00
committed by Jiangjie.Bai
parent fbed123991
commit df98ce3a6f
2 changed files with 15 additions and 4 deletions

View File

@@ -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 })
}
}
]

View File

@@ -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}/`
}