mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
fix: standardize admin form inputs, validation, and sync with backend constraints
- Unified all inputs to use .input CSS class, consistent label styles, and btn-primary/btn-secondary buttons - Fixed number inputs to use number | '' pattern allowing field clearing without default replacement - Added field-level validation with inline error borders and messages - Synced frontend constraints with backend Pydantic schemas (maxLength, min/max values) - Fixed toggle switch dimensions across all admin forms
This commit is contained in:
@@ -675,7 +675,7 @@ export default function AdminBanSystem() {
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
onKeyDown={(e) => e.key === 'Enter' && handleSearch()}
|
||||
placeholder={t('banSystem.users.searchPlaceholder')}
|
||||
className="w-full rounded-lg border border-dark-700 bg-dark-800 py-2 pl-10 pr-4 text-dark-100 placeholder-dark-500 focus:border-accent-500 focus:outline-none"
|
||||
className="input pl-10"
|
||||
/>
|
||||
</div>
|
||||
<button
|
||||
@@ -1333,7 +1333,7 @@ export default function AdminBanSystem() {
|
||||
min={setting.min_value ?? undefined}
|
||||
max={setting.max_value ?? undefined}
|
||||
disabled={!setting.editable || settingLoading === setting.key}
|
||||
className="w-24 rounded-lg border border-dark-700 bg-dark-900 px-3 py-1.5 text-sm text-dark-100 focus:border-accent-500 focus:outline-none disabled:opacity-50"
|
||||
className="input w-24"
|
||||
/>
|
||||
) : setting.type === 'list' ? (
|
||||
<div className="flex max-w-xs flex-wrap justify-end gap-1.5">
|
||||
@@ -1353,7 +1353,7 @@ export default function AdminBanSystem() {
|
||||
)}
|
||||
{setting.editable && nodes && setting.key.includes('nodes') && (
|
||||
<select
|
||||
className="rounded border border-dark-700 bg-dark-900 px-2 py-1 text-xs text-dark-300 focus:border-accent-500 focus:outline-none"
|
||||
className="input py-1 text-xs"
|
||||
onChange={(e) => {
|
||||
if (e.target.value) {
|
||||
const currentList = Array.isArray(setting.value)
|
||||
|
||||
Reference in New Issue
Block a user