Merge branch 'v2-dev' into v2

This commit is contained in:
xiaojunnuo
2024-11-16 00:50:30 +08:00
47 changed files with 261 additions and 825 deletions
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.27.4](https://github.com/certd/certd/compare/v1.27.3...v1.27.4) (2024-11-14)
### Performance Improvements
* 公共cname服务支持关闭 ([f4ae512](https://github.com/certd/certd/commit/f4ae5125dc4cd97816976779cb3586b5ee78947e))
## [1.27.3](https://github.com/certd/certd/compare/v1.27.2...v1.27.3) (2024-11-13)
### Bug Fixes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/ui-client",
"version": "1.27.3",
"version": "1.27.4",
"private": true,
"scripts": {
"dev": "vite --open",
@@ -65,8 +65,8 @@
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@certd/lib-iframe": "^1.27.3",
"@certd/pipeline": "^1.27.3",
"@certd/lib-iframe": "^1.27.4",
"@certd/pipeline": "^1.27.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12",
@@ -8,7 +8,7 @@
<pi-status-show :status="item.node.status?.result" type="icon"></pi-status-show>
</div>
</template>
<div class="pi-task-view-logs" style="overflow: auto">
<div class="pi-task-view-logs" :class="item.node.id" style="overflow: auto">
<template v-for="(logItem, index) of item.logs" :key="index">
<span :class="logItem.color"> {{ logItem.time }}</span> <span>{{ logItem.content }}</span>
</template>
@@ -19,7 +19,7 @@
</template>
<script lang="ts">
import { computed, inject, Ref, ref } from "vue";
import { computed, inject, nextTick, Ref, ref, watch } from "vue";
import { RunHistory } from "../../type";
import PiStatusShow from "/@/views/certd/pipeline/pipeline/component/status-show.vue";
@@ -61,6 +61,7 @@ export default {
if (currentHistory?.value?.logs != null) {
node.logs = computed(() => {
if (currentHistory?.value?.logs && currentHistory.value?.logs[node.node.id] != null) {
console.log("log changed", node.node.id);
const logs = currentHistory.value?.logs[node.node.id];
const list = [];
for (let log of logs) {
@@ -78,6 +79,30 @@ export default {
}
return [];
});
watch(
() => {
return node.logs.value.length;
},
async () => {
let el = document.querySelector(`.pi-task-view-logs.${node.node.id}`);
console.log("el", el);
//判断当前是否在底部
const isBottom = el ? el.scrollHeight - el.scrollTop === el.clientHeight : true;
await nextTick();
el = document.querySelector(`.pi-task-view-logs.${node.node.id}`);
//如果在底部则滚动到底部
if (isBottom && el) {
el?.scrollTo({
top: el.scrollHeight,
behavior: "smooth"
});
}
},
{
immediate: true
}
);
}
}
@@ -14,6 +14,7 @@ export type SysPrivateSetting = {
httpProxy?: string;
httpsProxy?: string;
dnsResultOrder?: string;
commonCnameEnabled?: boolean;
};
export const SettingKeys = {
@@ -65,7 +65,8 @@
<a-form :model="testFormState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onTestSend">
<a-form-item label="测试收件邮箱" name="receiver" :rules="[{ required: true, message: '请输入测试收件邮箱' }]">
<a-input v-model:value="testFormState.receiver" />
<div class="helper">发送失败可以试试使用官方邮件服务器</div>
<div class="helper">发送失败<a href="https://certd.docmirror.cn/guide/use/email/" target="_blank">邮件配置帮助文档</a></div>
<div class="helper">您还可以试试使用官方邮件服务器</div>
</a-form-item>
<a-form-item :wrapper-col="{ offset: 8, span: 16 }">
<a-button type="primary" :loading="testFormState.loading" html-type="submit">测试</a-button>
@@ -23,6 +23,7 @@
<a-form-item label="管理其他用户流水线" :name="['public', 'managerOtherUserPipeline']">
<a-switch v-model:checked="formState.public.managerOtherUserPipeline" />
</a-form-item>
<a-form-item label="ICP备案号" :name="['public', 'icpNo']">
<a-input v-model:value="formState.public.icpNo" placeholder="粤ICP备xxxxxxx号" />
</a-form-item>
@@ -37,7 +38,7 @@
<a-input v-model:value="formState.private.httpsProxy" placeholder="http://192.168.1.2:18010/" />
<a-button class="ml-5" type="primary" :loading="testProxyLoading" title="保存后,再点击测试" @click="testProxy">测试</a-button>
</div>
<div class="helper">一般这两个代理填一样的</div>
<div class="helper">一般这两个代理填一样的保存后再测试</div>
</a-form-item>
<a-form-item label="双栈网络" :name="['private', 'dnsResultOrder']">
@@ -48,6 +49,11 @@
</a-select>
<div class="helper">如果选择IPv6优先需要在docker-compose.yaml中启用ipv6</div>
</a-form-item>
<a-form-item label="启用公共CNAME服务" :name="['private', 'commonCnameEnabled']">
<a-switch v-model:checked="formState.private.commonCnameEnabled" />
</a-form-item>
<a-form-item :wrapper-col="{ offset: 8, span: 16 }">
<a-button :loading="saveLoading" type="primary" html-type="submit">保存</a-button>
</a-form-item>
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.27.4](https://github.com/certd/certd/compare/v1.27.3...v1.27.4) (2024-11-14)
### Performance Improvements
* 公共cname服务支持关闭 ([f4ae512](https://github.com/certd/certd/commit/f4ae5125dc4cd97816976779cb3586b5ee78947e))
## [1.27.3](https://github.com/certd/certd/compare/v1.27.2...v1.27.3) (2024-11-13)
### Bug Fixes
+12 -12
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/ui-server",
"version": "1.27.3",
"version": "1.27.4",
"description": "fast-server base midway",
"private": true,
"type": "module",
@@ -29,17 +29,17 @@
},
"dependencies": {
"@alicloud/pop-core": "^1.7.10",
"@certd/acme-client": "^1.27.3",
"@certd/basic": "^1.27.3",
"@certd/commercial-core": "^1.27.3",
"@certd/lib-huawei": "^1.27.3",
"@certd/lib-k8s": "^1.27.3",
"@certd/lib-server": "^1.27.3",
"@certd/midway-flyway-js": "^1.27.3",
"@certd/pipeline": "^1.27.3",
"@certd/plugin-cert": "^1.27.3",
"@certd/plugin-plus": "^1.27.3",
"@certd/plus-core": "^1.27.3",
"@certd/acme-client": "^1.27.4",
"@certd/basic": "^1.27.4",
"@certd/commercial-core": "^1.27.4",
"@certd/lib-huawei": "^1.27.4",
"@certd/lib-k8s": "^1.27.4",
"@certd/lib-server": "^1.27.4",
"@certd/midway-flyway-js": "^1.27.4",
"@certd/pipeline": "^1.27.4",
"@certd/plugin-cert": "^1.27.4",
"@certd/plugin-plus": "^1.27.4",
"@certd/plus-core": "^1.27.4",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
"@koa/cors": "^5.0.0",
@@ -1,7 +1,7 @@
import { Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { BaseService, ListReq, ValidateException } from '@certd/lib-server';
import { BaseService, ListReq, SysPrivateSettings, SysSettingsService, ValidateException } from '@certd/lib-server';
import { CnameProviderEntity } from '../entity/cname-provider.js';
import { CommonProviders } from './common-provider.js';
@@ -14,6 +14,9 @@ export class CnameProviderService extends BaseService<CnameProviderEntity> {
@InjectEntityModel(CnameProviderEntity)
repository: Repository<CnameProviderEntity>;
@Inject()
settingsService: SysSettingsService;
//@ts-ignore
getRepository() {
return this.repository;
@@ -85,7 +88,10 @@ export class CnameProviderService extends BaseService<CnameProviderEntity> {
if (founds && founds.length > 0) {
return founds[0];
}
if (CommonProviders.length > 0) {
const sysPrivateSettings = await this.settingsService.getSetting<SysPrivateSettings>(SysPrivateSettings);
if (sysPrivateSettings.commonCnameEnabled !== false && CommonProviders.length > 0) {
return CommonProviders[0] as CnameProviderEntity;
}
return null;
@@ -93,8 +99,12 @@ export class CnameProviderService extends BaseService<CnameProviderEntity> {
async list(req: ListReq): Promise<any[]> {
const list = await super.list(req);
const sysPrivateSettings = await this.settingsService.getSetting<SysPrivateSettings>(SysPrivateSettings);
return [...list, ...CommonProviders];
if (sysPrivateSettings.commonCnameEnabled !== false) {
return [...list, ...CommonProviders];
}
return list;
}
async info(id: any, infoIgnoreProperty?: any): Promise<any | null> {
@@ -135,5 +135,6 @@ export class RoleService extends BaseService<RoleEntity> {
if (urs.length > 0) {
throw new Error('该角色已被用户使用,无法删除');
}
await this.deleteWhere({ id: In(idArr) });
}
}
@@ -1,22 +1,26 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { CertInfo, CertReader } from '@certd/plugin-cert';
import { isDev } from '../../../utils/env.js';
import { isDev } from '@certd/basic';
@IsTaskPlugin({
name: 'demoTest',
title: 'Demo测试插件',
icon: 'clarity:plugin-line',
//插件分组
group: pluginGroups.other.key,
default: {
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed,
},
},
// 你开发的插件要删除此项,否则不会在生产环墋中显示
deprecated: isDev() ? '测试插件,生产环境不显示' : undefined,
})
export class DemoTestPlugin extends AbstractTaskPlugin {
//测试参数
@TaskInput({
title: '属性示例',
value: '默认值',
component: {
//前端组件配置,具体配置见组件文档 https://www.antdv.com/components/input-cn
name: 'a-input',
@@ -57,7 +61,7 @@ export class DemoTestPlugin extends AbstractTaskPlugin {
name: 'output-selector',
from: ['CertApply', 'CertApplyLego'],
},
// required: true,
// required: true, // 必填
})
cert!: CertInfo;
@@ -70,6 +74,7 @@ export class DemoTestPlugin extends AbstractTaskPlugin {
type: 'demo', //固定授权类型
},
// rules: [{ required: true, message: '此项必填' }],
// required: true, //必填
})
accessId!: string;
@@ -98,8 +103,5 @@ export class DemoTestPlugin extends AbstractTaskPlugin {
this.logger.info('授权id:', accessId);
}
}
//TODO 这里实例化插件,进行注册
if (isDev()) {
//你的实现 要去掉这个if,不然生产环境将不会显示
new DemoTestPlugin();
}
//实例化一下,注册插件
new DemoTestPlugin();