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

View File

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

View File

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