mirror of
https://github.com/certd/certd.git
synced 2026-04-05 07:20:56 +08:00
fix: 修复创建流水线时,无法根据dns类型默认正确的dns授权的bug
Closes https://github.com/certd/certd/issues/97
This commit is contained in:
19
packages/ui/certd-client/src/use/use-refrence.ts
Normal file
19
packages/ui/certd-client/src/use/use-refrence.ts
Normal 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);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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: {
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -8,6 +8,13 @@ const preview = {
|
||||
preview: {
|
||||
enabled: true,
|
||||
},
|
||||
typeorm: {
|
||||
dataSource: {
|
||||
default: {
|
||||
logging: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as MidwayConfig;
|
||||
|
||||
mergeConfig(preview, 'preview');
|
||||
|
||||
@@ -8,6 +8,13 @@ const production = {
|
||||
preview: {
|
||||
enabled: false,
|
||||
},
|
||||
typeorm: {
|
||||
dataSource: {
|
||||
default: {
|
||||
logging: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as MidwayConfig;
|
||||
|
||||
mergeConfig(production, 'production');
|
||||
|
||||
Reference in New Issue
Block a user