Skip to content

Commit 2b7f0d4

Browse files
AlecRust0pc0deFR
andauthored
Display system time on cron pages (hestiacp#4236)
* Display system time on cron pages * Add .u-side-by-side-tablet --------- Co-authored-by: Kevin Falcoz <0pc0defr@gmail.com>
1 parent 742e34f commit 2b7f0d4

File tree

6 files changed

+40
-3
lines changed

6 files changed

+40
-3
lines changed

web/add/cron/index.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@
106106
if (empty($v_min)) {
107107
$v_min = "";
108108
}
109+
110+
// Get current system time
111+
exec(HESTIA_CMD . "v-get-sys-timezone", $output, $return_var);
112+
date_default_timezone_set($output[0]);
113+
$current_timestamp = time();
114+
109115
// Render
110116
render_page($user, $TAB, "add_cron");
111117

web/css/src/utilities.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@
159159
align-items: center !important;
160160
}
161161

162+
.u-side-by-side-tablet {
163+
@media (--viewport-small) {
164+
display: flex !important;
165+
justify-content: space-between !important;
166+
align-items: center !important;
167+
}
168+
}
169+
162170
.u-list-bulleted {
163171
list-style: disc !important;
164172
padding-left: 40px !important;

web/edit/cron/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@
9090
}
9191
}
9292

93+
// Get current system time
94+
exec(HESTIA_CMD . "v-get-sys-timezone", $output, $return_var);
95+
date_default_timezone_set($output[0]);
96+
$current_timestamp = time();
97+
9398
// Render page
9499
render_page($user, $TAB, "edit_cron");
95100

web/templates/pages/add_cron.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@
2222
<input type="hidden" name="ok" value="Add">
2323

2424
<div class="form-container form-container-wide">
25-
<h1 class="u-mb20"><?= _("Add Cron Job") ?></h1>
25+
<div class="u-side-by-side-tablet u-mb20">
26+
<h1><?= _("Add Cron Job") ?></h1>
27+
<p>
28+
<?= _('System time') ?>: <span class="u-text-bold">
29+
<time datetime="<?= date("c", $current_timestamp) ?>">
30+
<?= date("d M Y, H:i", $current_timestamp) ?>
31+
</time>
32+
</span>
33+
</p>
34+
</div>
2635
<?php show_alert_message($_SESSION); ?>
2736
<div class="u-mb20">
2837
<label for="v_cmd" class="form-label"><?= _("Command") ?></label>

web/templates/pages/edit_cron.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@
2222
<input type="hidden" name="save" value="save">
2323

2424
<div class="form-container form-container-wide">
25-
<h1 class="u-mb20"><?= _("Edit Cron Job") ?></h1>
25+
<div class="u-side-by-side-tablet u-mb20">
26+
<h1><?= _("Edit Cron Job") ?></h1>
27+
<p>
28+
<?= _('System time') ?>: <span class="u-text-bold">
29+
<time datetime="<?= date("c", $current_timestamp) ?>">
30+
<?= date("d M Y, H:i", $current_timestamp) ?>
31+
</time>
32+
</span>
33+
</p>
34+
</div>
2635
<?php show_alert_message($_SESSION); ?>
2736
<div class="u-mb20">
2837
<label for="v_cmd" class="form-label"><?= _("Command") ?></label>

web/templates/pages/generate_ssl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</label>
4848
<input type="text" class="form-control" name="v_org" id="v_org" value="<?= htmlentities(trim($v_org, "'")) ?>">
4949
</div>
50-
<div class="u-side-by-side">
50+
<div>
5151
<button type="submit" class="button" name="generate">
5252
<?= _("Generate") ?>
5353
</button>

0 commit comments

Comments
 (0)