From 208cbd6d89a0c7b84c9d3006048eb7efab244157 Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Thu, 8 Aug 2024 20:56:14 -0400 Subject: [PATCH] Peer data reset function is don e --- .../configurationComponents/peerSettings.vue | 53 ++++++++++++++++--- .../peerSettingsDropdown.vue | 37 ++++++------- src/static/css/dashboard.css | 4 +- 3 files changed, 66 insertions(+), 28 deletions(-) diff --git a/src/static/app/src/components/configurationComponents/peerSettings.vue b/src/static/app/src/components/configurationComponents/peerSettings.vue index 2c37595..a413de7 100644 --- a/src/static/app/src/components/configurationComponents/peerSettings.vue +++ b/src/static/app/src/components/configurationComponents/peerSettings.vue @@ -37,6 +37,21 @@ export default { } this.$emit("refresh") }) + }, + resetPeerData(type){ + this.saving = true + fetchPost(`/api/resetPeerData/${this.$route.params.id}`, { + id: this.data.id, + type: type + }, (res) => { + this.saving = false; + if (res.status){ + this.dashboardConfigurationStore.newMessage("Server", "Peer data usage reset successfully.", "success") + }else{ + this.dashboardConfigurationStore.newMessage("Server", res.message, "danger") + } + this.$emit("refresh") + }) } }, beforeMount() { @@ -57,15 +72,15 @@ export default {