mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-09-08 15:41:20 +02: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:
@@ -223,7 +223,13 @@ templ ConfigForm(ctx context.Context, data ConfigFormData) {
|
||||
hx-redirect="/configs"
|
||||
hx-boost="true"
|
||||
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 -->
|
||||
|
||||
@@ -269,7 +269,7 @@ templ LayoutWithContext(title string, ctx context.Context) {
|
||||
background: theme('colors.secondary.600');
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: theme('colors.secondary.400');
|
||||
background: theme('colors.secondary.500');
|
||||
}
|
||||
.dark ::-webkit-scrollbar-thumb:hover {
|
||||
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"
|
||||
x-model="sourcePath"
|
||||
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"
|
||||
placeholder="/path/to/source"/>
|
||||
</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