fix: Fix models & eslint
1. The response of models has been changed from array to map, we should make it compatible with old data 2. Change level to `off` for import/prefer-default-export to remove annoying unnecessary warnings Change-Id: I6feac90b3db36b2c0929b27bb82dee8536951bb3
This commit is contained in:
parent
af6a745eea
commit
d74c640adc
@ -67,7 +67,7 @@
|
|||||||
"jsx-a11y/click-events-have-key-events": "warn",
|
"jsx-a11y/click-events-have-key-events": "warn",
|
||||||
"jsx-a11y/no-static-element-interactions": "warn",
|
"jsx-a11y/no-static-element-interactions": "warn",
|
||||||
"import/no-extraneous-dependencies": "warn",
|
"import/no-extraneous-dependencies": "warn",
|
||||||
"import/prefer-default-export": "warn",
|
"import/prefer-default-export": "off",
|
||||||
"no-nested-ternary": "warn",
|
"no-nested-ternary": "warn",
|
||||||
"import/no-named-as-default": "warn"
|
"import/no-named-as-default": "warn"
|
||||||
},
|
},
|
||||||
|
@ -87,26 +87,38 @@ export class ParamSetting extends Base {
|
|||||||
const item = (this.settingStore.list.data || []).find(
|
const item = (this.settingStore.list.data || []).find(
|
||||||
(it) => it.key === 'gpu_models'
|
(it) => it.key === 'gpu_models'
|
||||||
);
|
);
|
||||||
return item
|
if (item && item.value instanceof Array) {
|
||||||
? item.value.map((it) => ({
|
return item.value.map((it) => ({
|
||||||
value: it,
|
value: it,
|
||||||
label: it,
|
label: it,
|
||||||
}))
|
}));
|
||||||
: [];
|
}
|
||||||
|
if (item && typeof item.value === 'object') {
|
||||||
|
return Object.keys(item.value).map((it) => ({
|
||||||
|
label: it,
|
||||||
|
value: it,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
get usbTypes() {
|
get usbTypes() {
|
||||||
const item = (this.settingStore.list.data || []).find(
|
const item = (this.settingStore.list.data || []).find(
|
||||||
(it) => it.key === 'usb_models'
|
(it) => it.key === 'usb_models'
|
||||||
);
|
);
|
||||||
return item
|
if (item && item.value instanceof Array) {
|
||||||
? [
|
return item.value.map((it) => ({
|
||||||
{
|
value: it,
|
||||||
value: item.value,
|
label: it,
|
||||||
label: item.value,
|
}));
|
||||||
},
|
}
|
||||||
]
|
if (item && typeof item.value === 'object') {
|
||||||
: [];
|
return Object.keys(item.value).map((it) => ({
|
||||||
|
label: it,
|
||||||
|
value: it,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
get vgpuTypes() {
|
get vgpuTypes() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user