function tableau() { $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $items = $tpl->_ENGINE_parse_body("{items}"); $size = $tpl->_ENGINE_parse_body("{size}"); $SaveToDisk = $tpl->_ENGINE_parse_body("{SaveToDisk}"); $addCat = $tpl->_ENGINE_parse_body("{add} {category}"); $date = $tpl->_ENGINE_parse_body("{zDate}"); $task = $tpl->_ENGINE_parse_body("{task}"); $new_schedule = $tpl->_ENGINE_parse_body("{new_rotate}"); $explain = $tpl->_ENGINE_parse_body("{explain_squid_tasks}"); $run = $tpl->_ENGINE_parse_body("{run}"); $task = $tpl->_ENGINE_parse_body("{task}"); $sizeT = $tpl->_ENGINE_parse_body("{size}"); $filename = $tpl->_ENGINE_parse_body("{filename}"); $empty = $tpl->_ENGINE_parse_body("{empty}"); $askdelete = $tpl->javascript_parse_text("{empty_store} ?"); $zdate = $tpl->javascript_parse_text("{date}"); $action = $tpl->javascript_parse_text("{action}"); $q = new mysql_storelogs(); $files = $q->COUNT_ROWS("accesslogs"); $size = $q->TABLE_SIZE("access_store"); $title = $tpl->_ENGINE_parse_body("MySQL: {storage} {files}:" . FormatNumberX($files, 0) . " (" . FormatBytes($size / 1024) . ")"); $t = time(); $html = "\n\t\n\t<table class='{$t}' style='display: none' id='{$t}' style='width:99%'></table>\n\t<script>\n\tvar rowSquidTask='';\n\t\$(document).ready(function(){\n\t\$('#{$t}').flexigrid({\n\turl: '{$page}?search-store=yes&minisize={$_GET["minisize"]}&t={$t}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$zdate}', name : 'filetime', width : 158, sortable : true, align: 'left'},\n\t{display: '{$filename}', name : 'filename', width : 378, sortable : true, align: 'left'},\n\t{display: '{$sizeT}', name : 'filesize', width : 95, sortable : true, align: 'left'},\n\t{display: '{$task}', name : 'taskid', width : 40, sortable : true, align: 'center'},\n\t{display: '{$action}', name : 'action', width : 40, sortable : false, align: 'center'},\n\t{display: ' ', name : 'delete', width : 32, sortable : false, align: 'center'}\n\t],\n\n\tsearchitems : [\n\t{display: '{$filename}', name : 'filename'},\n\t{display: '{$task}', name : 'taskid'},\n\t],\n\tsortname: 'filetime',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<strong>{$title}</strong>',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: 835,\n\theight: 400,\n\tsingleSelect: true\n\t\n\t});\n\t});\n\t\n\t\n\t\n\tfunction EmptyStorage(){\n\tif(confirm('{$askdelete}')){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('DELETE-STORE','yes');\n\tXHR.sendAndLoad('logrotate.php', 'POST',x_EmptyStorage);\n\t}\n\t}\n\t\n\tfunction SquidCrontaskUpdateTable(){\n\t\$('#{$t}').flexReload();\n\t}\n\t\n\tvar x_RotateTaskEnable=function (obj) {\n\tvar ID='{$_GET["ID"]}';\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t}\n\t\n\tvar x_EmptyStorage=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);}\n\t\$('#{$t}').flexReload();\n\t}\n\t\n\t\n\t\n\tfunction DisableSquidDefaultScheduleCheck(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('DisableSquidDefaultSchedule').checked){XHR.appendData('DisableSquidDefaultSchedule',1);}\n\telse{XHR.appendData('DisableSquidDefaultSchedule',0);}\n\tXHR.sendAndLoad('{$page}', 'POST',x_DisableSquidDefaultScheduleCheck);\n\t}\n\t\n\t\n\t\n\t\n\tvar x_StorageTaskDelete=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);return;}\n\t\$('#row'+rowSquidTask).remove();\n\t}\n\t\n\tfunction StorageTaskDelete(filename,md5){\n\trowSquidTask=md5;\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('filename',filename);\n\tXHR.appendData('storage-delete','yes');\n\tXHR.sendAndLoad('logrotate.php', 'POST',x_StorageTaskDelete);\n\t}\n\t\n\t\n\t\n\t</script>"; echo $html; }
function storage() { $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $EnableSyslogDB = $sock->GET_INFO("EnableSyslogDB"); if (!is_numeric($EnableSyslogDB)) { $EnableSyslogDB = 0; } $items = $tpl->_ENGINE_parse_body("{items}"); $size = $tpl->_ENGINE_parse_body("{size}"); $SaveToDisk = $tpl->_ENGINE_parse_body("{SaveToDisk}"); $addCat = $tpl->_ENGINE_parse_body("{add} {category}"); $date = $tpl->_ENGINE_parse_body("{zDate}"); $task = $tpl->_ENGINE_parse_body("{task}"); $new_schedule = $tpl->_ENGINE_parse_body("{new_rotate}"); $explain = $tpl->_ENGINE_parse_body("{explain_squid_tasks}"); $run = $tpl->_ENGINE_parse_body("{run}"); $task = $tpl->_ENGINE_parse_body("{task}"); $sizeT = $tpl->_ENGINE_parse_body("{size}"); $filename = $tpl->_ENGINE_parse_body("{filename}"); $empty = $tpl->_ENGINE_parse_body("{empty}"); $askdelete = $tpl->javascript_parse_text("{empty_store} ?"); $zdate = $tpl->javascript_parse_text("{date}"); $action = $tpl->javascript_parse_text("{action}"); $hostname = $tpl->javascript_parse_text("{hostname}"); $parameters = $tpl->javascript_parse_text("{service_parameters}"); $use_remote_nas = $tpl->javascript_parse_text("{parameters}"); $purge_to_nas = $tpl->javascript_parse_text("{purge_to_nas}"); $q = new mysql_storelogs(); $files = $q->COUNT_ROWS("files_info"); $size = $q->TABLE_SIZE("files_store"); $title = $tpl->_ENGINE_parse_body("{files}:" . FormatNumberX($files, 0) . " (" . FormatBytes($size / 1024) . ")"); $t = time(); if ($q->MySQLSyslogType == 3) { $error = $tpl->_ENGINE_parse_body("<div class=text-info style='font-size:16px'>{syslog_used_nas_storage}</div>"); } $html = "\n\t{$error}\n\t<table class='{$t}' style='display: none' id='{$t}' style='width:99%'></table>\n\t\n<script>\nvar rowSquidTask='';\n\$(document).ready(function(){\n\$('#{$t}').flexigrid({\n\turl: '{$page}?search-store=yes&minisize={$_GET["minisize"]}&t={$t}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$zdate}', name : 'filetime', width : 158, sortable : true, align: 'left'},\n\t\t{display: '{$hostname}', name : 'hostname', width : 336, sortable : true, align: 'left'},\n\t\t{display: '{$filename}', name : 'filename', width : 336, sortable : true, align: 'left'},\n\t\t{display: '{$sizeT}', name : 'filesize', width : 95, sortable : true, align: 'left'},\n\t\t{display: '{$task}', name : 'taskid', width : 40, sortable : true, align: 'center'},\n\t\t{display: '{$action}', name : 'action', width : 40, sortable : false, align: 'center'},\n\t\t{display: ' ', name : 'delete', width : 32, sortable : false, align: 'center'}\n\t],\nbuttons : [\n\t\n\t{name: '{$empty}', bclass: 'Delz', onpress : EmptyStorage},\n\t{name: '{$parameters}', bclass: 'Settings', onpress : Parameters{$t}},\n\t{name: '{$use_remote_nas}', bclass: 'shared', onpress : Nas{$t}},\n\t{name: '{$purge_to_nas}', bclass: 'backup', onpress : backup{$t}},\n\t\n\t\n\t\n\t\n\t\t],\t\n\tsearchitems : [\n\t\t{display: '{$filename}', name : 'filename'},\n\t\t{display: '{$task}', name : 'taskid'},\n\t\t],\n\tsortname: 'filetime',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<strong>{$title}</strong>',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 400,\n\tsingleSelect: true\n\t\n\t}); \n});\t\n\nfunction Parameters{$t}(){\n\tLoadjs('MySQLSyslog.wizard.php');\n\t}\n\t\nfunction Nas{$t}(){\n\tLoadjs('{$page}?remote-nas-js=yes');\n}\n\nfunction backup{$t}(){\nLoadjs('{$page}?purge-nas-js=yes');\n}\n\t\n\tfunction EmptyStorage(){\n\t\tif(confirm('{$askdelete}')){\n\t \t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('DELETE-STORE','yes');\n\t \t\tXHR.sendAndLoad('{$page}', 'POST',x_EmptyStorage);\t\t\n\t\t}\n\t}\n\t\n\tfunction SquidCrontaskUpdateTable(){\n\t\t\$('#{$t}').flexReload();\n\t }\n\t\n\tvar x_RotateTaskEnable=function (obj) {\n\t\tvar ID='{$_GET["ID"]}';\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);}\t\t\n\t}\n\n\tvar x_EmptyStorage=function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);}\n\t\t\$('#{$t}').flexReload();\t\t\n\t}\t\t\n\n\n\n\tfunction DisableSquidDefaultScheduleCheck(){\n\t \tvar XHR = new XHRConnection();\n\t \tif(document.getElementById('DisableSquidDefaultSchedule').checked){XHR.appendData('DisableSquidDefaultSchedule',1);}\n\t \telse{XHR.appendData('DisableSquidDefaultSchedule',0);}\n\t \tXHR.sendAndLoad('{$page}', 'POST',x_DisableSquidDefaultScheduleCheck);\t\n\t}\n\t\n\n\t\n\t\n\tvar x_StorageTaskDelete=function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);return;}\n\t\t\$('#row'+rowSquidTask).remove();\n\t}\t\n\t\n\tfunction StorageTaskDelete(filename,md5){\n\t\trowSquidTask=md5;\n\t \tvar XHR = new XHRConnection();\n\t\tXHR.appendData('filename',filename);\n\t \tXHR.appendData('storage-delete','yes');\n\t \tXHR.sendAndLoad('{$page}', 'POST',x_StorageTaskDelete);\t\n\t}\n\t\n\t\n\t\n</script>"; echo $html; }
function tableau(){ $page=CurrentPageName(); $tpl=new templates(); $sock=new sockets(); $items=$tpl->_ENGINE_parse_body("{items}"); $size=$tpl->_ENGINE_parse_body("{size}"); $SaveToDisk=$tpl->_ENGINE_parse_body("{SaveToDisk}"); $addCat=$tpl->_ENGINE_parse_body("{add} {category}"); $date=$tpl->_ENGINE_parse_body("{zDate}"); $task=$tpl->_ENGINE_parse_body("{task}"); $new_schedule=$tpl->_ENGINE_parse_body("{new_rotate}"); $explain=$tpl->_ENGINE_parse_body("{explain_squid_tasks}"); $run=$tpl->_ENGINE_parse_body("{run}"); $task=$tpl->_ENGINE_parse_body("{task}"); $sizeT=$tpl->_ENGINE_parse_body("{size}"); $filename=$tpl->_ENGINE_parse_body("{filename}"); $empty=$tpl->_ENGINE_parse_body("{empty}"); $askdelete=$tpl->javascript_parse_text("{empty_store} ?"); $zdate=$tpl->javascript_parse_text("{date}"); $action=$tpl->javascript_parse_text("{action}"); $q=new mysql_storelogs(); $files=$q->COUNT_ROWS("accesslogs"); $size=$q->TABLE_SIZE("access_store"); $title=$tpl->_ENGINE_parse_body("MySQL: {storage} {files}:".FormatNumberX($files,0)." (".FormatBytes($size/1024).")"); $t=time(); $html=" <table class='$t' style='display: none' id='$t' style='width:99%'></table> <script> var rowSquidTask=''; $(document).ready(function(){ $('#$t').flexigrid({ url: '$page?search-store=yes&minisize={$_GET["minisize"]}&t=$t', dataType: 'json', colModel : [ {display: '$zdate', name : 'filetime', width : 197, sortable : true, align: 'left'}, {display: '$filename', name : 'filename', width : 378, sortable : true, align: 'left'}, {display: '$sizeT', name : 'filesize', width : 95, sortable : true, align: 'left'}, {display: ' ', name : 'delete', width : 32, sortable : false, align: 'center'} ], searchitems : [ {display: '$filename', name : 'filename'}, {display: '$task', name : 'taskid'}, ], sortname: 'filetime', sortorder: 'desc', usepager: true, title: '<strong>$title</strong>', useRp: true, rp: 15, showTableToggleBtn: false, width: '99%', height: 400, singleSelect: true }); }); function EmptyStorage(){ if(confirm('$askdelete')){ var XHR = new XHRConnection(); XHR.appendData('DELETE-STORE','yes'); XHR.sendAndLoad('logrotate.php', 'POST',x_EmptyStorage); } } function SquidCrontaskUpdateTable(){ $('#$t').flexReload(); } var x_RotateTaskEnable=function (obj) { var ID='{$_GET["ID"]}'; var results=obj.responseText; if(results.length>0){alert(results);} } var x_EmptyStorage=function (obj) { var results=obj.responseText; if(results.length>0){alert(results);} $('#$t').flexReload(); } function DisableSquidDefaultScheduleCheck(){ var XHR = new XHRConnection(); if(document.getElementById('DisableSquidDefaultSchedule').checked){XHR.appendData('DisableSquidDefaultSchedule',1);} else{XHR.appendData('DisableSquidDefaultSchedule',0);} XHR.sendAndLoad('$page', 'POST',x_DisableSquidDefaultScheduleCheck); } var x_StorageTaskDelete$t=function (obj) { var results=obj.responseText; if(results.length>0){alert(results);return;} $('#row'+rowSquidTask).remove(); } function StorageTaskDelete$t(ID,md5){ rowSquidTask=md5; if(!confirm('Remove source logs '+ID+' ?')){return;} var XHR = new XHRConnection(); XHR.appendData('storage-delete',ID); XHR.sendAndLoad('$page', 'POST',x_StorageTaskDelete$t); } </script>"; echo $html; }