system cache clear button
This commit is contained in:
parent
faac4e59bd
commit
afc1b6e2da
11
sai/modules/saimod_sys_cache/js/saimod_sys_cache.js
Normal file
11
sai/modules/saimod_sys_cache/js/saimod_sys_cache.js
Normal file
@ -0,0 +1,11 @@
|
||||
function init_saimod_sys_cache(){
|
||||
$('#btn_cache_clear').click(function() {
|
||||
$.ajax({ url: './sai.php',
|
||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_cache',
|
||||
action: 'clear'},
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
system.load('cache',true);}
|
||||
});
|
||||
});
|
||||
}
|
||||
11
sai/modules/saimod_sys_cache/qq/SYS_SAIMOD_CACHE_CLEAR.php
Normal file
11
sai/modules/saimod_sys_cache/qq/SYS_SAIMOD_CACHE_CLEAR.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace SYSTEM\SQL;
|
||||
class SYS_SAIMOD_CACHE_CLEAR extends \SYSTEM\DB\QQ {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function pgsql(){return
|
||||
'DELETE FROM system.cache;';
|
||||
}
|
||||
public static function mysql(){return
|
||||
'DELETE FROM system_cache;';
|
||||
}
|
||||
}
|
||||
@ -9,9 +9,13 @@ class saimod_sys_cache extends \SYSTEM\SAI\SaiModule {
|
||||
while($r = $res->next()){
|
||||
$r['class'] = self::tablerow_class($r['cache']);
|
||||
$vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_cache/tpl/saimod_sys_cache_entry.tpl'))->SERVERPATH(), $r);}
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_CACHE));
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl'))->SERVERPATH(), $vars);
|
||||
}
|
||||
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_cache_action_clear(){
|
||||
return \SYSTEM\SQL\SYS_SAIMOD_CACHE_CLEAR::QI() ? \SYSTEM\LOG\JsonResult::ok() : \SYSTEM\LOG\JsonResult::fail();}
|
||||
|
||||
private static function tablerow_class($cacheID){
|
||||
if($cacheID == 1){
|
||||
return 'info';}
|
||||
@ -22,5 +26,6 @@ class saimod_sys_cache extends \SYSTEM\SAI\SaiModule {
|
||||
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
|
||||
|
||||
//public static function css(){}
|
||||
//public static function js(){}
|
||||
public static function js(){
|
||||
return array(new \SYSTEM\PSAI('modules/saimod_sys_cache/js/saimod_sys_cache.js'));}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
<h4>System Cache</h4><hr>
|
||||
Entries: ${count} showing 100
|
||||
<button type="button" class="btn-sm btn btn-warning pull-right" id="btn_cache_clear"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> ${basic_clear}</button>
|
||||
<table class="sai_table table table-hover table-condensed" style="overflow: auto;">
|
||||
<tr>
|
||||
<th>Cache</th>
|
||||
|
||||
@ -141,7 +141,7 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (830, 42, 3, 800, 'tab', 'name', 'STRING');
|
||||
|
||||
|
||||
-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (900, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_cache', 'action', NULL);
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (900, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_cache', 'action', NULL);
|
||||
|
||||
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1000, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_todo', 'action', NULL);
|
||||
|
||||
@ -635,6 +635,13 @@
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_add_right', 'basic');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_add_right', 'sai_security');
|
||||
|
||||
DELETE FROM `system_text` WHERE id = 'basic_clear';
|
||||
DELETE FROM `system_text_tag` WHERE id = 'basic_clear';
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_clear', 'deDE', 'Leeren', 1, 1, '2015-04-16 23:11:18', '2015-04-16 16:48:36');
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_clear', 'enUS', 'Clear', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_clear', 'basic');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_clear', 'sai_cache');
|
||||
|
||||
-- SAI
|
||||
DELETE FROM `system_text` WHERE id = 'sai_api_title';
|
||||
DELETE FROM `system_text_tag` WHERE id = 'sai_api_title';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user