mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-02-06 03:30:25 -05:00
Refactor protocol configuration logic in server form
This commit is contained in:
parent
705391f82a
commit
5318b9cf44
@ -356,7 +356,8 @@ export default function ServerForm(props: {
|
||||
...initialValues,
|
||||
protocols: PROTOCOLS.map((type) => {
|
||||
const existingProtocol = initialValues.protocols?.find((p) => p.type === type);
|
||||
return existingProtocol || getProtocolDefaultConfig(type);
|
||||
const defaultConfig = getProtocolDefaultConfig(type);
|
||||
return existingProtocol ? { ...defaultConfig, ...existingProtocol } : defaultConfig;
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user