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