mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-18 18:45:23 +00:00
fix selector
This commit is contained in:
parent
3b921aa911
commit
30cbcd1b95
@ -295,15 +295,12 @@ async function setSourceSelector() {
|
||||
return;
|
||||
}
|
||||
const pod = params.podId || selectorStore.pods[0].id;
|
||||
let currentPod;
|
||||
if (states.currentPod) {
|
||||
currentPod = selectorStore.pods.find(
|
||||
(d: { label: string }) => d.label === states.currentPod
|
||||
);
|
||||
} else {
|
||||
currentPod = selectorStore.pods.find((d: { id: string }) => d.id === pod);
|
||||
}
|
||||
const currentPod = selectorStore.pods.find(
|
||||
(d: { id: string }) => d.id === pod
|
||||
);
|
||||
if (!currentPod) {
|
||||
selectorStore.setCurrentProcess(null);
|
||||
states.currentProcess = "";
|
||||
return;
|
||||
}
|
||||
selectorStore.setCurrentPod(currentPod);
|
||||
@ -314,16 +311,9 @@ async function setSourceSelector() {
|
||||
return;
|
||||
}
|
||||
const process = params.processId || selectorStore.processes[0].id;
|
||||
let currentProcess;
|
||||
if (states.currentProcess) {
|
||||
currentProcess = selectorStore.processes.find(
|
||||
(d: { label: string }) => d.label === states.currentProcess
|
||||
);
|
||||
} else {
|
||||
currentProcess = selectorStore.processes.find(
|
||||
(d: { id: string }) => d.id === process
|
||||
);
|
||||
}
|
||||
const currentProcess = selectorStore.processes.find(
|
||||
(d: { id: string }) => d.id === process
|
||||
);
|
||||
if (currentProcess) {
|
||||
selectorStore.setCurrentProcess(currentProcess);
|
||||
states.currentProcess = currentProcess.label;
|
||||
@ -344,36 +334,27 @@ async function setDestSelector() {
|
||||
return;
|
||||
}
|
||||
const destPod = params.destPodId || selectorStore.destPods[0].id;
|
||||
let currentDestPod = { label: "" };
|
||||
if (states.currentDestPod) {
|
||||
currentDestPod = selectorStore.pods.find(
|
||||
(d: { label: string }) => d.label === states.currentDestPod
|
||||
);
|
||||
} else {
|
||||
currentDestPod = selectorStore.destPods.find(
|
||||
(d: { id: string }) => d.id === destPod
|
||||
);
|
||||
}
|
||||
const currentDestPod = selectorStore.destPods.find(
|
||||
(d: { id: string }) => d.id === destPod
|
||||
);
|
||||
if (!currentDestPod) {
|
||||
states.currentDestProcess = "";
|
||||
selectorStore.setCurrentProcess(null);
|
||||
return;
|
||||
}
|
||||
selectorStore.setCurrentDestPod(currentDestPod);
|
||||
states.currentDestPod = currentDestPod.label;
|
||||
const destProcess = params.destProcessId || selectorStore.destProcesses[0].id;
|
||||
let currentDestProcess;
|
||||
if (states.currentDestProcess) {
|
||||
currentDestProcess = selectorStore.destProcesses.find(
|
||||
(d: { label: string }) => d.label === states.currentProcess
|
||||
);
|
||||
} else {
|
||||
currentDestProcess = selectorStore.destProcesses.find(
|
||||
(d: { id: string }) => d.id === destProcess
|
||||
);
|
||||
}
|
||||
if (currentDestProcess) {
|
||||
selectorStore.setCurrentProcess(currentDestProcess);
|
||||
states.currentProcess = currentDestProcess.label;
|
||||
const currentDestProcess = selectorStore.destProcesses.find(
|
||||
(d: { id: string }) => d.id === destProcess
|
||||
);
|
||||
if (!currentDestProcess) {
|
||||
states.currentDestProcess = "";
|
||||
selectorStore.setCurrentProcess(null);
|
||||
return;
|
||||
}
|
||||
selectorStore.setCurrentProcess(currentDestProcess);
|
||||
states.currentDestProcess = currentDestProcess.label;
|
||||
}
|
||||
|
||||
async function getServices() {
|
||||
|
Loading…
Reference in New Issue
Block a user