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() {
|
||||
const systemVersion = await this.getSystemVersion();
|
||||
|
||||
if (systemVersion.v2 && systemVersion.v2.toLowerCase().includes("scale")) {
|
||||
const versionRaw = systemVersion.v2?.toLowerCase() || "";
|
||||
|
||||
if (versionRaw.includes("scale")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
const match = versionRaw.match(/^truenas-(\d+)\.(\d+)/);
|
||||
if (match) {
|
||||
const major = parseInt(match[1], 10);
|
||||
if (major >= 22) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2166,15 +2166,20 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver {
|
|||
|
||||
async getIsScale() {
|
||||
const systemVersion = await this.getSystemVersion();
|
||||
|
||||
if (
|
||||
systemVersion.v2 &&
|
||||
(systemVersion.v2.toLowerCase().includes("scale") ||
|
||||
systemVersion.v2.toLowerCase().includes("community"))
|
||||
) {
|
||||
const versionRaw = systemVersion.v2?.toLowerCase() || "";
|
||||
|
||||
if (versionRaw.includes("scale")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
const match = versionRaw.match(/^truenas-(\d+)\.(\d+)/);
|
||||
if (match) {
|
||||
const major = parseInt(match[1], 10);
|
||||
if (major >= 22) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue