seeder-st2110-components 1.2.6 → 1.2.7
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.css +1 -0
- package/dist/index.esm.css +1 -0
- package/dist/index.esm.js +473 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +471 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
package/dist/index.js
CHANGED
|
@@ -3177,8 +3177,479 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
3177
3177
|
};
|
|
3178
3178
|
var NetworkSettingsModal$1 = /*#__PURE__*/react.memo(NetworkSettingsModal);
|
|
3179
3179
|
|
|
3180
|
+
const LeftList = /*#__PURE__*/react.memo(_ref => {
|
|
3181
|
+
let {
|
|
3182
|
+
dataSource,
|
|
3183
|
+
selectedPresetId,
|
|
3184
|
+
onSelectPreset,
|
|
3185
|
+
onAddNew,
|
|
3186
|
+
onRemove,
|
|
3187
|
+
hasPresets = dataSource.length > 0,
|
|
3188
|
+
showDescription = false,
|
|
3189
|
+
texts = {
|
|
3190
|
+
newButton: "New Preset",
|
|
3191
|
+
removeButton: "Remove"
|
|
3192
|
+
}
|
|
3193
|
+
} = _ref;
|
|
3194
|
+
// 动态计算列布局
|
|
3195
|
+
const gridColumns = showDescription ? "grid-cols-3" : "grid-cols-2";
|
|
3196
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3197
|
+
className: "h-full left-list-wrapper",
|
|
3198
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3199
|
+
className: "list-container",
|
|
3200
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.List, {
|
|
3201
|
+
header: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3202
|
+
className: `grid ${gridColumns} w-full list-header`,
|
|
3203
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3204
|
+
children: "Name"
|
|
3205
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3206
|
+
children: "Create Time"
|
|
3207
|
+
}), showDescription && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3208
|
+
children: "Description"
|
|
3209
|
+
})]
|
|
3210
|
+
}),
|
|
3211
|
+
dataSource: dataSource,
|
|
3212
|
+
rowKey: "id",
|
|
3213
|
+
renderItem: item => /*#__PURE__*/jsxRuntime.jsx(antd.List.Item, {
|
|
3214
|
+
className: `list-item ${selectedPresetId === item.id ? 'selected' : ''}`,
|
|
3215
|
+
style: {
|
|
3216
|
+
padding: "9px 24px"
|
|
3217
|
+
},
|
|
3218
|
+
onClick: () => onSelectPreset(item),
|
|
3219
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3220
|
+
className: `grid ${gridColumns} w-full text-text-normal`,
|
|
3221
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3222
|
+
title: item.name,
|
|
3223
|
+
children: item.name || "Untitled Preset"
|
|
3224
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3225
|
+
children: item.create_time
|
|
3226
|
+
}), showDescription && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3227
|
+
children: item.description
|
|
3228
|
+
})]
|
|
3229
|
+
})
|
|
3230
|
+
}),
|
|
3231
|
+
locale: {
|
|
3232
|
+
emptyText: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3233
|
+
className: "p-8",
|
|
3234
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Empty, {
|
|
3235
|
+
image: antd.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
3236
|
+
description: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3237
|
+
className: "text-gray-400",
|
|
3238
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
3239
|
+
type: "link",
|
|
3240
|
+
onClick: onAddNew,
|
|
3241
|
+
className: "p-0 h-auto",
|
|
3242
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(icons.PlusOutlined, {}),
|
|
3243
|
+
children: "Create new preset"
|
|
3244
|
+
})
|
|
3245
|
+
})
|
|
3246
|
+
})
|
|
3247
|
+
})
|
|
3248
|
+
}
|
|
3249
|
+
})
|
|
3250
|
+
}), hasPresets && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3251
|
+
className: "p-4",
|
|
3252
|
+
style: {
|
|
3253
|
+
paddingInline: 24
|
|
3254
|
+
},
|
|
3255
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
|
|
3256
|
+
size: "middle",
|
|
3257
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
3258
|
+
type: "default",
|
|
3259
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(icons.PlusOutlined, {}),
|
|
3260
|
+
style: {
|
|
3261
|
+
padding: "20px 12px"
|
|
3262
|
+
},
|
|
3263
|
+
className: "btn-gray",
|
|
3264
|
+
onClick: onAddNew,
|
|
3265
|
+
children: texts.newButton
|
|
3266
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
3267
|
+
type: "default",
|
|
3268
|
+
style: {
|
|
3269
|
+
padding: "20px 12px"
|
|
3270
|
+
},
|
|
3271
|
+
className: "btn-gray",
|
|
3272
|
+
onClick: onRemove,
|
|
3273
|
+
children: texts.removeButton
|
|
3274
|
+
})]
|
|
3275
|
+
})
|
|
3276
|
+
})]
|
|
3277
|
+
});
|
|
3278
|
+
});
|
|
3279
|
+
const SubmitButton = _ref2 => {
|
|
3280
|
+
let {
|
|
3281
|
+
loading,
|
|
3282
|
+
action,
|
|
3283
|
+
children,
|
|
3284
|
+
disabled = false
|
|
3285
|
+
} = _ref2;
|
|
3286
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3287
|
+
className: "submit-btn-wrapper",
|
|
3288
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
3289
|
+
className: "btn-gray",
|
|
3290
|
+
loading: loading,
|
|
3291
|
+
onClick: action,
|
|
3292
|
+
disabled: disabled,
|
|
3293
|
+
children: children
|
|
3294
|
+
})
|
|
3295
|
+
});
|
|
3296
|
+
};
|
|
3297
|
+
const RightDetailForm = /*#__PURE__*/react.memo(_ref3 => {
|
|
3298
|
+
let {
|
|
3299
|
+
form,
|
|
3300
|
+
onSave,
|
|
3301
|
+
onLoad,
|
|
3302
|
+
isLoading,
|
|
3303
|
+
isEditing,
|
|
3304
|
+
fields = {
|
|
3305
|
+
name: {
|
|
3306
|
+
label: "Preset Name",
|
|
3307
|
+
placeholder: "Enter preset name",
|
|
3308
|
+
required: true
|
|
3309
|
+
}
|
|
3310
|
+
},
|
|
3311
|
+
texts = {
|
|
3312
|
+
loadButton: "Load",
|
|
3313
|
+
saveButton: "Save"
|
|
3314
|
+
},
|
|
3315
|
+
presetChanged
|
|
3316
|
+
} = _ref3;
|
|
3317
|
+
const [initialSelected, setInitialSelected] = react.useState([]);
|
|
3318
|
+
const currentSelected = antd.Form.useWatch('category_list', form) || [];
|
|
3319
|
+
|
|
3320
|
+
// 检查是否包含category_list字段
|
|
3321
|
+
const hasCategoryList = fields.category_list !== null && fields.category_list !== undefined;
|
|
3322
|
+
|
|
3323
|
+
// 初始化 category_list 的选择状态
|
|
3324
|
+
react.useEffect(() => {
|
|
3325
|
+
if (hasCategoryList) {
|
|
3326
|
+
const currentValue = form.getFieldValue('category_list') || [];
|
|
3327
|
+
setInitialSelected(currentValue);
|
|
3328
|
+
}
|
|
3329
|
+
}, [presetChanged, form, hasCategoryList]); // 当presetChanged变化时更新
|
|
3330
|
+
|
|
3331
|
+
// 动态生成 checkbox 选项
|
|
3332
|
+
const checkboxOptions = react.useMemo(() => {
|
|
3333
|
+
if (!hasCategoryList) return [];
|
|
3334
|
+
return fields.category_list.options.map(category => {
|
|
3335
|
+
const isInitiallySelected = initialSelected.includes(category.name);
|
|
3336
|
+
const shouldDisable = isEditing ? !isInitiallySelected : false;
|
|
3337
|
+
return {
|
|
3338
|
+
...category,
|
|
3339
|
+
disabled: shouldDisable
|
|
3340
|
+
};
|
|
3341
|
+
});
|
|
3342
|
+
}, [initialSelected, isEditing, hasCategoryList, fields.category_list]);
|
|
3343
|
+
return /*#__PURE__*/jsxRuntime.jsxs(antd.Flex, {
|
|
3344
|
+
vertical: true,
|
|
3345
|
+
className: "h-full",
|
|
3346
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(antd.Form, {
|
|
3347
|
+
form: form,
|
|
3348
|
+
layout: "vertical",
|
|
3349
|
+
autoComplete: "off",
|
|
3350
|
+
style: {
|
|
3351
|
+
flex: 1,
|
|
3352
|
+
overflowY: 'auto'
|
|
3353
|
+
},
|
|
3354
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
3355
|
+
name: "name",
|
|
3356
|
+
label: fields.name.label,
|
|
3357
|
+
rules: [{
|
|
3358
|
+
required: fields.name.required,
|
|
3359
|
+
validator: async (_, value) => {
|
|
3360
|
+
if (!value || value.trim() === '') {
|
|
3361
|
+
return Promise.reject(new Error('Preset name cannot be empty or spaces only'));
|
|
3362
|
+
}
|
|
3363
|
+
}
|
|
3364
|
+
}],
|
|
3365
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
3366
|
+
placeholder: fields.name.placeholder,
|
|
3367
|
+
disabled: isEditing
|
|
3368
|
+
})
|
|
3369
|
+
}), hasCategoryList && /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
3370
|
+
name: "category_list",
|
|
3371
|
+
label: fields.category_list.label,
|
|
3372
|
+
rules: [{
|
|
3373
|
+
required: fields.category_list.required,
|
|
3374
|
+
message: 'Please select at least one category',
|
|
3375
|
+
validator: (_, value) => {
|
|
3376
|
+
if (value && value.length > 0) {
|
|
3377
|
+
return Promise.resolve();
|
|
3378
|
+
}
|
|
3379
|
+
return Promise.reject(new Error('Please select at least one category'));
|
|
3380
|
+
}
|
|
3381
|
+
}],
|
|
3382
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
|
|
3383
|
+
className: "grid grid-cols-2 gap-2",
|
|
3384
|
+
children: checkboxOptions.map(category => /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox, {
|
|
3385
|
+
value: category.name,
|
|
3386
|
+
disabled: category.disabled,
|
|
3387
|
+
children: category.label
|
|
3388
|
+
}, category.name))
|
|
3389
|
+
})
|
|
3390
|
+
}), fields.description && /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
3391
|
+
name: "description",
|
|
3392
|
+
label: fields.description.label,
|
|
3393
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
3394
|
+
rows: 4,
|
|
3395
|
+
placeholder: fields.description.placeholder,
|
|
3396
|
+
disabled: isEditing
|
|
3397
|
+
})
|
|
3398
|
+
})]
|
|
3399
|
+
}), isEditing ? /*#__PURE__*/jsxRuntime.jsx(SubmitButton, {
|
|
3400
|
+
action: onLoad,
|
|
3401
|
+
...(hasCategoryList && {
|
|
3402
|
+
disabled: !currentSelected.length
|
|
3403
|
+
}),
|
|
3404
|
+
children: texts.loadButton
|
|
3405
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(SubmitButton, {
|
|
3406
|
+
action: onSave,
|
|
3407
|
+
loading: isLoading,
|
|
3408
|
+
children: texts.saveButton
|
|
3409
|
+
})]
|
|
3410
|
+
});
|
|
3411
|
+
});
|
|
3412
|
+
|
|
3413
|
+
const Preset = _ref => {
|
|
3414
|
+
let {
|
|
3415
|
+
open,
|
|
3416
|
+
onClose,
|
|
3417
|
+
// API 方法通过 props 传入
|
|
3418
|
+
getPresetList,
|
|
3419
|
+
savePreset,
|
|
3420
|
+
removePreset,
|
|
3421
|
+
loadPreset,
|
|
3422
|
+
// 字段配置
|
|
3423
|
+
fields = {
|
|
3424
|
+
name: {
|
|
3425
|
+
label: "Preset Name",
|
|
3426
|
+
placeholder: "Enter preset name",
|
|
3427
|
+
required: true
|
|
3428
|
+
}
|
|
3429
|
+
},
|
|
3430
|
+
texts = {
|
|
3431
|
+
title: "Preset Management",
|
|
3432
|
+
emptyText: "Select a preset from the list to view details",
|
|
3433
|
+
deleteConfirm: "Are you sure to delete preset",
|
|
3434
|
+
loadText: "Loading...",
|
|
3435
|
+
successText: "Success",
|
|
3436
|
+
newButton: "New Preset",
|
|
3437
|
+
removeButton: "Remove",
|
|
3438
|
+
loadButton: "Load",
|
|
3439
|
+
saveButton: "Save"
|
|
3440
|
+
},
|
|
3441
|
+
// 样式定制
|
|
3442
|
+
width = 1000,
|
|
3443
|
+
height = 680,
|
|
3444
|
+
className = ""
|
|
3445
|
+
} = _ref;
|
|
3446
|
+
const {
|
|
3447
|
+
message: AntdMessage,
|
|
3448
|
+
modal: AntdModal
|
|
3449
|
+
} = antd.App.useApp();
|
|
3450
|
+
const [presetList, setPresetList] = react.useState([]);
|
|
3451
|
+
const [selectedPreset, setSelectedPreset] = react.useState(null);
|
|
3452
|
+
const [loading, setLoading] = react.useState(false);
|
|
3453
|
+
const [presetChanged, setPresetChanged] = react.useState(0);
|
|
3454
|
+
const [form] = antd.Form.useForm();
|
|
3455
|
+
|
|
3456
|
+
// 获取预设列表
|
|
3457
|
+
react.useEffect(() => {
|
|
3458
|
+
fetchPresetList();
|
|
3459
|
+
}, []);
|
|
3460
|
+
const fetchPresetList = react.useCallback(async () => {
|
|
3461
|
+
try {
|
|
3462
|
+
const data = await getPresetList();
|
|
3463
|
+
if (data?.preset_list) {
|
|
3464
|
+
setPresetList(data.preset_list);
|
|
3465
|
+
}
|
|
3466
|
+
} catch (error) {
|
|
3467
|
+
console.error('Failed to fetch preset list:', error);
|
|
3468
|
+
}
|
|
3469
|
+
}, [getPresetList]);
|
|
3470
|
+
const handleSelectPreset = react.useCallback(preset => {
|
|
3471
|
+
setSelectedPreset(preset);
|
|
3472
|
+
form.setFieldsValue(preset);
|
|
3473
|
+
// setPresetChanged(prev => prev + 1); // 触发更新
|
|
3474
|
+
}, [form]);
|
|
3475
|
+
const handleAddNew = react.useCallback(() => {
|
|
3476
|
+
const unsavedPreset = presetList.find(item => !item.id);
|
|
3477
|
+
if (unsavedPreset) {
|
|
3478
|
+
AntdMessage.warning('Existing unsaved preset detected.');
|
|
3479
|
+
return;
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
// 创建新的数据,包含所有配置的字段
|
|
3483
|
+
const newPreset = Object.keys(fields).reduce((acc, fieldName) => {
|
|
3484
|
+
acc[fieldName] = '';
|
|
3485
|
+
return acc;
|
|
3486
|
+
}, {});
|
|
3487
|
+
|
|
3488
|
+
// 特殊处理 category_list
|
|
3489
|
+
if (fields.category_list?.options) {
|
|
3490
|
+
newPreset.category_list = fields.category_list.options.map(item => item.name);
|
|
3491
|
+
}
|
|
3492
|
+
setPresetList([...presetList, newPreset]);
|
|
3493
|
+
setSelectedPreset(newPreset);
|
|
3494
|
+
form.setFieldsValue(newPreset);
|
|
3495
|
+
}, [form, presetList, AntdMessage]);
|
|
3496
|
+
const handleRemove = react.useCallback(async () => {
|
|
3497
|
+
if (!selectedPreset) return;
|
|
3498
|
+
|
|
3499
|
+
// 检查是否为新建的未保存数据(无id)
|
|
3500
|
+
const isUnsavedPreset = !selectedPreset.id;
|
|
3501
|
+
const presetName = selectedPreset.name || 'Untitled Preset';
|
|
3502
|
+
try {
|
|
3503
|
+
AntdModal.confirm({
|
|
3504
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(icons.ExclamationCircleFilled, {}),
|
|
3505
|
+
title: `${texts.deleteConfirm} "${presetName}"?`,
|
|
3506
|
+
cancelText: 'No',
|
|
3507
|
+
okText: 'Yes',
|
|
3508
|
+
onOk: async () => {
|
|
3509
|
+
if (!isUnsavedPreset) {
|
|
3510
|
+
await removePreset({
|
|
3511
|
+
id: selectedPreset.id
|
|
3512
|
+
});
|
|
3513
|
+
AntdMessage.success(texts.successText);
|
|
3514
|
+
// 刷新列表
|
|
3515
|
+
await fetchPresetList();
|
|
3516
|
+
} else {
|
|
3517
|
+
setPresetList(prev => prev.filter(item => !!item.id));
|
|
3518
|
+
}
|
|
3519
|
+
|
|
3520
|
+
// 重置表单和选择状态
|
|
3521
|
+
setSelectedPreset(null);
|
|
3522
|
+
form.resetFields();
|
|
3523
|
+
}
|
|
3524
|
+
});
|
|
3525
|
+
} catch (error) {
|
|
3526
|
+
console.error('Failed to delete preset:', error);
|
|
3527
|
+
}
|
|
3528
|
+
}, [selectedPreset, form, AntdModal, AntdMessage, fetchPresetList, texts]);
|
|
3529
|
+
const handleLoadPreset = react.useCallback(async () => {
|
|
3530
|
+
if (!selectedPreset?.id) return;
|
|
3531
|
+
|
|
3532
|
+
// 显示加载模态框
|
|
3533
|
+
const modalInstance = antd.Modal.info({
|
|
3534
|
+
title: texts.loadText,
|
|
3535
|
+
content: /*#__PURE__*/jsxRuntime.jsx(antd.Spin, {
|
|
3536
|
+
size: "large",
|
|
3537
|
+
className: "block mx-auto"
|
|
3538
|
+
}),
|
|
3539
|
+
maskClosable: false,
|
|
3540
|
+
okButtonProps: {
|
|
3541
|
+
style: {
|
|
3542
|
+
display: 'none'
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3545
|
+
});
|
|
3546
|
+
try {
|
|
3547
|
+
await loadPreset({
|
|
3548
|
+
id: selectedPreset.id,
|
|
3549
|
+
...(selectedPreset.category_list && {
|
|
3550
|
+
category_list: selectedPreset.category_list
|
|
3551
|
+
})
|
|
3552
|
+
});
|
|
3553
|
+
// 成功时延迟关闭
|
|
3554
|
+
setTimeout(() => {
|
|
3555
|
+
modalInstance.destroy();
|
|
3556
|
+
AntdMessage.success(texts.successText);
|
|
3557
|
+
}, 1000);
|
|
3558
|
+
} catch (error) {
|
|
3559
|
+
console.error('Failed to load preset:', error);
|
|
3560
|
+
modalInstance.destroy();
|
|
3561
|
+
}
|
|
3562
|
+
}, [selectedPreset, loadPreset, texts, AntdMessage]);
|
|
3563
|
+
const handleSave = react.useCallback(async () => {
|
|
3564
|
+
setLoading(true);
|
|
3565
|
+
try {
|
|
3566
|
+
const values = await form.validateFields();
|
|
3567
|
+
console.log('Form values:', values);
|
|
3568
|
+
await savePreset(values);
|
|
3569
|
+
AntdMessage.success(texts.successText);
|
|
3570
|
+
// 刷新列表
|
|
3571
|
+
await fetchPresetList();
|
|
3572
|
+
|
|
3573
|
+
// 重置表单和选择状态
|
|
3574
|
+
setSelectedPreset(null);
|
|
3575
|
+
form.resetFields();
|
|
3576
|
+
} catch (error) {
|
|
3577
|
+
if (error.errorFields) {
|
|
3578
|
+
// 表单验证错误
|
|
3579
|
+
console.error('Form validation failed:', error.errorFields);
|
|
3580
|
+
} else {
|
|
3581
|
+
console.error('Failed to save preset:', error);
|
|
3582
|
+
}
|
|
3583
|
+
} finally {
|
|
3584
|
+
setLoading(false);
|
|
3585
|
+
}
|
|
3586
|
+
}, [form, AntdMessage, fetchPresetList, savePreset, texts]);
|
|
3587
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Modal, {
|
|
3588
|
+
title: texts.title,
|
|
3589
|
+
width: width,
|
|
3590
|
+
open: open,
|
|
3591
|
+
wrapClassName: `preset-management ${className}`,
|
|
3592
|
+
footer: null,
|
|
3593
|
+
onCancel: onClose,
|
|
3594
|
+
centered: true,
|
|
3595
|
+
styles: {
|
|
3596
|
+
body: {
|
|
3597
|
+
height: `${height}px`
|
|
3598
|
+
}
|
|
3599
|
+
},
|
|
3600
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Row, {
|
|
3601
|
+
gutter: 0,
|
|
3602
|
+
className: "h-full w-full",
|
|
3603
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Col, {
|
|
3604
|
+
span: 14,
|
|
3605
|
+
className: "h-full",
|
|
3606
|
+
children: /*#__PURE__*/jsxRuntime.jsx(LeftList, {
|
|
3607
|
+
dataSource: presetList,
|
|
3608
|
+
selectedPresetId: selectedPreset?.id,
|
|
3609
|
+
onSelectPreset: handleSelectPreset,
|
|
3610
|
+
onAddNew: handleAddNew,
|
|
3611
|
+
onRemove: handleRemove,
|
|
3612
|
+
showDescription: !!fields.description // 根据 fields 判断是否显示 description
|
|
3613
|
+
,
|
|
3614
|
+
texts: {
|
|
3615
|
+
newButton: texts.newButton,
|
|
3616
|
+
removeButton: texts.removeButton
|
|
3617
|
+
}
|
|
3618
|
+
})
|
|
3619
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Col, {
|
|
3620
|
+
span: 10,
|
|
3621
|
+
className: "h-full p-6",
|
|
3622
|
+
children: selectedPreset ? /*#__PURE__*/jsxRuntime.jsx(RightDetailForm, {
|
|
3623
|
+
form: form,
|
|
3624
|
+
onSave: handleSave,
|
|
3625
|
+
onLoad: handleLoadPreset,
|
|
3626
|
+
isLoading: loading,
|
|
3627
|
+
isEditing: !!selectedPreset?.id,
|
|
3628
|
+
fields: fields,
|
|
3629
|
+
texts: {
|
|
3630
|
+
loadButton: texts.loadButton,
|
|
3631
|
+
saveButton: texts.saveButton
|
|
3632
|
+
},
|
|
3633
|
+
presetChanged: presetChanged
|
|
3634
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Flex, {
|
|
3635
|
+
vertical: true,
|
|
3636
|
+
justify: "center",
|
|
3637
|
+
align: "center",
|
|
3638
|
+
className: "h-full text-gray-400",
|
|
3639
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Empty, {
|
|
3640
|
+
image: antd.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
3641
|
+
description: texts.emptyText
|
|
3642
|
+
})
|
|
3643
|
+
})
|
|
3644
|
+
})]
|
|
3645
|
+
})
|
|
3646
|
+
});
|
|
3647
|
+
};
|
|
3648
|
+
var PresetModal = /*#__PURE__*/react.memo(Preset);
|
|
3649
|
+
|
|
3180
3650
|
exports.AuthorizationModal = AuthorizationModal;
|
|
3181
3651
|
exports.NetworkSettingsModal = NetworkSettingsModal$1;
|
|
3652
|
+
exports.PresetModal = PresetModal;
|
|
3182
3653
|
exports.PtpModal = PtpModal$1;
|
|
3183
3654
|
exports.SystemOperations = SystemOperations;
|
|
3184
3655
|
exports.UpgradeManager = UpgradeManager;
|