Skip to content
Snippets Groups Projects
Commit 1d479d1b authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

- new timer ... starts counting on last refresh

parent d864f2f0
Branches
No related tags found
No related merge requests found
......@@ -119,7 +119,7 @@ class cronlogrenderer extends cronlog{
. $this->_renderAccessAndAge($iLast)
. 'gesamt: <strong>' . count($aData).'</strong>'
. ($iErrors ? ' (Fehler: <strong>' . $iErrors.'</strong>... OK: <strong>' . $iOK.'</strong>)' : '')
. '<br><br>'
. '<br>'
. '</div>'
. '<table id="'.$sIdTable.'">'
. '<thead><tr>'.$sTblHead.'</tr></thead>'
......@@ -229,7 +229,7 @@ class cronlogrenderer extends cronlog{
// init datatable
. '<script>'
. '$(document).ready( function () {$(\'#'.$sIdTable.'\').DataTable({"retrieve": true, "aaSorting":[[0,"desc"]],"aaSorting":[[0,"desc"]], "aLengthMenu":[[10,25,100,-1],[10,25,100,"---"]]});} );'
. '$(document).ready( function () {$(\'#'.$sIdTable.'\').DataTable({"retrieve": true, "aaSorting":[[0,"desc"]],"aaSorting":[[0,"desc"]], "aLengthMenu":[[25,100,-1],[25,100,"---"]]});} );'
. '</script>'
. '
......@@ -322,7 +322,7 @@ class cronlogrenderer extends cronlog{
<h3>Graph mit Timeline</h3>
<p class="hint">
Aus der History der letzten 6 Tage werden die Ceonjobs mit mehr als '.$this->_iMinTime4Timeline.' Sekunden Laufzeit dargestellt.<br>
Aus der History der letzten 6 Tage werden die Cronjobs mit mehr als '.$this->_iMinTime4Timeline.' Sekunden Laufzeit dargestellt.<br>
So kann man ggf. Konflikte und Ungereimtheiten finden.<br>
Innerhalb der Timeline kann man mit dem Mausrad den Zoom ver&auml;ndern.
</p>
......
......@@ -20,7 +20,7 @@ class cronlog {
protected $_sFileFilter_serverlog = '*.log';
protected $_aSkipJoblogs = array(
'dok-kvm-instances',
// 'dok-kvm-instances',
'sync-log-2-lithium',
);
......
......@@ -26,7 +26,7 @@
<div id="content">
<h2 id="lblServername">Server w&auml;hlen...</h2>
<span id="counter" style="float: right;"></span>
<nav class="tabs">
<a href="#cronlogs" onclick="setTab(this); return false;" class="active"><i class="far fa-file-alt"></i> Logs</a>
<a href="#cronhistory" onclick="setTab(this); return false;"><i class="fas fa-history"></i> History</a>
......@@ -39,13 +39,13 @@
-->
<div id="tabcontent">
<div id="cronlogs" class="active">Moment ...</div>
<div id="cronhistory">Moment ...</div>
<div id="graph">Moment ...</div>
<div id="cronlogs" class="active"><br>Moment ...</div>
<div id="cronhistory"><br>Moment ...</div>
<div id="graph"><br>Moment ...</div>
</div>
</div>
<div id="overlay" ondblclick="closeOverlay();">
<div id="showlog" class="active">Moment ...</div>
<div id="showlog" class="active"><br>Moment ...</div>
</div>
</body></html>
\ No newline at end of file
......@@ -3,6 +3,9 @@ var sSELECTEDSERVER = '';
var sACTIVESERVERTAB = 'cronlogs';
var bSETADDRESSBAR = false;
var iRefreshTime = 60;
var iRefreshCounter = 0;
var bDEBUG=0;
/**
......@@ -49,6 +52,7 @@ function getPageItem(id, sMoreData, bNoAdressbarUpdate) {
sData = 'item=' + id + '&server=' + sSELECTEDSERVER + (sMoreData ? '&'+sMoreData : '');
if(!bNoAdressbarUpdate){
setAdressbar();
iRefreshCounter=0;
}
jQuery.ajax({
url: phpscript,
......@@ -68,6 +72,14 @@ function getPageItem(id, sMoreData, bNoAdressbarUpdate) {
});
}
function refreshTimer() {
$('#counter').html('Refresh in '+(iRefreshTime-iRefreshCounter)+' sec'+'<div style="width:'+(100 - (iRefreshCounter/iRefreshTime*100))+'%;">&nbsp;</div>');
iRefreshCounter++;
if(iRefreshCounter>iRefreshTime){
refreshPage();
}
}
/**
* refresh content with ajax requests
* @returns {undefined}
......@@ -75,6 +87,7 @@ function getPageItem(id, sMoreData, bNoAdressbarUpdate) {
function refreshPage() {
getPageItem('selectserver');
getPageItem(sACTIVESERVERTAB);
iRefreshCounter=0;
}
/**
......@@ -197,7 +210,7 @@ $(document).ready(function () {
window.setTimeout("updateFilterFields('" + q + "');", 500);
}
bSETADDRESSBAR = true;
window.setInterval('refreshPage()', 60000);
window.setInterval('refreshTimer()', 1000);
});
/*
......
......@@ -15,8 +15,13 @@ button:active{box-shadow: none; }
footer{background: rgba(0,60,60,0.05); border-top: 1px solid #ccc; padding: 1em; margin-top: 5em;}
footer a{color:#678;}
h1{border-bottom: 0px solid ;}
h1{border-bottom: 1px solid #cde;}
h1 a{color: #38a;}
h1 a:hover{text-decoration: none;}
h2{color:#379;}
h2 i{color:#abc; font-size: 140%;}
h3{color: #39b;}
h3:before{content: ':: '}
i.fa{font-size: 150%; }
i.fa.lookup{font-size: 100%; opacity: 0.4;}
......@@ -24,15 +29,18 @@ nav.servers{float: left; margin-right: 1em;}
nav.tabs{}
nav.tabs a{display: block; float: left; background: rgba(0,60,60,0.05); padding: 0.5em 1em; color:#345; text-decoration: none; margin-right: 2px; border-top: 4px solid rgba(0,0,0,0.01);}
nav.tabs a.active{background: #cdd; border-color: rgb(255,0,51);; }
nav.tabs a.active{background: #d0e0e0; border-color: rgb(255,0,51); }
nav.tabs a:hover{border-color: #abc;}
input{border: 1px solid #ddd; padding: 0.3em;}
option{font-family: verdana,arial; font-size:1.0em; }
option:hover{background: #eee;}
select{border: 0;}
p.hint{margin-bottom: 1em; background:#fec; padding: 1em; }
p.hint{margin-bottom: 1em; background:#fed; padding: 1em; }
table{border: 1px solid #ccc;}
tr:hover{background:#eee;}
th{background:#cdd; padding:0.5em;}
th{background:#eee; padding:0.5em;}
td{padding:0.3em;}
.imllogo:before {background: rgb(255,0,51);color: #fff;padding: 0.5em 0.3em;content: 'IML'; font-family: "arial"; text-shadow: none;}
......@@ -49,11 +57,13 @@ td{padding:0.3em;}
.log-value{color:#008;}
pre div:hover{background:rgba(0,0,0,0.1);}
#counter{color:#cde;}
#counter div{background:#bcd; height: 2px; }
/* ----- override datatable defaukts */
.dataTables_wrapper{clear: none;float: left; margin: auto 1px;}
table.dataTable tbody tr{background: none;}
table.dataTable{margin: 0; width: auto;}
table.dataTable tbody td{padding: 3px;}
table.dataTable{margin: 0; width: auto; }
table.dataTable tbody td{padding: 3px;padding: 1px;}
.message{border: 1px solid rgba(0,0,0,0.1); padding: 1em; float: right;}
table.dataTable tbody tr.message-ok, .message-ok{background:#cfc; color:#080 !important;}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment