This commit is contained in:
2026-03-09 00:05:15 +01:00
parent 1c1dc4c98b
commit 9f22fa068e
3 changed files with 35 additions and 13 deletions

View File

@@ -64,6 +64,10 @@ SH;
$updateCount = (int)$m[1];
}
}
$updatePreview = trim($updOutStr);
if (strlen($updatePreview) > 1200) {
$updatePreview = substr($updatePreview, 0, 1200);
}
[$upgExit, $upgOut, $upgErr] = runSshCommandCapture($host, $upgradeCmd, $strictHostKey, 25);
$upgOutStr = (string)$upgOut;
@@ -108,6 +112,7 @@ SH;
'updates' => [
'count' => $updateCount,
'preview' => $updatePreview,
'raw' => $updatePreview,
'error' => $updExit === 0 && !$updateErr ? '' : trim($updErrStr ?: $updOutStr),
],
'os' => [
@@ -362,6 +367,7 @@ function hostAuthOk(array $host, bool $strictHostKey): bool
data-update-checked="<?= e((string)($h['update_checked_at'] ?? '')) ?>"
data-update-count="<?= e((string)($h['update_count'] ?? '')) ?>"
data-update-error="<?= e((string)($h['update_error'] ?? '')) ?>"
data-update-preview="<?= e((string)($h['update_preview'] ?? '')) ?>"
data-upgrade-available="<?= e((string)($h['upgrade_available'] ?? '')) ?>"
data-upgrade-raw="<?= e((string)($h['upgrade_raw'] ?? '')) ?>"
data-upgrade-error="<?= e((string)($h['upgrade_error'] ?? '')) ?>">