diff --git a/src/store/modules/network-profiling.ts b/src/store/modules/network-profiling.ts index 2a5b36ee..9cd7782d 100644 --- a/src/store/modules/network-profiling.ts +++ b/src/store/modules/network-profiling.ts @@ -21,6 +21,7 @@ import graphql from "@/graphql"; import { AxiosResponse } from "axios"; import { Call } from "@/types/topology"; import { LayoutConfig } from "@/types/dashboard"; +import { ElMessage } from "element-plus"; interface NetworkProfilingState { networkTasks: EBPFTaskList[]; @@ -33,6 +34,7 @@ interface NetworkProfilingState { metricsLayout: LayoutConfig[]; selectedMetric: Nullable; activeMetricIndex: string; + aliveNetwork: boolean; } export const networkProfilingStore = defineStore({ @@ -48,6 +50,7 @@ export const networkProfilingStore = defineStore({ metricsLayout: [], selectedMetric: null, activeMetricIndex: "", + aliveNetwork: false, }), actions: { setSelectedNetworkTask(task: EBPFTaskList) { @@ -137,6 +140,22 @@ export const networkProfilingStore = defineStore({ this.setSelectedNetworkTask(this.selectedNetworkTask); return res.data; }, + async keepNetworkProfiling(taskId: string) { + if (!taskId) { + return new Promise((resolve) => resolve({})); + } + const res: AxiosResponse = await graphql + .query("aliveNetworkProfiling") + .params({ taskId }); + + this.aliveMessage = ""; + if (res.data.errors) { + return res.data; + } + this.aliveNetwork = res.data.data.keepEBPFNetworkProfiling.status; + ElMessage.warning(res.data.data.keepEBPFNetworkProfiling.errorReason); + return res.data; + }, async getProcessTopology(params: { duration: any; serviceInstanceId: string; diff --git a/src/views/dashboard/related/network-profiling/components/Schedules.vue b/src/views/dashboard/related/network-profiling/components/Schedules.vue index 67f76615..0e76c915 100644 --- a/src/views/dashboard/related/network-profiling/components/Schedules.vue +++ b/src/views/dashboard/related/network-profiling/components/Schedules.vue @@ -13,9 +13,9 @@ 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. -->