refactor: Update UI components for improved styling and accessibility

- Change background and text colors in configuration forms to enhance visibility and consistency with dark mode.
- Update button classes and layout for better responsiveness and user experience.
- Revise authentication prompts and information sections for Google Drive and Google Photos to clarify the authentication process.
- Ensure all text elements are styled appropriately for both light and dark themes, improving overall accessibility.
This commit is contained in:
StarFleetCPTN
2025-03-16 11:53:22 -07:00
parent cab1de3306
commit 522699d96a
6 changed files with 176 additions and 152 deletions
+25 -25
View File
@@ -49,7 +49,7 @@ templ FilePatternFields() {
Pattern for output filename. Use variables like ${`filename`}, ${`timestamp`}, ${`date`}
</p>
<div>
<p class="mt-1 text-xs text-gray-500">
<p class="mt-1 text-xs text-secondary-500 dark:text-secondary-400">
Pattern for filenames. Available variables:<br />
${`filename`} - Original filename without extension (e.g., "report")<br />
${`ext`} - Original file extension (e.g., "csv")<br />
@@ -65,8 +65,8 @@ templ FilePatternFields() {
}
templ ArchiveOptions() {
<div class="border border-gray-200 rounded-lg p-6 bg-gray-50 shadow-sm">
<h3 class="text-lg font-medium text-gray-900 mb-4">Archive &amp; Delete Options</h3>
<div class="border border-secondary-200 dark:border-secondary-700 rounded-lg p-6 bg-secondary-50 dark:bg-secondary-800/50 shadow-sm">
<h3 class="text-lg font-medium text-secondary-900 dark:text-secondary-100 mb-4">Archive &amp; Delete Options</h3>
<div class="mb-4">
<label for="archive_enabled" class="flex items-center cursor-pointer">
@@ -75,29 +75,29 @@ templ ArchiveOptions() {
class="sr-only"
:value="archiveEnabled ? 'true' : 'false'"
/>
<div class="block bg-gray-200 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition"
<div class="block bg-secondary-200 dark:bg-secondary-700 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white dark:bg-secondary-100 w-6 h-6 rounded-full transition"
:class="archiveEnabled ? 'transform translate-x-6 bg-primary-500' : ''"></div>
</div>
<div class="ml-3 text-gray-700 font-medium">
<div class="ml-3 text-secondary-700 dark:text-secondary-300 font-medium">
Enable archiving
</div>
</label>
</div>
<div class="mb-4" x-show="archiveEnabled">
<label for="archive_path" class="block text-sm font-medium text-gray-700 mb-1">Archive Path</label>
<label for="archive_path" class="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-1">Archive Path</label>
<div class="relative">
<span class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-folder text-gray-400"></i>
<i class="fas fa-folder text-secondary-400 dark:text-secondary-600"></i>
</span>
<input id="archive_path" name="archive_path" type="text"
class="pl-10 pr-10 py-2 border border-gray-300 rounded-md focus:ring-primary-500 focus:border-primary-500 block w-full shadow-sm"
class="form-input pl-10 w-full rounded-lg border-secondary-300 dark:border-secondary-700 dark:bg-secondary-800 dark:text-secondary-100 focus:ring-primary-500 focus:border-primary-500"
placeholder="Path to archive files"
x-model="archivePath"
/>
</div>
<p class="mt-1 text-xs text-gray-500">
<p class="mt-1 text-xs text-secondary-500 dark:text-secondary-400">
Files will be moved here after successful transfer
</p>
</div>
@@ -109,15 +109,15 @@ templ ArchiveOptions() {
class="sr-only"
:value="deleteAfterTransfer ? 'true' : 'false'"
/>
<div class="block bg-gray-200 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition"
<div class="block bg-secondary-200 dark:bg-secondary-700 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white dark:bg-secondary-100 w-6 h-6 rounded-full transition"
:class="deleteAfterTransfer ? 'transform translate-x-6 bg-red-500' : ''"></div>
</div>
<div class="ml-3 text-gray-700 font-medium">
<div class="ml-3 text-secondary-700 dark:text-secondary-300 font-medium">
Delete source files after transfer
</div>
</label>
<p class="mt-1 ml-14 text-xs text-red-500" x-show="deleteAfterTransfer">
<p class="mt-1 ml-14 text-xs text-red-500 dark:text-red-400" x-show="deleteAfterTransfer">
<i class="fas fa-exclamation-triangle mr-1"></i> Warning: This will permanently delete the original files
</p>
</div>
@@ -129,30 +129,30 @@ templ ArchiveOptions() {
class="sr-only"
:value="skipProcessedFiles ? 'true' : 'false'"
/>
<div class="block bg-gray-200 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition"
<div class="block bg-secondary-200 dark:bg-secondary-700 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white dark:bg-secondary-100 w-6 h-6 rounded-full transition"
:class="skipProcessedFiles ? 'transform translate-x-6 bg-primary-500' : ''"></div>
</div>
<div class="ml-3 text-gray-700 font-medium">
<div class="ml-3 text-secondary-700 dark:text-secondary-300 font-medium">
Skip files that have already been processed
</div>
</label>
<p class="mt-1 ml-14 text-xs text-gray-500">
<p class="mt-1 ml-14 text-xs text-secondary-500 dark:text-secondary-400">
Files with the same hash that have been successfully processed before will be skipped
</p>
</div>
<div class="mb-4">
<label for="max_concurrent_transfers" class="block text-sm font-medium text-gray-700 mb-1">Concurrent Transfers</label>
<label for="max_concurrent_transfers" class="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-1">Concurrent Transfers</label>
<div class="flex items-center">
<input type="range" id="max_concurrent_transfers" name="max_concurrent_transfers"
class="form-range w-2/3 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"
class="form-range w-2/3 h-2 bg-secondary-200 dark:bg-secondary-700 rounded-lg appearance-none cursor-pointer"
min="1" max="32" step="1"
x-model="maxConcurrentTransfers"
/>
<span class="ml-4 text-gray-700" x-text="maxConcurrentTransfers"></span>
<span class="ml-4 text-secondary-700 dark:text-secondary-300" x-text="maxConcurrentTransfers"></span>
</div>
<p class="mt-1 text-xs text-gray-500">
<p class="mt-1 text-xs text-secondary-500 dark:text-secondary-400">
Number of files to transfer simultaneously (higher values may improve performance but increase resource usage)
</p>
</div>
@@ -161,16 +161,16 @@ templ ArchiveOptions() {
templ RcloneFlags() {
<div>
<label for="rclone_flags" class="block text-sm font-medium text-gray-700">Rclone Flags</label>
<label for="rclone_flags" class="block text-sm font-medium text-secondary-700 dark:text-secondary-300">Rclone Flags</label>
<div class="mt-1 relative rounded-md shadow-sm">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-flag text-gray-400"></i>
<i class="fas fa-flag text-secondary-400 dark:text-secondary-600"></i>
</div>
<input type="text" name="rclone_flags" id="rclone_flags" x-model="rcloneFlags"
class="form-input pl-10 w-full rounded-lg border-secondary-300 dark:border-secondary-700 dark:bg-secondary-800 dark:text-secondary-100 focus:ring-primary-500 focus:border-primary-500"
placeholder="--transfers 4 --checkers 8" />
</div>
<p class="mt-1 text-xs text-gray-500">
<p class="mt-1 text-xs text-secondary-500 dark:text-secondary-400">
Optional: Additional rclone flags for fine-tuning the transfer.
</p>
</div>
+22 -26
View File
@@ -14,11 +14,11 @@ templ GoogleDriveDestinationForm() {
class="sr-only"
x-model="useBuiltinAuth"
/>
<div class="block bg-gray-200 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition"
<div class="block bg-secondary-200 dark:bg-secondary-700 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white dark:bg-secondary-100 w-6 h-6 rounded-full transition"
:class="useBuiltinAuth ? 'transform translate-x-6 bg-primary-500' : ''"></div>
</div>
<div class="ml-3 text-gray-700 font-medium">
<div class="ml-3 text-secondary-700 dark:text-secondary-300 font-medium">
Use rclone's built-in Google authentication (recommended)
</div>
</label>
@@ -112,47 +112,43 @@ templ GoogleDriveDestinationForm() {
</p>
</div>
<div class="p-4 bg-amber-50 rounded-lg border border-amber-100">
<div class="p-4 bg-amber-50 dark:bg-amber-900/50 rounded-lg border border-amber-100 dark:border-amber-700">
<div class="flex">
<div class="flex-shrink-0">
<i class="fas fa-exclamation-triangle text-amber-500"></i>
<i class="fas fa-exclamation-triangle text-amber-500 dark:text-amber-400"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-amber-800">Important: Authentication Required</h3>
<div class="mt-2 text-sm text-amber-700">
<p><strong>After saving this configuration</strong>, you will need to authenticate with Google Drive.</p>
<p class="mt-1">The authentication process will require you to:</p>
<ol class="list-decimal list-inside mt-1 space-y-1">
<li>Visit a Google authorization URL</li>
<li>Sign in to your Google account</li>
<li>Grant permission to access your Google Drive</li>
<li>Copy the authorization code back to this application</li>
<h3 class="text-sm font-medium text-amber-800 dark:text-amber-200">Authentication Required</h3>
<div class="mt-2 text-sm text-amber-700 dark:text-amber-300">
<p>After saving this configuration, you'll need to authenticate with Google Drive:</p>
<ol class="list-decimal list-inside mt-2 space-y-1">
<li>Go to the configurations page</li>
<li>Click the "Authenticate" button for this configuration</li>
<li>You'll be redirected to Google to grant access permissions</li>
<li>After granting permission, you'll be automatically redirected back to GoMFT</li>
</ol>
<p class="mt-2 text-xs">
This is a one-time process for each configuration. The application will store your authorization token securely.
</p>
</div>
</div>
</div>
</div>
<div class="p-4 bg-blue-50 rounded-lg border border-blue-100">
<div class="p-4 bg-blue-50 dark:bg-blue-900/50 rounded-lg border border-blue-100 dark:border-blue-700">
<div class="flex">
<div class="flex-shrink-0">
<i class="fas fa-info-circle text-blue-400"></i>
<i class="fas fa-info-circle text-blue-400 dark:text-blue-300"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-blue-800">Authentication Information</h3>
<div class="mt-2 text-sm text-blue-700">
<h3 class="text-sm font-medium text-blue-800 dark:text-blue-200">Authentication Information</h3>
<div class="mt-2 text-sm text-blue-700 dark:text-blue-300">
<template x-if="useBuiltinAuth">
<div>
<p>You're using rclone's built-in authentication, which simplifies the setup process:</p>
<ul class="list-disc list-inside mt-1 space-y-1">
<li>No need to create your own Google API credentials</li>
<li>Authentication happens through a browser window</li>
<li>You will need to manually copy the authorization code back</li>
<li>Authentication happens through Google's secure OAuth flow</li>
<li>Automatic redirection back to GoMFT after authentication</li>
</ul>
<p class="mt-2 text-xs text-amber-600">
<p class="mt-2 text-xs text-amber-600 dark:text-amber-400">
<i class="fas fa-exclamation-triangle mr-1"></i>
Note: The built-in authentication uses shared credentials which have rate limits across all rclone users.
If you plan to transfer large amounts of data or run many concurrent transfers, consider creating your own credentials.
@@ -163,10 +159,10 @@ templ GoogleDriveDestinationForm() {
<div>
<p>To use Google Drive with your own credentials:</p>
<ol class="list-decimal list-inside mt-1 space-y-1">
<li>Go to the <a href="https://console.cloud.google.com/" target="_blank" class="text-blue-600 underline">Google Cloud Console</a></li>
<li>Go to the <a href="https://console.cloud.google.com/" target="_blank" class="text-blue-600 dark:text-blue-400 underline">Google Cloud Console</a></li>
<li>Create a project and enable the Google Drive API</li>
<li>Create OAuth 2.0 credentials (Client ID & Secret)</li>
<li>Set authorized redirect URI to <code class="bg-blue-100 px-1 py-0.5 rounded">http://localhost:53682/</code></li>
<li>Set authorized redirect URI to <code class="bg-blue-100 dark:bg-blue-800 px-1 py-0.5 rounded">http://localhost:53682/</code></li>
</ol>
</div>
</template>
+32 -39
View File
@@ -13,13 +13,12 @@ templ GooglePhotosDestinationForm() {
<input id="use_builtin_auth" name="use_builtin_auth" type="checkbox"
class="sr-only"
x-model="useBuiltinAuth"
value="true"
/>
<div class="block bg-gray-200 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition"
<div class="block bg-secondary-200 dark:bg-secondary-700 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white dark:bg-secondary-100 w-6 h-6 rounded-full transition"
:class="useBuiltinAuth ? 'transform translate-x-6 bg-primary-500' : ''"></div>
</div>
<div class="ml-3 text-gray-700 font-medium">
<div class="ml-3 text-secondary-700 dark:text-secondary-300 font-medium">
Use rclone's built-in Google authentication (recommended)
</div>
</label>
@@ -74,13 +73,12 @@ templ GooglePhotosDestinationForm() {
<input id="dest_read_only" name="dest_read_only" type="checkbox"
class="sr-only"
x-model="destReadOnly"
value="true"
/>
<div class="block bg-gray-200 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition"
<div class="block bg-secondary-200 dark:bg-secondary-700 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white dark:bg-secondary-100 w-6 h-6 rounded-full transition"
:class="destReadOnly ? 'transform translate-x-6 bg-primary-500' : ''"></div>
</div>
<div class="ml-3 text-gray-700 font-medium">
<div class="ml-3 text-secondary-700 dark:text-secondary-300 font-medium">
Read-only mode
</div>
</label>
@@ -110,13 +108,12 @@ templ GooglePhotosDestinationForm() {
<input id="dest_include_archived" name="dest_include_archived" type="checkbox"
class="sr-only"
x-model="destIncludeArchived"
value="true"
/>
<div class="block bg-gray-200 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition"
<div class="block bg-secondary-200 dark:bg-secondary-700 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white dark:bg-secondary-100 w-6 h-6 rounded-full transition"
:class="destIncludeArchived ? 'transform translate-x-6 bg-primary-500' : ''"></div>
</div>
<div class="ml-3 text-gray-700 font-medium">
<div class="ml-3 text-secondary-700 dark:text-secondary-300 font-medium">
Include archived media
</div>
</label>
@@ -140,47 +137,43 @@ templ GooglePhotosDestinationForm() {
</p>
</div>
<div class="p-4 bg-amber-50 rounded-lg border border-amber-100">
<div class="p-4 bg-amber-50 dark:bg-amber-900/50 rounded-lg border border-amber-100 dark:border-amber-700">
<div class="flex">
<div class="flex-shrink-0">
<i class="fas fa-exclamation-triangle text-amber-500"></i>
<i class="fas fa-exclamation-triangle text-amber-500 dark:text-amber-400"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-amber-800">Important: Authentication Required</h3>
<div class="mt-2 text-sm text-amber-700">
<p><strong>After saving this configuration</strong>, you will need to authenticate with Google Photos.</p>
<p class="mt-1">The authentication process will require you to:</p>
<ol class="list-decimal list-inside mt-1 space-y-1">
<li>Visit a Google authorization URL</li>
<li>Sign in to your Google account</li>
<li>Grant permission to access your Google Photos</li>
<li>Copy the authorization code back to this application</li>
<h3 class="text-sm font-medium text-amber-800 dark:text-amber-200">Authentication Required</h3>
<div class="mt-2 text-sm text-amber-700 dark:text-amber-300">
<p>After saving this configuration, you'll need to authenticate with Google Photos:</p>
<ol class="list-decimal list-inside mt-2 space-y-1">
<li>Go to the configurations page</li>
<li>Click the "Authenticate" button for this configuration</li>
<li>You'll be redirected to Google to grant access permissions</li>
<li>After granting permission, you'll be automatically redirected back to GoMFT</li>
</ol>
<p class="mt-2 text-xs">
This is a one-time process for each configuration. The application will store your authorization token securely.
</p>
</div>
</div>
</div>
</div>
<div class="p-4 bg-blue-50 rounded-lg border border-blue-100">
<div class="p-4 bg-blue-50 dark:bg-blue-900/50 rounded-lg border border-blue-100 dark:border-blue-700">
<div class="flex">
<div class="flex-shrink-0">
<i class="fas fa-info-circle text-blue-400"></i>
<i class="fas fa-info-circle text-blue-400 dark:text-blue-300"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-blue-800">Authentication Information</h3>
<div class="mt-2 text-sm text-blue-700">
<h3 class="text-sm font-medium text-blue-800 dark:text-blue-200">Authentication Information</h3>
<div class="mt-2 text-sm text-blue-700 dark:text-blue-300">
<template x-if="useBuiltinAuth">
<div>
<p>You're using rclone's built-in authentication, which simplifies the setup process:</p>
<ul class="list-disc list-inside mt-1 space-y-1">
<li>No need to create your own Google API credentials</li>
<li>Authentication happens through a browser window</li>
<li>You will need to manually copy the authorization code back</li>
<li>Authentication happens through Google's secure OAuth flow</li>
<li>Automatic redirection back to GoMFT after authentication</li>
</ul>
<p class="mt-2 text-xs text-amber-600">
<p class="mt-2 text-xs text-amber-600 dark:text-amber-400">
<i class="fas fa-exclamation-triangle mr-1"></i>
Note: The built-in authentication uses shared credentials which have rate limits across all rclone users.
If you plan to transfer large amounts of data or run many concurrent transfers, consider creating your own credentials.
@@ -191,10 +184,10 @@ templ GooglePhotosDestinationForm() {
<div>
<p>To use Google Photos with your own credentials:</p>
<ol class="list-decimal list-inside mt-1 space-y-1">
<li>Go to the <a href="https://console.cloud.google.com/" target="_blank" class="text-blue-600 underline">Google Cloud Console</a></li>
<li>Go to the <a href="https://console.cloud.google.com/" target="_blank" class="text-blue-600 dark:text-blue-400 underline">Google Cloud Console</a></li>
<li>Create a project and enable the Google Photos API</li>
<li>Create OAuth 2.0 credentials (Client ID & Secret)</li>
<li>Set authorized redirect URI to <code class="bg-blue-100 px-1 py-0.5 rounded">http://localhost:53682/</code></li>
<li>Set authorized redirect URI to <code class="bg-blue-100 dark:bg-blue-800 px-1 py-0.5 rounded">http://localhost:53682/</code></li>
</ol>
</div>
</template>
@@ -203,14 +196,14 @@ templ GooglePhotosDestinationForm() {
</div>
</div>
<div class="p-4 bg-yellow-50 rounded-lg border border-yellow-100">
<div class="p-4 bg-yellow-50 dark:bg-yellow-900/50 rounded-lg border border-yellow-100 dark:border-yellow-700">
<div class="flex">
<div class="flex-shrink-0">
<i class="fas fa-exclamation-circle text-yellow-500"></i>
<i class="fas fa-exclamation-circle text-yellow-500 dark:text-yellow-400"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-yellow-800">Important Note About Google Photos</h3>
<div class="mt-2 text-sm text-yellow-700">
<h3 class="text-sm font-medium text-yellow-800 dark:text-yellow-200">Important Note About Google Photos</h3>
<div class="mt-2 text-sm text-yellow-700 dark:text-yellow-300">
<p>All media items uploaded to Google Photos with rclone are stored in full resolution at original quality. These uploads will count towards storage in your Google Account.</p>
</div>
</div>
+53 -8
View File
@@ -14,11 +14,11 @@ templ GoogleDriveSourceForm() {
class="sr-only"
x-model="useBuiltinAuth"
/>
<div class="block bg-gray-200 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition"
<div class="block bg-secondary-200 dark:bg-secondary-700 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white dark:bg-secondary-100 w-6 h-6 rounded-full transition"
:class="useBuiltinAuth ? 'transform translate-x-6 bg-primary-500' : ''"></div>
</div>
<div class="ml-3 text-gray-700 font-medium">
<div class="ml-3 text-secondary-700 dark:text-secondary-300 font-medium">
Use rclone's built-in Google authentication (recommended)
</div>
</label>
@@ -112,15 +112,60 @@ templ GoogleDriveSourceForm() {
</p>
</div>
<div class="p-4 bg-amber-50 rounded-lg border border-amber-100">
<div class="p-4 bg-amber-50 dark:bg-amber-900/50 rounded-lg border border-amber-100 dark:border-amber-700">
<div class="flex">
<div class="flex-shrink-0">
<i class="fas fa-exclamation-triangle text-amber-500"></i>
<i class="fas fa-exclamation-triangle text-amber-500 dark:text-amber-400"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-amber-800">Authentication Required</h3>
<div class="mt-2 text-sm text-amber-700">
<p>After saving this configuration, you'll need to authenticate with Google Drive on the configurations page.</p>
<h3 class="text-sm font-medium text-amber-800 dark:text-amber-200">Authentication Required</h3>
<div class="mt-2 text-sm text-amber-700 dark:text-amber-300">
<p>After saving this configuration, you'll need to authenticate with Google Drive:</p>
<ol class="list-decimal list-inside mt-2 space-y-1">
<li>Go to the configurations page</li>
<li>Click the "Authenticate" button for this configuration</li>
<li>You'll be redirected to Google to grant access permissions</li>
<li>After granting permission, you'll be automatically redirected back to GoMFT</li>
</ol>
</div>
</div>
</div>
</div>
<div class="p-4 bg-blue-50 dark:bg-blue-900/50 rounded-lg border border-blue-100 dark:border-blue-700">
<div class="flex">
<div class="flex-shrink-0">
<i class="fas fa-info-circle text-blue-400 dark:text-blue-300"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-blue-800 dark:text-blue-200">Authentication Information</h3>
<div class="mt-2 text-sm text-blue-700 dark:text-blue-300">
<template x-if="useBuiltinAuth">
<div>
<p>You're using rclone's built-in authentication, which simplifies the setup process:</p>
<ul class="list-disc list-inside mt-1 space-y-1">
<li>No need to create your own Google API credentials</li>
<li>Authentication happens through Google's secure OAuth flow</li>
<li>Automatic redirection back to GoMFT after authentication</li>
</ul>
<p class="mt-2 text-xs text-amber-600 dark:text-amber-400">
<i class="fas fa-exclamation-triangle mr-1"></i>
Note: The built-in authentication uses shared credentials which have rate limits across all rclone users.
If you plan to transfer large amounts of data or run many concurrent transfers, consider creating your own credentials.
</p>
</div>
</template>
<template x-if="!useBuiltinAuth">
<div>
<p>To use Google Drive with your own credentials:</p>
<ol class="list-decimal list-inside mt-1 space-y-1">
<li>Go to the <a href="https://console.cloud.google.com/" target="_blank" class="text-blue-600 dark:text-blue-400 underline">Google Cloud Console</a></li>
<li>Create a project and enable the Google Drive API</li>
<li>Create OAuth 2.0 credentials (Client ID & Secret)</li>
<li>Set authorized redirect URI to <code class="bg-blue-100 dark:bg-blue-800 px-1 py-0.5 rounded">http://localhost:53682/</code></li>
</ol>
</div>
</template>
</div>
</div>
</div>
+34 -41
View File
@@ -8,18 +8,17 @@ templ GooglePhotosSourceForm() {
}
})">
<div class="mb-6">
<label for="use_builtin_auth" class="flex items-center cursor-pointer">
<label for="use_builtin_auth_source" class="flex items-center cursor-pointer">
<div class="relative">
<input id="use_builtin_auth" name="use_builtin_auth" type="checkbox"
<input id="use_builtin_auth_source" name="use_builtin_auth_source" type="checkbox"
class="sr-only"
x-model="useBuiltinAuth"
value="true"
/>
<div class="block bg-gray-200 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition"
<div class="block bg-secondary-200 dark:bg-secondary-700 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white dark:bg-secondary-100 w-6 h-6 rounded-full transition"
:class="useBuiltinAuth ? 'transform translate-x-6 bg-primary-500' : ''"></div>
</div>
<div class="ml-3 text-gray-700 font-medium">
<div class="ml-3 text-secondary-700 dark:text-secondary-300 font-medium">
Use rclone's built-in Google authentication (recommended)
</div>
</label>
@@ -74,13 +73,12 @@ templ GooglePhotosSourceForm() {
<input id="source_read_only" name="source_read_only" type="checkbox"
class="sr-only"
x-model="sourceReadOnly"
value="true"
/>
<div class="block bg-gray-200 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition"
<div class="block bg-secondary-200 dark:bg-secondary-700 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white dark:bg-secondary-100 w-6 h-6 rounded-full transition"
:class="sourceReadOnly ? 'transform translate-x-6 bg-primary-500' : ''"></div>
</div>
<div class="ml-3 text-gray-700 font-medium">
<div class="ml-3 text-secondary-700 dark:text-secondary-300 font-medium">
Read-only mode
</div>
</label>
@@ -110,13 +108,12 @@ templ GooglePhotosSourceForm() {
<input id="source_include_archived" name="source_include_archived" type="checkbox"
class="sr-only"
x-model="sourceIncludeArchived"
value="true"
/>
<div class="block bg-gray-200 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition"
<div class="block bg-secondary-200 dark:bg-secondary-700 w-14 h-8 rounded-full"></div>
<div class="dot absolute left-1 top-1 bg-white dark:bg-secondary-100 w-6 h-6 rounded-full transition"
:class="sourceIncludeArchived ? 'transform translate-x-6 bg-primary-500' : ''"></div>
</div>
<div class="ml-3 text-gray-700 font-medium">
<div class="ml-3 text-secondary-700 dark:text-secondary-300 font-medium">
Include archived media
</div>
</label>
@@ -140,47 +137,43 @@ templ GooglePhotosSourceForm() {
</p>
</div>
<div class="p-4 bg-amber-50 rounded-lg border border-amber-100">
<div class="p-4 bg-amber-50 dark:bg-amber-900/50 rounded-lg border border-amber-100 dark:border-amber-700">
<div class="flex">
<div class="flex-shrink-0">
<i class="fas fa-exclamation-triangle text-amber-500"></i>
<i class="fas fa-exclamation-triangle text-amber-500 dark:text-amber-400"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-amber-800">Important: Authentication Required</h3>
<div class="mt-2 text-sm text-amber-700">
<p><strong>After saving this configuration</strong>, you will need to authenticate with Google Photos.</p>
<p class="mt-1">The authentication process will require you to:</p>
<ol class="list-decimal list-inside mt-1 space-y-1">
<li>Visit a Google authorization URL</li>
<li>Sign in to your Google account</li>
<li>Grant permission to access your Google Photos</li>
<li>Copy the authorization code back to this application</li>
<h3 class="text-sm font-medium text-amber-800 dark:text-amber-200">Authentication Required</h3>
<div class="mt-2 text-sm text-amber-700 dark:text-amber-300">
<p>After saving this configuration, you'll need to authenticate with Google Photos:</p>
<ol class="list-decimal list-inside mt-2 space-y-1">
<li>Go to the configurations page</li>
<li>Click the "Authenticate" button for this configuration</li>
<li>You'll be redirected to Google to grant access permissions</li>
<li>After granting permission, you'll be automatically redirected back to GoMFT</li>
</ol>
<p class="mt-2 text-xs">
This is a one-time process for each configuration. The application will store your authorization token securely.
</p>
</div>
</div>
</div>
</div>
<div class="p-4 bg-blue-50 rounded-lg border border-blue-100">
<div class="p-4 bg-blue-50 dark:bg-blue-900/50 rounded-lg border border-blue-100 dark:border-blue-700">
<div class="flex">
<div class="flex-shrink-0">
<i class="fas fa-info-circle text-blue-400"></i>
<i class="fas fa-info-circle text-blue-400 dark:text-blue-300"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-blue-800">Authentication Information</h3>
<div class="mt-2 text-sm text-blue-700">
<h3 class="text-sm font-medium text-blue-800 dark:text-blue-200">Authentication Information</h3>
<div class="mt-2 text-sm text-blue-700 dark:text-blue-300">
<template x-if="useBuiltinAuth">
<div>
<p>You're using rclone's built-in authentication, which simplifies the setup process:</p>
<ul class="list-disc list-inside mt-1 space-y-1">
<li>No need to create your own Google API credentials</li>
<li>Authentication happens through a browser window</li>
<li>You will need to manually copy the authorization code back</li>
<li>Authentication happens through Google's secure OAuth flow</li>
<li>Automatic redirection back to GoMFT after authentication</li>
</ul>
<p class="mt-2 text-xs text-amber-600">
<p class="mt-2 text-xs text-amber-600 dark:text-amber-400">
<i class="fas fa-exclamation-triangle mr-1"></i>
Note: The built-in authentication uses shared credentials which have rate limits across all rclone users.
If you plan to transfer large amounts of data or run many concurrent transfers, consider creating your own credentials.
@@ -191,10 +184,10 @@ templ GooglePhotosSourceForm() {
<div>
<p>To use Google Photos with your own credentials:</p>
<ol class="list-decimal list-inside mt-1 space-y-1">
<li>Go to the <a href="https://console.cloud.google.com/" target="_blank" class="text-blue-600 underline">Google Cloud Console</a></li>
<li>Go to the <a href="https://console.cloud.google.com/" target="_blank" class="text-blue-600 dark:text-blue-400 underline">Google Cloud Console</a></li>
<li>Create a project and enable the Google Photos API</li>
<li>Create OAuth 2.0 credentials (Client ID & Secret)</li>
<li>Set authorized redirect URI to <code class="bg-blue-100 px-1 py-0.5 rounded">http://localhost:53682/</code></li>
<li>Set authorized redirect URI to <code class="bg-blue-100 dark:bg-blue-800 px-1 py-0.5 rounded">http://localhost:53682/</code></li>
</ol>
</div>
</template>
@@ -203,14 +196,14 @@ templ GooglePhotosSourceForm() {
</div>
</div>
<div class="p-4 bg-yellow-50 rounded-lg border border-yellow-100">
<div class="p-4 bg-yellow-50 dark:bg-yellow-900/50 rounded-lg border border-yellow-100 dark:border-yellow-700">
<div class="flex">
<div class="flex-shrink-0">
<i class="fas fa-exclamation-circle text-yellow-500"></i>
<i class="fas fa-exclamation-circle text-yellow-500 dark:text-yellow-400"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-yellow-800">Important Note About Google Photos</h3>
<div class="mt-2 text-sm text-yellow-700">
<h3 class="text-sm font-medium text-yellow-800 dark:text-yellow-200">Important Note About Google Photos</h3>
<div class="mt-2 text-sm text-yellow-700 dark:text-yellow-300">
<p>When downloading from Google Photos, be aware that some original metadata may not be preserved. Google Photos processes and may compress some images upon upload.</p>
</div>
</div>