mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-09-08 15:41:20 +02:00
- Update .gitignore to include new provider files and ensure proper tracking. - Refactor job and config forms to support multiple configuration selections, improving user experience. - Implement logic to handle the initialization of skipProcessedFiles with a default value. - Add new provider form templates for better organization and management of source and destination configurations. - Enhance tests for provider forms and job configurations to ensure robust functionality. - Introduce nullable handling for skipProcessedFiles in the database schema and update related migrations. - Improve error handling and validation in job creation and editing processes.
147 lines
6.2 KiB
Templ
147 lines
6.2 KiB
Templ
package destination
|
|
|
|
templ SFTPDestinationForm() {
|
|
<div class="sm:col-span-6 space-y-6">
|
|
<div class="sm:col-span-4">
|
|
<label for="dest_host" class="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-1">Host</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
|
<i class="fas fa-server text-secondary-400 dark:text-secondary-600"></i>
|
|
</div>
|
|
<input
|
|
type="text"
|
|
name="dest_host"
|
|
id="dest_host"
|
|
x-model="destHost"
|
|
required
|
|
aria-describedby="dest_host_help"
|
|
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="sftp.example.com"/>
|
|
</div>
|
|
<p id="dest_host_help" class="mt-1 text-xs text-secondary-500 dark:text-secondary-400">
|
|
Enter the SFTP server hostname or IP address.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="sm:col-span-4">
|
|
<label for="dest_port" class="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-1">Port</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
|
<i class="fas fa-plug text-secondary-400 dark:text-secondary-600"></i>
|
|
</div>
|
|
<input
|
|
type="number"
|
|
name="dest_port"
|
|
id="dest_port"
|
|
x-model="destPort"
|
|
required
|
|
min="1"
|
|
max="65535"
|
|
value="22"
|
|
aria-describedby="dest_port_help"
|
|
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="22"/>
|
|
</div>
|
|
<p id="dest_port_help" class="mt-1 text-xs text-secondary-500 dark:text-secondary-400">
|
|
Default SFTP port is 22.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="sm:col-span-4">
|
|
<label for="dest_path" class="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-1">Remote Path</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
|
<i class="fas fa-folder text-secondary-400 dark:text-secondary-600"></i>
|
|
</div>
|
|
<input
|
|
type="text"
|
|
name="destination_path"
|
|
id="destination_path"
|
|
x-model="destinationPath"
|
|
required
|
|
aria-describedby="destination_path_help"
|
|
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/files"/>
|
|
</div>
|
|
<p id="destination_path_help" class="mt-1 text-xs text-secondary-500 dark:text-secondary-400">
|
|
Absolute path to the files on the remote server.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="sm:col-span-4">
|
|
<label for="dest_user" class="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-1">Username</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
|
<i class="fas fa-user text-secondary-400 dark:text-secondary-600"></i>
|
|
</div>
|
|
<input
|
|
type="text"
|
|
name="dest_user"
|
|
id="dest_user"
|
|
x-model="destUser"
|
|
required
|
|
aria-describedby="dest_user_help"
|
|
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"/>
|
|
</div>
|
|
<p id="dest_user_help" class="mt-1 text-xs text-secondary-500 dark:text-secondary-400">
|
|
Username for SFTP authentication.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="sm:col-span-4">
|
|
<label for="dest_auth_type" class="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-1">Authentication Type</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
|
<i class="fas fa-lock text-secondary-400 dark:text-secondary-600"></i>
|
|
</div>
|
|
<select
|
|
id="dest_auth_type"
|
|
name="dest_auth_type"
|
|
x-model="destAuthType"
|
|
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">
|
|
<option value="password">Password</option>
|
|
<option value="key_file">SSH Key File</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="sm:col-span-4" x-show="destAuthType === 'password'">
|
|
<label for="dest_password" class="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-1">Password</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
|
<i class="fas fa-key text-secondary-400 dark:text-secondary-600"></i>
|
|
</div>
|
|
<input
|
|
type="password"
|
|
name="dest_password"
|
|
id="dest_password"
|
|
x-model="destPassword"
|
|
x-bind:required="destAuthType === 'password'"
|
|
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="Password"/>
|
|
</div>
|
|
<input type="hidden" name="dest_password" :value="destPassword"/>
|
|
</div>
|
|
|
|
<div class="sm:col-span-4" x-show="destAuthType === 'key_file'">
|
|
<label for="dest_key_file" class="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-1">Key File</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
|
<i class="fas fa-file-alt text-secondary-400 dark:text-secondary-600"></i>
|
|
</div>
|
|
<input
|
|
type="text"
|
|
name="dest_key_file"
|
|
id="dest_key_file"
|
|
x-model="destKeyFile"
|
|
x-bind:required="destAuthType === 'key_file'"
|
|
aria-describedby="dest_key_file_help"
|
|
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/key"/>
|
|
</div>
|
|
<p id="dest_key_file_help" class="mt-1 text-xs text-secondary-500 dark:text-secondary-400">
|
|
Absolute path to SSH private key file.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
} |