fix: 修复创建流水线时,无法根据dns类型默认正确的dns授权的bug

Closes https://github.com/certd/certd/issues/97
pull/101/head
xiaojunnuo 2024-07-24 00:42:33 +08:00
parent f7fc06e657
commit a2c43b50a6
5 changed files with 38 additions and 2 deletions

View File

@ -0,0 +1,19 @@
import _ from "lodash-es";
import { compute } from "@fast-crud/fast-crud";
export function useReference(form: any) {
if (!form.reference) {
return;
}
for (const reference of form.reference) {
debugger;
_.set(
form,
reference.dest,
compute<any>((scope) => {
debugger;
return _.get(scope, reference.src);
})
);
}
}

View File

@ -1,5 +1,7 @@
import { compute, CreateCrudOptionsRet, dict } from "@fast-crud/fast-crud";
import { PluginGroup } from "@certd/pipeline";
import { useReference } from "/@/use/use-refrence";
import _ from "lodash-es";
export default function (certPluginGroup: PluginGroup, formWrapperRef: any): CreateCrudOptionsRet {
const inputs: any = {};
@ -10,10 +12,11 @@ export default function (certPluginGroup: PluginGroup, formWrapperRef: any): Cre
inputs[inputKey].form.show = true;
continue;
}
const inputDefine = plugin.input[inputKey];
const inputDefine = _.cloneDeep(plugin.input[inputKey]);
if (!inputDefine.required && !inputDefine.maybeNeed) {
continue;
}
useReference(inputDefine);
inputs[inputKey] = {
title: inputDefine.title,
form: {

View File

@ -59,7 +59,7 @@ const development = {
type: 'better-sqlite3',
database: './data/db.sqlite',
synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true
logging: true,
logging: false,
// 配置实体模型 或者 entities: '/entity',
entities: ['**/modules/*/entity/*.ts', '**/entity/*.js', '**/entity/*.d.ts', PipelineEntity, FlywayHistory, UserEntity],

View File

@ -8,6 +8,13 @@ const preview = {
preview: {
enabled: true,
},
typeorm: {
dataSource: {
default: {
logging: false,
},
},
},
} as MidwayConfig;
mergeConfig(preview, 'preview');

View File

@ -8,6 +8,13 @@ const production = {
preview: {
enabled: false,
},
typeorm: {
dataSource: {
default: {
logging: false,
},
},
},
} as MidwayConfig;
mergeConfig(production, 'production');