summaryrefslogtreecommitdiffstats
path: root/modules-available/systemstatus
diff options
context:
space:
mode:
authorSimon Rettberg2025-02-20 13:57:08 +0100
committerSimon Rettberg2025-02-20 13:57:08 +0100
commitc759b48ff38735a0d7fd47ff75e1254e2b2b5170 (patch)
tree4d91d93a040951ed638f29aa02dc9e74e68b3043 /modules-available/systemstatus
parent[exams] Tweak exam list, add note on top about running exams (diff)
downloadslx-admin-c759b48ff38735a0d7fd47ff75e1254e2b2b5170.tar.gz
slx-admin-c759b48ff38735a0d7fd47ff75e1254e2b2b5170.tar.xz
slx-admin-c759b48ff38735a0d7fd47ff75e1254e2b2b5170.zip
[systemstatus] Add warning about running exams below reboot button
Diffstat (limited to 'modules-available/systemstatus')
-rw-r--r--modules-available/systemstatus/lang/de/template-tags.json3
-rw-r--r--modules-available/systemstatus/lang/en/template-tags.json3
-rw-r--r--modules-available/systemstatus/page.inc.php8
-rw-r--r--modules-available/systemstatus/templates/_page.html12
4 files changed, 25 insertions, 1 deletions
diff --git a/modules-available/systemstatus/lang/de/template-tags.json b/modules-available/systemstatus/lang/de/template-tags.json
index c94720a6..37e20a76 100644
--- a/modules-available/systemstatus/lang/de/template-tags.json
+++ b/modules-available/systemstatus/lang/de/template-tags.json
@@ -13,6 +13,7 @@
"lang_distribution": "Distribution",
"lang_dmsdUnreachable": "dmsd nicht erreichbar",
"lang_everythingUpToDate": "Das System ist auf dem aktuellen Stand",
+ "lang_exam": "Pr\u00fcfung",
"lang_failure": "Fehler",
"lang_fixDependencies": "Installationsprobleme beheben",
"lang_foundStore": "Vorgefunden:",
@@ -37,6 +38,7 @@
"lang_restart": "Neustarten",
"lang_runFullUpdate": "\"Full-Upgrade\" durchf\u00fchren",
"lang_runUpdate": "Update durchf\u00fchren",
+ "lang_runningClients": "Laufende Rechner",
"lang_runningDownloads": "Aktive Downloads",
"lang_runningUploads": "Aktive Uploads",
"lang_serverReboot": "Server neustarten",
@@ -50,6 +52,7 @@
"lang_system": "System",
"lang_systemPartition": "Systempartition",
"lang_systemStoreError": "Fehler beim Ermitteln des verf\u00fcgbaren Systemspeichers",
+ "lang_timeRemaining": "Verbleibend (hh:mm)",
"lang_total": "Gesamt",
"lang_updatedPackages": "Ausstehende Updates",
"lang_updatesWikiLink": "Mehr Informationen zu Updates im bwLehrpool-Wiki",
diff --git a/modules-available/systemstatus/lang/en/template-tags.json b/modules-available/systemstatus/lang/en/template-tags.json
index 7758c71c..cd21f0e2 100644
--- a/modules-available/systemstatus/lang/en/template-tags.json
+++ b/modules-available/systemstatus/lang/en/template-tags.json
@@ -13,6 +13,7 @@
"lang_distribution": "Distribution",
"lang_dmsdUnreachable": "dmsd not reachable",
"lang_everythingUpToDate": "Everything is up to date",
+ "lang_exam": "Exam",
"lang_failure": "Failure",
"lang_fixDependencies": "Fix installation\/dependency problems",
"lang_foundStore": "Found:",
@@ -37,6 +38,7 @@
"lang_restart": "Restart",
"lang_runFullUpdate": "Run \"full-upgrade\"",
"lang_runUpdate": "Run update",
+ "lang_runningClients": "Running clients",
"lang_runningDownloads": "Running downloads",
"lang_runningUploads": "Running uploads",
"lang_serverReboot": "Reboot Server",
@@ -50,6 +52,7 @@
"lang_system": "System",
"lang_systemPartition": "System partition",
"lang_systemStoreError": "Error querying available system storage",
+ "lang_timeRemaining": "Remaining (hh:mm)",
"lang_total": "Total",
"lang_updatedPackages": "Pending updates",
"lang_updatesWikiLink": "See bwLehrpool Wiki for more information regarding updates",
diff --git a/modules-available/systemstatus/page.inc.php b/modules-available/systemstatus/page.inc.php
index 00f36cbe..7dc92568 100644
--- a/modules-available/systemstatus/page.inc.php
+++ b/modules-available/systemstatus/page.inc.php
@@ -104,6 +104,14 @@ class Page_SystemStatus extends Page
if (!empty($pkgs)) {
$data['packages'] = implode(', ', $pkgs);
}
+ if (Module::isAvailable('exams')) {
+ // Any machines running in exam mode might be relevant if you want to reboot the server :>
+ $data['exams'] = Exams::plausiblyInExamMode();
+ foreach ($data['exams'] as &$exam) {
+ $exam['remaining_s'] = Util::formatDuration($exam['eend'] - time(), false);
+ }
+ unset($exam);
+ }
Render::addTemplate('_page', $data);
}
diff --git a/modules-available/systemstatus/templates/_page.html b/modules-available/systemstatus/templates/_page.html
index dedcf01a..50ca9359 100644
--- a/modules-available/systemstatus/templates/_page.html
+++ b/modules-available/systemstatus/templates/_page.html
@@ -92,7 +92,7 @@
<div class="row">
- <div class="col-md-6">
+ <div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
{{lang_maintenance}}
@@ -111,6 +111,13 @@
{{lang_runningDownloads}}: <span class="downloads">??</span>
<div class="alert alert-warning collapse">{{lang_dmsdUnreachable}}</div>
</div>
+ {{#exams}}
+ <div class="alert alert-warning">
+ {{lang_exam}}: {{examtitle}},
+ {{lang_timeRemaining}}: {{remaining_s}}
+ ({{lang_runningClients}}: <b>{{machines}}</b>)
+ </div>
+ {{/exams}}
<div>
{{#packages}}
{{lang_updatedPackages}}: {{packages}}
@@ -171,6 +178,9 @@
} else {
if (data.downloads !== null) $dmsd.find('.downloads').text(data.downloads);
if (data.uploads !== null) $dmsd.find('.uploads').text(data.uploads);
+ if (data.uploads > 0 || data.downloads > 0) {
+ $dmsd.addClass('alert alert-warning');
+ }
}
}).fail(function () {
$dmsd.find('.alert').show();