@@ -16,10 +16,27 @@ import { dayjs } from '@tap/business/src/shared'
1616import { Modal } from ' @tap/component/src/modal'
1717import { useI18n } from ' @tap/i18n'
1818import { computed , onUnmounted , ref , watch } from ' vue'
19+ import { useRouter } from ' vue-router'
1920import TaskRebalanceDrawer from ' ../cluster/TaskRebalanceDrawer.vue'
2021
2122const { t } = useI18n ()
2223const $has = useHas ()
24+ const router = useRouter ()
25+
26+ const SYNC_TYPE_ROUTE_MAP: Record <string , string > = {
27+ sync: ' TaskMonitor' ,
28+ migrate: ' MigrationMonitor' ,
29+ logCollector: ' SharedMiningMonitor' ,
30+ mem_cache: ' SharedCacheMonitor' ,
31+ connHeartbeat: ' HeartbeatMonitor' ,
32+ }
33+
34+ function openTaskMonitor(taskId : string , syncType : string ) {
35+ const name = SYNC_TYPE_ROUTE_MAP [syncType ]
36+ if (! name ) return
37+ const { href } = router .resolve ({ name , params: { id: taskId } })
38+ window .open (href , ' _blank' )
39+ }
2340
2441const hasEditPermission = computed (() => {
2542 return $has (' v2_task_rebalance_Edit' )
@@ -620,10 +637,24 @@ onUnmounted(stopDetailPolling)
620637 >
621638 <el-table-column
622639 :label =" t('daas_task_rebalance_history_col_task')"
623- prop =" taskName"
624640 min-width =" 180"
625- show-overflow-tooltip
626- />
641+ >
642+ <template #default =" { row } " >
643+ <el-link
644+ v-if =" row.syncType"
645+ class =" task-name-link"
646+ :underline =" false"
647+ type =" primary"
648+ @click =" openTaskMonitor(row.taskId, row.syncType)"
649+ >
650+ <span class =" ellipsis" >{{ row.taskName }}</span >
651+ <el-icon class =" task-name-link__icon ml-1" >
652+ <i-lucide-external-link />
653+ </el-icon >
654+ </el-link >
655+ <span v-else class =" ellipsis" >{{ row.taskName }}</span >
656+ </template >
657+ </el-table-column >
627658 <el-table-column
628659 :label =" t('daas_task_rebalance_history_col_source')"
629660 min-width =" 140"
@@ -718,6 +749,22 @@ onUnmounted(stopDetailPolling)
718749</template >
719750
720751<style lang="scss" scoped>
752+ .task-name-link {
753+ max-width : 100% ;
754+ display : inline-flex ;
755+ align-items : center ;
756+
757+ & __icon {
758+ flex-shrink : 0 ;
759+ opacity : 0 ;
760+ transition : opacity 0.15s ;
761+ }
762+
763+ & :hover .task-name-link__icon {
764+ opacity : 1 ;
765+ }
766+ }
767+
721768.stat-card {
722769 border : 1px solid var (--el-border-color-lighter );
723770 background-color : var (--el-bg-color );
0 commit comments