chore: 新增插件额外配置功能

- 在插件管理中添加 extra 字段,用于存储额外配置信息
- 实现插件编辑页面的额外配置编辑功能
- 更新数据库结构,增加 extra 列
- 优化代码编辑器的导入方式
- 更新 fast-crud 相关包版本
This commit is contained in:
xiaojunnuo
2025-04-11 14:00:28 +08:00
parent 67f956d4a0
commit c2ca1ea1e5
8 changed files with 79 additions and 49 deletions
@@ -6,6 +6,8 @@ import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq,
import { useUserStore } from "/src/store/modules/user";
import { useSettingStore } from "/src/store/modules/settings";
import { Modal } from "ant-design-vue";
//@ts-ignore
import yaml from "js-yaml";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const router = useRouter();
@@ -277,7 +279,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
},
"default.strategy.runStrategy": {
"extra.default.strategy.runStrategy": {
title: "运行策略",
type: "dict-select",
@@ -299,6 +301,16 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
color: "auto",
},
},
valueBuilder({ row }) {
if (row.extra) {
row.extra = yaml.load(row.extra);
}
},
valueResolve({ row }) {
if (row.extra) {
row.extra = yaml.dump(row.extra);
}
},
},
disabled: {
title: "点击禁用/启用",