mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
feat: update layers for Hierarchy topology
This commit is contained in:
parent
341224a10c
commit
4da6b4ae3c
@ -599,7 +599,12 @@ export const topologyStore = defineStore({
|
||||
const dashboardStore = useDashboardStore();
|
||||
const { currentService } = useSelectorStore();
|
||||
const id = this.node ? this.node.id : (currentService || {}).id;
|
||||
const layer = this.node ? this.node.layer : dashboardStore.layerId;
|
||||
let layer = dashboardStore.layerId;
|
||||
if (this.node) {
|
||||
layer = this.node.layers.includes(dashboardStore.layerId)
|
||||
? dashboardStore.layerId
|
||||
: this.node.layers.filter((d: string) => d !== dashboardStore.layerId)[0];
|
||||
}
|
||||
if (!(id && layer)) {
|
||||
return new Promise((resolve) => resolve({}));
|
||||
}
|
||||
|
@ -128,7 +128,13 @@ limitations under the License. -->
|
||||
{{ item.title }}
|
||||
</span>
|
||||
</div>
|
||||
<el-dialog v-model="hierarchyRelated" :destroy-on-close="true" @closed="hierarchyRelated = false" width="640px">
|
||||
<el-dialog
|
||||
v-model="hierarchyRelated"
|
||||
:title="getHierarchyTitle()"
|
||||
:destroy-on-close="true"
|
||||
@closed="hierarchyRelated = false"
|
||||
width="640px"
|
||||
>
|
||||
<div class="hierarchy-related">
|
||||
<hierarchy-map :config="config" />
|
||||
</div>
|
||||
@ -269,6 +275,20 @@ limitations under the License. -->
|
||||
currentNode.value = null;
|
||||
}
|
||||
|
||||
function getHierarchyTitle() {
|
||||
if (!currentNode.value) {
|
||||
return;
|
||||
}
|
||||
if (currentNode.value.layers.includes(dashboardStore.layerId)) {
|
||||
return `${dashboardStore.layerId} --> ${currentNode.value.name}`;
|
||||
}
|
||||
const layer = currentNode.value.layers.filter((d: string) => d !== dashboardStore.layerId);
|
||||
if (layer.length) {
|
||||
return `${layer[0]} --> ${currentNode.value.name}`;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
async function initLegendMetrics() {
|
||||
if (!topologyStore.nodes.length) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user