mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-09-08 15:41:20 +02:00
- Upgraded `golang.org/x/crypto` to v0.36.0 and other indirect dependencies to their latest versions. - Added functionality to assign admin roles to users upon creation in the main application logic. - Introduced new templates for admin role management, including forms for creating and editing roles. - Removed deprecated admin tools template to streamline the admin interface. - Added audit logging for role changes to improve tracking and accountability.
112 lines
6.1 KiB
Templ
112 lines
6.1 KiB
Templ
package source
|
|
|
|
templ SMBSourceForm() {
|
|
<div class="space-y-6 mt-4">
|
|
<div class="p-4 mb-4 text-sm text-blue-800 rounded-lg bg-blue-50 dark:bg-blue-900/30 dark:text-blue-300" role="alert">
|
|
<div class="flex items-center">
|
|
<i class="fas fa-info-circle mr-2"></i>
|
|
<span>Configure your SMB/CIFS share connection details below. You'll need server address, share name, and credentials.</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-6">
|
|
<label for="source_host" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Server Address</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none">
|
|
<i class="fas fa-server text-gray-400 dark:text-gray-500"></i>
|
|
</div>
|
|
<input type="text" id="source_host" name="source_host" x-model="sourceHost" required
|
|
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
placeholder="192.168.1.100 or server.example.com" />
|
|
</div>
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
|
IP address or hostname of the SMB/CIFS server
|
|
</p>
|
|
</div>
|
|
|
|
<div class="mb-6">
|
|
<label for="source_share" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Share Name</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none">
|
|
<i class="fas fa-share-alt text-gray-400 dark:text-gray-500"></i>
|
|
</div>
|
|
<input type="text" id="source_share" name="source_share" x-model="sourceShare" required
|
|
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
placeholder="Documents" />
|
|
</div>
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
|
Name of the shared folder on the server (without leading slashes)
|
|
</p>
|
|
</div>
|
|
|
|
<div class="mb-6">
|
|
<label for="source_domain" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Domain (Optional)</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none">
|
|
<i class="fas fa-sitemap text-gray-400 dark:text-gray-500"></i>
|
|
</div>
|
|
<input type="text" id="source_domain" name="source_domain" x-model="sourceDomain"
|
|
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
placeholder="WORKGROUP or DOMAIN" />
|
|
</div>
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
|
Windows domain name (if applicable). Default is 'WORKGROUP' for standalone servers.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="mb-6">
|
|
<label for="source_user" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Username</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none">
|
|
<i class="fas fa-user text-gray-400 dark:text-gray-500"></i>
|
|
</div>
|
|
<input type="text" id="source_user" name="source_user" x-model="sourceUser" required
|
|
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
placeholder="smb_username" />
|
|
</div>
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
|
Username for SMB/CIFS authentication
|
|
</p>
|
|
</div>
|
|
|
|
<div class="mb-6">
|
|
<label for="source_password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Password</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none">
|
|
<i class="fas fa-lock text-gray-400 dark:text-gray-500"></i>
|
|
</div>
|
|
<input type="password" id="source_password" name="source_password" x-model="sourcePassword" required
|
|
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
placeholder="SMB password" />
|
|
</div>
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
|
Password for SMB/CIFS authentication
|
|
</p>
|
|
</div>
|
|
|
|
<div class="mb-6">
|
|
<label for="source_path" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Subfolder Path (Optional)</label>
|
|
<div class="relative">
|
|
<div class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none">
|
|
<i class="fas fa-folder-open text-gray-400 dark:text-gray-500"></i>
|
|
</div>
|
|
<input type="text" id="source_path" name="source_path" x-model="sourcePath"
|
|
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
placeholder="path/to/subfolder" />
|
|
</div>
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
|
Path to a subfolder within the share (Optional). Use forward slashes.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="p-4 mb-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-yellow-900/30 dark:text-yellow-300" role="alert">
|
|
<div class="flex">
|
|
<i class="fas fa-exclamation-triangle mr-2 flex-shrink-0"></i>
|
|
<div>
|
|
<h3 class="font-medium">Connection Note</h3>
|
|
<p class="mt-1">Make sure the SMB server is accessible from this machine and that the share permissions allow the specified user to read the files.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
} |