fix: support TrueNAS newer version edition in platform check
This commit is contained in:
parent
86b8427a35
commit
f51d822660
|
|
@ -162,11 +162,20 @@ class Api {
|
||||||
|
|
||||||
async getIsScale() {
|
async getIsScale() {
|
||||||
const systemVersion = await this.getSystemVersion();
|
const systemVersion = await this.getSystemVersion();
|
||||||
|
const versionRaw = systemVersion.v2?.toLowerCase() || "";
|
||||||
|
|
||||||
if (systemVersion.v2 && systemVersion.v2.toLowerCase().includes("scale")) {
|
if (versionRaw.includes("scale")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const match = versionRaw.match(/^truenas-(\d+)\.(\d+)/);
|
||||||
|
if (match) {
|
||||||
|
const major = parseInt(match[1], 10);
|
||||||
|
if (major >= 22) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2166,15 +2166,20 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver {
|
||||||
|
|
||||||
async getIsScale() {
|
async getIsScale() {
|
||||||
const systemVersion = await this.getSystemVersion();
|
const systemVersion = await this.getSystemVersion();
|
||||||
|
const versionRaw = systemVersion.v2?.toLowerCase() || "";
|
||||||
|
|
||||||
if (
|
if (versionRaw.includes("scale")) {
|
||||||
systemVersion.v2 &&
|
|
||||||
(systemVersion.v2.toLowerCase().includes("scale") ||
|
|
||||||
systemVersion.v2.toLowerCase().includes("community"))
|
|
||||||
) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const match = versionRaw.match(/^truenas-(\d+)\.(\d+)/);
|
||||||
|
if (match) {
|
||||||
|
const major = parseInt(match[1], 10);
|
||||||
|
if (major >= 22) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue