-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed the issue of querying irrelevant endpoint information on the endpoint topology page. #442
Conversation
src/store/modules/topology.ts
Outdated
@@ -338,14 +338,18 @@ export const topologyStore = defineStore({ | |||
} | |||
const res = await this.getEndpointTopology(endpointIds); | |||
if (depth > 1) { | |||
const ids = res.nodes.map((item: Node) => item.id).filter((d: string) => !endpointIds.includes(d)); | |||
const ids = res.nodes | |||
.filter((item: Node) => item.isReal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A database could be not real
. I think we should only filter User out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A database could be
not real
. I think we should only filter User out.
Is it filtered like this?
.filter((item: Node) => item.name != ' User')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conjectured nodes and the User node are not real.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that is.
Okay, I'll make the changes now
3a788f2
to
80e13ce
Compare
src/store/modules/topology.ts
Outdated
@@ -338,14 +338,19 @@ export const topologyStore = defineStore({ | |||
} | |||
const res = await this.getEndpointTopology(endpointIds); | |||
if (depth > 1) { | |||
const ids = res.nodes.map((item: Node) => item.id).filter((d: string) => !endpointIds.includes(d)); | |||
const nodeName = "User"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const nodeName = "User"; | |
const userNodeName = "User"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Super-Lu You should not accept my codes directly, this is a variable renaming, the other codes are not aligned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Super-Lu You should not accept my codes directly, this is a variable renaming, the other codes are not aligned.
Yes, thank you for the reminder.
Let's wait for @Fine0830 review later. |
OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Super-Lu . There is a nit in it. Please fix.
src/store/modules/topology.ts
Outdated
const ids = res.nodes | ||
.filter((item: Node) => item.name != userNodeName) | ||
.map((item: Node) => item.id) | ||
.filter((d: string) => !endpointIds.includes(d)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const ids = res.nodes | |
.filter((item: Node) => item.name != userNodeName) | |
.map((item: Node) => item.id) | |
.filter((d: string) => !endpointIds.includes(d)); | |
const ids = res.nodes.filter((d: Node) => !endpointIds.includes(d.id) && d.name !== userNodeName).map((item: Node) => item.id); |
src/store/modules/topology.ts
Outdated
if (!ids.length) { | ||
this.setTopology(res); | ||
return; | ||
} | ||
const json = await this.getEndpointTopology(ids); | ||
if (depth > 2) { | ||
const pods = json.nodes | ||
.filter((item: Node) => item.name != userNodeName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to change as above
src/store/modules/topology.ts
Outdated
@@ -357,6 +362,7 @@ export const topologyStore = defineStore({ | |||
const topo = await this.getEndpointTopology(pods); | |||
if (depth > 3) { | |||
const endpoints = topo.nodes | |||
.filter((item: Node) => item.name != userNodeName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to change as above
src/store/modules/topology.ts
Outdated
@@ -368,6 +374,7 @@ export const topologyStore = defineStore({ | |||
const data = await this.getEndpointTopology(endpoints); | |||
if (depth > 4) { | |||
const nodeIds = data.nodes | |||
.filter((item: Node) => item.name != userNodeName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to change as above
|
ea3934f
to
6622d51
Compare
6622d51
to
f61ee1e
Compare
Excuse me, why does the submitted code format automatically change. |
Is it code changed or code style changed? The git hook should only change/format code styles. |
The code style has been modified, with one line becoming multiple lines |
I think prettier did that. |
Sorry, I didn't understand what it meant. Are you saying this is normal? |
…page, if the query parameters contain the ID of the virtual endpoint User, all link information will be retrieved.
f61ee1e
to
9df8170
Compare
prettier is a bundled tool of this repo, it will reformat codes when you do git push. |
I understand now, thank you for your explanation. |
@Super-Lu You need to sync the submodule in the main repo( |
Sure, I'll handle it as soon as possible. |
Fix the issue where when initiating a query on the endpoint topology page, if the query parameters contain the ID of the virtual endpoint User, all link information will be retrieved.
Fixes apache/skywalking#12880