diff --git a/frontend/src/components/LoadingContainer.vue b/frontend/src/components/LoadingContainer.vue new file mode 100644 index 0000000..60ac6af --- /dev/null +++ b/frontend/src/components/LoadingContainer.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/frontend/src/components/Spinner.vue b/frontend/src/components/Spinner.vue new file mode 100644 index 0000000..cfa3972 --- /dev/null +++ b/frontend/src/components/Spinner.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/frontend/src/stores/nodes.ts b/frontend/src/stores/nodes.ts index 9af5242..a59a304 100644 --- a/frontend/src/stores/nodes.ts +++ b/frontend/src/stores/nodes.ts @@ -38,7 +38,6 @@ export const useNodesStore = defineStore({ }, actions: { async refresh(page: number, nodesPerPage: number): Promise { - // TODO: Handle paging const result = await internalApi.getPagedList( "nodes", isEnhancedNode, diff --git a/frontend/src/views/AdminNodesView.vue b/frontend/src/views/AdminNodesView.vue index 7373ad2..3043a67 100644 --- a/frontend/src/views/AdminNodesView.vue +++ b/frontend/src/views/AdminNodesView.vue @@ -3,17 +3,28 @@ import {useNodesStore} from "@/stores/nodes"; import {onMounted, ref} from "vue"; import type {EnhancedNode, MAC} from "@/types"; import Pager from "@/components/Pager.vue"; +import LoadingContainer from "@/components/LoadingContainer.vue"; + +const NODE_PER_PAGE = 50; type NodeRedactField = "nickname" | "email" | "token"; type NodeRedactFieldsMap = Partial>; -type NodesRedactFieldsMap = Partial>; +type NodesRedactFieldsMap = Partial>; const nodes = useNodesStore(); const redactFieldsByDefault = ref(true); const nodesRedactFieldsMap = ref({} as NodesRedactFieldsMap) +const loading = ref(false); + async function refresh(page: number): Promise { - await nodes.refresh(page, 50); + loading.value = true; + redactAllFields(true); + try { + await nodes.refresh(page, NODE_PER_PAGE); + } finally { + loading.value = false; + } } function redactAllFields(shallRedactFields: boolean): void { @@ -46,7 +57,7 @@ onMounted(async () => await refresh(1));

Knoten

- Gesamt: {{nodes.getTotalNodes}} + Gesamt: {{ nodes.getTotalNodes }}