mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-18 00:45:26 +00:00
update pages
This commit is contained in:
parent
9b8a939e62
commit
cda73845bb
@ -65,17 +65,6 @@ limitations under the License. -->
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<el-pagination
|
|
||||||
class="pagination"
|
|
||||||
background
|
|
||||||
small
|
|
||||||
layout="prev, pager, next"
|
|
||||||
:page-size="pageSize"
|
|
||||||
:total="selectorStore.pods.length"
|
|
||||||
@current-change="changePage"
|
|
||||||
@prev-click="changePage"
|
|
||||||
@next-click="changePage"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -117,7 +106,6 @@ const selectorStore = useSelectorStore();
|
|||||||
const dashboardStore = useDashboardStore();
|
const dashboardStore = useDashboardStore();
|
||||||
const chartLoading = ref<boolean>(false);
|
const chartLoading = ref<boolean>(false);
|
||||||
const endpoints = ref<Endpoint[]>([]);
|
const endpoints = ref<Endpoint[]>([]);
|
||||||
const pageSize = 10;
|
|
||||||
const searchText = ref<string>("");
|
const searchText = ref<string>("");
|
||||||
|
|
||||||
queryEndpoints();
|
queryEndpoints();
|
||||||
@ -133,9 +121,7 @@ async function queryEndpoints() {
|
|||||||
ElMessage.error(resp.errors);
|
ElMessage.error(resp.errors);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
endpoints.value = selectorStore.pods.filter(
|
endpoints.value = selectorStore.pods;
|
||||||
(d: unknown, index: number) => index < pageSize
|
|
||||||
);
|
|
||||||
queryEndpointMetrics(endpoints.value);
|
queryEndpointMetrics(endpoints.value);
|
||||||
}
|
}
|
||||||
async function queryEndpointMetrics(currentPods: Endpoint[]) {
|
async function queryEndpointMetrics(currentPods: Endpoint[]) {
|
||||||
@ -180,14 +166,6 @@ function clickEndpoint(scope: any) {
|
|||||||
`/dashboard/${d.layer}/${d.entity}/${selectorStore.currentService.id}/${scope.row.id}/${d.name}`
|
`/dashboard/${d.layer}/${d.entity}/${selectorStore.currentService.id}/${scope.row.id}/${d.name}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function changePage(pageIndex: number) {
|
|
||||||
endpoints.value = selectorStore.pods.filter((d: unknown, index: number) => {
|
|
||||||
if (index >= (pageIndex - 1) * pageSize && index < pageIndex * pageSize) {
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
queryEndpointMetrics(endpoints.value);
|
|
||||||
}
|
|
||||||
async function searchList() {
|
async function searchList() {
|
||||||
await queryEndpoints();
|
await queryEndpoints();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user