From a0b57d0a5abc008afc0f8b51a64e3973a796be48 Mon Sep 17 00:00:00 2001 From: Fine0830 Date: Tue, 10 May 2022 17:03:47 +0800 Subject: [PATCH 1/4] feat: remove the layer filed for instance query (#81) --- src/graphql/fragments/selector.ts | 60 +++++++++++++++---------------- src/types/selector.d.ts | 1 - 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/graphql/fragments/selector.ts b/src/graphql/fragments/selector.ts index f855d8f3..a5c70392 100644 --- a/src/graphql/fragments/selector.ts +++ b/src/graphql/fragments/selector.ts @@ -20,10 +20,10 @@ export const Services = { services: listServices(layer: $layer) { id value: name - label: name - group - layers - normal + label: name + group + layers + normal } `, }; @@ -36,17 +36,16 @@ export const Instances = { variable: "$serviceId: ID!, $duration: Duration!", query: ` pods: listInstances(duration: $duration, serviceId: $serviceId) { - id - value: name - label: name - language - instanceUUID - layer - attributes { - name - value - } + id + value: name + label: name + language + instanceUUID + attributes { + name + value } + } `, }; export const Endpoints = { @@ -66,10 +65,10 @@ export const getService = { service: getService(serviceId: $serviceId) { id value: name - label: name - group - layers - normal + label: name + group + layers + normal } `, }; @@ -79,16 +78,15 @@ export const getInstance = { query: ` instance: getInstance(instanceId: $instanceId) { id - value: name - label: name - language - instanceUUID - layer - attributes { - name - value - } + value: name + label: name + language + instanceUUID + attributes { + name + value } + } `, }; @@ -97,10 +95,10 @@ export const getEndpoint = { query: ` endpoint: getEndpointInfo(endpointId: $endpointId) { id - value: name - label: name - serviceId - serviceName + value: name + label: name + serviceId + serviceName } `, }; diff --git a/src/types/selector.d.ts b/src/types/selector.d.ts index 4e1439cd..293ef469 100644 --- a/src/types/selector.d.ts +++ b/src/types/selector.d.ts @@ -26,7 +26,6 @@ export type Service = { export type Instance = { value: string; label: string; - layer?: string; language?: string; instanceUUID?: string; attributes?: { name: string; value: string }[]; From 49c4c96a6aa9df6d0bb1e29315e8bb9499969d18 Mon Sep 17 00:00:00 2001 From: Fine0830 Date: Tue, 10 May 2022 17:25:56 +0800 Subject: [PATCH 2/4] remove process layer (#82) --- src/graphql/fragments/ebpf.ts | 1 - src/types/ebpf.d.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/graphql/fragments/ebpf.ts b/src/graphql/fragments/ebpf.ts index 662cfb31..4a80777a 100644 --- a/src/graphql/fragments/ebpf.ts +++ b/src/graphql/fragments/ebpf.ts @@ -60,7 +60,6 @@ export const queryEBPFSchedules = { serviceName instanceId instanceName - layer agentId detectType attributes { diff --git a/src/types/ebpf.d.ts b/src/types/ebpf.d.ts index 7ca3febc..b40597ef 100644 --- a/src/types/ebpf.d.ts +++ b/src/types/ebpf.d.ts @@ -50,7 +50,6 @@ export type Process = { serviceName: string; instanceId: string; instanceName: string; - layer: string; agentId: string; detectType: string; attributes: { name: string; value: string }; From ca14a7d2c2f1c6cc2ff10485dc27eeaf1292d0a6 Mon Sep 17 00:00:00 2001 From: Fine0830 Date: Wed, 11 May 2022 15:05:58 +0800 Subject: [PATCH 3/4] fix: set date to 0 and remove duration filed (#83) --- src/components/DateCalendar.vue | 7 +++---- src/store/modules/ebpf.ts | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/DateCalendar.vue b/src/components/DateCalendar.vue index 3e3a150f..f331192e 100755 --- a/src/components/DateCalendar.vue +++ b/src/components/DateCalendar.vue @@ -247,7 +247,7 @@ limitations under the License. --> (state.showMinutes = state.showSeconds = false) " :class="{ on: state.showHours }" - >{{ state.hour || dd }}{{ dd(state.hour) }} : (state.showHours = state.showSeconds = false) " :class="{ on: state.showMinutes }" - >{{ state.minute || dd }}{{ dd(state.minute) }} : @@ -268,7 +268,7 @@ limitations under the License. --> (state.showHours = state.showMinutes = false) " :class="{ on: state.showSeconds }" - >{{ state.second || dd }}{{ dd(state.second) }} @@ -464,7 +464,6 @@ const status = ( const minutes = time.getMinutes(); const seconds = time.getSeconds(); const milliseconds = time.getMilliseconds(); - const dd = (t: number) => `0${t}`.slice(-2); const map: { [key: string]: string | number } = { YYYY: year, MM: dd(month + 1), diff --git a/src/store/modules/ebpf.ts b/src/store/modules/ebpf.ts index d59f317b..897abf12 100644 --- a/src/store/modules/ebpf.ts +++ b/src/store/modules/ebpf.ts @@ -103,14 +103,13 @@ export const ebpfStore = defineStore({ this.getEBPFSchedules({ taskId: this.taskList[0].taskId }); return res.data; }, - async getEBPFSchedules(params: { taskId: string; duration?: Duration }) { + async getEBPFSchedules(params: { taskId: string }) { if (!params.taskId) { return new Promise((resolve) => resolve({})); } - const duration = useAppStoreWithOut().durationTime; const res: AxiosResponse = await graphql .query("getEBPFSchedules") - .params({ ...params, duration }); + .params({ ...params }); if (res.data.errors) { this.eBPFSchedules = []; From 0e0f2704b3f40c01d0f389c26d6253389cfea0e3 Mon Sep 17 00:00:00 2001 From: Fine0830 Date: Wed, 11 May 2022 20:02:45 +0800 Subject: [PATCH 4/4] fix graphql query (#84) --- src/graphql/fragments/ebpf.ts | 4 ++-- src/locales/lang/en.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graphql/fragments/ebpf.ts b/src/graphql/fragments/ebpf.ts index 4a80777a..7479b623 100644 --- a/src/graphql/fragments/ebpf.ts +++ b/src/graphql/fragments/ebpf.ts @@ -48,9 +48,9 @@ export const queryEBPFTasks = { }`, }; export const queryEBPFSchedules = { - variable: "$taskId: ID!, $duration: Duration!", + variable: "$taskId: ID!", query: ` - eBPFSchedules: queryEBPFProfilingSchedules(taskId: $taskId, duration: $duration) { + eBPFSchedules: queryEBPFProfilingSchedules(taskId: $taskId) { scheduleId taskId process { diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts index 9bed54dc..b04edd50 100644 --- a/src/locales/lang/en.ts +++ b/src/locales/lang/en.ts @@ -134,7 +134,7 @@ const msg = { taskId: "Task ID", triggerType: "Trigger Type", targetType: "Target Type", - ebpfTip: "Don't have process could profiling", + ebpfTip: "Don't have a process for profiling", processSelect: "Click to select processes", hourTip: "Select Hour", minuteTip: "Select Minute",