diff --git a/src/store/modules/ebpf.ts b/src/store/modules/ebpf.ts index c4ee5b8a..fae47281 100644 --- a/src/store/modules/ebpf.ts +++ b/src/store/modules/ebpf.ts @@ -135,17 +135,19 @@ export const ebpfStore = defineStore({ return res.data; } this.networkTasks = res.data.data.queryEBPFTasks || []; + this.selectedNetworkTask = this.networkTasks[0] || {}; + this.setSelectedNetworkTask(this.selectedNetworkTask); if (!this.networkTasks.length) { return res.data; } - this.selectedNetworkTask = this.networkTasks[0] || {}; - this.setSelectedNetworkTask(this.selectedNetworkTask); } else { this.tip = ""; if (res.data.errors) { return res.data; } this.taskList = res.data.data.queryEBPFTasks || []; + this.selectedTask = this.taskList[0] || {}; + this.setSelectedTask(this.selectedTask); if (!this.taskList.length) { return res.data; } diff --git a/src/views/dashboard/related/ebpf/components/TaskList.vue b/src/views/dashboard/related/ebpf/components/TaskList.vue index 82427b88..7a2d71b2 100644 --- a/src/views/dashboard/related/ebpf/components/TaskList.vue +++ b/src/views/dashboard/related/ebpf/components/TaskList.vue @@ -30,7 +30,7 @@ limitations under the License. -->