package components import ( "context" "fmt" ) // Storage Providers Import Page // User uploads a config, previews/edit remotes, selects which to import // On submit, POSTs selected remotes to /storage-providers/import/confirm // Main import page template templ StorageProvidersImport(ctx context.Context, preview RcloneImportPreview) {

Import rclone Config

Back to Providers

Import from rclone Config

Upload your rclone configuration file to import storage providers. You'll be able to preview and select which remotes to import, and add any missing credentials.

Accepted formats: .conf, .txt, .ini, .cfg

@RcloneImportPreviewContent(ctx, preview)
} // Just the preview content for HTMX updates templ RcloneImportPreviewContent(ctx context.Context, preview RcloneImportPreview) { if preview.Error != "" { } else if preview.Remotes != nil && len(preview.Remotes) > 0 {

Found {fmt.Sprintf("%d", len(preview.Remotes))} remotes

Select which remotes to import and edit their details if needed.

if len(preview.Remotes) > 0 { for _, remote := range preview.Remotes { } } else { }
Name Type Fields
for k, v := range remote.Fields {
{k}:
}
Add or Update Credentials
if _, exists := remote.Fields["user"]; !exists && (remote.Type == "sftp" || remote.Type == "ftp" || remote.Type == "smb" || remote.Type == "webdav") {
user:
} if _, exists := remote.Fields["pass"]; !exists && (remote.Type == "sftp" || remote.Type == "ftp" || remote.Type == "smb" || remote.Type == "webdav") {
pass:
} if remote.Type == "s3" || remote.Type == "wasabi" || remote.Type == "minio" || remote.Type == "b2" { if _, exists := remote.Fields["access_key_id"]; !exists {
access_key_id:
} if _, exists := remote.Fields["secret_access_key"]; !exists {
secret_access_key:
} } if remote.Type == "drive" || remote.Type == "onedrive" || remote.Type == "gphotos" { if _, exists := remote.Fields["client_id"]; !exists {
client_id:
} if _, exists := remote.Fields["client_secret"]; !exists {
client_secret:
} }
No remotes found in config.
Cancel
} else { } }