summaryrefslogtreecommitdiffstats
path: root/modules-available/systemstatus/hooks/main-warning.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2023-07-04 14:10:46 +0200
committerSimon Rettberg2023-07-04 14:10:46 +0200
commit13c22169624e5633977ed62b95aed844301881ac (patch)
treeff87f8ddd057070c898aa6c73f0779f094f5608b /modules-available/systemstatus/hooks/main-warning.inc.php
parentUpdate phpStorm: Disable "accidental + instead of ." warning (diff)
downloadslx-admin-13c22169624e5633977ed62b95aed844301881ac.tar.gz
slx-admin-13c22169624e5633977ed62b95aed844301881ac.tar.xz
slx-admin-13c22169624e5633977ed62b95aed844301881ac.zip
[systemstatus] Show (estimate) of last time updates were installed
Plus other minor tweaks, like message on main page.
Diffstat (limited to 'modules-available/systemstatus/hooks/main-warning.inc.php')
-rw-r--r--modules-available/systemstatus/hooks/main-warning.inc.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules-available/systemstatus/hooks/main-warning.inc.php b/modules-available/systemstatus/hooks/main-warning.inc.php
index 5707c7d2..02b017e8 100644
--- a/modules-available/systemstatus/hooks/main-warning.inc.php
+++ b/modules-available/systemstatus/hooks/main-warning.inc.php
@@ -6,6 +6,12 @@ if (file_exists('/run/reboot-required.pkgs')) {
Message::addInfo('systemstatus.update-reboot-required', true, implode(', ', $lines));
}
+$aptTs = SystemStatus::getAptLastDbUpdateTime();
+if ($aptTs + 864000 < time()) {
+ // No update for 10 days
+ Message::addWarning('systemstatus.apt-db-out-of-date', true, Util::prettyTime($aptTs));
+}
+
if (SystemStatus::diskStat($systemUsage, $storeUsage, $current, $wanted)) {
if ($current === $wanted && isset($storeUsage['freeKb']) && $storeUsage['freeKb'] < 60000000) { // 60GB
Message::addWarning('systemstatus.storage-low-vmstore', true, Util::readableFileSize($storeUsage['freeKb'], -1 , 1));