feat: update

This commit is contained in:
Fine 2023-05-30 10:12:44 +08:00
parent 77b58517c4
commit 29155118fc
3 changed files with 12 additions and 12 deletions

View File

@ -29,7 +29,7 @@ interface ContinousProfilingState {
strategyList: Array<Recordable<StrategyItem>>;
selectedStrategy: Recordable<StrategyItem>;
taskList: Array<Recordable<EBPFTaskList>>;
selectedContinousTask: Recordable<EBPFTaskList>;
selectedTask: Recordable<EBPFTaskList>;
errorTip: string;
errorReason: string;
processes: Process[];
@ -47,7 +47,7 @@ export const continousProfilingStore = defineStore({
strategyList: [],
selectedStrategy: {},
taskList: [],
selectedContinousTask: {},
selectedTask: {},
errorReason: "",
errorTip: "",
ebpfTips: "",
@ -62,8 +62,8 @@ export const continousProfilingStore = defineStore({
setSelectedStrategy(task: Recordable<StrategyItem>) {
this.selectedStrategy = task || {};
},
setSelectedContinousTask(task: Recordable<EBPFTaskList>) {
this.selectedContinousTask = task || {};
setselectedTask(task: Recordable<EBPFTaskList>) {
this.selectedTask = task || {};
},
setCurrentSchedule(s: EBPFProfilingSchedule) {
this.currentSchedule = s;
@ -134,8 +134,8 @@ export const continousProfilingStore = defineStore({
return res.data;
}
this.taskList = res.data.data.queryEBPFTasks || [];
this.selectedContinousTask = this.taskList[0] || {};
this.setSelectedContinousTask(this.selectedContinousTask);
this.selectedTask = this.taskList[0] || {};
this.setselectedTask(this.selectedTask);
if (!this.taskList.length) {
const networkProfilingStore = useNetworkProfilingStore();
networkProfilingStore.seNodes([]);

View File

@ -41,7 +41,7 @@ limitations under the License. -->
<div
class="vis-graph-topology ml-5"
v-loading="networkProfilingStore.loadNodes"
v-if="continousProfilingStore.selectedContinousTask.type === TargetTypes[2].value"
v-if="continousProfilingStore.selectedTask.type === TargetTypes[2].value"
>
<process-topology v-if="networkProfilingStore.nodes.length" :config="config" />
<div class="text" v-else>
@ -98,14 +98,14 @@ limitations under the License. -->
}
async function analyzeTask() {
if (continousProfilingStore.selectedContinousTask.type === TargetTypes[2].value) {
await networkProfilingStore.setSelectedNetworkTask(continousProfilingStore.selectedContinousTask);
if (continousProfilingStore.selectedTask.type === TargetTypes[2].value) {
await networkProfilingStore.setSelectedNetworkTask(continousProfilingStore.selectedTask);
await getTopology();
return;
}
const res = await continousProfilingStore.getEBPFSchedules({
taskId: continousProfilingStore.selectedContinousTask.taskId,
taskId: continousProfilingStore.selectedTask.taskId,
});
if (res.errors) {
ElMessage.error(res.errors);

View File

@ -30,7 +30,7 @@ limitations under the License. -->
<td
class="profile-td"
:class="{
selected: continousProfilingStore.selectedContinousTask.taskId === i.taskId,
selected: continousProfilingStore.selectedTask.taskId === i.taskId,
}"
>
<div class="ell">
@ -70,7 +70,7 @@ limitations under the License. -->
const viewDetail = ref<boolean>(false);
async function changeTask(item: EBPFTaskList) {
continousProfilingStore.setSelectedContinousTask(item);
continousProfilingStore.setselectedTask(item);
}
</script>
<style lang="scss" scoped>