addressed review findings

This commit is contained in:
Fabian Triebsch 2025-06-10 16:50:36 +02:00 committed by Fabian Triebsch
parent 91f34dde79
commit e4c05cb37c
3 changed files with 30 additions and 17 deletions

View file

@ -427,7 +427,13 @@ class Monitor extends BeanModel {
}
}
const agentFamily = this.forceIp ? (this.forceIp === "ipv4" ? 4 : 6) : undefined;
let agentFamily = undefined;
if (this.forceIp === "ipv4") {
agentFamily = 4;
}
if (this.forceIp === "ipv6") {
agentFamily = 6;
}
const httpsAgentOptions = {
maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940)

View file

@ -1111,5 +1111,7 @@
"Phone numbers": "Phone numbers",
"Sender name": "Sender name",
"smsplanetNeedToApproveName": "Needs to be approved in the client panel",
"Disable URL in Notification": "Disable URL in Notification"
"Disable URL in Notification": "Disable URL in Notification",
"Force Ip": "Force IP",
"forceIpDescription": "If not None, the monitor will enforce using either IPv4 or IPv6 for connecting to the target."
}

View file

@ -745,6 +745,26 @@
{{ $t("acceptedStatusCodesDescription") }}
</div>
</div>
<div class="my-3">
<label for="forceIp" class="form-label">{{ $t("Force Ip") }}</label>
<select id="forceIp" v-model="monitor.forceIp" class="form-select">
<option :value="null">
{{ $t("None") }}
</option>
<option value="ipv4">
IPv4
</option>
<option value="ipv6">
IPv6
</option>
</select>
<div class="form-text">
{{ $t("forceIpDescription") }}
</div>
</div>
</template>
<!-- Parent Monitor -->
@ -906,21 +926,6 @@
</select>
</div>
<div class="my-3">
<label for="forceIp" class="form-label">{{ $t("Force Ip") }}</label>
<select id="forceIp" v-model="monitor.forceIp" class="form-select">
<option :value="null">
{{ $t("None") }}
</option>
<option value="ipv4">
ipv4
</option>
<option value="ipv6">
ipv6
</option>
</select>
</div>
<!-- Encoding -->
<div class="my-3">
<label for="httpBodyEncoding" class="form-label">{{ $t("Body Encoding") }}</label>