diff --git a/src/views/dashboard/related/async-profiling/components/NewTask.vue b/src/views/dashboard/related/async-profiling/components/NewTask.vue index 461cc740..5d720872 100644 --- a/src/views/dashboard/related/async-profiling/components/NewTask.vue +++ b/src/views/dashboard/related/async-profiling/components/NewTask.vue @@ -35,7 +35,13 @@ limitations under the License. -->
{{ t("profilingEvents") }}
- +
@@ -103,10 +109,11 @@ limitations under the License. --> const selectorStore = useSelectorStore(); const { t } = useI18n(); const serviceInstanceIds = ref([]); - const asyncEvents = ref([ProfilingEvents[0].value]); + const asyncEvents = ref([ProfilingEvents[0]]); const duration = ref(DurationOptions[0].value); const execArgs = ref(""); const loading = ref(false); + const PartofEvents = [ProfilingEvents[3], ProfilingEvents[4], ProfilingEvents[5]]; function changeDuration(val: string) { duration.value = val; @@ -116,6 +123,21 @@ limitations under the License. --> serviceInstanceIds.value = options.map((d: Option) => d.value); } + function disableEvents(item: string) { + if (asyncEvents.value.includes(ProfilingEvents[0]) && PartofEvents.includes(item)) { + return true; + } + if (item === ProfilingEvents[0]) { + for (const event of PartofEvents) { + if (asyncEvents.value.includes(event)) { + return true; + } + } + } + + return false; + } + async function createTask() { const params = { serviceId: selectorStore.currentService.id, diff --git a/src/views/dashboard/related/async-profiling/components/data.ts b/src/views/dashboard/related/async-profiling/components/data.ts index 6078842b..f672b3c3 100644 --- a/src/views/dashboard/related/async-profiling/components/data.ts +++ b/src/views/dashboard/related/async-profiling/components/data.ts @@ -21,14 +21,7 @@ export const DurationOptions = [ { value: "15", label: "15 min" }, ]; -export const ProfilingEvents = [ - { value: "CPU", label: "CPU" }, - { value: "ALLOC", label: "ALLOC" }, - { value: "WALL", label: "WALL" }, - { value: "LOCK", label: "LOCK" }, - { value: "CTIMER", label: "CTIMER" }, - { value: "ITIMER", label: "ITIMER" }, -]; +export const ProfilingEvents = ["CPU", "ALLOC", "LOCK", "WALL", "CTIMER", "ITIMER"]; export enum EventsMap { CPU = "EXECUTION_SAMPLE",