Skip to content

Commit

Permalink
add UI elements for node count
Browse files Browse the repository at this point in the history
  • Loading branch information
USA-RedDragon committed May 1, 2024
1 parent e55501d commit 25d7539
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions frontend/src/components/NodesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
@page="onPage($event)"
>
<template #header>
<p>Found {{ this.arednNodesCount }} AREDN nodes and {{ this.devicesCount }} total devices.</p>
<br />
<div class="flex justify-content-between">
<PVButton type="button" icon="pi pi-filter-slash" label="Clear" outlined @click="clearFilter()" />
<span class="p-input-icon-left">
Expand Down Expand Up @@ -87,6 +89,8 @@ export default {
totalRecords: 0,
filters: null,
page: 1,
arednNodesCount: 0,
devicesCount: 0,
};
},
created() {
Expand Down Expand Up @@ -118,6 +122,14 @@ export default {
},
fetchData(page = 1, limit = 50) {
this.loading = true;
API.get(`/olsr/hosts/count`)
.then((res) => {
this.arednNodesCount = res.data.nodes;
this.devicesCount = res.data.total;
})
.catch((err) => {
console.error(err);
});
API.get(`/olsr/hosts?page=${page}&limit=${limit}`)
.then((res) => {
if (!res.data.nodes) {
Expand Down

0 comments on commit 25d7539

Please sign in to comment.