mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
perf: history增加触发类型显示
This commit is contained in:
@@ -16,6 +16,9 @@ export class HistoryEntity {
|
||||
@Column({ comment: '结果状态', length: 20, nullable: true })
|
||||
status: string;
|
||||
|
||||
@Column({ name: 'trigger_type',comment: '触发类型', length: 20, nullable: true })
|
||||
triggerType: string;
|
||||
|
||||
@Column({
|
||||
name: 'end_time',
|
||||
comment: '结束时间',
|
||||
|
||||
@@ -60,12 +60,13 @@ export class HistoryService extends BaseService<HistoryEntity> {
|
||||
return new HistoryDetail(entity, log);
|
||||
}
|
||||
|
||||
async start(pipeline: PipelineEntity) {
|
||||
async start(pipeline: PipelineEntity,triggerType:string) {
|
||||
const bean = {
|
||||
userId: pipeline.userId,
|
||||
pipelineId: pipeline.id,
|
||||
title: pipeline.title,
|
||||
status: 'start',
|
||||
triggerType
|
||||
};
|
||||
const { id } = await this.add(bean);
|
||||
//清除大于pipeline.keepHistoryCount的历史记录
|
||||
|
||||
@@ -497,7 +497,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
};
|
||||
|
||||
const userId = entity.userId;
|
||||
const historyId = await this.historyService.start(entity);
|
||||
const historyId = await this.historyService.start(entity,triggerType);
|
||||
const userIsAdmin = await this.userService.isAdmin(userId);
|
||||
const user: UserInfo = {
|
||||
id: userId,
|
||||
|
||||
Reference in New Issue
Block a user