mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-10-15 18:48:15 +02:00
feat: Add support for skipping processed files in transfer configs
- Introduce new `skip_processed_files` option for transfer configurations - Add database migration to support the new column - Update config form and UI to include skip processed files toggle - Enhance scheduler to respect skip processed files setting - Modify file processing logic to optionally skip previously processed files - Add environment variable support for skip processed files configuration
This commit is contained in:
1 parent
6d0c215c38
commit
5eac95818e
14 files changed
+305
-134
No files matched your search
@@ -72,6 +72,7 @@ func getInitialData(config *db.TransferConfig) string {
|
||||
archivePath := ""
|
||||
archiveEnabled := false
|
||||
deleteAfterTransfer := false
|
||||
skipProcessedFiles := true
|
||||
rcloneFlags := ""
|
||||
|
||||
// If editing an existing config, populate with those values
|
||||
@@ -129,6 +130,7 @@ func getInitialData(config *db.TransferConfig) string {
|
||||
archivePath = config.ArchivePath
|
||||
archiveEnabled = config.ArchiveEnabled
|
||||
deleteAfterTransfer = config.DeleteAfterTransfer
|
||||
skipProcessedFiles = config.SkipProcessedFiles
|
||||
rcloneFlags = config.RcloneFlags
|
||||
}
|
||||
|
||||
@@ -183,6 +185,7 @@ func getInitialData(config *db.TransferConfig) string {
|
||||
archivePath: '%s',
|
||||
archiveEnabled: %v,
|
||||
deleteAfterTransfer: %v,
|
||||
skipProcessedFiles: %v,
|
||||
rcloneFlags: '%s',
|
||||
}`,
|
||||
name, sourceType, sourcePath, sourceHost, sourcePort, sourceUser, sourcePassword, sourceKeyFile, sourceAuthType,
|
||||
@@ -192,7 +195,7 @@ func getInitialData(config *db.TransferConfig) string {
|
||||
destinationType, destinationPath, destHost, destPort, destUser, destPassword, destKeyFile, destAuthType,
|
||||
destBucket, destRegion, destAccessKey, destSecretKey, destEndpoint, destShare, destDomain, destPassiveMode,
|
||||
destClientId, destClientSecret, destDriveId, destTeamDrive,
|
||||
archivePath, archiveEnabled, deleteAfterTransfer, rcloneFlags)
|
||||
archivePath, archiveEnabled, deleteAfterTransfer, skipProcessedFiles, rcloneFlags)
|
||||
}
|
||||
|
||||
templ ConfigForm(ctx context.Context, data ConfigFormData) {
|
||||
|
||||
@@ -121,6 +121,26 @@ templ ArchiveOptions() {
|
||||
<i class="fas fa-exclamation-triangle mr-1"></i> Warning: This will permanently delete the original files
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="skip_processed_files" class="flex items-center cursor-pointer">
|
||||
<div class="relative">
|
||||
<input id="skip_processed_files" name="skip_processed_files" type="checkbox" x-model="skipProcessedFiles"
|
||||
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"
|
||||
:class="skipProcessedFiles ? 'transform translate-x-6 bg-primary-500' : ''"></div>
|
||||
</div>
|
||||
<div class="ml-3 text-gray-700 font-medium">
|
||||
Skip files that have already been processed
|
||||
</div>
|
||||
</label>
|
||||
<p class="mt-1 ml-14 text-xs text-gray-500">
|
||||
Files with the same hash that have been successfully processed before will be skipped
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user