mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-07 05:34:17 +00:00
- Fix duplicate :min attributes on a-input-number (webPort, subPort, tgCpu) - Fix mismatched closing tags (a-input/a-switch instead of a-input-number) - Fix twoFactorEnable toggle receiving MouseEvent instead of boolean - Fix noise input handlers referencing undefined global `event` - Add error handling to settings change detection polling loop - Bump version to v1.5.4-beta
2.4 KiB
2.4 KiB
2026-04-24 Fix Settings Save Button and UI Bugs
Problem
Settings page save button would not enable when user changed settings.
Root Cause Analysis
Systematic debugging found multiple UI bugs affecting the settings page:
-
Duplicate
:minattributes ona-input-number(3 locations)general.html:42— webPort had:min="1" :min="65535"(second should be:max)subscription/general.html:43— subPort had same issuetelegram.html:64— tgCpu had:min="0" :min="100"(second should be:max)
-
Mismatched closing tags
general.html:42—<a-input-number>closed with</a-input>telegram.html:64—<a-input-number>closed with</a-switch>
-
twoFactorEnable toggle broken (
security.html:39)- Used
@click="toggleTwoFactor" :checked="..."instead of proper event handling @clickpasses MouseEvent as first arg, not the boolean toggle value- Method expected boolean but received Event → always truthy → always triggered enable flow
- Used
-
Noise input handlers referenced undefined
event(json.html:91,99)(value) => updateNoisePacket(index, event.target.value)—eventis not defined- Arrow function parameter named
valuebut code accessed globalevent
-
Polling loop had no error handling (
settings.html:653-656)- Any error in the
while(true)loop would silently stop change detection
- Any error in the
Changes
- Fixed
:min/:maxattributes on alla-input-numbercomponents - Fixed closing tags to match opening tags
- Changed twoFactorEnable to use
@click.prevent="toggleTwoFactor(!allSetting.twoFactorEnable)" - Updated
toggleTwoFactormethod to only settwoFactorEnableon success - Fixed noise input handlers to use
(e) => ... e.target.value - Added try/catch around polling loop comparison
Files Modified
web/html/settings/panel/general.html— webPort input fixweb/html/settings/panel/subscription/general.html— subPort input fixweb/html/settings/panel/telegram.html— tgCpu input fixweb/html/settings/panel/security.html— twoFactorEnable toggle fixweb/html/settings/panel/subscription/json.html— noise input handler fixweb/html/settings.html— toggleTwoFactor method + polling error handling
Verification
- Visual inspection of all modified templates
- Confirmed
ObjectUtil.equals()shallow comparison works correctly with Vue 2 reactivity - Confirmed
AllSettingclass properties match Go struct fields