feat: Add connection testing functionality for Rclone providers

- Introduced a new endpoint to test connections for source and destination providers.
- Implemented a TestResult component to display success or error messages based on connection outcomes.
- Enhanced the configuration form with buttons to initiate connection tests, improving user experience.
- Updated backend logic to handle connection testing and return appropriate feedback to the frontend.
- Refactored existing handlers and routes to accommodate the new testing functionality.
This commit is contained in:
StarFleetCPTN
2025-03-29 11:27:48 -07:00
parent f95720758e
commit 68dd9fc173
7 changed files with 452 additions and 4 deletions
+17
View File
@@ -446,3 +446,20 @@ function enhanceMobileForms() {
});
});
}
// Listen for custom 'showToast' event triggered by HX-Trigger
document.body.addEventListener('showToast', function(event) {
// Debug logs removed
if (event.detail && event.detail.message && event.detail.type) {
// Call the globally defined showToast function from toast_js.templ
if (typeof showToast === 'function') {
showToast(event.detail.message, event.detail.type);
} else {
console.error('showToast function not found. Ensure toast_js.templ is loaded.');
}
} else {
console.warn('Received showToast event without expected detail:', event.detail);
}
});