pull/243/head
xiaojunnuo 2024-11-12 10:12:10 +08:00
parent ae072929df
commit 6841c2328e
9 changed files with 65 additions and 30 deletions

2
.gitignore vendored
View File

@ -29,3 +29,5 @@ test/**/*.js
/packages/ui/certd-server/data/db.sqlite
/packages/ui/certd-server/data/keys.yaml
/packages/pro/
test.js

View File

@ -13,7 +13,8 @@ services:
- "7001:7001"
# ↓↓↓↓ ---------------------------------------------------------- https端口可以根据实际情况是否暴露相关服务端口
- "7002:7002"
networks:
- ip6net
# #↓↓↓↓ -------------------------------------------------------------- 如果出现getaddrinfo ENOTFOUND等错误可以尝试设置dns配置
# dns:
# - 223.5.5.5
@ -44,4 +45,9 @@ services:
# - certd_typeorm_dataSource_default_password=yourpasswd # 密码
# - certd_typeorm_dataSource_default_database=certd # 数据库名
networks:
ip6net:
enable_ipv6: true
ipam:
config:
- subnet: 2001:db8::/64

View File

@ -88,11 +88,11 @@ class HttpError extends Error {
if (url) {
this.message = `${this.message}:${url}`;
}
// const { stack, cause } = error;
delete this.cause;
delete this.stack;
// this.cause = cause;
// this.stack = stack;
const { stack, cause } = error;
// delete this.cause;
// delete this.stack;
this.cause = cause;
this.stack = stack;
delete error.stack;
delete error.cause;
delete error.response;

View File

@ -57,9 +57,9 @@ export class HttpError extends Error {
data: error.response?.data,
};
// const { stack, cause } = error;
// this.cause = cause;
// this.stack = stack;
const { stack, cause } = error;
this.cause = cause;
this.stack = stack;
delete error.response;
delete error.config;
delete error.request;

View File

@ -116,10 +116,14 @@ export class RunHistory {
}
logError(runnable: Runnable, e: Error) {
// delete e.stack;
// delete e.cause;
const errorInfo = runnable.runnableType === "step" ? e : e.message;
this._loggers[runnable.id].error(`[${runnable.runnableType}] [${runnable.title}]<id:${runnable.id}> `, errorInfo);
const { cause, stack } = e;
delete e.stack;
delete e.cause;
if (runnable.runnableType === "step") {
this._loggers[runnable.id].error(`[${runnable.runnableType}] [${runnable.title}]<id:${runnable.id}> `, e, stack, cause);
} else {
this._loggers[runnable.id].error(`[${runnable.runnableType}] [${runnable.title}]<id:${runnable.id}> `, e.message);
}
}
finally(runnable: Runnable) {

View File

@ -74,16 +74,16 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
})
renewDays!: number;
@TaskInput({
title: "强制更新",
component: {
name: "a-switch",
vModel: "checked",
},
order: 100,
helper: "是否强制重新申请证书",
})
forceUpdate!: string;
// @TaskInput({
// title: "强制更新",
// component: {
// name: "a-switch",
// vModel: "checked",
// },
// order: 100,
// helper: "是否强制重新申请证书",
// })
// forceUpdate!: string;
@TaskInput({
title: "成功后邮件通知",
@ -221,11 +221,11 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
*
*/
async condition() {
if (this.forceUpdate) {
this.logger.info("强制更新证书选项已勾选,准备申请新证书");
this.logger.warn("申请完之后,切记取消强制更新,避免申请过多证书。");
return null;
}
// if (this.forceUpdate) {
// this.logger.info("强制更新证书选项已勾选,准备申请新证书");
// this.logger.warn("申请完之后,切记取消强制更新,避免申请过多证书。");
// return null;
// }
let inputChanged = this.ctx.inputChanged;
if (inputChanged) {

View File

@ -139,7 +139,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
width: 300,
cellRender: ({ row, value }) => {
debugger;
return <router-link to={{ path: "/certd/pipeline/detail", query: { id: row.pipelineId } }}>{value}</router-link>;
return (
<router-link to={{ path: "/certd/pipeline/detail", query: { id: row.pipelineId, editMode: false, historyId: row.id } }}>{value}</router-link>
);
}
}
},

View File

@ -5,6 +5,7 @@ export type StatusEnumItem = {
icon: string;
spin?: boolean;
iconSpin?: boolean;
iconColor?: string;
};
export type StatusEnumType = {
[key: string]: StatusEnumItem;

20
test.js Normal file
View File

@ -0,0 +1,20 @@
import axios from 'axios'
import dns from "dns";
// axios.request({
// url:"http://[2407:3740:0:301::c]/"
// }).then(res=>{
// console.log(res)
// })
//
// dns.resolve("api.cloudflare.com", (err, address) => {
// console.log(address);
// })
import {http} from '@certd/basic'
http.request({
url:"https://api.cloudflare.com"
}).then(res=>{
console.log(res)
})