mirror of
https://github.com/certd/certd.git
synced 2026-04-29 08:47:24 +08:00
perf: 站点监控支持指定ip地址检查
This commit is contained in:
@@ -48,7 +48,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async add(data: SiteInfoEntity) {
|
async add(data: SiteInfoEntity) {
|
||||||
if (!data.userId) {
|
if (data.userId == null) {
|
||||||
throw new Error("userId is required");
|
throw new Error("userId is required");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getUserMonitorCount(userId: number) {
|
async getUserMonitorCount(userId: number) {
|
||||||
if (!userId) {
|
if (userId==null) {
|
||||||
throw new Error("userId is required");
|
throw new Error("userId is required");
|
||||||
}
|
}
|
||||||
return await this.repository.count({
|
return await this.repository.count({
|
||||||
@@ -127,7 +127,8 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
|||||||
host: site.domain,
|
host: site.domain,
|
||||||
port: site.httpsPort,
|
port: site.httpsPort,
|
||||||
retryTimes,
|
retryTimes,
|
||||||
customDns
|
customDns,
|
||||||
|
ipAddress: site.ipAddress,
|
||||||
});
|
});
|
||||||
|
|
||||||
const certi: PeerCertificate = res.certificate;
|
const certi: PeerCertificate = res.certificate;
|
||||||
@@ -345,7 +346,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkAllByUsers(userId: any,projectId?: number) {
|
async checkAllByUsers(userId: any,projectId?: number) {
|
||||||
if (!userId) {
|
if (userId==null) {
|
||||||
throw new Error("userId is required");
|
throw new Error("userId is required");
|
||||||
}
|
}
|
||||||
const sites = await this.repository.find({
|
const sites = await this.repository.find({
|
||||||
|
|||||||
Reference in New Issue
Block a user