diff --git a/classes/cronlog-renderer.class.php b/classes/cronlog-renderer.class.php index 6ae8eae88be6809d65f121187f770dfa27e5a641..0a730ca0260da8bf15d093f1ac265e446ce3faca 100644 --- a/classes/cronlog-renderer.class.php +++ b/classes/cronlog-renderer.class.php @@ -57,6 +57,22 @@ class cronlogrenderer extends cronlog{ ; } + /** + * get onclick value to filter a datatable + * @param string $sDatatable id of table + * @param string $sFiltertext text to filter + * @return string + * + */ + protected function _filterDatatable($sDatatable, $sFiltertext){ + /* + <a href="#" title="Filtere nach VHost «crawler.ascii.iml.unibe.ch:443»" + onclick="$('#tableRenderedallrequestsphp1_filter>INPUT').val('crawler.ascii.iml.unibe.ch:443'); + $('#tableRenderedallrequestsphp1').dataTable().fnFilter('crawler.ascii.iml.unibe.ch:443'); return false;">crawler.ascii.iml.unibe.ch:443</a> + */ + return '$(\'#'.$sDatatable.'\').dataTable().fnFilter(\''.$sFiltertext.'\'); return false;'; + } + /** * get html code for a table with events of executed cronjobs * @@ -198,9 +214,9 @@ class cronlogrenderer extends cronlog{ . '</p>' . '<div>' . $this->_renderAccessAndAge($iLast) - . ($iErrors ? '<span class="btn bg-danger">' . $iErrors.'</span> ' : '') - . ( $iOK ? '<span class="btn bg-success">' . $iOK.'</span>' : '') - . ($iErrors && $iOK ? ' ... gesamt: <span class="btn bg-gray">' . count($aData).'</span>' : '' ) + . ($iErrors ? '<a href="#" class="btn bg-danger" onclick="'.$this->_filterDatatable($sIdTable, "FEHLER").'">' . $iErrors.'</a> ' : '') + . ( $iOK ? '<a href="#" class="btn bg-success" onclick="'.$this->_filterDatatable($sIdTable, "OK").'">' . $iOK.'</a>' : '') + . ($iErrors && $iOK ? ' ... gesamt: <a href="#" class="btn bg-gray" onclick="'.$this->_filterDatatable($sIdTable, "").'">' . count($aData).'</a>' : '' ) . '<br>' . '</div>' . '<table id="'.$sIdTable.'" class="table-striped">' diff --git a/index.php b/index.php index fba00f2dd546e463b9356a825f597ba7af1199ee..f27f56482ce2b42db4cdac40fcc819bcda69c2a0 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ <?php -define("APP_VERSION", '2.0.2'); +define("APP_VERSION", '2.0.3'); require_once('classes/render-adminlte.class.php'); $renderAdminLTE=new renderadminlte();