mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-11-16 08:44:40 +01:00
chore: Refine config form and UI components
- Add x-init hook to set default form values in config form - Adjust scrollbar hover color in layout - Create marker files for providers, source, and destination packages - Remove unnecessary error styling in local source form
This commit is contained in:
1 parent
43f1772038
commit
3b9ff3b6a8
6 files changed
+17
-3
No files matched your search
@@ -223,7 +223,13 @@ templ ConfigForm(ctx context.Context, data ConfigFormData) {
|
|||||||
hx-redirect="/configs"
|
hx-redirect="/configs"
|
||||||
hx-boost="true"
|
hx-boost="true"
|
||||||
x-data={ getInitialData(data.Config) }
|
x-data={ getInitialData(data.Config) }
|
||||||
@submit.prevent="if (validateForm()) { loading = true; $el.submit(); } else { loading = false; }"
|
x-init="$nextTick(() => {
|
||||||
|
// Ensure initial form state displays correctly on load
|
||||||
|
sourceType = sourceType || 'local';
|
||||||
|
destinationType = destinationType || 'local';
|
||||||
|
sourcePort = sourcePort || 22;
|
||||||
|
destPort = destPort || 22;
|
||||||
|
})"
|
||||||
>
|
>
|
||||||
|
|
||||||
<!-- Name field -->
|
<!-- Name field -->
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ templ LayoutWithContext(title string, ctx context.Context) {
|
|||||||
background: theme('colors.secondary.600');
|
background: theme('colors.secondary.600');
|
||||||
}
|
}
|
||||||
::-webkit-scrollbar-thumb:hover {
|
::-webkit-scrollbar-thumb:hover {
|
||||||
background: theme('colors.secondary.400');
|
background: theme('colors.secondary.500');
|
||||||
}
|
}
|
||||||
.dark ::-webkit-scrollbar-thumb:hover {
|
.dark ::-webkit-scrollbar-thumb:hover {
|
||||||
background: theme('colors.secondary.500');
|
background: theme('colors.secondary.500');
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// Package destination contains the UI destination forms for the GoMFT application.
|
||||||
|
// This file serves as a marker for the destination package to ensure it's properly recognized by Go.
|
||||||
|
package destination
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// Package providers contains the UI providers for the GoMFT application.
|
||||||
|
// This file serves as a marker for the providers package to ensure it's properly recognized by Go.
|
||||||
|
package providers
|
||||||
@@ -14,7 +14,6 @@ templ LocalSourceForm() {
|
|||||||
id="source_path"
|
id="source_path"
|
||||||
x-model="sourcePath"
|
x-model="sourcePath"
|
||||||
required
|
required
|
||||||
x-bind:class="{'border-red-500 focus:border-red-500 focus:ring-red-500': errors.sourcePath}"
|
|
||||||
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"
|
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/source"/>
|
placeholder="/path/to/source"/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// Package source contains the UI source forms for the GoMFT application.
|
||||||
|
// This file serves as a marker for the source package to ensure it's properly recognized by Go.
|
||||||
|
package source
|
||||||
Reference in new issue
Block a user