perf: 站点监控支持指定ip地址检查

This commit is contained in:
xiaojunnuo
2026-02-13 23:51:19 +08:00
parent a4ea82c04b
commit 83d81b64b3
@@ -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({