diff --git a/src/components/Radio.vue b/src/components/Radio.vue index 7eafaa4e..2cd786fb 100644 --- a/src/components/Radio.vue +++ b/src/components/Radio.vue @@ -24,8 +24,8 @@ import { ref } from "vue"; import type { PropType } from "vue"; interface Option { - label: string; - value: string; + label: string | number; + value: string | number; } /*global defineProps, defineEmits */ diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts index aeab2faf..d6cde5e5 100644 --- a/src/locales/lang/en.ts +++ b/src/locales/lang/en.ts @@ -174,6 +174,12 @@ const msg = { asTable: "As Table", toTheRight: "To The Right", legendValues: "Legend Values", + minDuration: "Minimal Request Duration", + when4xx: + "Sample HTTP requests and responses with tracing when response code between 400 and 499", + when5xx: + "Sample HTTP requests and responses with tracing when response code between 500 and 599", + taskTitle: "HTTP request and response collecting rules", seconds: "Seconds", hourTip: "Select Hour", minuteTip: "Select Minute", diff --git a/src/locales/lang/es.ts b/src/locales/lang/es.ts index cdaafb3e..f1b87697 100644 --- a/src/locales/lang/es.ts +++ b/src/locales/lang/es.ts @@ -178,6 +178,12 @@ const msg = { showLegend: "Mostrar leyenda", asTable: "Como tabla", toTheRight: "Derecha", + minDuration: "Duración mínima de la solicitud", + when4xx: + "Ejemplo de solicitud y respuesta http con seguimiento cuando el Código de respuesta está entre 400 y 499", + when5xx: + "Ejemplo de solicitud y respuesta http con seguimiento cuando el Código de respuesta está entre 500 y 599", + taskTitle: "Reglas de recolección de peticiones y respuestas HTTP", second: "s", yearSuffix: "Año", monthsHead: "Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Set_Oct_Nov_Dic", diff --git a/src/locales/lang/zh.ts b/src/locales/lang/zh.ts index bc961401..9c990b8c 100644 --- a/src/locales/lang/zh.ts +++ b/src/locales/lang/zh.ts @@ -171,6 +171,10 @@ const msg = { asTable: "作为表格", toTheRight: "在右边", legendValues: "图例值", + minDuration: "最小请求持续时间", + when4xx: "当响应代码介于400和499之间时,带有跟踪的HTTP请求和响应示例", + when5xx: "当响应代码介于500和599之间时,带有跟踪的HTTP请求和响应示例", + taskTitle: "HTTP请求和响应收集规则", seconds: "秒", hourTip: "选择小时", minuteTip: "选择分钟", diff --git a/src/store/modules/network-profiling.ts b/src/store/modules/network-profiling.ts index 2c45208c..f6c4bc25 100644 --- a/src/store/modules/network-profiling.ts +++ b/src/store/modules/network-profiling.ts @@ -110,13 +110,23 @@ export const networkProfilingStore = defineStore({ this.calls = calls; this.nodes = data.nodes; }, - async createNetworkTask(param: { - serviceId: string; - serviceInstanceId: string; - }) { + async createNetworkTask( + instanceId: string, + params: { + uriRegex: string; + when4xx: string; + when5xx: string; + minDuration: number; + }[] + ) { const res: AxiosResponse = await graphql .query("newNetworkProfiling") - .params({ request: { instanceId: param.serviceInstanceId } }); + .params({ + request: { + instanceId, + samplings: params, + }, + }); if (res.data.errors) { return res.data; diff --git a/src/types/ebpf.d.ts b/src/types/ebpf.d.ts index e9986ef1..d46d0139 100644 --- a/src/types/ebpf.d.ts +++ b/src/types/ebpf.d.ts @@ -77,3 +77,9 @@ export type ProcessNode = { x?: number; y?: number; }; +export interface NetworkProfilingRequest { + uriRegex: string; + when4xx: string; + when5xx: string; + minDuration: number; +} diff --git a/src/views/dashboard/related/network-profiling/components/NewConditions.vue b/src/views/dashboard/related/network-profiling/components/NewConditions.vue new file mode 100644 index 00000000..1ed8ac66 --- /dev/null +++ b/src/views/dashboard/related/network-profiling/components/NewConditions.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/views/dashboard/related/network-profiling/components/NewTask.vue b/src/views/dashboard/related/network-profiling/components/NewTask.vue new file mode 100644 index 00000000..9bce52a7 --- /dev/null +++ b/src/views/dashboard/related/network-profiling/components/NewTask.vue @@ -0,0 +1,139 @@ + + + + + diff --git a/src/views/dashboard/related/network-profiling/components/Tasks.vue b/src/views/dashboard/related/network-profiling/components/Tasks.vue index 3cb089fa..72e0ec95 100644 --- a/src/views/dashboard/related/network-profiling/components/Tasks.vue +++ b/src/views/dashboard/related/network-profiling/components/Tasks.vue @@ -17,24 +17,13 @@ limitations under the License. -->
{{ t("taskList") }} - + - - -
> + + +