mirror of
https://github.com/certd/certd.git
synced 2026-06-15 13:47:33 +08:00
perf: 优化阿里云API网关增加翻页查询
This commit is contained in:
@@ -181,7 +181,7 @@ https://certd.handfree.work/
|
||||
|
||||
|
||||
> [50元专业版优惠券限时领取](https://app.handfree.work/subject/#/app/certd/product) https://app.handfree.work/subject/#/app/certd/product
|
||||
> handfree.work是Certd官方激活码购买平台
|
||||
> app.handfree.work是Certd官方激活码购买平台
|
||||
|
||||
|
||||
专业版、商业版特权对比
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ Certd 是一款开源、免费、全自动申请和部署更新SSL证书的工
|
||||
关键字:证书自动申请、证书自动更新、证书自动续期、证书自动续签、证书管理工具
|
||||
|
||||
|
||||
| 官方开源地址: | |
|
||||
| |官方开源地址: |
|
||||
| ---- | ---- |
|
||||
| [Github](https://github.com/certd/certd)|  |
|
||||
| [Gitee](https://gitee.com/certd/certd) |  |
|
||||
|
||||
@@ -227,7 +227,11 @@ export class DeployCertToAliyunApig extends AbstractTaskPlugin {
|
||||
domain: item.name,
|
||||
};
|
||||
});
|
||||
return optionsUtils.buildGroupOptions(options, this.certDomains);
|
||||
const records = optionsUtils.buildGroupOptions(options, this.certDomains);
|
||||
return {
|
||||
list: records,
|
||||
total: res?.data?.totalSize || 0,
|
||||
}
|
||||
}
|
||||
|
||||
async onGetRegionList(data: any) {
|
||||
|
||||
+19
-4
@@ -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 { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
|
||||
import { optionsUtils } from "@certd/basic";
|
||||
@@ -70,6 +70,8 @@ export class DeployCertToAliyunApiGateway extends AbstractTaskPlugin {
|
||||
watches: ["regionEndpoint", "accessId"],
|
||||
required: true,
|
||||
single: true,
|
||||
pager: true,
|
||||
search: true,
|
||||
})
|
||||
)
|
||||
groupId!: string;
|
||||
@@ -122,7 +124,7 @@ export class DeployCertToAliyunApiGateway extends AbstractTaskPlugin {
|
||||
this.logger.info(`设置${domainName}证书成功:`, ret.RequestId);
|
||||
}
|
||||
|
||||
async onGetGroupList(data: any) {
|
||||
async onGetGroupList(data: PageSearch) {
|
||||
if (!this.accessId) {
|
||||
throw new Error("请选择Access授权");
|
||||
}
|
||||
@@ -131,23 +133,36 @@ export class DeployCertToAliyunApiGateway extends AbstractTaskPlugin {
|
||||
}
|
||||
const access = await this.getAccess<AliyunAccess>(this.accessId);
|
||||
const client = access.getClient(this.regionEndpoint);
|
||||
|
||||
const pager = new Pager(data)
|
||||
const res = await client.doRequest({
|
||||
// 接口名称
|
||||
action: "DescribeApiGroups",
|
||||
// 接口版本
|
||||
version: "2016-07-14",
|
||||
data: {},
|
||||
data: {
|
||||
query: {
|
||||
GroupName: data.searchKey,
|
||||
PageNumber: pager.pageNo,
|
||||
PageSize: pager.pageSize,
|
||||
},
|
||||
},
|
||||
});
|
||||
const list = res?.ApiGroupAttributes?.ApiGroupAttribute;
|
||||
if (!list || list.length === 0) {
|
||||
throw new Error("没有数据,您可以手动输入API网关ID");
|
||||
}
|
||||
return list.map((item: any) => {
|
||||
const records = list.map((item: any) => {
|
||||
return {
|
||||
value: item.GroupId,
|
||||
label: `${item.GroupName}<${item.GroupId}>`,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
list: records,
|
||||
total: res?.TotalCount || 0,
|
||||
}
|
||||
}
|
||||
|
||||
async onGetDomainList(data: any) {
|
||||
|
||||
Reference in New Issue
Block a user