changed naming from fore ip to ip family

This commit is contained in:
Fabian Triebsch 2025-06-11 10:14:19 +02:00 committed by Fabian Triebsch
parent e4c05cb37c
commit 3416b35835
5 changed files with 15 additions and 13 deletions

View file

@ -1,13 +1,13 @@
exports.up = function (knex) { exports.up = function (knex) {
return knex.schema return knex.schema
.alterTable("monitor", function (table) { .alterTable("monitor", function (table) {
table.boolean("force_ip").defaultTo(null); table.boolean("ip_family").defaultTo(null);
}); });
}; };
exports.down = function (knex) { exports.down = function (knex) {
return knex.schema return knex.schema
.alterTable("monitor", function (table) { .alterTable("monitor", function (table) {
table.dropColumn("force_ip"); table.dropColumn("ip_family");
}); });
}; };

View file

@ -160,7 +160,7 @@ class Monitor extends BeanModel {
smtpSecurity: this.smtpSecurity, smtpSecurity: this.smtpSecurity,
rabbitmqNodes: JSON.parse(this.rabbitmqNodes), rabbitmqNodes: JSON.parse(this.rabbitmqNodes),
conditions: JSON.parse(this.conditions), conditions: JSON.parse(this.conditions),
forceIp: this.forceIp, ipFamily: this.ipFamily,
// ping advanced options // ping advanced options
ping_numeric: this.isPingNumeric(), ping_numeric: this.isPingNumeric(),
@ -428,10 +428,10 @@ class Monitor extends BeanModel {
} }
let agentFamily = undefined; let agentFamily = undefined;
if (this.forceIp === "ipv4") { if (this.ipFamily === "ipv4") {
agentFamily = 4; agentFamily = 4;
} }
if (this.forceIp === "ipv6") { if (this.ipFamily === "ipv6") {
agentFamily = 6; agentFamily = 6;
} }
@ -439,11 +439,13 @@ class Monitor extends BeanModel {
maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940) maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940)
rejectUnauthorized: !this.getIgnoreTls(), rejectUnauthorized: !this.getIgnoreTls(),
secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT, secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT,
autoSelectFamily: true,
...(agentFamily ? { family: agentFamily } : {}) ...(agentFamily ? { family: agentFamily } : {})
}; };
const httpAgentOptions = { const httpAgentOptions = {
maxCachedSessions: 0, maxCachedSessions: 0,
autoSelectFamily: true,
...(agentFamily ? { family: agentFamily } : {}) ...(agentFamily ? { family: agentFamily } : {})
}; };

View file

@ -792,7 +792,7 @@ let needSetup = false;
bean.url = monitor.url; bean.url = monitor.url;
bean.method = monitor.method; bean.method = monitor.method;
bean.body = monitor.body; bean.body = monitor.body;
bean.forceIp = monitor.forceIp; bean.ipFamily = monitor.ipFamily;
bean.headers = monitor.headers; bean.headers = monitor.headers;
bean.basic_auth_user = monitor.basic_auth_user; bean.basic_auth_user = monitor.basic_auth_user;
bean.basic_auth_pass = monitor.basic_auth_pass; bean.basic_auth_pass = monitor.basic_auth_pass;

View file

@ -1112,6 +1112,6 @@
"Sender name": "Sender name", "Sender name": "Sender name",
"smsplanetNeedToApproveName": "Needs to be approved in the client panel", "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", "Ip Family": "IP Family",
"forceIpDescription": "If not None, the monitor will enforce using either IPv4 or IPv6 for connecting to the target." "ipFamilyDescription": "Choose the IP version to use (IPv4 or IPv6). If \"auto-select\" is chosen, it will use \"Happy Eyeballs\" for determining the IP version."
} }

View file

@ -747,11 +747,11 @@
</div> </div>
<div class="my-3"> <div class="my-3">
<label for="forceIp" class="form-label">{{ $t("Force Ip") }}</label> <label for="ipFamily" class="form-label">{{ $t("Ip Family") }}</label>
<select id="forceIp" v-model="monitor.forceIp" class="form-select"> <select id="ipFamily" v-model="monitor.ipFamily" class="form-select">
<option :value="null"> <option :value="null">
{{ $t("None") }} {{ $t("auto-select") }}
</option> </option>
<option value="ipv4"> <option value="ipv4">
IPv4 IPv4
@ -762,7 +762,7 @@
</select> </select>
<div class="form-text"> <div class="form-text">
{{ $t("forceIpDescription") }} {{ $t("ipFamilyDescription") }} (<a href="https://en.wikipedia.org/wiki/Happy_Eyeballs">{{ $t('Learn More') }}</a>)
</div> </div>
</div> </div>
</template> </template>
@ -1149,7 +1149,7 @@ const monitorDefaults = {
parent: null, parent: null,
url: "https://", url: "https://",
method: "GET", method: "GET",
forceIp: null, ipFamily: null,
interval: 60, interval: 60,
retryInterval: 60, retryInterval: 60,
resendInterval: 0, resendInterval: 0,