mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-19 19:45:02 +03:00
fix(xray): read and write log.logLevel in the Xray basics tab
xray-core 26.11.9 (#7329) spells the key log.logLevel and still accepts loglevel. A template written with the new spelling showed "warning" in the panel, and changing the level added a second loglevel key beside it, leaving the core to pick between two values. The select now reads either spelling and saves a single logLevel key.
This commit is contained in:
@@ -414,12 +414,15 @@ export default function BasicsTab({
|
||||
paddings="small"
|
||||
control={
|
||||
<Select
|
||||
value={(log.loglevel as string) || 'warning'}
|
||||
value={((log.logLevel ?? log.loglevel) as string) || 'warning'}
|
||||
style={{ width: '100%' }}
|
||||
options={LOG_LEVELS.map((s) => ({ value: s, label: s }))}
|
||||
onChange={(v) =>
|
||||
mutate((tt) => {
|
||||
if (tt.log) tt.log.loglevel = v;
|
||||
if (!tt.log) return;
|
||||
// The core reads either spelling, so keeping both would let the stale one win.
|
||||
delete tt.log.loglevel;
|
||||
tt.log.logLevel = v;
|
||||
})
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user