fix(Easy Setup): add selected model size to storage projection

This commit is contained in:
Jake Turner 2026-01-20 06:28:05 +00:00 committed by Jake Turner
parent 937da5d869
commit 04e169fe7b
2 changed files with 33 additions and 1 deletions

View File

@ -266,14 +266,39 @@ export default function EasySetupWizard(props: { system: { services: ServiceSlim
}) })
} }
// Add AI models
if (recommendedModels) {
selectedAiModels.forEach((modelName) => {
const model = recommendedModels.find((m) => m.name === modelName)
if (model?.tags?.[0]?.size) {
// Parse size string like "4.7GB" or "1.5GB"
const sizeStr = model.tags[0].size
const match = sizeStr.match(/^([\d.]+)\s*(GB|MB|KB)?$/i)
if (match) {
const value = parseFloat(match[1])
const unit = (match[2] || 'GB').toUpperCase()
if (unit === 'GB') {
totalBytes += value * 1024 * 1024 * 1024
} else if (unit === 'MB') {
totalBytes += value * 1024 * 1024
} else if (unit === 'KB') {
totalBytes += value * 1024
}
}
}
})
}
return totalBytes return totalBytes
}, [ }, [
selectedTiers, selectedTiers,
selectedMapCollections, selectedMapCollections,
selectedZimCollections, selectedZimCollections,
selectedAiModels,
categories, categories,
mapCollections, mapCollections,
zimCollections, zimCollections,
recommendedModels,
]) ])
// Get primary disk/filesystem info for storage projection // Get primary disk/filesystem info for storage projection

View File

@ -43,7 +43,6 @@
"maplibre-gl": "^4.7.1", "maplibre-gl": "^4.7.1",
"mysql2": "^3.14.1", "mysql2": "^3.14.1",
"pino-pretty": "^13.0.0", "pino-pretty": "^13.0.0",
"playwright": "^1.57.0",
"pmtiles": "^4.3.0", "pmtiles": "^4.3.0",
"postcss": "^8.5.6", "postcss": "^8.5.6",
"react": "^19.1.0", "react": "^19.1.0",
@ -9683,7 +9682,10 @@
"version": "1.57.0", "version": "1.57.0",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.57.0.tgz", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.57.0.tgz",
"integrity": "sha512-ilYQj1s8sr2ppEJ2YVadYBN0Mb3mdo9J0wQ+UuDhzYqURwSoW4n1Xs5vs7ORwgDGmyEh33tRMeS8KhdkMoLXQw==", "integrity": "sha512-ilYQj1s8sr2ppEJ2YVadYBN0Mb3mdo9J0wQ+UuDhzYqURwSoW4n1Xs5vs7ORwgDGmyEh33tRMeS8KhdkMoLXQw==",
"dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": { "dependencies": {
"playwright-core": "1.57.0" "playwright-core": "1.57.0"
}, },
@ -9701,7 +9703,10 @@
"version": "1.57.0", "version": "1.57.0",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.57.0.tgz", "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.57.0.tgz",
"integrity": "sha512-agTcKlMw/mjBWOnD6kFZttAAGHgi/Nw0CZ2o6JqWSbMlI219lAFLZZCyqByTsvVAJq5XA5H8cA6PrvBRpBWEuQ==", "integrity": "sha512-agTcKlMw/mjBWOnD6kFZttAAGHgi/Nw0CZ2o6JqWSbMlI219lAFLZZCyqByTsvVAJq5XA5H8cA6PrvBRpBWEuQ==",
"dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true,
"peer": true,
"bin": { "bin": {
"playwright-core": "cli.js" "playwright-core": "cli.js"
}, },
@ -9713,12 +9718,14 @@
"version": "2.3.2", "version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
"darwin" "darwin"
], ],
"peer": true,
"engines": { "engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0" "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
} }