seeder-st2110-components 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -2512,17 +2512,20 @@ const NetworkSettingsModal = _ref2 => {
2512
2512
 
2513
2513
  // 更新QSFP配置
2514
2514
  if (sections.includes('QSFP') && values.QSFP) {
2515
- const st2110Data = {
2516
- st2110_interfaces: values.QSFP.map((item, index) => ({
2517
- // 只有当原始数据中存在id时才包含id
2518
- ...(st2110Interfaces?.[index]?.id !== undefined && {
2519
- id: st2110Interfaces?.[index]?.id
2520
- }),
2521
- ip_address: item.ip_address,
2522
- ...(showNetmask.QSFP ? {
2523
- netmask: item.netmask
2524
- } : {})
2525
- }))
2515
+ const interfacesData = values.QSFP.map((item, index) => ({
2516
+ // 只有当原始数据中存在id时才包含id
2517
+ ...(st2110Interfaces?.[index]?.id !== undefined && {
2518
+ id: st2110Interfaces?.[index]?.id
2519
+ }),
2520
+ ip_address: item.ip_address,
2521
+ ...(showNetmask.QSFP ? {
2522
+ netmask: item.netmask
2523
+ } : {})
2524
+ }));
2525
+ const st2110Data = st2110Interfaces.some(iface => 'id' in iface) ? {
2526
+ st2110_interfaces: interfacesData
2527
+ } : {
2528
+ interfaces: interfacesData
2526
2529
  };
2527
2530
  updatePromises.push(updateSysConfig(st2110Data));
2528
2531
  }