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:
Sanaei
2026-11-12 19:10:19 +01:00
parent bf2d0ada8b
commit bfe826c18f
2 changed files with 39 additions and 2 deletions
+5 -2
View File
@@ -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;
})
}
/>