mirror of https://github.com/certd/certd
chore:
parent
c96fcb7afc
commit
dd2b0a1595
|
@ -18,6 +18,8 @@ export class SysPublicSettings extends BaseSettings {
|
|||
limitUserPipelineCount = 0;
|
||||
managerOtherUserPipeline = false;
|
||||
icpNo?: string;
|
||||
defaultCron?: string;
|
||||
defaultNotification?: number;
|
||||
// triggerOnStartup = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
|||
},
|
||||
required: true,
|
||||
helper:
|
||||
"DNS直接验证:域名是在阿里云、腾讯云、华为云、Cloudflare、西数注册的,选它。\nCNAME代理验证:支持任何注册商注册的域名,但第一次需要手动添加CNAME记录",
|
||||
"DNS直接验证:域名是在阿里云、腾讯云、华为云、Cloudflare、NameSilo、西数注册的,选它。\nCNAME代理验证:支持任何注册商注册的域名,但第一次需要手动添加CNAME记录",
|
||||
})
|
||||
challengeType!: string;
|
||||
|
||||
|
|
|
@ -24,11 +24,18 @@ export type PlusInfo = {
|
|||
isComm?: boolean;
|
||||
};
|
||||
export type SysPublicSetting = {
|
||||
registerEnabled: boolean;
|
||||
managerOtherUserPipeline: boolean;
|
||||
registerEnabled?: boolean;
|
||||
limitUserPipelineCount?: number;
|
||||
managerOtherUserPipeline?: boolean;
|
||||
icpNo?: string;
|
||||
};
|
||||
|
||||
export type SysPrivateSetting = {
|
||||
httpProxy?: string;
|
||||
httpsProxy?: string;
|
||||
dnsResultOrder?: string;
|
||||
commonCnameEnabled?: boolean;
|
||||
};
|
||||
export type SysInstallInfo = {
|
||||
siteId: string;
|
||||
};
|
||||
|
|
|
@ -13,8 +13,9 @@
|
|||
@error="onError"
|
||||
/>
|
||||
</div>
|
||||
<div class="mt-5">
|
||||
<div class="mt-5 flex">
|
||||
<a-input :disabled="true" :readonly="readonly" :value="modelValue" @change="onChange"></a-input>
|
||||
<fs-icon icon="ion:close-circle" class="pointer fs-16 ml-5 color-gray" title="清除选择" @click="onClear"></fs-icon>
|
||||
</div>
|
||||
<div class="helper">下次触发时间:{{ nextTime }}</div>
|
||||
<div class="fs-helper">{{ errorMessage }}</div>
|
||||
|
@ -35,8 +36,12 @@ const props = defineProps<{
|
|||
}>();
|
||||
|
||||
const period = ref<string>("");
|
||||
if (props.modelValue == null) {
|
||||
if (props.modelValue == null || props.modelValue.endsWith("* * *")) {
|
||||
period.value = "day";
|
||||
} else if (props.modelValue.endsWith("* *")) {
|
||||
period.value = "month";
|
||||
} else if (props.modelValue.endsWith("*")) {
|
||||
period.value = "year";
|
||||
}
|
||||
const emit = defineEmits<{
|
||||
"update:modelValue": any;
|
||||
|
@ -74,6 +79,13 @@ const onError = (error: any) => {
|
|||
errorMessage.value = error;
|
||||
};
|
||||
|
||||
const onClear = () => {
|
||||
if (props.disabled) {
|
||||
return;
|
||||
}
|
||||
onUpdate("");
|
||||
};
|
||||
|
||||
const nextTime = computed(() => {
|
||||
if (props.modelValue == null) {
|
||||
return "请先设置正确的cron表达式";
|
||||
|
|
|
@ -198,6 +198,9 @@ h1, h2, h3, h4, h5, h6 {
|
|||
.color-green {
|
||||
color: green;
|
||||
}
|
||||
.color-gray {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.iconify{
|
||||
//font-size: 16px;
|
||||
|
|
|
@ -110,7 +110,6 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
|||
const define = await api.GetProviderDefine(value);
|
||||
currentDefine.value = define;
|
||||
console.log("define", define);
|
||||
debugger;
|
||||
if (!immediate) {
|
||||
form.body = {};
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
|||
|
||||
const addRequest = async (req: AddReq) => {
|
||||
const { form } = req;
|
||||
debugger;
|
||||
const res = await api.AddObj(form);
|
||||
return res;
|
||||
};
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<span v-else class="mlr-5 text-gray">{{ placeholder }}</span>
|
||||
<a-button class="ml-5" :disabled="disabled" :size="size" @click="chooseForm.open">选择</a-button>
|
||||
<a-form-item-rest v-if="chooseForm.show">
|
||||
<a-modal v-model:open="chooseForm.show" title="选择通知" width="900px" @ok="chooseForm.ok">
|
||||
<a-modal v-model:open="chooseForm.show" title="选择通知渠道" width="900px" @ok="chooseForm.ok">
|
||||
<div style="height: 400px; position: relative">
|
||||
<cert-notification-modal v-model="selectedId"></cert-notification-modal>
|
||||
</div>
|
||||
|
|
|
@ -5,6 +5,7 @@ import _, { merge } from "lodash-es";
|
|||
import { useUserStore } from "/@/store/modules/user";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import * as api from "../api.plugin";
|
||||
import NotificationSelector from "/@/views/certd/notification/notification-selector/index.vue";
|
||||
export default function (certPluginGroup: PluginGroup, formWrapperRef: any): CreateCrudOptionsRet {
|
||||
const inputs: any = {};
|
||||
const userStore = useUserStore();
|
||||
|
@ -102,30 +103,16 @@ export default function (certPluginGroup: PluginGroup, formWrapperRef: any): Cre
|
|||
order: 100
|
||||
}
|
||||
},
|
||||
emailNotify: {
|
||||
title: "失败邮件通知",
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ value: true, label: "启用" },
|
||||
{ value: false, label: "不启用" }
|
||||
]
|
||||
}),
|
||||
notification: {
|
||||
title: "失败通知",
|
||||
type: "text",
|
||||
form: {
|
||||
component: {
|
||||
name: NotificationSelector,
|
||||
vModel: "modelValue"
|
||||
},
|
||||
order: 101,
|
||||
value: true,
|
||||
helper: {
|
||||
render: () => {
|
||||
if (settingStore.isPlus) {
|
||||
return "建议启用";
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
建议启用,需要配置<router-link to={{ path: "/sys/settings/email" }}>邮件服务器</router-link>才能发送邮件
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
helper: "建议设置,任务执行失败实时提醒"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import * as _ from "lodash-es";
|
|||
import { useModal } from "/@/use/use-modal";
|
||||
import CertView from "./cert-view.vue";
|
||||
import { eachStages } from "./utils";
|
||||
|
||||
import { createApi as createNotificationApi } from "../notification/api";
|
||||
export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
|
@ -102,13 +102,13 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
|||
triggers.push({ title: "定时触发", type: "timer", props: { cron: form.triggerCron } });
|
||||
}
|
||||
const notifications = [];
|
||||
if (form.emailNotify) {
|
||||
if (form.notification) {
|
||||
const notify = await createNotificationApi().GetSimpleInfo(form.notification);
|
||||
notifications.push({
|
||||
type: "email",
|
||||
type: "custom",
|
||||
when: ["error", "turnToSuccess"],
|
||||
options: {
|
||||
receivers: [form.email]
|
||||
}
|
||||
notificationId: form.notification,
|
||||
title: notify.name
|
||||
});
|
||||
}
|
||||
let pipeline = {
|
||||
|
|
|
@ -75,7 +75,8 @@ export type PluginConfigBean = {
|
|||
};
|
||||
|
||||
export type CertApplyPluginSysInput = {
|
||||
googleCommonEabAccessId: number;
|
||||
googleCommonEabAccessId?: number;
|
||||
zerosslCommonEabAccessId?: number;
|
||||
};
|
||||
export type PluginSysSetting<T> = {
|
||||
sysSetting: {
|
||||
|
|
|
@ -1,22 +1,9 @@
|
|||
// @ts-ignore
|
||||
import { request } from "/@/api/service";
|
||||
import { SysPrivateSetting, SysPublicSetting } from "/@/api/modules/api.basic";
|
||||
const apiPrefix = "/sys/settings";
|
||||
export type SysSettings = { public: SysPublicSetting; private: SysPrivateSetting };
|
||||
|
||||
export type SysPublicSetting = {
|
||||
registerEnabled?: boolean;
|
||||
limitUserPipelineCount?: number;
|
||||
managerOtherUserPipeline?: boolean;
|
||||
icpNo?: string;
|
||||
};
|
||||
|
||||
export type SysPrivateSetting = {
|
||||
httpProxy?: string;
|
||||
httpsProxy?: string;
|
||||
dnsResultOrder?: string;
|
||||
commonCnameEnabled?: boolean;
|
||||
};
|
||||
|
||||
export const SettingKeys = {
|
||||
SysPublic: "sys.public",
|
||||
SysPrivate: "sys.private",
|
||||
|
|
|
@ -73,7 +73,7 @@ import { notification } from "ant-design-vue";
|
|||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { merge } from "lodash-es";
|
||||
import { util } from "/@/utils";
|
||||
|
||||
import NotificationSelector from "/src/views/certd/notification/notification-selector/index.vue";
|
||||
defineOptions({
|
||||
name: "SysSettings"
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue