This commit is contained in:
Qiuxia Fan 2022-04-24 12:55:25 +08:00
parent 96164e5623
commit 1f173b5c62
2 changed files with 10 additions and 3 deletions

View File

@ -117,7 +117,7 @@ const handleSelectionChange = (arr: Process[]) => {
};
async function analyzeEBPF() {
let arr: string[] = [];
let arr: string[] = selectedLabels.value;
if (selectedLabels.value.includes("0")) {
arr = labels.value.map((d: Option) => d.value);
}
@ -125,7 +125,7 @@ async function analyzeEBPF() {
const scheduleIdList = ebpfStore.eBPFSchedules.flatMap(
(d: EBPFProfilingSchedule) => {
const l = d.process.labels.find((d: string) => arr.includes(d));
const i = selectedLabels.value.includes(d.process.id);
const i = selectedProcesses.value.includes(d.process.id);
if (l || i) {
ranges.push({
start: d.startTime,
@ -164,6 +164,7 @@ function visTimeline() {
visGraph.value.destroy();
}
labels.value = [{ label: "All", value: "0" }];
selectedLabels.value = ["0"];
processes.value = [];
const schedules = ebpfStore.eBPFSchedules.map(
(d: EBPFProfilingSchedule, index: number) => {

View File

@ -103,7 +103,7 @@ limitations under the License. -->
</el-dialog>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import { ref, watch } from "vue";
import dayjs from "dayjs";
import { useI18n } from "vue-i18n";
import { useEbpfStore } from "@/store/modules/ebpf";
@ -126,6 +126,12 @@ async function changeTask(item: EBPFTaskList) {
ElMessage.error(res.errors);
}
}
watch(
() => ebpfStore.taskList,
() => {
selectedTask.value = ebpfStore.taskList[0] || {};
}
);
</script>
<style lang="scss" scoped>
.profile-task-list {