package components import ( "context" "fmt" "github.com/starfleetcptn/gomft/internal/db" ) // Dialog component for confirmation dialogs using Flowbite modal templ ConfigDialog(id string, title string, message string, confirmClass string, confirmText string, action string, configID uint, configName string) {
} script closeModal(id string) { const modal = document.getElementById(id); const backdrop = document.getElementById(id + '-backdrop'); if (modal) { modal.classList.add('hidden'); modal.classList.remove('flex'); } if (backdrop) { backdrop.remove(); } document.body.style.overflow = ''; } script showModal(id string) { const modal = document.getElementById(id); if (modal) { modal.classList.remove('hidden'); modal.classList.add('flex'); document.body.style.overflow = 'hidden'; } } script triggerConfigDelete(dialogId string, configID uint, configName string) { // Hide the dialog document.getElementById(dialogId).classList.add("hidden"); document.getElementById(dialogId).classList.remove("flex"); // Store data in a way that's accessible to event handlers window.lastDeletedConfig = { id: configID, name: configName }; // Add custom marker to track this deletion window.currentlyDeletingConfig = true; } type ConfigsData struct { Configs []db.TransferConfig Error string ErrorDetails string Status string } templ Configs(ctx context.Context, data ConfigsData) { @LayoutWithContext("Transfer Configurations", ctx) {{ config.Name }
if (config.DestinationType == "gdrive" || config.SourceType == "gdrive" || config.SourceType == "gphotos" || config.DestinationType == "gphotos") && !config.GetGoogleAuthenticated() { Authentication Required } if (config.DestinationType == "gdrive" || config.SourceType == "gdrive" || config.SourceType == "gphotos" || config.DestinationType == "gphotos") && config.GetGoogleAuthenticated() { Authenticated }Source: { config.SourceType }: { config.SourcePath }
Destination: { config.DestinationType }: { config.DestinationPath }
Updated: { config.UpdatedAt.Format("2006-01-02 15:04:05") }
Configurations define how files are transferred between systems
Google Drive and Google Photos configurations require authentication. Click the "Authenticate" button to complete setup.
When duplicating configurations, you may need to re-enter sensitive credentials for security reasons. Make sure to edit duplicated configurations to add any required credentials.