fix(striker-ui): correct optimized-for-os option key/value in ProvisionServerDialog

main
Tsu-ba-me 2 years ago
parent 73c791296b
commit cd869363d2
  1. 9
      striker-ui/components/ProvisionServerDialog.tsx

@ -1498,7 +1498,9 @@ const ProvisionServerDialog = ({
setOSAutocompleteOptions( setOSAutocompleteOptions(
data.osList.map((keyValuePair: string) => { data.osList.map((keyValuePair: string) => {
const [osKey, osValue] = keyValuePair.split(','); const [osKey, osValue] = keyValuePair
.replace(/^key=([^\s]+),name=['"](.*)['"]$/, '$1,$2')
.split(',');
return { return {
label: osValue, label: osValue,
@ -1728,6 +1730,11 @@ const ProvisionServerDialog = ({
}} }}
openOnFocus openOnFocus
options={osAutocompleteOptions} options={osAutocompleteOptions}
renderOption={(optionProps, option) => (
<li {...optionProps} key={`ps-optimize-for-os-${option.key}`}>
{option.label} ({option.key})
</li>
)}
value={inputOptimizeForOSValue} value={inputOptimizeForOSValue}
/> />
</Box> </Box>

Loading…
Cancel
Save