mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
fix: update
This commit is contained in:
parent
eeb41cffe4
commit
44ed462663
@ -43,7 +43,6 @@ interface TopologyState {
|
|||||||
linkServerMetrics: MetricVal;
|
linkServerMetrics: MetricVal;
|
||||||
linkClientMetrics: MetricVal;
|
linkClientMetrics: MetricVal;
|
||||||
hierarchyNodeMetrics: { [key: string]: MetricVal };
|
hierarchyNodeMetrics: { [key: string]: MetricVal };
|
||||||
hierarchyServiceNode: Nullable<Node>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const topologyStore = defineStore({
|
export const topologyStore = defineStore({
|
||||||
@ -57,7 +56,6 @@ export const topologyStore = defineStore({
|
|||||||
hierarchyInstanceNodes: [],
|
hierarchyInstanceNodes: [],
|
||||||
node: null,
|
node: null,
|
||||||
call: null,
|
call: null,
|
||||||
hierarchyServiceNode: null,
|
|
||||||
nodeMetricValue: {},
|
nodeMetricValue: {},
|
||||||
linkServerMetrics: {},
|
linkServerMetrics: {},
|
||||||
linkClientMetrics: {},
|
linkClientMetrics: {},
|
||||||
@ -70,9 +68,6 @@ export const topologyStore = defineStore({
|
|||||||
setLink(link: Call) {
|
setLink(link: Call) {
|
||||||
this.call = link;
|
this.call = link;
|
||||||
},
|
},
|
||||||
setHierarchyServiceNode(node: HierarchyNode) {
|
|
||||||
this.hierarchyServiceNode = node;
|
|
||||||
},
|
|
||||||
setInstanceTopology(data: { nodes: Node[]; calls: Call[] }) {
|
setInstanceTopology(data: { nodes: Node[]; calls: Call[] }) {
|
||||||
for (const call of data.calls) {
|
for (const call of data.calls) {
|
||||||
for (const node of data.nodes) {
|
for (const node of data.nodes) {
|
||||||
|
@ -114,7 +114,7 @@ limitations under the License. -->
|
|||||||
const loading = ref<boolean>(false);
|
const loading = ref<boolean>(false);
|
||||||
const svg = ref<Nullable<any>>(null);
|
const svg = ref<Nullable<any>>(null);
|
||||||
const graph = ref<Nullable<any>>(null);
|
const graph = ref<Nullable<any>>(null);
|
||||||
const settings = ref<any>(props.config);
|
// const settings = ref<any>(props.config);
|
||||||
const showSetting = ref<boolean>(false);
|
const showSetting = ref<boolean>(false);
|
||||||
const topologyLayout = ref<any>({});
|
const topologyLayout = ref<any>({});
|
||||||
const popover = ref<Nullable<any>>(null);
|
const popover = ref<Nullable<any>>(null);
|
||||||
@ -143,7 +143,6 @@ limitations under the License. -->
|
|||||||
svg.value.call(zoom(d3, graph.value, diff.value));
|
svg.value.call(zoom(d3, graph.value, diff.value));
|
||||||
}
|
}
|
||||||
async function freshNodes() {
|
async function freshNodes() {
|
||||||
topologyStore.setHierarchyServiceNode(null);
|
|
||||||
const resp = await topologyStore.getHierarchyServiceTopology();
|
const resp = await topologyStore.getHierarchyServiceTopology();
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|
||||||
@ -183,10 +182,6 @@ limitations under the License. -->
|
|||||||
popover.value = d3.select("#popover");
|
popover.value = d3.select("#popover");
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSettings(config: any) {
|
|
||||||
settings.value = config;
|
|
||||||
}
|
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
const levels = computeLevels(topologyStore.hierarchyServiceCalls, topologyStore.hierarchyServiceNodes, []);
|
const levels = computeLevels(topologyStore.hierarchyServiceCalls, topologyStore.hierarchyServiceNodes, []);
|
||||||
|
|
||||||
@ -209,19 +204,8 @@ limitations under the License. -->
|
|||||||
currentNode.value = null;
|
currentNode.value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function showConfig() {
|
|
||||||
showSetting.value = !showSetting.value;
|
|
||||||
dashboardStore.selectWidget(props.config);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getNodeStatus(d: any) {
|
function getNodeStatus(d: any) {
|
||||||
const item =
|
return d.isReal ? icons.CUBEERROR : icons.CUBE;
|
||||||
(settings.value.hierarchyServicesConfig || []).find((i: { layer: string }) => d.layer === i.layer) || {};
|
|
||||||
|
|
||||||
if (!item.legendMQE) {
|
|
||||||
return icons.CUBE;
|
|
||||||
}
|
|
||||||
return Number(d[item.legendMQE]) && d.isReal ? icons.CUBEERROR : icons.CUBE;
|
|
||||||
}
|
}
|
||||||
function showNodeTip(event: MouseEvent, data: Node) {
|
function showNodeTip(event: MouseEvent, data: Node) {
|
||||||
const dashboard =
|
const dashboard =
|
||||||
@ -262,7 +246,6 @@ limitations under the License. -->
|
|||||||
function handleNodeClick(event: MouseEvent, d: Node & { x: number; y: number }) {
|
function handleNodeClick(event: MouseEvent, d: Node & { x: number; y: number }) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
hideTip();
|
hideTip();
|
||||||
// topologyStore.setHierarchyServiceNode(d);
|
|
||||||
const dashboard =
|
const dashboard =
|
||||||
getDashboard(
|
getDashboard(
|
||||||
{
|
{
|
||||||
@ -280,7 +263,6 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
|
|
||||||
function svgEvent() {
|
function svgEvent() {
|
||||||
topologyStore.setHierarchyServiceNode(null);
|
|
||||||
dashboardStore.selectWidget(props.config);
|
dashboardStore.selectWidget(props.config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user