mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-18 23:34:04 +02:00
Add port field to SRV condition variable
This commit is contained in:
parent
979c89004d
commit
4f7c8ae3b4
1 changed files with 3 additions and 4 deletions
|
@ -37,7 +37,7 @@ class DnsMonitorType extends MonitorType {
|
|||
new ConditionVariable("retry", defaultNumberOperators),
|
||||
new ConditionVariable("minimum", defaultNumberOperators),
|
||||
// SRV
|
||||
new ConditionVariable("targets", defaultArrayOperators),
|
||||
new ConditionVariable("servers", defaultArrayOperators),
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -140,15 +140,14 @@ class DnsMonitorType extends MonitorType {
|
|||
case "SRV":
|
||||
dnsMessage = records.map((record) => {
|
||||
return Object.entries({
|
||||
"Target": record.target,
|
||||
"Port": record.port,
|
||||
"Server": `${record.target}:${record.port}`,
|
||||
"Priority": record.priority,
|
||||
"Weight": record.weight,
|
||||
}).map(([ name, value ]) => {
|
||||
return `${name}: ${value}`;
|
||||
}).join("; ");
|
||||
}).join(" | ");
|
||||
conditionsResult = handleConditions({ targets: records.map(record => record.target) });
|
||||
conditionsResult = handleConditions({ servers: records.map(record => `${record.target}:${record.port}`) });
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue