diff --git a/packages/plugins/plugin-cert/src/plugin/cert-plugin/convert.ts b/packages/plugins/plugin-cert/src/plugin/cert-plugin/convert.ts
index e320a975..1861e875 100644
--- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/convert.ts
+++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/convert.ts
@@ -30,7 +30,7 @@ export class CertConverter {
// 转der
derPath = await this.convertDer(ctx);
- //jksPath = await this.convertJks(ctx, pfxPath, opts.pfxPassword);
+ //jksPath = await this.convertJks(ctx, opts.pfxPassword);
};
await certReader.readCertFile({ logger: this.logger, handle });
@@ -64,7 +64,7 @@ export class CertConverter {
if (pfxPassword) {
passwordArg = `-password pass:${pfxPassword}`;
}
- // 兼容server 2016
+ // 兼容server 2016,旧版本不能用sha256
const oldPfxCmd = `openssl pkcs12 -macalg SHA1 -keypbe PBE-SHA1-3DES -certpbe PBE-SHA1-3DES -export -out ${pfxPath} -inkey ${tmpKeyPath} -in ${tmpCrtPath} ${passwordArg}`;
// const newPfx = `openssl pkcs12 -export -out ${pfxPath} -inkey ${tmpKeyPath} -in ${tmpCrtPath} ${passwordArg}`;
await this.exec(oldPfxCmd);
@@ -98,18 +98,18 @@ export class CertConverter {
// this.saveFile(filename, fileBuffer);
}
- async convertJks(opts: CertReaderHandleContext, pfxPath: string, pfxPassword = "") {
+ async convertJks(opts: CertReaderHandleContext, pfxPassword = "") {
const jksPassword = pfxPassword || "123456";
try {
const randomStr = Math.floor(Math.random() * 1000000) + "";
- // const p12Path = path.join(os.tmpdir(), "/certd/tmp/", randomStr + `_cert.p12`);
- // const { tmpCrtPath, tmpKeyPath } = opts;
- // let passwordArg = "-passout pass:";
- // if (pfxPassword) {
- // passwordArg = `-password pass:${pfxPassword}`;
- // }
- // await this.exec(`openssl pkcs12 -export -in ${tmpCrtPath} -inkey ${tmpKeyPath} -out ${p12Path} -name certd ${passwordArg}`);
+ const p12Path = path.join(os.tmpdir(), "/certd/tmp/", randomStr + `_cert.p12`);
+ const { tmpCrtPath, tmpKeyPath } = opts;
+ let passwordArg = "-passout pass:";
+ if (pfxPassword) {
+ passwordArg = `-password pass:${pfxPassword}`;
+ }
+ await this.exec(`openssl pkcs12 -export -in ${tmpCrtPath} -inkey ${tmpKeyPath} -out ${p12Path} -name certd ${passwordArg}`);
const jksPath = path.join(os.tmpdir(), "/certd/tmp/", randomStr + `_cert.jks`);
const dir = path.dirname(jksPath);
@@ -117,8 +117,9 @@ export class CertConverter {
fs.mkdirSync(dir, { recursive: true });
}
await this.exec(
- `keytool -importkeystore -srckeystore ${pfxPath} -srcstoretype PKCS12 -srcstorepass "${pfxPassword}" -destkeystore ${jksPath} -deststoretype PKCS12 -deststorepass "${jksPassword}" `
+ `keytool -importkeystore -srckeystore ${p12Path} -srcstoretype PKCS12 -srcstorepass "${pfxPassword}" -destkeystore ${jksPath} -deststoretype PKCS12 -deststorepass "${jksPassword}" `
);
+ fs.unlinkSync(p12Path);
return jksPath;
} catch (e) {
this.logger.error("转换jks失败", e);
diff --git a/packages/ui/certd-client/package.json b/packages/ui/certd-client/package.json
index 2370e660..a8350352 100644
--- a/packages/ui/certd-client/package.json
+++ b/packages/ui/certd-client/package.json
@@ -45,6 +45,7 @@
"cron-parser": "^4.9.0",
"cropperjs": "^1.6.1",
"dayjs": "^1.11.10",
+ "echarts": "^5.5.1",
"highlight.js": "^11.9.0",
"humanize-duration": "^3.27.3",
"lodash-es": "^4.17.21",
@@ -58,6 +59,7 @@
"sortablejs": "^1.15.2",
"vue": "^3.4.21",
"vue-cropperjs": "^5.0.0",
+ "vue-echarts": "^7.0.3",
"vue-i18n": "^9.10.2",
"vue-router": "^4.3.0",
"vuedraggable": "^4.1.0"
diff --git a/packages/ui/certd-client/src/views/certd/pipeline/certd-form/crud.tsx b/packages/ui/certd-client/src/views/certd/pipeline/certd-form/crud.tsx
index f4523a07..f294bb12 100644
--- a/packages/ui/certd-client/src/views/certd/pipeline/certd-form/crud.tsx
+++ b/packages/ui/certd-client/src/views/certd/pipeline/certd-form/crud.tsx
@@ -98,8 +98,7 @@ export default function (certPluginGroup: PluginGroup, formWrapperRef: any): Cre
vModel: "modelValue",
placeholder: "0 0 4 * * *"
},
- helper:
- "点击上面的按钮,选择每天几点几分定时执行,后面的分秒都要选择0。\n例如:0 0 4 * * *,每天凌晨4点0分0秒触发\n建议设置为每天触发一次,证书未到期之前任务会跳过,不会重复执行",
+ helper: "点击上面的按钮,选择每天几点几分定时执行,后面的分秒都要选择0。\n建议设置为每天触发一次,证书未到期之前任务会跳过,不会重复执行",
order: 100
}
},
diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue
index d4909738..b6dacaf3 100644
--- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue
+++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue
@@ -3,7 +3,7 @@
v-model:open="triggerDrawerVisible"
placement="right"
:closable="true"
- width="600px"
+ width="650px"
class="pi-trigger-form"
@after-open-change="triggerDrawerOnAfterVisibleChange"
>
@@ -58,8 +58,7 @@
name: 'cron-editor',
vModel: 'modelValue'
},
- helper:
- '点击上面的按钮,选择每天几点几分定时执行,后面的分秒都要选择0。\n例如:0 0 4 * * *,每天凌晨4点0分0秒触发\n建议设置为每天触发一次,证书未到期之前任务会跳过,不会重复执行',
+ helper: '点击上面的按钮,选择每天几点几分定时执行,后面的分秒都要选择0。\n建议设置为每天触发一次,证书未到期之前任务会跳过,不会重复执行',
rules: [{ required: true, message: '此项必填' }]
}"
/>
diff --git a/packages/ui/certd-client/src/views/framework/home/dashboard/api.ts b/packages/ui/certd-client/src/views/framework/home/dashboard/api.ts
new file mode 100644
index 00000000..72ec90b5
--- /dev/null
+++ b/packages/ui/certd-client/src/views/framework/home/dashboard/api.ts
@@ -0,0 +1,8 @@
+import { request } from "/@/api/service";
+
+export async function GetStatisticCount() {
+ return await request({
+ url: "/statistic/count",
+ method: "POST"
+ });
+}
diff --git a/packages/ui/certd-client/src/views/framework/home/dashboard/charts/d.ts b/packages/ui/certd-client/src/views/framework/home/dashboard/charts/d.ts
new file mode 100644
index 00000000..18d71221
--- /dev/null
+++ b/packages/ui/certd-client/src/views/framework/home/dashboard/charts/d.ts
@@ -0,0 +1,4 @@
+export type ChartItem = {
+ name: string;
+ value: number;
+};
diff --git a/packages/ui/certd-client/src/views/framework/home/dashboard/charts/day-count.vue b/packages/ui/certd-client/src/views/framework/home/dashboard/charts/day-count.vue
new file mode 100644
index 00000000..50e4ae63
--- /dev/null
+++ b/packages/ui/certd-client/src/views/framework/home/dashboard/charts/day-count.vue
@@ -0,0 +1,104 @@
+
+