@@ -72,6 +72,7 @@ const detailError = ref('')
7272const detailData = shallowRef <Record <string , unknown >>({})
7373const detailCache = new Map <string , Record <string , unknown >>()
7474const currentDetailKey = ref (' ' )
75+ const currentDetailType = ref (' ' )
7576const selectedNodeId = ref (' ' )
7677
7778const clearSelectedNode = () => {
@@ -86,6 +87,7 @@ watch(detailDrawerOpen, (open) => {
8687 if (! open ) {
8788 clearSelectedNode ()
8889 currentDetailKey .value = ' '
90+ currentDetailType .value = ' '
8991 }
9092})
9193
@@ -162,7 +164,9 @@ const StatefulNode = defineComponent({
162164})
163165
164166const detailTitle = computed (() => {
165- return currentDetailKey .value ? ` 服务详情:${currentDetailKey .value } ` : ' 服务详情'
167+ const type = String (currentDetailType .value ?? ' ' ).toLowerCase ()
168+ const base = type === ' application' ? ' 应用详情' : ' 服务详情'
169+ return currentDetailKey .value ? ` ${base }:${currentDetailKey .value } ` : base
166170})
167171
168172const detailEntries = computed (() => {
@@ -276,6 +280,11 @@ const renderTopology = (graphData: any) => {
276280 selectedNodeId .value = serviceName
277281 detailDrawerOpen .value = true
278282 currentDetailKey .value = serviceName
283+ currentDetailType .value = String (nodeData ?.type ?? ' ' )
284+ .toLowerCase ()
285+ .includes (' application' )
286+ ? ' application'
287+ : ' service'
279288 detailError .value = ' '
280289
281290 const cacheKey = ` ${serviceName } `
@@ -292,7 +301,12 @@ const renderTopology = (graphData: any) => {
292301 if (nodeData .type === ' application' ) {
293302 res = await getApplicationDetail (nodeData .id )
294303 } else if (nodeData .type === ' service' ) {
295- res = await getServiceDetail (nodeData .id )
304+ const splitParams = nodeData .id .split (' :' )
305+ res = await getServiceDetail ({
306+ serviceName: splitParams [0 ],
307+ version: splitParams [1 ],
308+ group: splitParams [2 ]
309+ })
296310 }
297311 console .log (' res' , res )
298312 if (res ?.code !== HTTP_STATUS .SUCCESS ) {
0 commit comments