From ea2f424efab09796d9d45fe41a0e5e38581d6343 Mon Sep 17 00:00:00 2001 From: baldo Date: Mon, 30 May 2022 14:08:03 +0200 Subject: [PATCH] Add toggle to show / hide all sensitive fields. --- frontend/src/views/AdminNodesView.vue | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/AdminNodesView.vue b/frontend/src/views/AdminNodesView.vue index 0b648e2..29fda3c 100644 --- a/frontend/src/views/AdminNodesView.vue +++ b/frontend/src/views/AdminNodesView.vue @@ -9,19 +9,25 @@ type NodesRedactFieldsMap = Partial>; const nodes = useNodesStore(); const page = ref(0); +const redactFieldsByDefault = ref(true); const nodesRedactFieldsMap = ref({} as NodesRedactFieldsMap) function refresh(): void { nodes.refresh(); } +function redactAllFields(shallRedactFields: boolean): void { + redactFieldsByDefault.value = shallRedactFields; + nodesRedactFieldsMap.value = {}; +} + function shallRedactField(node: EnhancedNode, field: NodeRedactField): boolean { const redactFieldsMap = nodesRedactFieldsMap.value[node.mac]; if (!redactFieldsMap) { - return true; + return redactFieldsByDefault.value; } const redactField = redactFieldsMap[field]; - return redactField === undefined || redactField; + return redactField === undefined ? redactFieldsByDefault.value : redactField; } function setRedactField(node: EnhancedNode, field: NodeRedactField, value: boolean): void { @@ -45,6 +51,16 @@ refresh();
Gesamt: {{nodes.getTotalNodes}} + +