fix: 修复页面url跳转 任务日志页面跳转失败问题

This commit is contained in:
Bai 2023-02-22 15:28:14 +08:00 committed by Jiangjie.Bai
parent 08faad0f41
commit d6208eabd3
2 changed files with 6 additions and 5 deletions

View File

@ -17,14 +17,15 @@
</noscript> </noscript>
<script> <script>
window.onload = function() { window.onload = function() {
const baseUrl = "/ui/"
if (location.pathname === '/') { if (location.pathname === '/') {
location.pathname = baseUrl location.pathname = '/ui/'
} }
const origin = window.location.origin
const pathname = window.location.pathname const pathname = window.location.pathname
if (pathname.startsWith('/core')) {
return
}
if(pathname.indexOf('/ui') === -1) { if(pathname.indexOf('/ui') === -1) {
window.location.href = origin + '/ui/#' + pathname window.location.href = window.location.origin + '/ui/#' + pathname
} }
} }
</script> </script>

View File

@ -5,7 +5,7 @@ import { openWindow } from './common'
export function openTaskPage(taskId, taskType, taskUrl) { export function openTaskPage(taskId, taskType, taskUrl) {
taskType = taskType || 'celery' taskType = taskType || 'celery'
if (!taskUrl) { if (!taskUrl) {
taskUrl = `/#/ops/${taskType}/task/${taskId}/log/?type=${taskType}` taskUrl = `/core/ops/${taskType}/task/${taskId}/log/?type=${taskType}`
} }
openWindow(taskUrl) openWindow(taskUrl)
} }