mirror of
https://github.com/certd/certd.git
synced 2026-07-09 06:07:37 +08:00
perf(aliyun-apig): 优化阿里云API网关部署插件的查询及翻页
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
|
import { AbstractTaskPlugin, IsTaskPlugin, Pager, PageSearch, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
|
||||||
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
|
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
|
||||||
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
|
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
|
||||||
import { AliyunSslClient, CasCertId } from "../../../plugin-lib/aliyun/lib/ssl-client.js";
|
import { AliyunSslClient, CasCertId } from "../../../plugin-lib/aliyun/lib/ssl-client.js";
|
||||||
@@ -78,6 +78,8 @@ export class DeployCertToAliyunApig extends AbstractTaskPlugin {
|
|||||||
action: DeployCertToAliyunApig.prototype.onGetDomainList.name,
|
action: DeployCertToAliyunApig.prototype.onGetDomainList.name,
|
||||||
watches: ["region", "accessId", "gatewayType"],
|
watches: ["region", "accessId", "gatewayType"],
|
||||||
required: true,
|
required: true,
|
||||||
|
pager:true,
|
||||||
|
search:true,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
domainList!: string[];
|
domainList!: string[];
|
||||||
@@ -183,7 +185,7 @@ export class DeployCertToAliyunApig extends AbstractTaskPlugin {
|
|||||||
this.logger.info(`设置${domainId}证书成功:`, ret.requestId);
|
this.logger.info(`设置${domainId}证书成功:`, ret.requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
async onGetDomainList(data: any) {
|
async onGetDomainList(data: PageSearch) {
|
||||||
if (!this.accessId) {
|
if (!this.accessId) {
|
||||||
throw new Error("请选择Access授权");
|
throw new Error("请选择Access授权");
|
||||||
}
|
}
|
||||||
@@ -193,6 +195,8 @@ export class DeployCertToAliyunApig extends AbstractTaskPlugin {
|
|||||||
if (!this.gatewayType) {
|
if (!this.gatewayType) {
|
||||||
throw new Error("请选择网关类型");
|
throw new Error("请选择网关类型");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const pager = new Pager(data);
|
||||||
const access = await this.getAccess<AliyunAccess>(this.accessId);
|
const access = await this.getAccess<AliyunAccess>(this.accessId);
|
||||||
|
|
||||||
const client = access.getClient(this.regionEndpoint);
|
const client = access.getClient(this.regionEndpoint);
|
||||||
@@ -205,7 +209,9 @@ export class DeployCertToAliyunApig extends AbstractTaskPlugin {
|
|||||||
pathname: `/v1/domains`,
|
pathname: `/v1/domains`,
|
||||||
data: {
|
data: {
|
||||||
query: {
|
query: {
|
||||||
pageSize: 100,
|
nameLike: data.searchKey,
|
||||||
|
pageSize: pager.pageSize,
|
||||||
|
pageNumber: pager.pageNo,
|
||||||
gatewayType: this.gatewayType,
|
gatewayType: this.gatewayType,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-3
@@ -69,9 +69,7 @@ export class DeployCertToAliyunApiGateway extends AbstractTaskPlugin {
|
|||||||
action: DeployCertToAliyunApiGateway.prototype.onGetGroupList.name,
|
action: DeployCertToAliyunApiGateway.prototype.onGetGroupList.name,
|
||||||
watches: ["regionEndpoint", "accessId"],
|
watches: ["regionEndpoint", "accessId"],
|
||||||
required: true,
|
required: true,
|
||||||
component: {
|
single:true
|
||||||
name: "remote-auto-complete",
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
groupId!: string;
|
groupId!: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user