mirror of
https://github.com/certd/certd.git
synced 2026-05-14 20:17:32 +08:00
fix: 修复阿里云订阅流水线创建对话框无法获取阿里订单列表的bug
This commit is contained in:
@@ -34,11 +34,11 @@
|
||||
"@aws-sdk/s3-request-presigner": "^3.964.0",
|
||||
"@certd/vue-js-cron-light": "^4.0.14",
|
||||
"@ctrl/tinycolor": "^4.1.0",
|
||||
"@fast-crud/editor-code": "^1.27.8",
|
||||
"@fast-crud/fast-crud": "^1.27.8",
|
||||
"@fast-crud/fast-extends": "^1.27.8",
|
||||
"@fast-crud/ui-antdv4": "^1.27.8",
|
||||
"@fast-crud/ui-interface": "^1.27.8",
|
||||
"@fast-crud/editor-code": "^1.28.1",
|
||||
"@fast-crud/fast-crud": "^1.28.1",
|
||||
"@fast-crud/fast-extends": "^1.28.1",
|
||||
"@fast-crud/ui-antdv4": "^1.28.1",
|
||||
"@fast-crud/ui-interface": "^1.28.1",
|
||||
"@iconify/tailwind": "^1.2.0",
|
||||
"@iconify/vue": "^4.1.1",
|
||||
"@manypkg/get-packages": "^2.2.2",
|
||||
|
||||
@@ -74,7 +74,6 @@ const props = defineProps<
|
||||
uploadCert?: UploadCertProps;
|
||||
} & ComponentPropsType
|
||||
>();
|
||||
debugger;
|
||||
const emit = defineEmits<{
|
||||
"update:value": any;
|
||||
}>();
|
||||
@@ -141,8 +140,7 @@ const getOptions = async () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
message.value = "";
|
||||
message.value = "获取中...";
|
||||
hasError.value = false;
|
||||
loading.value = true;
|
||||
const pageNo = pagerRef.value.pageNo;
|
||||
|
||||
@@ -11,7 +11,17 @@ export type MergeScriptContext = {
|
||||
export function useReference(formItem: any) {
|
||||
if (formItem.mergeScript) {
|
||||
const ctx = {
|
||||
compute,
|
||||
compute: (opts: any) => {
|
||||
const func = (context: any) => {
|
||||
let form = context.form || {};
|
||||
form = form.input || form.body || form.access || form;
|
||||
return opts({
|
||||
...context,
|
||||
form,
|
||||
});
|
||||
};
|
||||
return compute(func);
|
||||
},
|
||||
asyncCompute,
|
||||
computed,
|
||||
};
|
||||
|
||||
@@ -94,9 +94,15 @@ export function setRunnableIds(pipeline: any) {
|
||||
return JSON.parse(content);
|
||||
}
|
||||
|
||||
export function useCertPipelineCreator() {
|
||||
export function useCertPipelineCreator({ formWrapperRef }: { formWrapperRef: Ref<any> }) {
|
||||
const { t } = useI18n();
|
||||
const { openCrudFormDialog } = useFormWrapper();
|
||||
|
||||
function open(opts: any) {
|
||||
return new Promise((resolve, reject) => {
|
||||
formWrapperRef.value.open(opts);
|
||||
});
|
||||
}
|
||||
const { openCrudFormDialog } = useFormWrapper({ open });
|
||||
|
||||
const pluginStore = usePluginStore();
|
||||
const settingStore = useSettingStore();
|
||||
@@ -111,10 +117,10 @@ export function useCertPipelineCreator() {
|
||||
// inputs[inputKey].form.show = true;
|
||||
const inputDefine = cloneDeep(certPlugin.input[inputKey]);
|
||||
if (inputDefine.maybeNeed) {
|
||||
moreParams.push(inputKey);
|
||||
moreParams.push("input." + inputKey);
|
||||
}
|
||||
useReference(inputDefine);
|
||||
inputs[inputKey] = {
|
||||
inputs["input." + inputKey] = {
|
||||
title: inputDefine.title,
|
||||
form: {
|
||||
...inputDefine,
|
||||
@@ -135,17 +141,19 @@ export function useCertPipelineCreator() {
|
||||
const DEFAULT_RENEW_DAYS = settingStore.sysPublic.defaultCertRenewDays || settingStore.sysPublic.defaultWillExpireDays || 20;
|
||||
|
||||
merge(inputs, {
|
||||
renewDays: {
|
||||
"input.renewDays": {
|
||||
form: {
|
||||
value: DEFAULT_RENEW_DAYS,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const initialForm = req.initialForm || {};
|
||||
initialForm.type = certPlugin.name;
|
||||
return {
|
||||
crudOptions: {
|
||||
form: {
|
||||
initialForm: req.initialForm || {},
|
||||
initialForm: initialForm,
|
||||
doSubmit,
|
||||
wrapper: {
|
||||
wrapClassName: "cert_pipeline_create_form",
|
||||
@@ -164,44 +172,6 @@ export function useCertPipelineCreator() {
|
||||
},
|
||||
},
|
||||
columns: {
|
||||
// certApplyPlugin: {
|
||||
// title: t("certd.plugin.selectTitle"),
|
||||
// type: "dict-select",
|
||||
// dict: dict({
|
||||
// data: [
|
||||
// { value: "CertApply", label: "JS-ACME" },
|
||||
// { value: "CertApplyLego", label: "Lego-ACME" },
|
||||
// { value: "CertApplyGetFormAliyun", label: "Aliyun-Order" },
|
||||
// ],
|
||||
// }),
|
||||
// form: {
|
||||
// order: 0,
|
||||
// value: "CertApply",
|
||||
// helper: {
|
||||
// render: () => {
|
||||
// return (
|
||||
// <ul>
|
||||
// <li>{t("certd.plugin.jsAcme")}</li>
|
||||
// <li>{t("certd.plugin.legoAcme")}</li>
|
||||
// <li>{t("certd.plugin.aliyunOrder")}</li>
|
||||
// </ul>
|
||||
// );
|
||||
// },
|
||||
// },
|
||||
// valueChange: {
|
||||
// handle: async ({ form, value }) => {
|
||||
// const config = await pluginStore.getPluginConfig({
|
||||
// name: value,
|
||||
// type: "builtIn",
|
||||
// });
|
||||
// if (config.sysSetting?.input) {
|
||||
// merge(form, config.sysSetting.input);
|
||||
// }
|
||||
// },
|
||||
// immediate: true,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
...inputs,
|
||||
triggerCron: {
|
||||
title: t("certd.pipelineForm.triggerCronTitle"),
|
||||
@@ -346,20 +316,20 @@ export function useCertPipelineCreator() {
|
||||
await checkPipelineLimit();
|
||||
|
||||
//设置系统初始值
|
||||
const initialForm: any = {};
|
||||
const initialForm: any = { input: {} };
|
||||
const pluginSysConfig = await pluginStore.getPluginConfig({ name: req.pluginName, type: "builtIn" });
|
||||
if (pluginSysConfig.sysSetting?.input) {
|
||||
for (const key in pluginSysConfig.sysSetting?.input) {
|
||||
initialForm[key] = pluginSysConfig.sysSetting?.input[key];
|
||||
initialForm.input[key] = pluginSysConfig.sysSetting?.input[key];
|
||||
}
|
||||
}
|
||||
|
||||
async function doSubmit({ form }: any) {
|
||||
// const certDetail = readCertDetail(form.cert.crt);
|
||||
// 添加certd pipeline
|
||||
const pluginInput = omit(form, ["triggerCron", "notification", "notificationTarget", "notificationWhen", "certApplyPlugin", "groupId"]);
|
||||
const pluginInput = form.input;
|
||||
let pipeline: any = {
|
||||
title: form.domains[0] + "证书自动化",
|
||||
title: pluginInput.domains[0] + "证书自动化",
|
||||
runnableType: "pipeline",
|
||||
stages: [
|
||||
{
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
<div>{{ t("certd.applyCertificate") }}</div>
|
||||
</template>
|
||||
</fs-crud>
|
||||
<fs-form-wrapper ref="formWrapperRef"></fs-form-wrapper>
|
||||
</fs-page>
|
||||
</template>
|
||||
|
||||
@@ -90,10 +91,9 @@ function onActionbarMoreItemClick(req: { key: string; item: any }) {
|
||||
openCertApplyDialog({ key: req.key, title: req.item?.title });
|
||||
}
|
||||
|
||||
const certdFormRef = ref<typeof CertdForm>();
|
||||
const currentPluginRef = ref();
|
||||
provide("getCurrentPluginDefine", () => {
|
||||
return currentPluginRef.value;
|
||||
return currentPluginRef;
|
||||
});
|
||||
|
||||
const addMorePipelineBtns = computed(() => {
|
||||
@@ -104,7 +104,9 @@ const addMorePipelineBtns = computed(() => {
|
||||
{ key: "BatchAddPipeline", title: t("certd.pipelinePage.batchAddPipeline"), icon: "ion:duplicate" },
|
||||
];
|
||||
});
|
||||
const { openAddCertdPipelineDialog } = useCertPipelineCreator();
|
||||
|
||||
const formWrapperRef = ref<any>();
|
||||
const { openAddCertdPipelineDialog } = useCertPipelineCreator({ formWrapperRef });
|
||||
function openCertApplyDialog(req: { key: string; title: string }) {
|
||||
if (req.key === "AddPipeline") {
|
||||
crudExpose.openAdd({});
|
||||
|
||||
Reference in New Issue
Block a user