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:
StarFleetCPTN
2025-03-08 23:03:41 -08:00
parent 43f1772038
commit 3b9ff3b6a8
6 changed files with 17 additions and 3 deletions
+7 -1
View File
@@ -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 -->
+1 -1
View File
@@ -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
+3
View File
@@ -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
-1
View File
@@ -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>
+3
View File
@@ -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