fix: conditional checks, evershelf.db fix, warning popup 5s, error modal (v1.7.22)
- health_check: use evershelf.db (not dispensa.db); auto-migrate if needed - removed dispensa.db (legacy, obsolete) - backups check: verify files exist (not dir writability, cron writes as root) - bring_token: read data/bring_token.json (not env var) - warning popup: 5s countdown bar with label+hint per warning, auto-closes - error popup: blocking panel with title + hint per critical failure - db_legacy check: warns if old dispensa.db still present - 32 total checks (added db_legacy, tts_url, scale_gateway) - hint messages on every check explaining cause and fix - translations: added check_db_legacy, check_tts, check_scale, critical_error_intro, error_network_detail in it/en/de
This commit is contained in:
@@ -11,6 +11,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
- **Recipe scraps tips** — During cooking steps, detect "waste" generated (peels, cores, bones, eggshells, coffee grounds, citrus zest, etc.) and surface AI-powered tips on how to reuse them (compost, natural cleaner, broth, candied peel, etc.). Could be shown as an optional collapsible hint card below the step that generates the scrap.
|
- **Recipe scraps tips** — During cooking steps, detect "waste" generated (peels, cores, bones, eggshells, coffee grounds, citrus zest, etc.) and surface AI-powered tips on how to reuse them (compost, natural cleaner, broth, candied peel, etc.). Could be shown as an optional collapsible hint card below the step that generates the scrap.
|
||||||
|
|
||||||
|
## [1.7.22] - 2026-05-17
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- **DB name corrected** — `health_check` now looks for `evershelf.db` (was wrongly looking for `dispensa.db`). Auto-migration included: if `evershelf.db` is missing but `dispensa.db` exists, it is renamed automatically on startup.
|
||||||
|
- **Removed legacy `data/dispensa.db`** — the old database file has been deleted; only `evershelf.db` is used.
|
||||||
|
- **Conditional checks** — Bring!, TTS, Scale and Internet checks only run when the respective feature is enabled in `.env` (no more false ❌/⚠️ for unconfigured features).
|
||||||
|
- **Backups check** — no longer checks if `data/backups/` is writable by www-data (cron writes as root). Now checks that backup files actually exist and the most recent one is recent.
|
||||||
|
- **Bring! token check** — reads `data/bring_token.json` file instead of looking for a non-existent `BRING_ACCESS_TOKEN` env var.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- **Warning popup with 5s countdown** — when non-critical checks fail at startup, a styled popup appears showing each warning with its label and a plain-language hint explaining the problem. A countdown bar auto-closes the popup after 5 seconds, then the app starts normally.
|
||||||
|
- **Error blocking popup** — when critical checks fail, a clear blocking panel shows with title "Errore critico", each failed check listed with its explanation hint, and a Retry button. The app does not start.
|
||||||
|
- **`db_legacy` check added** — warns (optional) if the old `dispensa.db` file is still present alongside `evershelf.db`.
|
||||||
|
- **32 total checks** — added `db_legacy`, `tts_url`, `scale_gateway` to the check set (conditional).
|
||||||
|
- **Hint messages** — every check now has an Italian-language `hint` field explaining what is wrong and how to fix it.
|
||||||
|
|
||||||
## [1.7.21] - 2026-05-20
|
## [1.7.21] - 2026-05-20
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
+143
-94
@@ -110,6 +110,10 @@ if (($_GET['action'] ?? '') === 'ping') {
|
|||||||
if (($_GET['action'] ?? '') === 'health_check') {
|
if (($_GET['action'] ?? '') === 'health_check') {
|
||||||
$checks = [];
|
$checks = [];
|
||||||
|
|
||||||
|
// ── Helper: read .env values without triggering app init ─────────────────
|
||||||
|
$envVals = loadEnv(); // already cached by loadEnv()
|
||||||
|
$envGet = fn($k) => $envVals[$k] ?? '';
|
||||||
|
|
||||||
// ── 1. PHP version ────────────────────────────────────────────────────────
|
// ── 1. PHP version ────────────────────────────────────────────────────────
|
||||||
$checks['php_version'] = [
|
$checks['php_version'] = [
|
||||||
'ok' => version_compare(PHP_VERSION, '8.0.0', '>='),
|
'ok' => version_compare(PHP_VERSION, '8.0.0', '>='),
|
||||||
@@ -127,28 +131,16 @@ if (($_GET['action'] ?? '') === 'health_check') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ── 4. PHP runtime configuration ─────────────────────────────────────────
|
// ── 4. PHP runtime configuration ─────────────────────────────────────────
|
||||||
// Memory limit
|
|
||||||
$memRaw = ini_get('memory_limit');
|
$memRaw = ini_get('memory_limit');
|
||||||
$memBytes = (function ($v) {
|
$memBytes = (function ($v) {
|
||||||
$v = trim($v);
|
$v = trim($v); if ($v === '-1') return PHP_INT_MAX;
|
||||||
if ($v === '-1') return PHP_INT_MAX;
|
$u = strtolower(substr($v, -1)); $n = (int)$v;
|
||||||
$unit = strtolower(substr($v, -1));
|
return match($u) { 'g' => $n*1073741824, 'm' => $n*1048576, 'k' => $n*1024, default => $n };
|
||||||
$num = (int) $v;
|
|
||||||
return match ($unit) { 'g' => $num * 1073741824, 'm' => $num * 1048576, 'k' => $num * 1024, default => $num };
|
|
||||||
})($memRaw);
|
})($memRaw);
|
||||||
$checks['php_memory'] = ['ok' => $memBytes >= 64 * 1048576, 'value' => $memRaw, 'optional' => true];
|
$checks['php_memory'] = ['ok' => $memBytes >= 64*1048576, 'value' => $memRaw, 'optional' => true];
|
||||||
|
|
||||||
// Max execution time
|
|
||||||
$maxExec = (int) ini_get('max_execution_time');
|
$maxExec = (int) ini_get('max_execution_time');
|
||||||
$checks['php_max_exec'] = [
|
$checks['php_max_exec'] = ['ok' => $maxExec === 0 || $maxExec >= 30, 'value' => $maxExec === 0 ? '∞' : $maxExec.'s', 'optional' => true];
|
||||||
'ok' => $maxExec === 0 || $maxExec >= 30,
|
$checks['php_upload'] = ['ok' => true, 'value' => ini_get('upload_max_filesize'), 'optional' => true];
|
||||||
'value' => $maxExec === 0 ? '∞' : $maxExec . 's',
|
|
||||||
'optional' => true,
|
|
||||||
];
|
|
||||||
|
|
||||||
// Upload size
|
|
||||||
$uploadRaw = ini_get('upload_max_filesize');
|
|
||||||
$checks['php_upload'] = ['ok' => true, 'value' => $uploadRaw, 'optional' => true];
|
|
||||||
|
|
||||||
// ── 5. data/ directory ────────────────────────────────────────────────────
|
// ── 5. data/ directory ────────────────────────────────────────────────────
|
||||||
$dataDir = __DIR__ . '/../data';
|
$dataDir = __DIR__ . '/../data';
|
||||||
@@ -158,13 +150,24 @@ if (($_GET['action'] ?? '') === 'health_check') {
|
|||||||
|
|
||||||
// data/rate_limits/
|
// data/rate_limits/
|
||||||
$rlDir = $dataDir . '/rate_limits';
|
$rlDir = $dataDir . '/rate_limits';
|
||||||
if (!is_dir($rlDir)) @mkdir($rlDir, 0775, true);
|
if (!is_dir($rlDir) && $dataDirOk) @mkdir($rlDir, 0775, true);
|
||||||
$checks['data_rate_limits'] = ['ok' => is_dir($rlDir) && is_writable($rlDir), 'optional' => true];
|
$checks['data_rate_limits'] = ['ok' => is_dir($rlDir) && is_writable($rlDir), 'optional' => true];
|
||||||
|
|
||||||
// data/backups/
|
// data/backups/ — written by cron as root; just verify dir exists and has recent files
|
||||||
$bkDir = $dataDir . '/backups';
|
$bkDir = $dataDir . '/backups';
|
||||||
if (!is_dir($bkDir)) @mkdir($bkDir, 0775, true);
|
$bkDirExists = is_dir($bkDir);
|
||||||
$checks['data_backups'] = ['ok' => is_dir($bkDir) && is_writable($bkDir), 'optional' => true];
|
$bkFiles = $bkDirExists ? array_filter(scandir($bkDir), fn($f) => str_ends_with($f, '.db')) : [];
|
||||||
|
$lastBkTime = $bkDirExists && $bkFiles
|
||||||
|
? max(array_map(fn($f) => filemtime($bkDir.'/'.$f), $bkFiles))
|
||||||
|
: 0;
|
||||||
|
$bkRecent = $lastBkTime > 0 && (time() - $lastBkTime) < 86400*2; // within 2 days
|
||||||
|
$bkCount = count($bkFiles);
|
||||||
|
$checks['data_backups'] = [
|
||||||
|
'ok' => $bkDirExists && $bkCount > 0,
|
||||||
|
'optional' => true,
|
||||||
|
'value' => $bkDirExists ? ($bkCount . ' backup' . ($bkRecent ? ', ultimo recente' : ', ultimo vecchio')) : null,
|
||||||
|
'hint' => $bkDirExists ? ($bkCount === 0 ? 'Nessun backup trovato — cron configurato?' : (!$bkRecent ? 'Ultimo backup datato — cron in esecuzione?' : null)) : 'Cartella backup mancante',
|
||||||
|
];
|
||||||
|
|
||||||
// ── 6. Actual file-write test ─────────────────────────────────────────────
|
// ── 6. Actual file-write test ─────────────────────────────────────────────
|
||||||
$testFile = $dataDir . '/_hc_' . getmypid() . '.tmp';
|
$testFile = $dataDir . '/_hc_' . getmypid() . '.tmp';
|
||||||
@@ -174,19 +177,37 @@ if (($_GET['action'] ?? '') === 'health_check') {
|
|||||||
|
|
||||||
// ── 7. Free disk space ────────────────────────────────────────────────────
|
// ── 7. Free disk space ────────────────────────────────────────────────────
|
||||||
$freeBytes = $dataDirOk ? @disk_free_space($dataDir) : false;
|
$freeBytes = $dataDirOk ? @disk_free_space($dataDir) : false;
|
||||||
$freeMB = $freeBytes !== false ? round($freeBytes / 1048576) : null;
|
$freeMB = $freeBytes !== false ? round($freeBytes/1048576) : null;
|
||||||
$checks['disk_space'] = [
|
$checks['disk_space'] = [
|
||||||
'ok' => $freeBytes === false || $freeBytes > 50 * 1048576,
|
'ok' => $freeBytes === false || $freeBytes > 50*1048576,
|
||||||
'value' => $freeMB !== null ? $freeMB . ' MB liberi' : null,
|
'value' => $freeMB !== null ? $freeMB.' MB liberi' : null,
|
||||||
'optional' => true,
|
'optional' => true,
|
||||||
|
'hint' => $freeBytes !== false && $freeBytes <= 50*1048576 ? 'Meno di 50 MB liberi — libera spazio sul disco' : null,
|
||||||
];
|
];
|
||||||
|
|
||||||
// ── 8. SQLite database ────────────────────────────────────────────────────
|
// ── 8. SQLite database ────────────────────────────────────────────────────
|
||||||
$dbPath = $dataDir . '/dispensa.db';
|
// Correct DB name is evershelf.db; detect legacy dispensa.db and suggest migration
|
||||||
|
$dbPath = $dataDir . '/evershelf.db';
|
||||||
|
$legacyDb = $dataDir . '/dispensa.db';
|
||||||
|
$hasLegacy = file_exists($legacyDb);
|
||||||
$isFresh = !file_exists($dbPath) && $dataDirOk;
|
$isFresh = !file_exists($dbPath) && $dataDirOk;
|
||||||
|
|
||||||
|
// Auto-migrate: if evershelf.db missing but dispensa.db exists, rename it
|
||||||
|
if ($isFresh && $hasLegacy && is_writable($legacyDb)) {
|
||||||
|
if (@rename($legacyDb, $dbPath)) {
|
||||||
|
$hasLegacy = false;
|
||||||
|
$isFresh = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Legacy DB still present alongside evershelf.db → warn
|
||||||
|
$checks['db_legacy'] = [
|
||||||
|
'ok' => !$hasLegacy,
|
||||||
|
'optional' => true,
|
||||||
|
'hint' => $hasLegacy ? 'Trovato vecchio dispensa.db — il file è ormai obsoleto, puoi eliminarlo manualmente' : null,
|
||||||
|
];
|
||||||
|
|
||||||
if ($isFresh) {
|
if ($isFresh) {
|
||||||
// Fresh install: DB will be created automatically on first real API call
|
|
||||||
$checks['db_connect'] = ['ok' => true, 'fresh' => true, 'value' => 'nuovo impianto'];
|
$checks['db_connect'] = ['ok' => true, 'fresh' => true, 'value' => 'nuovo impianto'];
|
||||||
$checks['db_tables'] = ['ok' => true, 'fresh' => true];
|
$checks['db_tables'] = ['ok' => true, 'fresh' => true];
|
||||||
$checks['db_integrity'] = ['ok' => true, 'fresh' => true];
|
$checks['db_integrity'] = ['ok' => true, 'fresh' => true];
|
||||||
@@ -202,110 +223,138 @@ if (($_GET['action'] ?? '') === 'health_check') {
|
|||||||
]);
|
]);
|
||||||
$pdo->query('SELECT 1');
|
$pdo->query('SELECT 1');
|
||||||
$dbConnOk = true;
|
$dbConnOk = true;
|
||||||
$checks['db_connect'] = ['ok' => true];
|
$checks['db_connect'] = ['ok' => true, 'value' => basename($dbPath)];
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$checks['db_connect'] = ['ok' => false, 'error' => $e->getMessage()];
|
$checks['db_connect'] = ['ok' => false, 'error' => $e->getMessage(),
|
||||||
|
'hint' => 'Impossibile aprire il database — verifica permessi su data/evershelf.db'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($dbConnOk && $pdo) {
|
if ($dbConnOk && $pdo) {
|
||||||
// Required tables
|
// Required tables
|
||||||
try {
|
|
||||||
$tables = $pdo->query("SELECT name FROM sqlite_master WHERE type='table'")->fetchAll(PDO::FETCH_COLUMN);
|
$tables = $pdo->query("SELECT name FROM sqlite_master WHERE type='table'")->fetchAll(PDO::FETCH_COLUMN);
|
||||||
$required = ['inventory', 'products', 'transactions'];
|
$required = ['inventory', 'products', 'transactions'];
|
||||||
$missing = array_values(array_diff($required, $tables));
|
$missing = array_values(array_diff($required, $tables));
|
||||||
$checks['db_tables'] = ['ok' => empty($missing), 'missing' => $missing];
|
$checks['db_tables'] = [
|
||||||
} catch (\Throwable $e) {
|
'ok' => empty($missing),
|
||||||
$checks['db_tables'] = ['ok' => false, 'error' => $e->getMessage()];
|
'missing' => $missing,
|
||||||
}
|
'hint' => !empty($missing) ? 'Tabelle mancanti: ' . implode(', ', $missing) . ' — esegui una chiamata API per auto-inizializzare il DB' : null,
|
||||||
|
];
|
||||||
|
|
||||||
// Integrity (fast)
|
// Integrity
|
||||||
try {
|
|
||||||
$integ = $pdo->query("PRAGMA quick_check")->fetchColumn();
|
$integ = $pdo->query("PRAGMA quick_check")->fetchColumn();
|
||||||
$checks['db_integrity'] = ['ok' => $integ === 'ok', 'value' => $integ !== 'ok' ? $integ : null];
|
$checks['db_integrity'] = [
|
||||||
} catch (\Throwable $e) {
|
'ok' => $integ === 'ok',
|
||||||
$checks['db_integrity'] = ['ok' => false, 'error' => $e->getMessage()];
|
'value' => $integ !== 'ok' ? $integ : null,
|
||||||
}
|
'hint' => $integ !== 'ok' ? 'Database corrotto: ' . $integ . ' — ripristina da un backup in data/backups/' : null,
|
||||||
|
];
|
||||||
|
|
||||||
// WAL mode
|
// WAL
|
||||||
try {
|
|
||||||
$wal = $pdo->query("PRAGMA journal_mode")->fetchColumn();
|
$wal = $pdo->query("PRAGMA journal_mode")->fetchColumn();
|
||||||
$checks['db_wal'] = ['ok' => $wal === 'wal', 'value' => $wal, 'optional' => true];
|
$checks['db_wal'] = ['ok' => $wal === 'wal', 'value' => $wal, 'optional' => true,
|
||||||
} catch (\Throwable $e) {
|
'hint' => $wal !== 'wal' ? 'Modalità journal non ottimale — sarà corretta automaticamente al primo avvio' : null];
|
||||||
$checks['db_wal'] = ['ok' => false, 'optional' => true];
|
|
||||||
}
|
|
||||||
|
|
||||||
// DB file size
|
// Size & rows
|
||||||
$dbSizeKB = round(filesize($dbPath) / 1024);
|
$checks['db_size'] = ['ok' => true, 'value' => round(filesize($dbPath)/1024).' KB', 'optional' => true];
|
||||||
$checks['db_size'] = ['ok' => true, 'value' => $dbSizeKB . ' KB', 'optional' => true];
|
|
||||||
|
|
||||||
// Row count
|
|
||||||
try {
|
|
||||||
$cnt = $pdo->query("SELECT COUNT(*) FROM inventory WHERE quantity > 0")->fetchColumn();
|
$cnt = $pdo->query("SELECT COUNT(*) FROM inventory WHERE quantity > 0")->fetchColumn();
|
||||||
$checks['db_row_count'] = ['ok' => true, 'value' => $cnt . ' prodotti in inventario', 'optional' => true];
|
$checks['db_row_count'] = ['ok' => true, 'value' => $cnt.' prodotti in inventario', 'optional' => true];
|
||||||
} catch (\Throwable $e) {
|
|
||||||
$checks['db_row_count'] = ['ok' => true, 'value' => '?', 'optional' => true];
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
foreach (['db_tables', 'db_integrity'] as $k) $checks[$k] = ['ok' => false];
|
foreach (['db_tables', 'db_integrity'] as $k)
|
||||||
foreach (['db_wal', 'db_size', 'db_row_count'] as $k) $checks[$k] = ['ok' => false, 'optional' => true];
|
$checks[$k] = ['ok' => false, 'hint' => 'Impossibile verificare — connessione DB fallita'];
|
||||||
|
foreach (['db_wal', 'db_size', 'db_row_count'] as $k)
|
||||||
|
$checks[$k] = ['ok' => false, 'optional' => true];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── 9. .env file ──────────────────────────────────────────────────────────
|
// ── 9. .env file ──────────────────────────────────────────────────────────
|
||||||
$checks['env_file'] = ['ok' => file_exists(__DIR__ . '/../.env'), 'optional' => true];
|
$envExists = file_exists(__DIR__ . '/../.env');
|
||||||
|
$checks['env_file'] = [
|
||||||
// ── 10. Gemini AI key ─────────────────────────────────────────────────────
|
'ok' => $envExists,
|
||||||
$checks['gemini_key'] = ['ok' => !empty(env('GEMINI_API_KEY')), 'optional' => true];
|
|
||||||
|
|
||||||
// ── 11. Bring! credentials & token ────────────────────────────────────────
|
|
||||||
$checks['bring_credentials'] = [
|
|
||||||
'ok' => !empty(env('BRING_EMAIL')) && !empty(env('BRING_PASSWORD')),
|
|
||||||
'optional' => true,
|
'optional' => true,
|
||||||
|
'hint' => !$envExists ? 'File .env mancante — copia .env.example in .env e configura i valori' : null,
|
||||||
];
|
];
|
||||||
$checks['bring_token'] = ['ok' => !empty(env('BRING_ACCESS_TOKEN')), 'optional' => true];
|
|
||||||
|
|
||||||
// ── 12. cURL SSL support ──────────────────────────────────────────────────
|
// ── 10. Gemini AI — solo se GEMINI_API_KEY è impostata ───────────────────
|
||||||
|
$geminiKey = $envGet('GEMINI_API_KEY');
|
||||||
|
if (!empty($geminiKey)) {
|
||||||
|
$checks['gemini_key'] = ['ok' => strlen($geminiKey) > 20, 'optional' => true,
|
||||||
|
'hint' => strlen($geminiKey) <= 20 ? 'Chiave Gemini AI sembra troppo corta — verifica il valore in .env' : null];
|
||||||
|
} else {
|
||||||
|
$checks['gemini_key'] = ['ok' => false, 'optional' => true,
|
||||||
|
'hint' => 'GEMINI_API_KEY non configurata — le funzioni AI non saranno disponibili'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── 11. Bring! — solo se EMAIL+PASSWORD sono impostate ───────────────────
|
||||||
|
$bringEmail = $envGet('BRING_EMAIL');
|
||||||
|
$bringPassword = $envGet('BRING_PASSWORD');
|
||||||
|
$bringEnabled = !empty($bringEmail) && !empty($bringPassword);
|
||||||
|
if ($bringEnabled) {
|
||||||
|
$checks['bring_credentials'] = ['ok' => true, 'optional' => true];
|
||||||
|
// Token: stored in data/bring_token.json (not in .env)
|
||||||
|
$bringTokenFile = $dataDir . '/bring_token.json';
|
||||||
|
$bringTokenOk = false;
|
||||||
|
$bringTokenHint = null;
|
||||||
|
if (file_exists($bringTokenFile)) {
|
||||||
|
$bringData = @json_decode(@file_get_contents($bringTokenFile), true);
|
||||||
|
$bringTokenOk = !empty($bringData['access_token'] ?? ($bringData['accessToken'] ?? ''));
|
||||||
|
if (!$bringTokenOk) $bringTokenHint = 'Token Bring! presente ma non valido — verrà rinnovato automaticamente al prossimo accesso';
|
||||||
|
} else {
|
||||||
|
$bringTokenHint = 'Token Bring! non ancora generato — verrà creato al primo accesso alla lista spesa';
|
||||||
|
}
|
||||||
|
$checks['bring_token'] = ['ok' => $bringTokenOk, 'optional' => true, 'hint' => $bringTokenHint];
|
||||||
|
}
|
||||||
|
// If Bring! not configured, skip entirely (no check at all)
|
||||||
|
|
||||||
|
// ── 12. TTS — solo se TTS_ENABLED ────────────────────────────────────────
|
||||||
|
if ($envGet('TTS_ENABLED') === 'true') {
|
||||||
|
$ttsUrl = $envGet('TTS_URL');
|
||||||
|
$checks['tts_url'] = [
|
||||||
|
'ok' => !empty($ttsUrl),
|
||||||
|
'optional' => true,
|
||||||
|
'hint' => empty($ttsUrl) ? 'TTS_ENABLED=true ma TTS_URL non configurata' : null,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── 13. Scale gateway — solo se SCALE_ENABLED ────────────────────────────
|
||||||
|
if ($envGet('SCALE_ENABLED') === 'true') {
|
||||||
|
$scaleUrl = $envGet('SCALE_GATEWAY_URL');
|
||||||
|
$checks['scale_gateway'] = [
|
||||||
|
'ok' => !empty($scaleUrl),
|
||||||
|
'optional' => true,
|
||||||
|
'hint' => empty($scaleUrl) ? 'SCALE_ENABLED=true ma SCALE_GATEWAY_URL non configurata' : null,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── 14. cURL SSL ──────────────────────────────────────────────────────────
|
||||||
if (function_exists('curl_version')) {
|
if (function_exists('curl_version')) {
|
||||||
$cv = curl_version();
|
$cv = curl_version();
|
||||||
$checks['curl_ssl'] = [
|
$checks['curl_ssl'] = ['ok' => !empty($cv['ssl_version']), 'value' => $cv['ssl_version'] ?? null, 'optional' => true,
|
||||||
'ok' => !empty($cv['ssl_version']),
|
'hint' => empty($cv['ssl_version']) ? 'cURL senza supporto SSL — le chiamate HTTPS potrebbero fallire' : null];
|
||||||
'value' => $cv['ssl_version'] ?? null,
|
|
||||||
'optional' => true,
|
|
||||||
];
|
|
||||||
} else {
|
} else {
|
||||||
$checks['curl_ssl'] = ['ok' => false, 'optional' => true];
|
$checks['curl_ssl'] = ['ok' => false, 'optional' => true, 'hint' => 'cURL non disponibile'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── 13. Internet / Gemini API reachability ────────────────────────────────
|
// ── 15. Internet — raggiungibilità API Gemini (solo se Gemini configurato) ─
|
||||||
$internetOk = false;
|
if (!empty($geminiKey) && extension_loaded('curl')) {
|
||||||
if (extension_loaded('curl')) {
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt_array($ch, [
|
curl_setopt_array($ch, [CURLOPT_URL => 'https://generativelanguage.googleapis.com/', CURLOPT_NOBODY => true,
|
||||||
CURLOPT_URL => 'https://generativelanguage.googleapis.com/',
|
CURLOPT_FOLLOWLOCATION => false, CURLOPT_TIMEOUT => 4, CURLOPT_CONNECTTIMEOUT => 3,
|
||||||
CURLOPT_NOBODY => true,
|
CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false]);
|
||||||
CURLOPT_FOLLOWLOCATION => false,
|
|
||||||
CURLOPT_TIMEOUT => 3,
|
|
||||||
CURLOPT_CONNECTTIMEOUT => 2,
|
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
|
||||||
CURLOPT_SSL_VERIFYPEER => false,
|
|
||||||
]);
|
|
||||||
curl_exec($ch);
|
curl_exec($ch);
|
||||||
$httpCode = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
$httpCode = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
$curlErr = curl_errno($ch);
|
$curlErrNo = curl_errno($ch);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
$internetOk = ($httpCode > 0) || ($curlErr === 0);
|
$internetOk = $httpCode > 0 || $curlErrNo === 0;
|
||||||
|
$checks['internet'] = ['ok' => $internetOk, 'optional' => true,
|
||||||
|
'hint' => !$internetOk ? 'Impossibile raggiungere i server Gemini — le funzioni AI non funzioneranno senza connessione internet' : null];
|
||||||
}
|
}
|
||||||
$checks['internet'] = ['ok' => $internetOk, 'optional' => true];
|
|
||||||
|
|
||||||
// ── Compute overall result ────────────────────────────────────────────────
|
// ── Compute overall result ────────────────────────────────────────────────
|
||||||
$criticalKeys = [
|
$criticalKeys = ['php_version', 'ext_pdo_sqlite', 'ext_curl', 'ext_json', 'ext_mbstring',
|
||||||
'php_version', 'ext_pdo_sqlite', 'ext_curl', 'ext_json', 'ext_mbstring',
|
'data_dir', 'data_write_test', 'db_connect', 'db_tables', 'db_integrity'];
|
||||||
'data_dir', 'data_write_test', 'db_connect', 'db_tables', 'db_integrity',
|
|
||||||
];
|
|
||||||
$allOk = array_reduce($criticalKeys, fn($c, $k) => $c && ($checks[$k]['ok'] ?? false), true);
|
$allOk = array_reduce($criticalKeys, fn($c, $k) => $c && ($checks[$k]['ok'] ?? false), true);
|
||||||
|
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode(['ok' => $allOk, 'checks' => $checks, 'fresh' => $isFresh ?? false], JSON_UNESCAPED_UNICODE);
|
echo json_encode(['ok' => $allOk, 'checks' => $checks, 'fresh' => $isFresh], JSON_UNESCAPED_UNICODE);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+94
-12
@@ -155,13 +155,88 @@ body {
|
|||||||
letter-spacing: 0.01em;
|
letter-spacing: 0.01em;
|
||||||
}
|
}
|
||||||
.preloader-warnings {
|
.preloader-warnings {
|
||||||
display: flex;
|
max-width: 310px;
|
||||||
flex-wrap: wrap;
|
width: 100%;
|
||||||
gap: 5px;
|
animation: zwFadeIn 0.3s ease;
|
||||||
justify-content: center;
|
|
||||||
max-width: 270px;
|
|
||||||
animation: zwFadeIn 0.25s ease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ── Warning popup (auto-close 5s) ─────────────────────────── */
|
||||||
|
.startup-popup {
|
||||||
|
border-radius: 12px;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.startup-popup-warn {
|
||||||
|
background: rgba(30,20,0,0.85);
|
||||||
|
border: 1px solid rgba(251,191,36,0.45);
|
||||||
|
}
|
||||||
|
.startup-popup-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 9px 14px 7px;
|
||||||
|
font-size: 0.82rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #fcd34d;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.startup-popup-countdown {
|
||||||
|
background: rgba(251,191,36,0.2);
|
||||||
|
color: #fcd34d;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
font-weight: 700;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.startup-popup-body {
|
||||||
|
padding: 2px 14px 10px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.startup-warn-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.startup-warn-icon {
|
||||||
|
font-size: 1rem;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-top: 1px;
|
||||||
|
}
|
||||||
|
.startup-warn-body {
|
||||||
|
font-size: 0.78rem;
|
||||||
|
color: #d4c08a;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
.startup-warn-body strong {
|
||||||
|
display: block;
|
||||||
|
color: #fcd34d;
|
||||||
|
font-size: 0.82rem;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
}
|
||||||
|
.startup-warn-body p {
|
||||||
|
margin: 0;
|
||||||
|
color: #c8a954;
|
||||||
|
}
|
||||||
|
.startup-popup-bar-wrap {
|
||||||
|
height: 3px;
|
||||||
|
background: rgba(251,191,36,0.15);
|
||||||
|
}
|
||||||
|
.startup-popup-bar {
|
||||||
|
height: 3px;
|
||||||
|
background: #fbbf24;
|
||||||
|
width: 100%;
|
||||||
|
will-change: width;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Error popup (blocking) ─────────────────────────────────── */
|
||||||
|
/* Keep .preloader-warn-badge for backward compat */
|
||||||
.preloader-warn-badge {
|
.preloader-warn-badge {
|
||||||
background: rgba(251,191,36,0.15);
|
background: rgba(251,191,36,0.15);
|
||||||
color: #fcd34d;
|
color: #fcd34d;
|
||||||
@@ -175,15 +250,22 @@ body {
|
|||||||
color: #fca5a5;
|
color: #fca5a5;
|
||||||
background: rgba(239,68,68,0.18);
|
background: rgba(239,68,68,0.18);
|
||||||
border: 1px solid rgba(239,68,68,0.4);
|
border: 1px solid rgba(239,68,68,0.4);
|
||||||
border-radius: 10px;
|
border-radius: 12px;
|
||||||
padding: 12px 18px;
|
padding: 14px 18px;
|
||||||
font-size: 0.84rem;
|
font-size: 0.80rem;
|
||||||
text-align: center;
|
text-align: left;
|
||||||
max-width: 280px;
|
max-width: 300px;
|
||||||
line-height: 1.5;
|
line-height: 1.6;
|
||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
animation: zwFadeIn 0.3s ease;
|
animation: zwFadeIn 0.3s ease;
|
||||||
}
|
}
|
||||||
|
.preloader-error-msg strong {
|
||||||
|
display: block;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
color: #f87171;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
.preloader-retry-btn {
|
.preloader-retry-btn {
|
||||||
background: #ef4444;
|
background: #ef4444;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
+92
-25
@@ -14924,17 +14924,18 @@ async function _runStartupCheck() {
|
|||||||
result = await resp.json();
|
result = await resp.json();
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
clearInterval(slowAnim);
|
clearInterval(slowAnim);
|
||||||
setProgress(100, tl('error_network', 'Impossibile contattare il server'), 'error');
|
_showStartupErrorPopup(
|
||||||
errorEl.textContent = tl('error_network', 'Impossibile contattare il server. Controlla la connessione di rete.');
|
tl('error_network', 'Impossibile contattare il server'),
|
||||||
errorEl.style.display = '';
|
tl('error_network_detail', 'Il browser non riesce a raggiungere il server PHP.\n\nPossibili cause:\n• Il server Apache/PHP non è in esecuzione\n• Problema di rete o firewall\n• URL dell\'app non corretta\n\nControlla che il server sia avviato e riprova.'),
|
||||||
retryBtn.style.display = '';
|
errorEl, retryBtn
|
||||||
|
);
|
||||||
|
setProgress(100, `❌ ${tl('error_network', 'Server non raggiungibile')}`, 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
clearInterval(slowAnim);
|
clearInterval(slowAnim);
|
||||||
_fetchDone = true;
|
_fetchDone = true;
|
||||||
|
|
||||||
// ── Ordered check definitions (must match PHP keys) ───────────────────────
|
// ── Ordered check definitions (must match PHP keys) ───────────────────────
|
||||||
// { key, label, critical }
|
|
||||||
const CHECKS = [
|
const CHECKS = [
|
||||||
// PHP runtime
|
// PHP runtime
|
||||||
{ key: 'php_version', label: 'PHP', critical: true },
|
{ key: 'php_version', label: 'PHP', critical: true },
|
||||||
@@ -14951,22 +14952,25 @@ async function _runStartupCheck() {
|
|||||||
{ key: 'php_upload', label: tl('check_php_upload', 'Upload PHP'), critical: false },
|
{ key: 'php_upload', label: tl('check_php_upload', 'Upload PHP'), critical: false },
|
||||||
// Filesystem
|
// Filesystem
|
||||||
{ key: 'data_dir', label: tl('check_data_dir', 'Cartella dati'), critical: true },
|
{ key: 'data_dir', label: tl('check_data_dir', 'Cartella dati'), critical: true },
|
||||||
{ key: 'data_rate_limits', label: tl('check_rate_limits', 'Rate limits dir'),critical: false },
|
{ key: 'data_rate_limits', label: tl('check_rate_limits', 'Rate limits dir'), critical: false },
|
||||||
{ key: 'data_backups', label: tl('check_backups', 'Backup dir'), critical: false },
|
{ key: 'data_backups', label: tl('check_backups', 'Backup dir'), critical: false },
|
||||||
{ key: 'data_write_test', label: tl('check_write_test', 'Test scrittura'), critical: true },
|
{ key: 'data_write_test', label: tl('check_write_test', 'Test scrittura'), critical: true },
|
||||||
{ key: 'disk_space', label: tl('check_disk_space', 'Spazio disco'), critical: false },
|
{ key: 'disk_space', label: tl('check_disk_space', 'Spazio disco'), critical: false },
|
||||||
// Database
|
// Database
|
||||||
|
{ key: 'db_legacy', label: tl('check_db_legacy', 'DB legacy'), critical: false },
|
||||||
{ key: 'db_connect', label: tl('check_db_connect', 'Connessione DB'), critical: true },
|
{ key: 'db_connect', label: tl('check_db_connect', 'Connessione DB'), critical: true },
|
||||||
{ key: 'db_tables', label: tl('check_db_tables', 'Tabelle DB'), critical: true },
|
{ key: 'db_tables', label: tl('check_db_tables', 'Tabelle DB'), critical: true },
|
||||||
{ key: 'db_integrity', label: tl('check_db_integrity','Integrità DB'), critical: true },
|
{ key: 'db_integrity', label: tl('check_db_integrity','Integrità DB'), critical: true },
|
||||||
{ key: 'db_wal', label: tl('check_db_wal', 'WAL mode'), critical: false },
|
{ key: 'db_wal', label: tl('check_db_wal', 'WAL mode'), critical: false },
|
||||||
{ key: 'db_size', label: tl('check_db_size', 'Dimensione DB'), critical: false },
|
{ key: 'db_size', label: tl('check_db_size', 'Dimensione DB'), critical: false },
|
||||||
{ key: 'db_row_count', label: tl('check_db_rows', 'Dati inventario'),critical: false },
|
{ key: 'db_row_count', label: tl('check_db_rows', 'Dati inventario'), critical: false },
|
||||||
// Config
|
// Config & optional features
|
||||||
{ key: 'env_file', label: tl('check_env', 'File .env'), critical: false },
|
{ key: 'env_file', label: tl('check_env', 'File .env'), critical: false },
|
||||||
{ key: 'gemini_key', label: tl('check_gemini', 'Gemini AI key'), critical: false },
|
{ key: 'gemini_key', label: tl('check_gemini', 'Gemini AI key'), critical: false },
|
||||||
{ key: 'bring_credentials', label: tl('check_bring_creds', 'Bring! credenziali'), critical: false },
|
{ key: 'bring_credentials', label: tl('check_bring_creds', 'Bring! credenziali'), critical: false },
|
||||||
{ key: 'bring_token', label: tl('check_bring_token', 'Bring! token'), critical: false },
|
{ key: 'bring_token', label: tl('check_bring_token', 'Bring! token'), critical: false },
|
||||||
|
{ key: 'tts_url', label: tl('check_tts', 'TTS URL'), critical: false },
|
||||||
|
{ key: 'scale_gateway', label: tl('check_scale', 'Scale gateway'), critical: false },
|
||||||
// Network
|
// Network
|
||||||
{ key: 'curl_ssl', label: tl('check_curl_ssl', 'cURL SSL'), critical: false },
|
{ key: 'curl_ssl', label: tl('check_curl_ssl', 'cURL SSL'), critical: false },
|
||||||
{ key: 'internet', label: tl('check_internet', 'Internet'), critical: false },
|
{ key: 'internet', label: tl('check_internet', 'Internet'), critical: false },
|
||||||
@@ -14978,10 +14982,10 @@ async function _runStartupCheck() {
|
|||||||
const total = CHECKS.filter(d => checks[d.key] !== undefined).length;
|
const total = CHECKS.filter(d => checks[d.key] !== undefined).length;
|
||||||
let done = 0;
|
let done = 0;
|
||||||
|
|
||||||
// Phase 2: step through each check with real-time label
|
// Phase 2: step through each check with animated label
|
||||||
for (const def of CHECKS) {
|
for (const def of CHECKS) {
|
||||||
const c = checks[def.key];
|
const c = checks[def.key];
|
||||||
if (c === undefined) continue; // not returned by server
|
if (c === undefined) continue; // not returned by server (feature not enabled)
|
||||||
|
|
||||||
done++;
|
done++;
|
||||||
const pct = 15 + Math.round((done / total) * 83); // 15→98%
|
const pct = 15 + Math.round((done / total) * 83); // 15→98%
|
||||||
@@ -14989,7 +14993,7 @@ async function _runStartupCheck() {
|
|||||||
const isOpt = c.optional === true || !def.critical;
|
const isOpt = c.optional === true || !def.critical;
|
||||||
const isFresh = c.fresh === true;
|
const isFresh = c.fresh === true;
|
||||||
|
|
||||||
// Build label: "check name (extra value)"
|
// Build label with value
|
||||||
let lbl = def.label;
|
let lbl = def.label;
|
||||||
if (c.value) lbl += ` (${c.value})`;
|
if (c.value) lbl += ` (${c.value})`;
|
||||||
if (isFresh) lbl += ` — ${tl('fresh_install', 'nuovo impianto')}`;
|
if (isFresh) lbl += ` — ${tl('fresh_install', 'nuovo impianto')}`;
|
||||||
@@ -15003,37 +15007,100 @@ async function _runStartupCheck() {
|
|||||||
(isOpt ? warnings : errors).push({ def, c });
|
(isOpt ? warnings : errors).push({ def, c });
|
||||||
}
|
}
|
||||||
|
|
||||||
await new Promise(r => setTimeout(r, 45)); // ~45ms per step → ~1.3s total
|
await new Promise(r => setTimeout(r, 40));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Completed ─────────────────────────────────────────────────────────────
|
// ── Errors → red bar + blocking popup ────────────────────────────────────
|
||||||
if (errors.length > 0) {
|
if (errors.length > 0) {
|
||||||
setProgress(100, `❌ ${tl('critical_error_short', 'Errore critico')}`, 'error');
|
setProgress(100, `❌ ${tl('critical_error_short', 'Errore critico')}`, 'error');
|
||||||
const errDetail = errors.map(e => e.def.label + (e.c.error ? `: ${e.c.error}` : '')).join('\n');
|
await new Promise(r => setTimeout(r, 300));
|
||||||
errorEl.textContent = `${tl('critical_error', 'Errore critico: l\'app non può avviarsi.')}${errDetail ? '\n' + errDetail : ''}`;
|
const errLines = errors.map(e => {
|
||||||
errorEl.style.display = '';
|
const hint = e.c.hint || (e.c.error ? e.c.error : null);
|
||||||
retryBtn.style.display = '';
|
return `❌ ${e.def.label}${hint ? '\n → ' + hint : ''}`;
|
||||||
|
}).join('\n\n');
|
||||||
|
_showStartupErrorPopup(
|
||||||
|
tl('critical_error_short', 'Errore critico'),
|
||||||
|
tl('critical_error_intro', 'L\'app non può avviarsi a causa dei seguenti problemi:') + '\n\n' + errLines,
|
||||||
|
errorEl, retryBtn
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Warnings only
|
// ── Warnings → amber bar + warning popup auto-close 5s ───────────────────
|
||||||
if (warnings.length > 0) {
|
if (warnings.length > 0) {
|
||||||
setProgress(100, `⚠️ ${warnings.length} ${tl('warnings_found', 'avvisi rilevati')}`, 'warn');
|
setProgress(100, `⚠️ ${warnings.length} ${tl('warnings_found', 'avvisi')}`, 'warn');
|
||||||
warningsEl.innerHTML = warnings
|
await new Promise(r => setTimeout(r, 200));
|
||||||
.map(w => `<span class="preloader-warn-badge">⚠️ ${w.def.label}</span>`)
|
|
||||||
.join('');
|
// Build warning popup (auto-close 5s)
|
||||||
warningsEl.style.display = '';
|
_showStartupWarningPopup(warnings, warningsEl, tl);
|
||||||
await new Promise(r => setTimeout(r, 2200)); // show warnings for 2.2s
|
|
||||||
|
// Wait for user to read (5s) then proceed
|
||||||
|
await new Promise(r => setTimeout(r, 5200));
|
||||||
|
|
||||||
|
// Hide warning popup
|
||||||
warningsEl.style.display = 'none';
|
warningsEl.style.display = 'none';
|
||||||
} else {
|
} else {
|
||||||
setProgress(100, `✅ ${tl('all_ok', 'Sistema OK')}`);
|
setProgress(100, `✅ ${tl('all_ok', 'Sistema OK')}`);
|
||||||
await new Promise(r => setTimeout(r, 700));
|
await new Promise(r => setTimeout(r, 600));
|
||||||
}
|
}
|
||||||
|
|
||||||
wrapEl.style.display = 'none';
|
wrapEl.style.display = 'none';
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Builds and shows the warning popup with countdown (auto-closes after 5s). */
|
||||||
|
function _showStartupWarningPopup(warnings, container, tl) {
|
||||||
|
const lines = warnings.map(w => {
|
||||||
|
const hint = w.c.hint || null;
|
||||||
|
return `<div class="startup-warn-item">
|
||||||
|
<span class="startup-warn-icon">⚠️</span>
|
||||||
|
<div class="startup-warn-body">
|
||||||
|
<strong>${w.def.label}</strong>
|
||||||
|
${hint ? `<p>${hint}</p>` : ''}
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
}).join('');
|
||||||
|
|
||||||
|
container.innerHTML = `
|
||||||
|
<div class="startup-popup startup-popup-warn">
|
||||||
|
<div class="startup-popup-header">
|
||||||
|
<span>⚠️ ${warnings.length} ${tl('warnings_found', 'avviso/i rilevato/i')}</span>
|
||||||
|
<span class="startup-popup-countdown" id="startup-countdown">5</span>
|
||||||
|
</div>
|
||||||
|
<div class="startup-popup-body">${lines}</div>
|
||||||
|
<div class="startup-popup-bar-wrap"><div class="startup-popup-bar" id="startup-popup-bar"></div></div>
|
||||||
|
</div>`;
|
||||||
|
container.style.display = '';
|
||||||
|
|
||||||
|
// Animate countdown bar
|
||||||
|
const barEl = document.getElementById('startup-popup-bar');
|
||||||
|
const cntEl = document.getElementById('startup-countdown');
|
||||||
|
if (barEl) {
|
||||||
|
barEl.style.transition = 'none';
|
||||||
|
barEl.style.width = '100%';
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
barEl.style.transition = 'width 5s linear';
|
||||||
|
barEl.style.width = '0%';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let secs = 4;
|
||||||
|
const t = setInterval(() => {
|
||||||
|
if (cntEl) cntEl.textContent = secs;
|
||||||
|
secs--;
|
||||||
|
if (secs < 0) clearInterval(t);
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Shows a blocking error in the preloader (no auto-close). */
|
||||||
|
function _showStartupErrorPopup(title, detail, errorEl, retryBtn) {
|
||||||
|
if (!errorEl) return;
|
||||||
|
errorEl.innerHTML = `<strong>${title}</strong>\n${detail}`;
|
||||||
|
errorEl.style.display = '';
|
||||||
|
if (retryBtn) retryBtn.style.display = '';
|
||||||
|
}
|
||||||
|
|
||||||
/** Retry button handler in the startup error screen. */
|
/** Retry button handler in the startup error screen. */
|
||||||
function _startupRetry() {
|
function _startupRetry() {
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|||||||
+4
-4
@@ -11,7 +11,7 @@
|
|||||||
<title>EverShelf</title>
|
<title>EverShelf</title>
|
||||||
<link rel="manifest" href="manifest.json">
|
<link rel="manifest" href="manifest.json">
|
||||||
<link rel="icon" type="image/png" href="assets/img/logo/logo_icon.png">
|
<link rel="icon" type="image/png" href="assets/img/logo/logo_icon.png">
|
||||||
<link rel="stylesheet" href="assets/css/style.css?v=20260520b">
|
<link rel="stylesheet" href="assets/css/style.css?v=20260517a">
|
||||||
<!-- QuaggaJS for barcode scanning -->
|
<!-- QuaggaJS for barcode scanning -->
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@ericblade/quagga2@1.8.4/dist/quagga.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/@ericblade/quagga2@1.8.4/dist/quagga.min.js"></script>
|
||||||
<!-- @xenova/transformers: ES-module bootstrap that exposes a lazy category-classifier as window._categoryPipelinePromise -->
|
<!-- @xenova/transformers: ES-module bootstrap that exposes a lazy category-classifier as window._categoryPipelinePromise -->
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
<div id="preloader-warnings" class="preloader-warnings" style="display:none"></div>
|
<div id="preloader-warnings" class="preloader-warnings" style="display:none"></div>
|
||||||
<div id="preloader-error-msg" class="preloader-error-msg" style="display:none"></div>
|
<div id="preloader-error-msg" class="preloader-error-msg" style="display:none"></div>
|
||||||
<button id="preloader-retry-btn" class="preloader-retry-btn" style="display:none" onclick="_startupRetry()">🔄 <span data-i18n="startup.retry">Riprova</span></button>
|
<button id="preloader-retry-btn" class="preloader-retry-btn" style="display:none" onclick="_startupRetry()">🔄 <span data-i18n="startup.retry">Riprova</span></button>
|
||||||
<span class="app-preloader-version" id="preloader-version">v1.7.21</span>
|
<span class="app-preloader-version" id="preloader-version">v1.7.22</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
<!-- Title — left-aligned; grows to fill space -->
|
<!-- Title — left-aligned; grows to fill space -->
|
||||||
<div class="header-title-wrap">
|
<div class="header-title-wrap">
|
||||||
<h1 class="header-title" onclick="showPage('dashboard')">
|
<h1 class="header-title" onclick="showPage('dashboard')">
|
||||||
<img src="assets/img/logo/logo_icon.png" alt="" class="header-logo-icon" aria-hidden="true" /><span data-i18n="nav.title">EverShelf</span><span class="header-version">v1.7.21</span>
|
<img src="assets/img/logo/logo_icon.png" alt="" class="header-logo-icon" aria-hidden="true" /><span data-i18n="nav.title">EverShelf</span><span class="header-version">v1.7.22</span>
|
||||||
</h1>
|
</h1>
|
||||||
<!-- Update badge — shown alongside title, never replaces it -->
|
<!-- Update badge — shown alongside title, never replaces it -->
|
||||||
<span class="header-update-badge" id="header-update-badge" style="display:none"></span>
|
<span class="header-update-badge" id="header-update-badge" style="display:none"></span>
|
||||||
@@ -1613,6 +1613,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="assets/js/app.js?v=20260520b"></script>
|
<script src="assets/js/app.js?v=20260517a"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"name": "EverShelf",
|
"name": "EverShelf",
|
||||||
"short_name": "EverShelf",
|
"short_name": "EverShelf",
|
||||||
"description": "Gestione completa della dispensa di casa con scansione barcode",
|
"description": "Gestione completa della dispensa di casa con scansione barcode",
|
||||||
"version": "1.7.20",
|
"version": "1.7.22",
|
||||||
"start_url": "/evershelf/",
|
"start_url": "/evershelf/",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"background_color": "#f0f4e8",
|
"background_color": "#f0f4e8",
|
||||||
|
|||||||
@@ -1212,6 +1212,7 @@
|
|||||||
"check_backups": "Backup-Verzeichnis",
|
"check_backups": "Backup-Verzeichnis",
|
||||||
"check_write_test": "Schreibtest",
|
"check_write_test": "Schreibtest",
|
||||||
"check_disk_space": "Speicherplatz",
|
"check_disk_space": "Speicherplatz",
|
||||||
|
"check_db_legacy": "Legacy-DB (dispensa.db)",
|
||||||
"check_db_connect": "Datenbankverbindung",
|
"check_db_connect": "Datenbankverbindung",
|
||||||
"check_db_tables": "Datenbanktabellen",
|
"check_db_tables": "Datenbanktabellen",
|
||||||
"check_db_integrity": "Datenbankintegrität",
|
"check_db_integrity": "Datenbankintegrität",
|
||||||
@@ -1222,6 +1223,8 @@
|
|||||||
"check_gemini": "Gemini-AI-Schlüssel",
|
"check_gemini": "Gemini-AI-Schlüssel",
|
||||||
"check_bring_creds": "Bring!-Anmeldedaten",
|
"check_bring_creds": "Bring!-Anmeldedaten",
|
||||||
"check_bring_token": "Bring!-Token",
|
"check_bring_token": "Bring!-Token",
|
||||||
|
"check_tts": "Text-to-Speech-URL",
|
||||||
|
"check_scale": "Waagen-Gateway",
|
||||||
"check_curl_ssl": "cURL-SSL",
|
"check_curl_ssl": "cURL-SSL",
|
||||||
"check_internet": "Internetverbindung",
|
"check_internet": "Internetverbindung",
|
||||||
"fresh_install": "Neuinstallation",
|
"fresh_install": "Neuinstallation",
|
||||||
@@ -1229,7 +1232,9 @@
|
|||||||
"all_ok": "System OK",
|
"all_ok": "System OK",
|
||||||
"critical_error_short": "Kritischer Fehler",
|
"critical_error_short": "Kritischer Fehler",
|
||||||
"critical_error": "Kritischer Fehler: Die App kann nicht gestartet werden. Prüfe die Serverlogs.",
|
"critical_error": "Kritischer Fehler: Die App kann nicht gestartet werden. Prüfe die Serverlogs.",
|
||||||
"error_network": "Server nicht erreichbar. Bitte Netzwerkverbindung prüfen.",
|
"critical_error_intro": "Die App kann aufgrund folgender Probleme nicht gestartet werden:",
|
||||||
|
"error_network": "Server nicht erreichbar.",
|
||||||
|
"error_network_detail": "Der Browser kann den PHP-Server nicht erreichen.\n\nMögliche Ursachen:\n• Apache/PHP-Server läuft nicht\n• Netzwerk- oder Firewall-Problem\n• Falsche App-URL\n\nBitte Server starten und erneut versuchen.",
|
||||||
"retry": "Erneut versuchen"
|
"retry": "Erneut versuchen"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1212,6 +1212,7 @@
|
|||||||
"check_backups": "Backup dir",
|
"check_backups": "Backup dir",
|
||||||
"check_write_test": "Disk write test",
|
"check_write_test": "Disk write test",
|
||||||
"check_disk_space": "Disk space",
|
"check_disk_space": "Disk space",
|
||||||
|
"check_db_legacy": "Legacy DB (dispensa.db)",
|
||||||
"check_db_connect": "Database connection",
|
"check_db_connect": "Database connection",
|
||||||
"check_db_tables": "Database tables",
|
"check_db_tables": "Database tables",
|
||||||
"check_db_integrity": "Database integrity",
|
"check_db_integrity": "Database integrity",
|
||||||
@@ -1222,6 +1223,8 @@
|
|||||||
"check_gemini": "Gemini AI key",
|
"check_gemini": "Gemini AI key",
|
||||||
"check_bring_creds": "Bring! credentials",
|
"check_bring_creds": "Bring! credentials",
|
||||||
"check_bring_token": "Bring! token",
|
"check_bring_token": "Bring! token",
|
||||||
|
"check_tts": "Text-to-Speech URL",
|
||||||
|
"check_scale": "Scale gateway",
|
||||||
"check_curl_ssl": "cURL SSL",
|
"check_curl_ssl": "cURL SSL",
|
||||||
"check_internet": "Internet connection",
|
"check_internet": "Internet connection",
|
||||||
"fresh_install": "fresh install",
|
"fresh_install": "fresh install",
|
||||||
@@ -1229,7 +1232,9 @@
|
|||||||
"all_ok": "System OK",
|
"all_ok": "System OK",
|
||||||
"critical_error_short": "Critical error",
|
"critical_error_short": "Critical error",
|
||||||
"critical_error": "Critical error: the app cannot start. Check your server logs.",
|
"critical_error": "Critical error: the app cannot start. Check your server logs.",
|
||||||
"error_network": "Cannot reach the server. Check your network connection.",
|
"critical_error_intro": "The app cannot start due to the following issues:",
|
||||||
|
"error_network": "Cannot reach the server.",
|
||||||
|
"error_network_detail": "The browser cannot reach the PHP server.\n\nPossible causes:\n• Apache/PHP server is not running\n• Network or firewall issue\n• Incorrect app URL\n\nMake sure the server is started and try again.",
|
||||||
"retry": "Retry"
|
"retry": "Retry"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1212,6 +1212,7 @@
|
|||||||
"check_backups": "Dir backup",
|
"check_backups": "Dir backup",
|
||||||
"check_write_test": "Test scrittura disco",
|
"check_write_test": "Test scrittura disco",
|
||||||
"check_disk_space": "Spazio disco",
|
"check_disk_space": "Spazio disco",
|
||||||
|
"check_db_legacy": "DB legacy (dispensa.db)",
|
||||||
"check_db_connect": "Connessione database",
|
"check_db_connect": "Connessione database",
|
||||||
"check_db_tables": "Tabelle database",
|
"check_db_tables": "Tabelle database",
|
||||||
"check_db_integrity": "Integrità database",
|
"check_db_integrity": "Integrità database",
|
||||||
@@ -1222,6 +1223,8 @@
|
|||||||
"check_gemini": "Chiave Gemini AI",
|
"check_gemini": "Chiave Gemini AI",
|
||||||
"check_bring_creds": "Credenziali Bring!",
|
"check_bring_creds": "Credenziali Bring!",
|
||||||
"check_bring_token": "Token Bring!",
|
"check_bring_token": "Token Bring!",
|
||||||
|
"check_tts": "URL Text-to-Speech",
|
||||||
|
"check_scale": "Gateway bilancia",
|
||||||
"check_curl_ssl": "cURL SSL",
|
"check_curl_ssl": "cURL SSL",
|
||||||
"check_internet": "Connessione internet",
|
"check_internet": "Connessione internet",
|
||||||
"fresh_install": "nuovo impianto",
|
"fresh_install": "nuovo impianto",
|
||||||
@@ -1229,7 +1232,9 @@
|
|||||||
"all_ok": "Sistema OK",
|
"all_ok": "Sistema OK",
|
||||||
"critical_error_short": "Errore critico",
|
"critical_error_short": "Errore critico",
|
||||||
"critical_error": "Errore critico: l'app non può avviarsi. Controlla i log del server.",
|
"critical_error": "Errore critico: l'app non può avviarsi. Controlla i log del server.",
|
||||||
"error_network": "Impossibile contattare il server. Controlla la connessione di rete.",
|
"critical_error_intro": "L'app non può avviarsi a causa dei seguenti problemi:",
|
||||||
|
"error_network": "Impossibile contattare il server.",
|
||||||
|
"error_network_detail": "Il browser non riesce a raggiungere il server PHP.\n\nPossibili cause:\n• Il server Apache/PHP non è in esecuzione\n• Problema di rete o firewall\n• URL dell'app non corretta\n\nControlla che il server sia avviato e riprova.",
|
||||||
"retry": "Riprova"
|
"retry": "Riprova"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user