From 59baa145f0e94349f76b2118af05f90d2f24e54b Mon Sep 17 00:00:00 2001 From: Fine Date: Mon, 30 Dec 2024 15:08:42 +0800 Subject: [PATCH 1/5] fix --- src/store/modules/async-profiling.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/store/modules/async-profiling.ts b/src/store/modules/async-profiling.ts index a0041f18..dc9760e8 100644 --- a/src/store/modules/async-profiling.ts +++ b/src/store/modules/async-profiling.ts @@ -96,7 +96,10 @@ export const asyncProfilingStore = defineStore({ duration: useAppStoreWithOut().durationTime, }); if (!res.data.errors) { - this.instances = res.data.data.pods || []; + this.instances = (res.data.data.pods || []).map((d) => { + d.value = d.id; + return d; + }); } return res.data; }, From 1d6f0d6272374a4b388615bd84319c7a89f1e48a Mon Sep 17 00:00:00 2001 From: Fine Date: Mon, 30 Dec 2024 15:16:47 +0800 Subject: [PATCH 2/5] add type --- src/store/modules/async-profiling.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/async-profiling.ts b/src/store/modules/async-profiling.ts index dc9760e8..1dffcc04 100644 --- a/src/store/modules/async-profiling.ts +++ b/src/store/modules/async-profiling.ts @@ -96,7 +96,7 @@ export const asyncProfilingStore = defineStore({ duration: useAppStoreWithOut().durationTime, }); if (!res.data.errors) { - this.instances = (res.data.data.pods || []).map((d) => { + this.instances = (res.data.data.pods || []).map((d: Instance) => { d.value = d.id; return d; }); From 1450f34bd36f34d2535c2fc18db864202b4ec193 Mon Sep 17 00:00:00 2001 From: Fine Date: Mon, 30 Dec 2024 15:20:14 +0800 Subject: [PATCH 3/5] fix --- src/store/modules/async-profiling.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/async-profiling.ts b/src/store/modules/async-profiling.ts index 1dffcc04..de865c8c 100644 --- a/src/store/modules/async-profiling.ts +++ b/src/store/modules/async-profiling.ts @@ -97,7 +97,7 @@ export const asyncProfilingStore = defineStore({ }); if (!res.data.errors) { this.instances = (res.data.data.pods || []).map((d: Instance) => { - d.value = d.id; + d.value = d.id || ""; return d; }); } From dfb71cffe8a9e23905eb76bec2bf1b393ba6a96f Mon Sep 17 00:00:00 2001 From: Fine Date: Mon, 30 Dec 2024 15:23:42 +0800 Subject: [PATCH 4/5] fix duration --- .../dashboard/related/async-profiling/components/TaskList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/dashboard/related/async-profiling/components/TaskList.vue b/src/views/dashboard/related/async-profiling/components/TaskList.vue index 7b8b3e24..e1ddf785 100644 --- a/src/views/dashboard/related/async-profiling/components/TaskList.vue +++ b/src/views/dashboard/related/async-profiling/components/TaskList.vue @@ -41,7 +41,7 @@ limitations under the License. --> {{ dateFormat(i.createTime) }} - {{ dateFormat(i.createTime + i.duration * 60 * 1000) }} + {{ dateFormat(i.createTime + i.duration * 1000) }} From 72f751f2571d09072ac0382a682fe29c831cfe06 Mon Sep 17 00:00:00 2001 From: Fine Date: Mon, 30 Dec 2024 15:31:56 +0800 Subject: [PATCH 5/5] fix --- src/store/modules/topology.ts | 6 +++--- src/utils/vec2.ts | 4 ++-- src/utils/vec3.ts | 4 ++-- .../related/network-profiling/components/Graph/layout.ts | 2 +- src/views/dashboard/related/profile/Content.vue | 4 ++-- src/views/dashboard/related/trace/TraceList.vue | 2 +- src/views/dashboard/related/trace/utils/d3-trace-list.ts | 2 +- src/views/dashboard/related/trace/utils/d3-trace-tree.ts | 2 +- tsconfig.vitest.json | 1 + 9 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/store/modules/topology.ts b/src/store/modules/topology.ts index 80a25808..d4a580b6 100644 --- a/src/store/modules/topology.ts +++ b/src/store/modules/topology.ts @@ -349,7 +349,7 @@ export const topologyStore = defineStore({ const json = await this.getEndpointTopology(ids); if (depth > 2) { const pods = json.nodes - .filter((d: Node) => ![...ids, ...endpointIds].includes(d.id) && d.name != userNodeName) + .filter((d: Node) => ![...ids, ...endpointIds].includes(d.id) && d.name !== userNodeName) .map((item: Node) => item.id); if (!pods.length) { const nodes = [...res.nodes, ...json.nodes]; @@ -360,7 +360,7 @@ export const topologyStore = defineStore({ const topo = await this.getEndpointTopology(pods); if (depth > 3) { const endpoints = topo.nodes - .filter((d: Node) => ![...ids, ...pods, ...endpointIds].includes(d.id) && d.name != userNodeName) + .filter((d: Node) => ![...ids, ...pods, ...endpointIds].includes(d.id) && d.name !== userNodeName) .map((item: Node) => item.id); if (!endpoints.length) { const nodes = [...res.nodes, ...json.nodes, ...topo.nodes]; @@ -373,7 +373,7 @@ export const topologyStore = defineStore({ const nodeIds = data.nodes .filter( (d: Node) => - ![...endpoints, ...ids, ...pods, ...endpointIds].includes(d.id) && d.name != userNodeName, + ![...endpoints, ...ids, ...pods, ...endpointIds].includes(d.id) && d.name !== userNodeName, ) .map((item: Node) => item.id); if (!nodeIds.length) { diff --git a/src/utils/vec2.ts b/src/utils/vec2.ts index 690bff74..2eef12f8 100644 --- a/src/utils/vec2.ts +++ b/src/utils/vec2.ts @@ -17,7 +17,7 @@ class Vec2 extends Float32Array { constructor(v?: unknown, y?: unknown) { super(2); - if (v instanceof Vec2 || v instanceof Float32Array || (v instanceof Array && v.length == 2)) { + if (v instanceof Vec2 || v instanceof Float32Array || (v instanceof Array && v.length === 2)) { this[0] = v[0]; this[1] = v[1]; } else if (typeof v === "number" && typeof y === "number") { @@ -104,7 +104,7 @@ class Vec2 extends Float32Array { } norm(out?: number[] | Vec2): number[] | Vec2 | undefined { const mag = Math.sqrt(this[0] * this[0] + this[1] * this[1]); - if (mag == 0) return this; + if (mag === 0) return this; out = out || this; out[0] = this[0] / mag; out[1] = this[1] / mag; diff --git a/src/utils/vec3.ts b/src/utils/vec3.ts index 3650fd06..d3afdc6a 100644 --- a/src/utils/vec3.ts +++ b/src/utils/vec3.ts @@ -17,7 +17,7 @@ class Vec3 extends Float32Array { constructor(v?: unknown, y?: unknown, z?: unknown) { super(3); - if (v instanceof Vec3 || v instanceof Float32Array || (v instanceof Array && v.length == 3)) { + if (v instanceof Vec3 || v instanceof Float32Array || (v instanceof Array && v.length === 3)) { this[0] = v[0]; this[1] = v[1]; this[2] = v[2]; @@ -150,7 +150,7 @@ class Vec3 extends Float32Array { } static norm(x: unknown, y: unknown, z: unknown): Vec3 { const rtn = new Vec3(); - if (x instanceof Vec3 || x instanceof Float32Array || (x instanceof Array && x.length == 3)) { + if (x instanceof Vec3 || x instanceof Float32Array || (x instanceof Array && x.length === 3)) { rtn.copy(x); } else if (typeof x === "number" && typeof y === "number" && typeof z === "number") { rtn.xyz(x, y, z); diff --git a/src/views/dashboard/related/network-profiling/components/Graph/layout.ts b/src/views/dashboard/related/network-profiling/components/Graph/layout.ts index ac52d56e..9c96803a 100644 --- a/src/views/dashboard/related/network-profiling/components/Graph/layout.ts +++ b/src/views/dashboard/related/network-profiling/components/Graph/layout.ts @@ -91,7 +91,7 @@ class Hex extends Int16Array { } xyz(x: number, y: number, z: number | null = null): Hex { - if (z == null) z = -x - y; + if (z === null) z = -x - y; if (x + y + z != 0) { console.log("Bad Axial Coordinate : : q %d r %d s %d", x, y, z); } diff --git a/src/views/dashboard/related/profile/Content.vue b/src/views/dashboard/related/profile/Content.vue index 2adcfc94..622b2411 100644 --- a/src/views/dashboard/related/profile/Content.vue +++ b/src/views/dashboard/related/profile/Content.vue @@ -21,9 +21,9 @@ limitations under the License. -->
-
+
:class="{ 'trace-success': !i.isError, 'trace-error': i.isError, - selected: selectedKey == i.key, + selected: selectedKey === i.key, }" >
{ event.stopPropagation(); - if (d.data.children.length == 0) return; + if (d.data.children.length === 0) return; this.click(d, this); }); nodeUpdate diff --git a/src/views/dashboard/related/trace/utils/d3-trace-tree.ts b/src/views/dashboard/related/trace/utils/d3-trace-tree.ts index 8ecc376d..bf9264c0 100644 --- a/src/views/dashboard/related/trace/utils/d3-trace-tree.ts +++ b/src/views/dashboard/related/trace/utils/d3-trace-tree.ts @@ -296,7 +296,7 @@ export default class TraceMap { .attr("cursor", "pointer") .on("click", (event: any, d: Recordable) => { event.stopPropagation(); - if (d.data.children.length == 0) return; + if (d.data.children.length === 0) return; click(d); }); const nodeExit = node diff --git a/tsconfig.vitest.json b/tsconfig.vitest.json index 6a78a1b3..5bf7652f 100644 --- a/tsconfig.vitest.json +++ b/tsconfig.vitest.json @@ -18,6 +18,7 @@ "extends": "./tsconfig.app.json", "exclude": [], "compilerOptions": { + "target": "esnext", "lib": [], "types": ["node", "jsdom"] }