pmcf 1.61.6 → 1.61.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cluster.mjs +1 -1
- package/src/host.mjs +8 -0
- package/src/location.mjs +1 -0
- package/types/host.d.mts +2 -0
package/package.json
CHANGED
package/src/cluster.mjs
CHANGED
|
@@ -78,7 +78,7 @@ export class Cluster extends Host {
|
|
|
78
78
|
cfg.push(` state ${cluster.masters.has(ni) ? "MASTER" : "BACKUP"}`);
|
|
79
79
|
cfg.push(` interface ${ni.name}`,);
|
|
80
80
|
cfg.push(" virtual_ipaddress {");
|
|
81
|
-
cfg.push(` ${cluster.
|
|
81
|
+
cfg.push(` ${cluster.cidrAddress} dev ${ni.name}`);
|
|
82
82
|
cfg.push(" }");
|
|
83
83
|
cfg.push(` virtual_router_id ${cluster.routerId}`);
|
|
84
84
|
cfg.push(` priority ${host.priority}`);
|
package/src/host.mjs
CHANGED
|
@@ -331,6 +331,10 @@ export class Host extends Base {
|
|
|
331
331
|
return [...this.networkAddresses()].map(na => na.address);
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
+
get cidrAddress() {
|
|
335
|
+
return this.cidrAddresses[0];
|
|
336
|
+
}
|
|
337
|
+
|
|
334
338
|
get cidrAddresses() {
|
|
335
339
|
return [...this.networkAddresses()].map(({ address, subnet }) =>
|
|
336
340
|
formatCIDR(address, subnet)
|
|
@@ -445,6 +449,10 @@ export class NetworkInterface extends Base {
|
|
|
445
449
|
return [...this.#ipAddresses].map(([address]) => address);
|
|
446
450
|
}
|
|
447
451
|
|
|
452
|
+
get cidrAddress() {
|
|
453
|
+
return this.cidrAddresses[0];
|
|
454
|
+
}
|
|
455
|
+
|
|
448
456
|
get cidrAddresses() {
|
|
449
457
|
return [...this.#ipAddresses].map(([address, subnet]) =>
|
|
450
458
|
formatCIDR(address, subnet)
|
package/src/location.mjs
CHANGED
package/types/host.d.mts
CHANGED
|
@@ -186,6 +186,7 @@ export class Host extends Base {
|
|
|
186
186
|
}, void, unknown>;
|
|
187
187
|
get rawAddress(): any;
|
|
188
188
|
get rawAddresses(): any[];
|
|
189
|
+
get cidrAddress(): any;
|
|
189
190
|
get cidrAddresses(): any[];
|
|
190
191
|
publicKey(type?: string): Promise<string>;
|
|
191
192
|
#private;
|
|
@@ -312,6 +313,7 @@ export class NetworkInterface extends Base {
|
|
|
312
313
|
get ipAddresses(): Map<any, any>;
|
|
313
314
|
get rawAddress(): any;
|
|
314
315
|
get rawAddresses(): any[];
|
|
316
|
+
get cidrAddress(): any;
|
|
315
317
|
get cidrAddresses(): any[];
|
|
316
318
|
get rawIPv4Addresses(): any[];
|
|
317
319
|
get rawIPv6Addresses(): any[];
|