Просмотр исходного кода

Display system time on cron pages (#4236)

* Display system time on cron pages

* Add .u-side-by-side-tablet

---------

Co-authored-by: Kevin Falcoz <0pc0defr@gmail.com>
Alec Rust 2 лет назад
Родитель
Сommit
2b7f0d451d

+ 6 - 0
web/add/cron/index.php

@@ -106,6 +106,12 @@ if (empty($v_hour)) {
 if (empty($v_min)) {
 	$v_min = "";
 }
+
+// Get current system time
+exec(HESTIA_CMD . "v-get-sys-timezone", $output, $return_var);
+date_default_timezone_set($output[0]);
+$current_timestamp = time();
+
 // Render
 render_page($user, $TAB, "add_cron");
 

+ 8 - 0
web/css/src/utilities.css

@@ -159,6 +159,14 @@
 	align-items: center !important;
 }
 
+.u-side-by-side-tablet {
+	@media (--viewport-small) {
+		display: flex !important;
+		justify-content: space-between !important;
+		align-items: center !important;
+	}
+}
+
 .u-list-bulleted {
 	list-style: disc !important;
 	padding-left: 40px !important;

+ 5 - 0
web/edit/cron/index.php

@@ -90,6 +90,11 @@ if (!empty($_POST["save"])) {
 	}
 }
 
+// Get current system time
+exec(HESTIA_CMD . "v-get-sys-timezone", $output, $return_var);
+date_default_timezone_set($output[0]);
+$current_timestamp = time();
+
 // Render page
 render_page($user, $TAB, "edit_cron");
 

+ 10 - 1
web/templates/pages/add_cron.php

@@ -22,7 +22,16 @@
 		<input type="hidden" name="ok" value="Add">
 
 		<div class="form-container form-container-wide">
-			<h1 class="u-mb20"><?= _("Add Cron Job") ?></h1>
+			<div class="u-side-by-side-tablet u-mb20">
+				<h1><?= _("Add Cron Job") ?></h1>
+				<p>
+					<?= _('System time') ?>: <span class="u-text-bold">
+						<time datetime="<?= date("c", $current_timestamp) ?>">
+							<?= date("d M Y, H:i", $current_timestamp) ?>
+						</time>
+					</span>
+				</p>
+			</div>
 			<?php show_alert_message($_SESSION); ?>
 			<div class="u-mb20">
 				<label for="v_cmd" class="form-label"><?= _("Command") ?></label>

+ 10 - 1
web/templates/pages/edit_cron.php

@@ -22,7 +22,16 @@
 		<input type="hidden" name="save" value="save">
 
 		<div class="form-container form-container-wide">
-			<h1 class="u-mb20"><?= _("Edit Cron Job") ?></h1>
+			<div class="u-side-by-side-tablet u-mb20">
+				<h1><?= _("Edit Cron Job") ?></h1>
+				<p>
+					<?= _('System time') ?>: <span class="u-text-bold">
+						<time datetime="<?= date("c", $current_timestamp) ?>">
+							<?= date("d M Y, H:i", $current_timestamp) ?>
+						</time>
+					</span>
+				</p>
+			</div>
 			<?php show_alert_message($_SESSION); ?>
 			<div class="u-mb20">
 				<label for="v_cmd" class="form-label"><?= _("Command") ?></label>

+ 1 - 1
web/templates/pages/generate_ssl.php

@@ -47,7 +47,7 @@
 				</label>
 				<input type="text" class="form-control" name="v_org" id="v_org" value="<?= htmlentities(trim($v_org, "'")) ?>">
 			</div>
-			<div class="u-side-by-side">
+			<div>
 				<button type="submit" class="button" name="generate">
 					<?= _("Generate") ?>
 				</button>