Compare commits

...

18 commits

Author SHA1 Message Date
GJS
dad90fdcff
Merge 810ae1f64b into b45dc6787d 2025-02-17 13:21:32 +01:00
GJS
810ae1f64b
Merge branch 'master' into feat-remove-multiple-monitors-at-once 2025-02-17 13:21:30 +01:00
GJS
2de32f5b60
Merge branch 'master' into feat-remove-multiple-monitors-at-once 2025-02-06 19:50:45 +01:00
GJS
52b8ffb7b6
Merge branch 'master' into feat-remove-multiple-monitors-at-once 2025-02-06 13:46:30 +01:00
GJS
08e47bf4ab
Merge branch 'master' into feat-remove-multiple-monitors-at-once 2025-02-01 13:37:05 +01:00
GJS
f5fa2b9bd8
Merge branch 'master' into feat-remove-multiple-monitors-at-once 2025-01-26 14:32:51 +01:00
GJS
916eb2051f
Merge branch 'master' into feat-remove-multiple-monitors-at-once 2025-01-26 14:15:24 +01:00
GJS
ed6ee1b3eb
Merge branch 'master' into feat-remove-multiple-monitors-at-once 2025-01-24 20:17:34 +01:00
GJS
0ed0285825
Merge branch 'master' into feat-remove-multiple-monitors-at-once 2025-01-22 19:30:59 +01:00
GJS
d33def89df
Merge branch 'master' into feat-remove-multiple-monitors-at-once 2025-01-18 18:27:20 +01:00
GJS
c4391bb583
Updated: Adjust monitor deletion flow and page reload behavior
- Changed the page redirect after monitor deletion to the home page ("/") for a proper UI refresh.
- Removed the temporary route ("/temp") to simplify the deletion process.
- Ensured that the UI reloads correctly after monitor deletions via a direct redirect to the home page.

modified: src/components/MonitorList.vue
2025-01-02 14:08:13 +01:00
GJS
6a96694c17
Refactored: Rename deletion methods and references for consistency
- Renamed `deleteSelectedDialog` to `deleteSelectedMonitorDialog` for better clarity.
- Updated the corresponding method `deleteSelected` to `deleteSelectedMonitor` to reflect the new naming convention.
- Updated references in the template and JavaScript to match the new method names.
- Ensured consistency in naming to improve code readability and maintainability.

No functionality changes were made; only method names were modified for clarity.

modified: src/components/MonitorList.vue
2024-12-31 09:12:12 +01:00
GJS
cd6d4e3c1c
Refined: Clean up code formatting for deleteSelected method
- Removed JSDoc comment for the `deleteSelected` method `@returns {void}`.
- No functional changes made to the logic or behavior of the method.

modified: src/components/MonitorList.vue
2024-12-30 11:16:54 +01:00
GJS
f3948ce802
Refined: Improve monitor deletion process and UI update
- Replaced `window.location.reload()` with Vue Router navigation to a temporary route for smoother page reload.
- Added Vue Router redirection to `/dashboard` after monitor deletion for better user experience.
- Updated function documentation to clarify behavior and return type.

modified: src/components/MonitorList.vue
2024-12-30 06:33:50 +01:00
GJS
4e8264f6e6
Updated: Improve monitor deletion flow with toast notification
- Added functionality to retrieve and display a toast message from localStorage
  after the page reloads, triggered by a successful monitor deletion.
- Modified the `deleteSelected` method to immediately refresh the page after
  deleting selected monitors and store the response for the toast notification.
- Cleaned up localStorage after showing the toast to avoid repeating the message.

modified: src/components/MonitorList.vue
2024-12-29 16:12:20 +01:00
GJS
4aa76f50cc
Reverted: Undo changes to translations in language files
- Reverted translations for the message in the following language files:
  - `de-CH.json`
  - `de-DE.json`
  - `fr-FR.json`
  - `nl-NL.json`
- Restored the original translations to prevent file inconsistencies.
- Prevented inconsistencies caused by previous translation updates.

modified: src/lang/de-CH.json
modified: src/lang/de-DE.json
modified: src/lang/fr-FR.json
modified: src/lang/nl-NL.json
2024-12-28 20:35:48 +01:00
GJS
f11bd57589
Added: Confirmation message for deleting selected monitor(s)
- Added a new key `deleteSelectedMonitorMsg` for the confirmation message.
- Included translations for the message in the following files:
  - `de-CH.json`
  - `de-DE.json`
  - `en.json`
  - `fr-FR.json`
  - `nl-NL.json`
- The message prompts for confirmation when deleting one or more selected monitor(s).
- Ensured the message follows existing formatting standards.

modified: src/lang/de-CH.json
modified: src/lang/de-DE.json
modified: src/lang/en.json
modified: src/lang/fr-FR.json
modified: src/lang/nl-NL.json
2024-12-28 15:47:25 +01:00
GJS
1a6bf9f3b2
Added: Delete functionality for selected monitor(s) in MonitorList.vue
- Added a delete button to the selection controls for deleting selected monitor(s).
- Integrated a confirmation dialog (`confirmDeleteSelected`) with the message `deleteSelectedMonitorMsg`.
- Implemented `deleteSelectedDialog` to trigger the confirmation dialog.
- Created `deleteSelected` method to handle monitor deletion and update the selection state.
- Implemented toast notifications for feedback on the deletion status.
- Added page reload mechanism to reflect the deletion of monitors after all selected monitors are removed.
- Ensured consistent functionality with existing selection and action methods.

modified: src/components/MonitorList.vue
2024-12-28 15:46:32 +01:00
2 changed files with 64 additions and 0 deletions

View file

@ -39,6 +39,7 @@
<button class="btn-outline-normal" @click="pauseDialog"><font-awesome-icon icon="pause" size="sm" /> {{ $t("Pause") }}</button>
<button class="btn-outline-normal" @click="resumeSelected"><font-awesome-icon icon="play" size="sm" /> {{ $t("Resume") }}</button>
<button class="btn-outline-normal text-danger" @click="deleteSelectedMonitorDialog"><font-awesome-icon icon="trash" size="sm" /> {{ $t("Delete") }}</button>
<span v-if="selectedMonitorCount > 0">
{{ $t("selectedMonitorCount", [ selectedMonitorCount ]) }}
@ -64,9 +65,13 @@
</div>
</div>
<!-- Confirm Dialogs -->
<Confirm ref="confirmPause" :yes-text="$t('Yes')" :no-text="$t('No')" @yes="pauseSelected">
{{ $t("pauseMonitorMsg") }}
</Confirm>
<Confirm ref="confirmDeleteSelectedMonitor" :yes-text="$t('Yes')" :no-text="$t('No')" @yes="deleteSelectedMonitor">
{{ $t("deleteSelectedMonitorMsg") }}
</Confirm>
</template>
<script>
@ -206,6 +211,21 @@ export default {
},
mounted() {
window.addEventListener("scroll", this.onScroll);
// Retrieve the toast message from localStorage
const toastMessage = localStorage.getItem("toastMessage");
if (toastMessage) {
/**
* If a toast message exists in localStorage:
* 1. Parse the message from string to object format.
* 2. Display the toast notification using the root component's toastRes method.
* 3. Remove the message from localStorage to prevent it from showing again.
*/
this.$root.toastRes(JSON.parse(toastMessage)); // Show the toast message
localStorage.removeItem("toastMessage"); // Clean up the localStorage
}
},
beforeUnmount() {
window.removeEventListener("scroll", this.onScroll);
@ -306,6 +326,49 @@ export default {
this.cancelSelectMode();
},
/**
* Show the confirmation dialog for deleting the selected monitors.
* This method triggers the display of a confirmation modal where the user can
* confirm or cancel the deletion of the selected monitors.
* @returns {void}
*/
deleteSelectedMonitorDialog() {
// Show the confirmation dialog for deletion
this.$refs.confirmDeleteSelectedMonitor.show();
},
/**
* 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}
*/
deleteSelectedMonitor() {
// Iterate over each selected monitor's ID and delete it
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];
// Navigate to the home page ("/") to trigger a page reload and reflect the updates
// This step is necessary to refresh the UI after the monitors have been deleted
this.$router.push("/");
// Store a flag in localStorage to trigger a toast notification on page reload
// This ensures the notification displays after the page refreshes
localStorage.setItem("toastMessage", JSON.stringify(res));
}
});
});
// Exit the selection mode, indicating that the deletion process is in progress
this.cancelSelectMode();
},
/**
* Whether a monitor should be displayed based on the filters
* @param {object} monitor Monitor to check

View file

@ -569,6 +569,7 @@
"grpcMethodDescription": "Method name is convert to camelCase format such as sayHello, check, etc.",
"acceptedStatusCodesDescription": "Select status codes which are considered as a successful response.",
"deleteMonitorMsg": "Are you sure want to delete this monitor?",
"deleteSelectedMonitorMsg": "Are you sure want to delete the following monitors?",
"deleteMaintenanceMsg": "Are you sure want to delete this maintenance?",
"deleteNotificationMsg": "Are you sure want to delete this notification for all monitors?",
"dnsPortDescription": "DNS server port. Defaults to 53. You can change the port at any time.",