From 4badfffac8bcc866239d8bfb990dd658f3be45ae Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Mon, 14 Feb 2022 21:06:05 +0800 Subject: [PATCH] feat: inspect nodes --- src/assets/icons/keyboard_backspace.svg | 17 +++ src/graphql/fragments/topology.ts | 20 ---- src/graphql/query/topology.ts | 2 - src/store/modules/topology.ts | 8 +- src/views/dashboard/controls/Widget.vue | 10 +- .../dashboard/related/topology/Graph.vue | 107 ++++++++++++++---- 6 files changed, 109 insertions(+), 55 deletions(-) create mode 100644 src/assets/icons/keyboard_backspace.svg diff --git a/src/assets/icons/keyboard_backspace.svg b/src/assets/icons/keyboard_backspace.svg new file mode 100644 index 00000000..989ad140 --- /dev/null +++ b/src/assets/icons/keyboard_backspace.svg @@ -0,0 +1,17 @@ + + + + diff --git a/src/graphql/fragments/topology.ts b/src/graphql/fragments/topology.ts index c84cce9e..6c57ef8b 100644 --- a/src/graphql/fragments/topology.ts +++ b/src/graphql/fragments/topology.ts @@ -14,26 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export const ServiceTopology = { - variable: "$duration: Duration!, $serviceId: ID!", - query: ` - topology: getServiceTopology(duration: $duration, serviceId: $serviceId) { - nodes { - id - name - type - isReal - } - calls { - id - source - detectPoints - target - sourceComponents - targetComponents - } - }`, -}; export const GlobalTopology = { variable: "$duration: Duration!", query: ` diff --git a/src/graphql/query/topology.ts b/src/graphql/query/topology.ts index 98e078ea..e07767da 100644 --- a/src/graphql/query/topology.ts +++ b/src/graphql/query/topology.ts @@ -17,13 +17,11 @@ import { InstanceTopology, EndpointTopology, - ServiceTopology, GlobalTopology, ServicesTopology, } from "../fragments/topology"; export const getGlobalTopology = `query queryData(${GlobalTopology.variable}) {${GlobalTopology.query}}`; export const getInstanceTopology = `query queryData(${InstanceTopology.variable}) {${InstanceTopology.query}}`; -export const getServiceTopology = `query queryData(${ServiceTopology.variable}) {${ServiceTopology.query}}`; export const getEndpointTopology = `query queryData(${EndpointTopology.variable}) {${EndpointTopology.query}}`; export const getServicesTopology = `query queryData(${ServicesTopology.variable}) {${ServicesTopology.query}}`; diff --git a/src/store/modules/topology.ts b/src/store/modules/topology.ts index 7ae735bf..2dbfbb00 100644 --- a/src/store/modules/topology.ts +++ b/src/store/modules/topology.ts @@ -68,13 +68,13 @@ export const topologyStore = defineStore({ setLinkClientMetrics(m: { id: string; value: unknown }[]) { this.linkClientMetrics = m; }, - async getServiceTopology() { - const serviceId = useSelectorStore().currentService.id; + async getServiceTopology(id: string) { + const serviceIds = [id]; const duration = useAppStoreWithOut().durationTime; const res: AxiosResponse = await graphql - .query("getServiceTopology") + .query("getServicesTopology") .params({ - serviceId, + serviceIds, duration, }); if (!res.data.errors) { diff --git a/src/views/dashboard/controls/Widget.vue b/src/views/dashboard/controls/Widget.vue index 6d3bfb42..7d538732 100644 --- a/src/views/dashboard/controls/Widget.vue +++ b/src/views/dashboard/controls/Widget.vue @@ -25,13 +25,11 @@ limitations under the License. --> v-show="data.widget?.tips" /> - +
{{ t("edit") }} diff --git a/src/views/dashboard/related/topology/Graph.vue b/src/views/dashboard/related/topology/Graph.vue index a39476e8..7fcee38b 100644 --- a/src/views/dashboard/related/topology/Graph.vue +++ b/src/views/dashboard/related/topology/Graph.vue @@ -22,12 +22,18 @@ limitations under the License. -->
- +
+ + + + + + +