From 68dd9fc1739f021140576b669cc8b41f02bd4061 Mon Sep 17 00:00:00 2001 From: StarFleetCPTN Date: Sat, 29 Mar 2025 11:27:48 -0700 Subject: [PATCH] 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. --- components/config_form.templ | 35 ++- components/providers/common/common.templ | 2 +- components/test_result.templ | 15 ++ internal/rclone_service/rclone_service.go | 298 ++++++++++++++++++++++ internal/web/handlers/config_handlers.go | 88 +++++++ internal/web/handlers/routes.go | 1 + static/js/app.js | 17 ++ 7 files changed, 452 insertions(+), 4 deletions(-) create mode 100644 components/test_result.templ create mode 100644 internal/rclone_service/rclone_service.go diff --git a/components/config_form.templ b/components/config_form.templ index 2f07b01..e106855 100644 --- a/components/config_form.templ +++ b/components/config_form.templ @@ -459,6 +459,9 @@ templ ConfigForm(ctx context.Context, data ConfigFormData) { Command Configuration + + @common.RcloneFlags(data.Config.CommandID) // Pass current command ID +
if !data.IsNew && data.InitialCommand != nil { @@ -467,9 +470,7 @@ templ ConfigForm(ctx context.Context, data ConfigFormData) { }
- - @common.RcloneFlags(data.Config.CommandID) // Pass current command ID - + @@ -481,6 +482,20 @@ templ ConfigForm(ctx context.Context, data ConfigFormData) { @common.SourceSelection() +
+ + +
+