mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-02 15:14:46 +00:00
fix: pod list (#266)
This commit is contained in:
parent
359197a1c5
commit
fe28fae27d
@ -113,7 +113,7 @@ limitations under the License. -->
|
|||||||
ElMessage.error(resp.errors);
|
ElMessage.error(resp.errors);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
endpoints.value = selectorStore.pods;
|
endpoints.value = resp.data.pods || [];
|
||||||
queryEndpointMetrics(endpoints.value);
|
queryEndpointMetrics(endpoints.value);
|
||||||
}
|
}
|
||||||
async function queryEndpointMetrics(currentPods: Endpoint[]) {
|
async function queryEndpointMetrics(currentPods: Endpoint[]) {
|
||||||
|
@ -70,7 +70,7 @@ limitations under the License. -->
|
|||||||
small
|
small
|
||||||
layout="prev, pager, next"
|
layout="prev, pager, next"
|
||||||
:page-size="pageSize"
|
:page-size="pageSize"
|
||||||
:total="selectorStore.pods.length"
|
:total="pods.length"
|
||||||
@current-change="changePage"
|
@current-change="changePage"
|
||||||
@prev-click="changePage"
|
@prev-click="changePage"
|
||||||
@next-click="changePage"
|
@next-click="changePage"
|
||||||
@ -125,6 +125,7 @@ limitations under the License. -->
|
|||||||
const colMetrics = ref<string[]>([]);
|
const colMetrics = ref<string[]>([]);
|
||||||
const metricConfig = ref<MetricConfigOpt[]>(props.config.metricConfig || []);
|
const metricConfig = ref<MetricConfigOpt[]>(props.config.metricConfig || []);
|
||||||
const metricTypes = ref<string[]>(props.config.metricTypes || []);
|
const metricTypes = ref<string[]>(props.config.metricTypes || []);
|
||||||
|
const pods = ref<Instance[]>([]); // all instances
|
||||||
if (props.needQuery) {
|
if (props.needQuery) {
|
||||||
queryInstance();
|
queryInstance();
|
||||||
}
|
}
|
||||||
@ -137,9 +138,11 @@ limitations under the License. -->
|
|||||||
if (resp && resp.errors) {
|
if (resp && resp.errors) {
|
||||||
ElMessage.error(resp.errors);
|
ElMessage.error(resp.errors);
|
||||||
instances.value = [];
|
instances.value = [];
|
||||||
|
pods.value = [];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
instances.value = selectorStore.pods.filter((d: unknown, index: number) => index < pageSize);
|
pods.value = resp.data.pods || [];
|
||||||
|
instances.value = pods.value.filter((d: unknown, index: number) => index < pageSize);
|
||||||
queryInstanceMetrics(instances.value);
|
queryInstanceMetrics(instances.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,7 +192,7 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
|
|
||||||
function changePage(pageIndex: number) {
|
function changePage(pageIndex: number) {
|
||||||
instances.value = selectorStore.pods.filter((d: unknown, index: number) => {
|
instances.value = pods.value.filter((d: unknown, index: number) => {
|
||||||
if (index >= (pageIndex - 1) * pageSize && index < pageIndex * pageSize) {
|
if (index >= (pageIndex - 1) * pageSize && index < pageIndex * pageSize) {
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@ -198,7 +201,7 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
|
|
||||||
function searchList() {
|
function searchList() {
|
||||||
const searchInstances = selectorStore.pods.filter((d: { label: string }) => d.label.includes(searchText.value));
|
const searchInstances = pods.value.filter((d: { label: string }) => d.label.includes(searchText.value));
|
||||||
instances.value = searchInstances.filter((d: unknown, index: number) => index < pageSize);
|
instances.value = searchInstances.filter((d: unknown, index: number) => index < pageSize);
|
||||||
queryInstanceMetrics(instances.value);
|
queryInstanceMetrics(instances.value);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user