package components import ( "context" "fmt" "github.com/starfleetcptn/gomft/internal/db" ) // Dialog component for confirmation dialogs templ ConfigDialog(id string, title string, message string, confirmClass string, confirmText string, action string, configID uint, configName string) { } script hideConfigDialog(id string) { document.getElementById(id).classList.add("hidden"); } script showConfigDialog(id string) { document.getElementById(id).classList.remove("hidden"); } script triggerConfigDelete(dialogId string, configID uint, configName string) { // Hide the dialog document.getElementById(dialogId).classList.add("hidden"); // 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.

} 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), "btn-danger", "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.

} }