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() {
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;
}

View File

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