summaryrefslogtreecommitdiffstats
path: root/modules-available/rebootcontrol
diff options
context:
space:
mode:
authorSimon Rettberg2022-05-02 17:54:40 +0200
committerSimon Rettberg2022-05-02 17:54:40 +0200
commit890ec384849330b3d87e31871060fbf477197ff1 (patch)
treec2359160b2251038d244da4dff2f2e334deb6ee8 /modules-available/rebootcontrol
parent[rebootcontrol] Show location for automated WOL test tasks (diff)
downloadslx-admin-890ec384849330b3d87e31871060fbf477197ff1.tar.gz
slx-admin-890ec384849330b3d87e31871060fbf477197ff1.tar.xz
slx-admin-890ec384849330b3d87e31871060fbf477197ff1.zip
[rebootcontrol] Show time of execution for WOL/reboot/shutdown
Diffstat (limited to 'modules-available/rebootcontrol')
-rw-r--r--modules-available/rebootcontrol/inc/rebootcontrol.inc.php1
-rw-r--r--modules-available/rebootcontrol/pages/task.inc.php3
-rw-r--r--modules-available/rebootcontrol/templates/status-checkconnection.html2
-rw-r--r--modules-available/rebootcontrol/templates/status-exec.html2
-rw-r--r--modules-available/rebootcontrol/templates/status-reboot.html3
-rw-r--r--modules-available/rebootcontrol/templates/status-wol.html2
-rw-r--r--modules-available/rebootcontrol/templates/task-list.html4
7 files changed, 15 insertions, 2 deletions
diff --git a/modules-available/rebootcontrol/inc/rebootcontrol.inc.php b/modules-available/rebootcontrol/inc/rebootcontrol.inc.php
index d68e4dea..e936b94e 100644
--- a/modules-available/rebootcontrol/inc/rebootcontrol.inc.php
+++ b/modules-available/rebootcontrol/inc/rebootcontrol.inc.php
@@ -77,6 +77,7 @@ class RebootControl
'locations' => $lids,
'clients' => $newClients,
'tasks' => [$taskId], // This did hold multiple tasks in the past; keep it in case we need this again
+ 'timestamp' => time(),
];
if (is_array($other)) {
$data += $other;
diff --git a/modules-available/rebootcontrol/pages/task.inc.php b/modules-available/rebootcontrol/pages/task.inc.php
index 691fd9e2..322b1ea9 100644
--- a/modules-available/rebootcontrol/pages/task.inc.php
+++ b/modules-available/rebootcontrol/pages/task.inc.php
@@ -95,6 +95,7 @@ class SubPage
} else {
Util::traceError('oopsie');
}
+ $job['timestamp_s'] = Util::prettyTime($job['timestamp']);
Render::addTemplate('status-' . $template, $job);
}
@@ -112,8 +113,10 @@ class SubPage
if (isset($entry['clients'])) {
$entry['clients'] = count($entry['clients']);
}
+ $entry['timestamp_s'] = Util::prettyTime($entry['timestamp']);
}
unset($entry);
+ ArrayUtil::sortByColumn($active, 'timestamp', SORT_NUMERIC | SORT_ASC);
Render::addTemplate('task-list', ['list' => $active]);
}
}
diff --git a/modules-available/rebootcontrol/templates/status-checkconnection.html b/modules-available/rebootcontrol/templates/status-checkconnection.html
index e31d95ea..da1177e7 100644
--- a/modules-available/rebootcontrol/templates/status-checkconnection.html
+++ b/modules-available/rebootcontrol/templates/status-checkconnection.html
@@ -1,4 +1,4 @@
-<h3>{{lang_checkingJumpHost}}: {{host}}</h3>
+<h3>{{lang_checkingJumpHost}}: {{host}} – {{timestamp_s}}</h3>
<div class="clearfix"></div>
<div class="collapse alert alert-success" id="result-ok">
diff --git a/modules-available/rebootcontrol/templates/status-exec.html b/modules-available/rebootcontrol/templates/status-exec.html
index 01da6bbb..d001941e 100644
--- a/modules-available/rebootcontrol/templates/status-exec.html
+++ b/modules-available/rebootcontrol/templates/status-exec.html
@@ -1,3 +1,5 @@
+<h3>{{timestamp_s}}</h3>
+
<div data-tm-id="{{id}}" data-tm-log="error" data-tm-callback="updateStatus">{{lang_executingRemotely}}</div>
<div class="slx-space"></div>
diff --git a/modules-available/rebootcontrol/templates/status-reboot.html b/modules-available/rebootcontrol/templates/status-reboot.html
index 7b46cab4..ff52244e 100644
--- a/modules-available/rebootcontrol/templates/status-reboot.html
+++ b/modules-available/rebootcontrol/templates/status-reboot.html
@@ -1,4 +1,5 @@
-<h3>{{action}}</h3>
+<h3>{{action}} – {{timestamp_s}}</h3>
+
{{#locations}}
<div class="loc">{{name}}</div>
{{/locations}}
diff --git a/modules-available/rebootcontrol/templates/status-wol.html b/modules-available/rebootcontrol/templates/status-wol.html
index 38e581fe..3a8de68f 100644
--- a/modules-available/rebootcontrol/templates/status-wol.html
+++ b/modules-available/rebootcontrol/templates/status-wol.html
@@ -1,3 +1,5 @@
+<h3>{{timestamp_s}}</h3>
+
{{#locations}}
<div class="loc">{{name}}</div>
{{/locations}}
diff --git a/modules-available/rebootcontrol/templates/task-list.html b/modules-available/rebootcontrol/templates/task-list.html
index 5ab75675..dcb04450 100644
--- a/modules-available/rebootcontrol/templates/task-list.html
+++ b/modules-available/rebootcontrol/templates/task-list.html
@@ -2,6 +2,7 @@
<table class="table">
<thead>
<tr>
+ <th>{{lang_when}}</th>
<th>{{lang_task}}</th>
<th>{{lang_location}}</th>
<th>{{lang_clientCount}}</th>
@@ -12,6 +13,9 @@
{{#list}}
<tr>
<td class="text-nowrap">
+ {{timestamp_s}}
+ </td>
+ <td class="text-nowrap">
<a href="?do=rebootcontrol&amp;show=task&amp;what=task&amp;taskid={{id}}">{{type}}</a>
<div class="small">{{action}}</div>
</td>