mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Merge pull request #7689 from owncloud/last_cron_log
Log last cron execution
This commit is contained in:
commit
5111fad006
6 changed files with 47 additions and 8 deletions
|
|
@ -4,13 +4,6 @@ td.status > span {
|
|||
width: 16px;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
span.success {
|
||||
background: #37ce02;
|
||||
border-radius: 8px;
|
||||
}
|
||||
span.error {
|
||||
background: #ce3702;
|
||||
}
|
||||
|
||||
td.mountPoint, td.backend { width:160px; }
|
||||
td.remove>img { visibility:hidden; padding-top:13px; }
|
||||
|
|
|
|||
|
|
@ -178,6 +178,9 @@ $CONFIG = array(
|
|||
/* Enable or disable the logging of IP addresses in case of webform auth failures */
|
||||
"log_authfailip" => false,
|
||||
|
||||
/* Whether ownCloud should log the last successfull cron exec */
|
||||
"cron_log" => true,
|
||||
|
||||
/* Whether http-basic username must equal username to login */
|
||||
"basic_auth" => true,
|
||||
|
||||
|
|
|
|||
4
cron.php
4
cron.php
|
|
@ -119,6 +119,10 @@ try {
|
|||
|
||||
// done!
|
||||
TemporaryCronClass::$sent = true;
|
||||
// Log the successfull cron exec
|
||||
if (OC_Config::getValue('cron_log', true)) {
|
||||
OC_Appconfig::setValue('core', 'lastcron', time());
|
||||
}
|
||||
exit();
|
||||
|
||||
} catch (Exception $ex) {
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ $tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking());
|
|||
$tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded());
|
||||
$tmpl->assign('old_php', OC_Util::isPHPoutdated());
|
||||
$tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax'));
|
||||
$tmpl->assign('cron_log', OC_Config::getValue('cron_log', true));
|
||||
$tmpl->assign('lastcron', OC_Appconfig::getValue('core', 'lastcron', false));
|
||||
$tmpl->assign('shareAPIEnabled', OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes'));
|
||||
|
||||
// Check if connected using HTTPS
|
||||
|
|
|
|||
|
|
@ -167,6 +167,26 @@ table.shareAPI td { padding-bottom: 0.8em; }
|
|||
width: 40px;
|
||||
}
|
||||
|
||||
.cronlog {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.cronstatus {
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
span.success {
|
||||
background: #37ce02;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
span.error {
|
||||
background: #ce3702;
|
||||
}
|
||||
|
||||
/* HELP */
|
||||
.pressed {background-color:#DDD;}
|
||||
|
||||
|
|
|
|||
|
|
@ -157,7 +157,24 @@ if (!$_['internetconnectionworking']) {
|
|||
;?>
|
||||
|
||||
<fieldset class="personalblock" id="backgroundjobs">
|
||||
<h2><?php p($l->t('Cron'));?></h2>
|
||||
<h2 class="inlineblock"><?php p($l->t('Cron'));?></h2>
|
||||
<?php if ($_['cron_log']): ?>
|
||||
<p class="cronlog inlineblock">
|
||||
<?php if ($_['lastcron'] !== false):
|
||||
$human_time = OC_Util::formatDate($_['lastcron']) . " UTC";
|
||||
if (time() - $_['lastcron'] <= 3600): ?>
|
||||
<span class="cronstatus success"></span>
|
||||
<?php p($l->t("Last cron was executed at %s.", array($human_time)));
|
||||
else: ?>
|
||||
<span class="cronstatus error"></span>
|
||||
<?php p($l->t("Last cron was executed at %s. This is more than an hour ago, something seems wrong.", array($human_time)));
|
||||
endif;
|
||||
else: ?>
|
||||
<span class="cronstatus error"></span>
|
||||
<?php p($l->t("Cron was not executed yet!"));
|
||||
endif; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<p>
|
||||
<input type="radio" name="mode" value="ajax"
|
||||
id="backgroundjobs_ajax" <?php if ($_['backgroundjobs_mode'] === "ajax") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue