mirror of
https://github.com/certd/certd.git
synced 2026-07-28 23:57:41 +08:00
perf: 证书成功通知增加有效期显示
This commit is contained in:
@@ -64,6 +64,7 @@ export default {
|
||||
projectUserManager: "Project User Management",
|
||||
myProjectManager: "My Projects",
|
||||
myProjectDetail: "Project Detail",
|
||||
projectDetail: "Project Detail",
|
||||
projectJoin: "Join Project",
|
||||
currentProject: "Current Project",
|
||||
projectMemberManager: "Project Member",
|
||||
|
||||
@@ -64,6 +64,7 @@ export default {
|
||||
enterpriseSetting: "企业设置",
|
||||
myProjectManager: "我的项目",
|
||||
myProjectDetail: "项目详情",
|
||||
projectDetail: "项目详情",
|
||||
projectJoin: "加入项目",
|
||||
currentProject: "当前项目",
|
||||
projectMemberManager: "项目成员管理",
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, reactive, ref, watch, inject, onMounted } from "vue";
|
||||
import { defineComponent, reactive, ref, watch, inject, onMounted, Ref } from "vue";
|
||||
import CertAccessModal from "./access/index.vue";
|
||||
import { createAccessApi } from "../api";
|
||||
import { message } from "ant-design-vue";
|
||||
@@ -64,9 +64,9 @@ export default defineComponent({
|
||||
setup(props, ctx) {
|
||||
const api = createAccessApi(props.from);
|
||||
|
||||
const target = ref({});
|
||||
const target:Ref<any> = ref({});
|
||||
const selectedId = ref();
|
||||
async function refreshTarget(value) {
|
||||
async function refreshTarget(value:any) {
|
||||
selectedId.value = value;
|
||||
if (value > 0) {
|
||||
target.value = await api.GetSimpleInfo(value);
|
||||
@@ -83,7 +83,7 @@ export default defineComponent({
|
||||
const userStore = useUserStore();
|
||||
const projectStore = useProjectStore();
|
||||
|
||||
async function emitValue(value) {
|
||||
async function emitValue(value:any) {
|
||||
const userId = userStore.userInfo.id;
|
||||
const isEnterprice = projectStore.isEnterprise;
|
||||
if (pipeline?.value) {
|
||||
@@ -132,7 +132,7 @@ export default defineComponent({
|
||||
|
||||
const providerDefine = ref({});
|
||||
|
||||
async function refreshProviderDefine(type) {
|
||||
async function refreshProviderDefine(type:any) {
|
||||
providerDefine.value = await api.GetProviderDefine(type);
|
||||
}
|
||||
watch(
|
||||
|
||||
@@ -76,7 +76,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
||||
this.clearLastStatus();
|
||||
|
||||
if (this.successNotify) {
|
||||
await this.sendSuccessNotify();
|
||||
await this.sendSuccessNotify(cert);
|
||||
}
|
||||
} else {
|
||||
throw new Error("申请证书失败");
|
||||
@@ -165,12 +165,14 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
||||
nextUpdateDays: leftDays - maxDays,
|
||||
};
|
||||
}
|
||||
async sendSuccessNotify() {
|
||||
async sendSuccessNotify(certReader: CertReader) {
|
||||
this.logger.info("发送证书申请成功通知");
|
||||
const url = await this.ctx.urlService.getPipelineDetailUrl(this.pipeline.id, this.ctx.runtime.id);
|
||||
const body: NotificationBody = {
|
||||
title: `证书申请成功【${this.pipeline.title}】`,
|
||||
content: `域名:${this.domains.join(",")}`,
|
||||
content: `域名:${this.domains.join(",")}\n
|
||||
证书有效期:${dayjs(certReader.expires).format("YYYY-MM-DD HH:mm:ss")}\n
|
||||
`,
|
||||
url: url,
|
||||
notificationType: "certApplySuccess",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user