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) {

Transfer Configurations

New Configuration
if len(data.Configs) == 0 {

No configurations

Get started by creating a new transfer configuration.

Create First Configuration
} else {
    for _, config := range data.Configs {
  • { 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 }
    if (config.DestinationType == "gdrive" || config.SourceType == "gdrive" || config.SourceType == "gphotos" || config.DestinationType == "gphotos") && !config.GetGoogleAuthenticated() { Authenticate } Edit @ConfigDialog( fmt.Sprintf("delete-config-dialog-%d", config.ID), "Delete Configuration", fmt.Sprintf("Are you sure you want to delete the configuration '%s'? This cannot be undone.", config.Name), "text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center", "Delete", "delete", config.ID, config.Name, )

    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.

} }