perf: 说明优化,默认值优化

pull/101/head
xiaojunnuo 2024-07-04 02:22:52 +08:00
parent 4656019898
commit 970c7fd8a0
13 changed files with 64 additions and 29 deletions

View File

@ -2,7 +2,7 @@ import { IsAccess, AccessInput } from "@certd/pipeline";
@IsAccess({
name: "eab",
title: "EABAccess",
title: "EAB授权",
desc: "ZeroSSL证书申请需要EAB授权",
})
export class EabAccess {

View File

@ -58,7 +58,7 @@ export class CertApplyPlugin extends AbstractTaskPlugin {
@TaskInput({
title: "证书提供商",
value: "letsencrypt",
default: "letsencrypt",
component: {
name: "a-select",
vModel: "value",

View File

@ -5,7 +5,7 @@
<fs-icon class="cd-icon-button" icon="ion:close-circle-outline" @click="clear"></fs-icon>
</span>
<span v-else class="mlr-5 gray">请选择</span>
<a-button @click="chooseForm.open"></a-button>
<a-button class="ml-5" @click="chooseForm.open"></a-button>
<a-form-item-rest v-if="chooseForm.show">
<a-modal v-model:open="chooseForm.show" title="选择授权提供者" width="700px" @ok="chooseForm.ok">
<div style="height: 400px; position: relative">
@ -46,9 +46,9 @@ export default defineComponent({
}
}
function clear(){
function clear() {
selectedId.value = "";
target.value = null
target.value = null;
ctx.emit("update:modelValue", selectedId.value);
}
@ -99,7 +99,6 @@ export default defineComponent({
}
});
return {
clear,
target,

View File

@ -1,7 +1,7 @@
import { compute } from "@fast-crud/fast-crud";
import { compute, CreateCrudOptionsProps, CreateCrudOptionsRet } from "@fast-crud/fast-crud";
import { Dicts } from "./dicts";
export default function () {
export default function (): CreateCrudOptionsRet {
return {
crudOptions: {
form: {
@ -12,7 +12,7 @@ export default function () {
columns: {
domains: {
title: "域名",
type: ["dict-select"],
type: "dict-select",
search: {
show: true,
component: {
@ -58,6 +58,30 @@ export default function () {
rules: [{ required: true, type: "email", message: "请填写邮箱" }]
}
},
blank: {
title: "占位",
type: "text",
form: {
blank: true
}
},
sslProvider: {
title: "证书提供商",
type: "dict-select",
dict: Dicts.sslProviderDict
},
eabAccess: {
title: "EAB授权",
type: "dict-select",
form: {
component: {
name: "PiAccessSelector",
type: "eab",
vModel: "modelValue"
},
helper: "如果是ZeroSSL需要配置EAB授权https://app.zerossl.com/developer 生成 'EAB' "
}
},
dnsProviderType: {
title: "DNS提供商",
type: "dict-select",

View File

@ -1,7 +1,12 @@
import { dict } from "@fast-crud/fast-crud";
export const Dicts = {
certIssuerDict: dict({ data: [{ value: "letencrypt", label: "LetEncrypt" }] }),
sslProviderDict: dict({
data: [
{ value: "letsencrypt", label: "Lets Encrypt" },
{ value: "zerossl", label: "ZeroSSL" }
]
}),
challengeTypeDict: dict({ data: [{ value: "dns", label: "DNS校验" }] }),
dnsProviderTypeDict: dict({
url: "pi/dnsProvider/dnsProviderTypeDict"

View File

@ -9,7 +9,7 @@ import { ref } from "vue";
import _ from "lodash-es";
export default {
name: "PiCertdForm",
setup(props:any, ctx:any) {
setup(props: any, ctx: any) {
//
const { buildFormOptions } = useColumns();
//使crudOptions
@ -18,7 +18,7 @@ export default {
const formOptions = buildFormOptions(
_.merge(crudOptions, {
form: {
doSubmit({ form }:any) {
doSubmit({ form }: any) {
// certd pipeline
doSubmitRef.value({ form });
}
@ -29,7 +29,7 @@ export default {
const formWrapperRef = ref();
const formWrapperOptions = ref();
formWrapperOptions.value = formOptions;
function open(doSubmit:any) {
function open(doSubmit: any) {
doSubmitRef.value = doSubmit;
formWrapperRef.value.open(formWrapperOptions.value);
}

View File

@ -7,6 +7,11 @@
<template #actionbar-right>
<!-- <span style="margin-left: 10px">出现<a-tag>Promise rejected attempt #18,retrying in 10000ms:No TXT recordsfound for name</a-tag></span>-->
</template>
<template #form-bottom>
<div>
申请证书
</div>
</template>
<pi-certd-form ref="certdFormRef"></pi-certd-form>
</fs-crud>
</fs-page>

View File

@ -64,11 +64,11 @@
name: 'a-select',
vModel: 'value',
options: [
{ value: 0, label: '正常运行' },
{ value: 1, label: '成功后跳过' }
{ value: 0, label: '正常运行(证书申请任务请选择它)' },
{ value: 1, label: '成功后跳过(其他任务请选择它)' }
]
},
helper:'该任务运行成功一次之后下次运行是否跳过,证书申请任务务必选择正常运行',
helper: '该任务运行成功一次之后下次运行是否跳过,保持默认即可',
rules: [{ required: true, message: '此项必填' }]
}"
:get-context-fn="blankFn"
@ -90,10 +90,10 @@ import { message, Modal } from "ant-design-vue";
import { computed, inject, Ref, ref } from "vue";
import _ from "lodash-es";
import { nanoid } from "nanoid";
import {CopyOutlined} from "@ant-design/icons-vue";
import { CopyOutlined } from "@ant-design/icons-vue";
export default {
name: "PiStepForm",
components:{CopyOutlined},
components: { CopyOutlined },
props: {
editMode: {
type: Boolean,
@ -173,7 +173,7 @@ export default {
stepDrawerShow();
};
const stepAdd = (emit: any,stepDef:any) => {
const stepAdd = (emit: any, stepDef: any) => {
mode.value = "add";
const step: any = {
id: nanoid(),
@ -183,7 +183,7 @@ export default {
input: {},
status: null
};
_.merge(step,stepDef)
_.merge(step, stepDef);
stepOpen(step, emit);
};

View File

@ -45,7 +45,7 @@ export class DeployCertToAliyunAckIngressPlugin extends AbstractTaskPlugin {
@TaskInput({
title: '大区',
value: 'cn-shanghai',
default: 'cn-shanghai',
component: {
placeholder: '集群所属大区',
},
@ -55,7 +55,7 @@ export class DeployCertToAliyunAckIngressPlugin extends AbstractTaskPlugin {
@TaskInput({
title: '命名空间',
value: 'default',
default: 'default',
component: {
placeholder: '命名空间',
},
@ -64,7 +64,7 @@ export class DeployCertToAliyunAckIngressPlugin extends AbstractTaskPlugin {
namespace!: string;
@TaskInput({
title: 'ingress名称',
value: '',
default: '',
component: {
placeholder: 'ingress名称',
},
@ -74,7 +74,7 @@ export class DeployCertToAliyunAckIngressPlugin extends AbstractTaskPlugin {
ingressName!: string;
@TaskInput({
title: 'ingress类型',
value: 'nginx',
default: 'nginx',
component: {
placeholder: '暂时只支持nginx类型',
},
@ -83,8 +83,10 @@ export class DeployCertToAliyunAckIngressPlugin extends AbstractTaskPlugin {
ingressClass!: string;
@TaskInput({
title: '是否私网ip',
value: false,
default: false,
component: {
name: 'a-switch',
vModel: 'checked',
placeholder: '集群连接端点是否是私网ip',
},
helper: '如果您当前certd运行在同一个私网下可以选择是。',

View File

@ -30,7 +30,7 @@ export class UploadCertToAliyun extends AbstractTaskPlugin {
@TaskInput({
title: '大区',
value: 'cn-hangzhou',
default: 'cn-hangzhou',
component: {
name: 'a-select',
vModel: 'value',

View File

@ -65,7 +65,7 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
'开启后将直接复制到当前主机某个目录不上传到主机由于是docker启动实际上是复制到docker容器内的“证书保存路径”你需要事先在docker-compose.yaml中配置主机目录映射 volumes: /your_target_path:/your_target_path',
component: {
name: 'a-switch',
value: false,
default: false,
vModel: 'checked',
},
})

View File

@ -10,7 +10,7 @@ import { DnspodAccess } from '../access';
@IsDnsProvider({
name: 'dnspod',
title: 'dnspod(已过时)',
title: 'dnspod(已过时,请尽快换成腾讯云)',
desc: '请尽快换成腾讯云类型',
accessType: 'dnspod',
})

View File

@ -24,7 +24,7 @@ import dayjs from 'dayjs';
export class DeployToClbPlugin extends AbstractTaskPlugin {
@TaskInput({
title: '大区',
value: 'ap-guangzhou',
default: 'ap-guangzhou',
component: {
name: 'a-select',
options: [{ value: 'ap-guangzhou' }],