fix: support TrueNAS newer version edition in platform check

This commit is contained in:
Yornik Heyl 2025-04-14 21:52:37 +02:00
parent 86b8427a35
commit f51d822660
2 changed files with 24 additions and 10 deletions

View File

@ -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;
} }

View File

@ -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;
} }