mirror of
https://github.com/danielbrendel/hortusfox-web.git
synced 2026-05-03 20:29:59 -05:00
Resolves #402
This commit is contained in:
@@ -152,6 +152,7 @@ return [
|
||||
array('/admin/api/add', 'ANY', 'admin@add_api_key'),
|
||||
array('/admin/api/{token}/remove', 'ANY', 'admin@remove_api_key'),
|
||||
array('/admin/api/{id}/toggle', 'ANY', 'admin@toggle_api_key'),
|
||||
array('/admin/cache/clear', 'ANY', 'admin@clear_cache'),
|
||||
|
||||
/** Cronjob Controller */
|
||||
array('/cronjob/tasks/overdue', 'GET', 'cronjobs@overdue_tasks'),
|
||||
|
||||
@@ -964,4 +964,24 @@ class AdminController extends BaseController {
|
||||
return back();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles URL: /admin/cache/clear
|
||||
*
|
||||
* @param Asatru\Controller\ControllerArg $request
|
||||
* @return Asatru\View\JsonHandler
|
||||
*/
|
||||
public function clear_cache($request)
|
||||
{
|
||||
try {
|
||||
CacheModel::clear();
|
||||
|
||||
return json(['code' => 200]);
|
||||
} catch (\Exception $e) {
|
||||
return json([
|
||||
'code' => 500,
|
||||
'msg' => $e->getMessage()
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -483,5 +483,6 @@ return [
|
||||
'hardy' => 'Hårdfør',
|
||||
'sorting_type_hardy' => 'Hårdfør',
|
||||
'confirm_set_gallery_photo_as_main' => 'Vil du erstatte hovedbilledet med dette?',
|
||||
'enable_quick_add' => 'Aktiver Quick-Add-widget'
|
||||
'enable_quick_add' => 'Aktiver Quick-Add-widget',
|
||||
'clear_cache' => 'Ryd cache'
|
||||
];
|
||||
+2
-1
@@ -483,5 +483,6 @@ return [
|
||||
'hardy' => 'Winterhart',
|
||||
'sorting_type_hardy' => 'Winterhart',
|
||||
'confirm_set_gallery_photo_as_main' => 'Soll das Hauptfoto mit diesem hier ersetzt werden?',
|
||||
'enable_quick_add' => 'Quick-Add-Widget aktivieren'
|
||||
'enable_quick_add' => 'Quick-Add-Widget aktivieren',
|
||||
'clear_cache' => 'Cache leeren'
|
||||
];
|
||||
+2
-1
@@ -483,5 +483,6 @@ return [
|
||||
'hardy' => 'Hardy',
|
||||
'sorting_type_hardy' => 'Hardy',
|
||||
'confirm_set_gallery_photo_as_main' => 'Do you want to replace the main photo with this one?',
|
||||
'enable_quick_add' => 'Enable Quick-Add widget'
|
||||
'enable_quick_add' => 'Enable Quick-Add widget',
|
||||
'clear_cache' => 'Clear cache'
|
||||
];
|
||||
+2
-1
@@ -483,5 +483,6 @@ return [
|
||||
'hardy' => 'Resistente al frío',
|
||||
'sorting_type_hardy' => 'Resistente al frío',
|
||||
'confirm_set_gallery_photo_as_main' => '¿Quieres reemplazar la foto principal con esta?',
|
||||
'enable_quick_add' => 'Activar el widget de adición rápida'
|
||||
'enable_quick_add' => 'Activar el widget de adición rápida',
|
||||
'clear_cache' => 'Borrar caché'
|
||||
];
|
||||
|
||||
+2
-1
@@ -483,5 +483,6 @@ return [
|
||||
'hardy' => 'Résistante au froid',
|
||||
'sorting_type_hardy' => 'Résistante au froid',
|
||||
'confirm_set_gallery_photo_as_main' => 'Voulez-vous remplacer la photo principale par celle-ci?',
|
||||
'enable_quick_add' => 'Activer le widget d’ajout rapide'
|
||||
'enable_quick_add' => 'Activer le widget d’ajout rapide',
|
||||
'clear_cache' => 'Vider le cache'
|
||||
];
|
||||
+2
-1
@@ -483,5 +483,6 @@ return [
|
||||
'hardy' => 'Winterhard',
|
||||
'sorting_type_hardy' => 'Winterhard',
|
||||
'confirm_set_gallery_photo_as_main' => 'Wil je de hoofdafbeelding vervangen door deze?',
|
||||
'enable_quick_add' => 'Quick-Add-widget inschakelen'
|
||||
'enable_quick_add' => 'Quick-Add-widget inschakelen',
|
||||
'clear_cache' => 'Cache wissen'
|
||||
];
|
||||
+2
-1
@@ -483,5 +483,6 @@ return [
|
||||
'hardy' => 'Hardfør',
|
||||
'sorting_type_hardy' => 'Hardfør',
|
||||
'confirm_set_gallery_photo_as_main' => 'Vil du bytte ut hovedbildet med dette?',
|
||||
'enable_quick_add' => 'Aktiver Quick-Add-modulen'
|
||||
'enable_quick_add' => 'Aktiver Quick-Add-modulen',
|
||||
'clear_cache' => 'Tøm cache'
|
||||
];
|
||||
+2
-1
@@ -483,5 +483,6 @@ return [
|
||||
'hardy' => 'Mrozoodporna',
|
||||
'sorting_type_hardy' => 'Mrozoodporna',
|
||||
'confirm_set_gallery_photo_as_main' => 'Czy chcesz zastąpić główne zdjęcie tym?',
|
||||
'enable_quick_add' => 'Włącz widżet szybkiego dodawania'
|
||||
'enable_quick_add' => 'Włącz widżet szybkiego dodawania',
|
||||
'clear_cache' => 'Wyczyść pamięć podręczną'
|
||||
];
|
||||
@@ -483,5 +483,6 @@ return [
|
||||
'hardy' => 'Resistente ao frio',
|
||||
'sorting_type_hardy' => 'Resistente ao frio',
|
||||
'confirm_set_gallery_photo_as_main' => 'Você quer substituir a foto principal por esta?',
|
||||
'enable_quick_add' => 'Ativar o widget de adição rápida'
|
||||
'enable_quick_add' => 'Ativar o widget de adição rápida',
|
||||
'clear_cache' => 'Limpar cache'
|
||||
];
|
||||
+2
-1
@@ -483,5 +483,6 @@ return [
|
||||
'hardy' => 'Морозоустойчивость',
|
||||
'sorting_type_hardy' => 'Морозоустойчивость',
|
||||
'confirm_set_gallery_photo_as_main' => 'Вы хотите заменить главное фото на это?',
|
||||
'enable_quick_add' => 'Включить виджет быстрого добавления'
|
||||
'enable_quick_add' => 'Включить виджет быстрого добавления',
|
||||
'clear_cache' => 'Очистить кэш'
|
||||
];
|
||||
|
||||
@@ -1926,6 +1926,17 @@ window.vue = new Vue({
|
||||
}
|
||||
},
|
||||
|
||||
clearCache: function(button) {
|
||||
window.vue.ajaxRequest('post', window.location.origin + '/admin/cache/clear', {}, function(response) {
|
||||
if (response.code == 200) {
|
||||
button.innerHTML = '<i class="fas fa-check"></i> ' + button.innerHTML;
|
||||
button.setAttribute('disabled', 'disabled');
|
||||
} else {
|
||||
alert(response.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
scrollTo: function(target) {
|
||||
let elem = document.querySelector(target);
|
||||
if (elem) {
|
||||
|
||||
@@ -3488,6 +3488,16 @@ fieldset .field {
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.admin-action-clear-cache {
|
||||
position: relative;
|
||||
margin-top: 35px;
|
||||
}
|
||||
|
||||
.admin-action-clear-cache svg {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.version-check {
|
||||
position: relative;
|
||||
margin-top: 30px;
|
||||
|
||||
@@ -1028,6 +1028,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin-action-clear-cache">
|
||||
<a class="button is-warning" href="javascript:void(0);" onclick="window.vue.clearCache(this);">{{ __('app.clear_cache') }}</a>
|
||||
</div>
|
||||
|
||||
<?php if ((!empty($new_version)) && (!empty($current_version))) { ?>
|
||||
<div class="version-info">
|
||||
<?php if ($new_version > $current_version) { ?>
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user