mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-18 16:05:24 +00:00
fix processes fliter
This commit is contained in:
parent
b02d22def3
commit
2033edbefd
2
src/types/ebpf.d.ts
vendored
2
src/types/ebpf.d.ts
vendored
@ -52,7 +52,7 @@ export type Process = {
|
|||||||
instanceName: string;
|
instanceName: string;
|
||||||
agentId: string;
|
agentId: string;
|
||||||
detectType: string;
|
detectType: string;
|
||||||
attributes: { name: string; value: string };
|
attributes: { name: string; value: string }[];
|
||||||
labels: string[];
|
labels: string[];
|
||||||
};
|
};
|
||||||
export type StackElement = {
|
export type StackElement = {
|
||||||
|
@ -34,7 +34,7 @@ limitations under the License. -->
|
|||||||
placeholder="Please input name"
|
placeholder="Please input name"
|
||||||
class="input-with-search"
|
class="input-with-search"
|
||||||
size="small"
|
size="small"
|
||||||
@change="searchProcesses"
|
@change="searchProcesses(0)"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<el-button size="small">
|
<el-button size="small">
|
||||||
@ -180,7 +180,7 @@ function visTimeline() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
searchProcesses();
|
searchProcesses(0);
|
||||||
if (!timeline.value) {
|
if (!timeline.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -200,18 +200,38 @@ function changePage(pageIndex: number) {
|
|||||||
searchProcesses(pageIndex);
|
searchProcesses(pageIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchProcesses(pageIndex?: any) {
|
function searchProcesses(pageIndex: number) {
|
||||||
const arr = processes.value.filter(
|
const arr = processes.value.filter(
|
||||||
(d: { name: string; instanceName: string }) =>
|
(d: {
|
||||||
|
name: string;
|
||||||
|
instanceName: string;
|
||||||
|
attributes: { name: string; value: string }[];
|
||||||
|
}) =>
|
||||||
d.name.includes(searchText.value) ||
|
d.name.includes(searchText.value) ||
|
||||||
d.instanceName.includes(searchText.value)
|
d.instanceName.includes(searchText.value) ||
|
||||||
|
searchAttribute(d.attributes, searchText.value)
|
||||||
);
|
);
|
||||||
currentProcesses.value = arr.splice(
|
currentProcesses.value = arr.filter(
|
||||||
(pageIndex - 1 || 0) * pageSize,
|
(d, index: number) =>
|
||||||
pageSize * (pageIndex || 1)
|
(pageIndex - 1 || 0) * pageSize <= index &&
|
||||||
|
pageSize * (pageIndex || 1) > index
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function searchAttribute(
|
||||||
|
attributes: { name: string; value: string }[],
|
||||||
|
text: string
|
||||||
|
) {
|
||||||
|
const item = attributes.find(
|
||||||
|
(d: { name: string; value: string }) => d.name === "command_line"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!item) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return item.value.includes(text);
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => ebpfStore.eBPFSchedules,
|
() => ebpfStore.eBPFSchedules,
|
||||||
() => {
|
() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user