refresh cache button plugin : add last cache update date and time on button title
This commit is contained in:
parent
a1f0701630
commit
b1f7854510
5 changed files with 37 additions and 17 deletions
|
|
@ -12,6 +12,11 @@ return [
|
|||
$projects = page('projects')->children();
|
||||
foreach ($projects as $project) {
|
||||
$project->rebuildStepsCache();
|
||||
|
||||
$formatter = new IntlDateFormatter('fr_FR', IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, 'Europe/Paris');
|
||||
$project->update([
|
||||
'lastCacheUpdate' => $formatter->format(time())
|
||||
]);
|
||||
}
|
||||
return [
|
||||
'satus' => 'success',
|
||||
|
|
@ -43,6 +48,12 @@ return [
|
|||
|
||||
$project->rebuildStepsCache();
|
||||
|
||||
$formatter = new IntlDateFormatter('fr_FR', IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, 'Europe/Paris');
|
||||
$project->update([
|
||||
'lastCacheUpdate' => $formatter->format(time())
|
||||
]);
|
||||
|
||||
|
||||
return [
|
||||
'satus' => 'success',
|
||||
'message' => 'Données de la page ' . $data->pageUri . ' rafraîchie avec succès.'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue