From 9290d53dda89709dde86bc6ba4249b1006b30999 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Thu, 4 Aug 2022 11:54:10 +0800 Subject: [PATCH] create tasks --- src/assets/icons/library_add.svg | 17 +++++++++ src/graphql/query/ebpf.ts | 2 +- src/store/modules/ebpf.ts | 17 +++++++++ .../related/network-profiling/Content.vue | 37 ++++++++++++++++++- .../network-profiling/components/Tasks.vue | 26 ++++++++----- 5 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 src/assets/icons/library_add.svg diff --git a/src/assets/icons/library_add.svg b/src/assets/icons/library_add.svg new file mode 100644 index 00000000..fb4b4f18 --- /dev/null +++ b/src/assets/icons/library_add.svg @@ -0,0 +1,17 @@ + + + + diff --git a/src/graphql/query/ebpf.ts b/src/graphql/query/ebpf.ts index 2518ebb3..052fc7af 100644 --- a/src/graphql/query/ebpf.ts +++ b/src/graphql/query/ebpf.ts @@ -35,6 +35,6 @@ export const getEBPFSchedules = `query queryEBPFSchedules(${queryEBPFSchedules.v export const getEBPFResult = `query analysisEBPFResult(${analysisEBPFResult.variable}) {${analysisEBPFResult.query}}`; -export const saveNetworkProfiling = `mutation createNetworkProfiling(${createNetworkProfiling.variable}) {${createNetworkProfiling.query}}`; +export const newNetworkProfiling = `mutation createNetworkProfiling(${createNetworkProfiling.variable}) {${createNetworkProfiling.query}}`; export const aliveNetworkProfiling = `mutation keepNetworkProfiling(${keepNetworkProfiling.variable}) {${keepNetworkProfiling.query}}`; diff --git a/src/store/modules/ebpf.ts b/src/store/modules/ebpf.ts index 4496ad58..c4ee5b8a 100644 --- a/src/store/modules/ebpf.ts +++ b/src/store/modules/ebpf.ts @@ -100,6 +100,23 @@ export const ebpfStore = defineStore({ }); return res.data; }, + async createNetworkTask(param: { + serviceId: string; + serviceInstanceId: string; + }) { + const res: AxiosResponse = await graphql + .query("newNetworkProfiling") + .params({ request: { serviceInstanceId: param.serviceInstanceId } }); + + if (res.data.errors) { + return res.data; + } + this.getTaskList({ + ...param, + targets: ["NETWORK"], + }); + return res.data; + }, async getTaskList(params: { serviceId: string; serviceInstanceId: string; diff --git a/src/views/dashboard/related/network-profiling/Content.vue b/src/views/dashboard/related/network-profiling/Content.vue index 21c9cb93..f58611c9 100644 --- a/src/views/dashboard/related/network-profiling/Content.vue +++ b/src/views/dashboard/related/network-profiling/Content.vue @@ -13,5 +13,40 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> + + diff --git a/src/views/dashboard/related/network-profiling/components/Tasks.vue b/src/views/dashboard/related/network-profiling/components/Tasks.vue index 118280d6..8ac59313 100644 --- a/src/views/dashboard/related/network-profiling/components/Tasks.vue +++ b/src/views/dashboard/related/network-profiling/components/Tasks.vue @@ -15,11 +15,13 @@ limitations under the License. -->