chore: 优化fix

This commit is contained in:
xiaojunnuo
2026-05-20 12:25:56 +08:00
parent adcf570b15
commit 5c80c99b94
8 changed files with 59 additions and 13 deletions
+38
View File
@@ -33,6 +33,44 @@ version: 1.0.0
7. 删除、审核通过、拒绝等危险操作必须保留确认弹窗和错误提示,成功后刷新当前 CRUD 列表。
8. 对话框里只做纯确认时可以使用 `Modal.confirm`;只要需要字段输入、表单校验或提交字段,统一使用 `useFormDialog` / `openFormDialog`,不要在 `Modal.confirm``content` 里手写输入框。
## crud 配置
const crudOptions ={
id: string, //表格唯一标识,同一个页面的多个表格的列设置和字段设置会根据id进行区分保存
request:{}, //http请求
columns:{ //字段配置
key:{ //字段key
column:{}, //对应table-column配置
form:{}, //表单中该字段的公共配置,viewForm、addForm、editForm、search会集成此配置,支持对应ui的form-item配置
viewForm:{}, //查看表单中该字段的配置,支持对应ui的form-item配置
addForm:{}, // 添加表单中该字段的配置,支持对应ui的form-item配置
editForm:{}, //编辑表单中该字段的配置,支持对应ui的form-item配置
search:{} //对应查询表单的form-item配置
}
},
search:{ //查询框配置 ,对应fs-search组件
options:{} //查询表单配置 ,对应el-from, a-form配置
},
actionbar:{}, //动作条,添加按钮,对应fs-actionbar组件
toolbar:{}, //工具条 ,对应fs-toolbar组件
table:{ //表格配置,对应fs-table
// 对应 el-table / a-table的配置
slots:{} // 对应el-table ,a-table的插槽
},
data:{}, //列表数据,无需配置,自动从pageRequest中获取
// 如果你要手动改变表格数据,可以通过crudBinding.value.data直接赋值修改表格数据
rowHandle:{}, //操作列配置,对应fs-row-handle
form:{ //表单的公共配置,对应el-forma-form配置
wrapper:{} //表单外部容器(对话框)的配置,对应el-dialog,el-drawer,a-model,a-drawer的配置
},
viewForm:{}, //查看表单的独立配置
editForm:{}, //编辑表单的独立配置
addForm:{}, //添加表单的独立配置
pagination:{}, //分页配置 ,对应el-pagination / a-pagination
container:{}, //容器配置 ,对应fs-container
}
## 布局高度
- Fast Crud 表格依赖外部容器高度计算。虽然表格本身有默认约 200px 高度,但页面内嵌 `fs-crud` 时,为了获得稳定可用的列表区域,必须让外层容器提供明确高度或剩余高度。
@@ -123,10 +123,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
value: "id",
label: "nickName",
}),
editForm: {
component: {
disabled: true,
},
},
form: {
show: true,
component: {
disabled: true,
disabled: false,
crossPage: true,
multiple: false,
select: {
@@ -183,9 +188,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
}),
form: {
show: true,
component: {
disabled: true,
},
},
column: {
width: 80,
@@ -8,7 +8,7 @@ import { SuiteContentWildcardDomainCountFix } from "./suite-content-wildcard-dom
type AutoFixTask = {
key: string;
fix: {
init(): Promise<void>;
init(): Promise<boolean>;
};
};
@@ -56,8 +56,8 @@ export class AutoFix {
if (setting.fixed?.[task.key]) {
continue;
}
await task.fix.init();
setting.fixed[task.key] = true;
const ret = await task.fix.init();
setting.fixed[task.key] = ret;
await this.sysSettingsService.saveSetting(setting);
}
}
@@ -38,8 +38,10 @@ export class CertInfoWildcardDomainCountFix {
if (fixedCount > 0) {
logger.info(`已修复证书泛域名数量历史数据,数量=${fixedCount}`);
}
return true
} catch (e: any) {
logger.error("修复证书泛域名数量历史数据失败", e);
}
return false
}
}
@@ -47,7 +47,7 @@ export class GoogleCommonEabAccountKeyFix {
async init() {
if (!isComm()) {
return;
return true;
}
try {
const certApplyConfig = await this.pluginConfigService.getPluginConfig({
@@ -56,31 +56,33 @@ export class GoogleCommonEabAccountKeyFix {
});
const googleCommonEabAccessId = certApplyConfig?.sysSetting?.input?.googleCommonEabAccessId;
if (!googleCommonEabAccessId) {
return;
return true;
}
const eabAccess = await this.accessService.getAccessById(googleCommonEabAccessId, false);
if (eabAccess.accountKey) {
return;
return true;
}
if (!eabAccess.kid) {
logger.info("公共Google EAB授权缺少KID,跳过历史ACME账号私钥修复");
return;
return true;
}
const accountConfig = await this.getLegacyGoogleAccountConfig(eabAccess.email);
const privateKey = accountConfig?.privateKey || accountConfig?.key || accountConfig?.accountKey;
if (!privateKey) {
logger.info("未找到可迁移到公共Google EAB授权的历史ACME账号私钥");
return;
return true;
}
const accountKey = buildEabAccountKeyValue(eabAccess.kid, privateKey);
await this.accessService.updateAccess({ id: googleCommonEabAccessId, eabType: "google", accountKey });
logger.info(`已修复公共Google EAB授权的ACME账号私钥,accessId=${googleCommonEabAccessId}`);
return true;
} catch (e: any) {
logger.error("修复公共Google EAB授权ACME账号私钥失败", e);
}
return false
}
async getLegacyGoogleAccountConfig(email?: string) {
@@ -41,6 +41,7 @@ export class OauthSubtypeBoundTypeFix {
await this.convertLegacyAddonLoginTypeToArray(addonEntity, legacyLoginType, manager);
}
});
return true
} catch (e: any) {
logger.error("修复OAuth subtype绑定历史数据失败", e);
}
@@ -33,9 +33,11 @@ export class SuiteContentWildcardDomainCountFix {
if (fixedCount > 0) {
logger.info(`已修复套餐最大泛域名数量历史数据,数量=${fixedCount}`);
}
return true
} catch (e: any) {
logger.error("修复套餐最大泛域名数量历史数据失败", e);
}
return false
}
private async fixSuiteContentWildcardDomainCountByTable(entityManager: any, tableName: string) {
@@ -363,7 +363,6 @@ export class PipelineService extends BaseService<PipelineEntity> {
if (!old && userSuite?.pipelineCount.max != -1 && userSuite?.pipelineCount.used + 1 > userSuite?.pipelineCount.max) {
throw new NeedSuiteException(`对不起,您最多只能创建${userSuite?.pipelineCount.max}条流水线,请购买或升级套餐`);
}
let oldDomainCount = 0;
let oldWildcardDomainCount = 0;
if (old?.id) {