Compare commits

..

1 commit

Author SHA1 Message Date
GJS
0f31fe3246
Merge 4e8264f6e6 into be2faf64ce 2024-12-29 15:13:32 +00:00

View file

@ -342,32 +342,26 @@ export default {
* Delete each selected monitor and update the UI once the deletion is complete.
* This method initiates the deletion process for all selected monitors, updates
* the user interface, and reloads the page to reflect the changes.
* @returns {void} - This function does not return any value.
* @returns {void}
*/
deleteSelected() {
// Iterate over each selected monitor's ID and delete it
// Delete each selected monitor
Object.keys(this.selectedMonitors).forEach(id => {
// Call the root method to delete the monitor by its ID
this.$root.deleteMonitor(id, (res) => {
// If the monitor deletion is successful
if (res.ok) {
// Remove the monitor from the selectedMonitors list upon successful deletion
delete this.selectedMonitors[id];
// Use Vue Router to navigate to a temporary route before redirecting to /dashboard
// This reloads the page to reflect changes after deletion
this.$router.push("/temp").then(() => {
this.$router.push("/dashboard");
});
// Refresh the page immediately after deleting the selected monitors
window.location.reload();
// Store a flag in localStorage to trigger a toast notification on page reload
// This ensures the notification displays after the page refreshes
// Store a flag in localStorage to trigger a toast notification once the page reloads
localStorage.setItem("toastMessage", JSON.stringify(res));
}
});
});
// Exit the selection mode, indicating that the deletion process is in progress
// Exit selection mode as deletion is in progress
this.cancelSelectMode();
},