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

remove index.html

parent 3503c3c3
No related branches found
No related tags found
1 merge request!3Restyle with AdminLTE
This commit is part of merge request !3. Comments created here will be created in the context of that merge request.
......@@ -244,11 +244,13 @@ class cronlogrenderer extends cronlog{
}
$sReturn='';
$sServer=isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : false;
$sReturn.='<li class="nav-item d-none d-sm-inline-block"><a href="#" class="nav-link">Instances:</a></li>';
foreach($this->_aInstances as $sInstance => $sUrl){
$sHost=parse_url($sUrl, PHP_URL_HOST);
$sClass=($sServer && $sServer==$sHost) ? 'active' : '';
$sReturn.='<a class="'.$sClass.'" href="'.$sUrl.'" title="'.$sUrl.'">'.$sInstance.'</a> ';
$sClass=($sServer && $sServer==$sHost) ? 'active bg-gray' : '';
// $sReturn.='<a class="'.$sClass.'" href="'.$sUrl.'" title="'.$sUrl.'">'.$sInstance.'</a> ';
$sReturn.='<li class="nav-item d-none d-sm-inline-block '.$sClass.'"><a href="'.$sUrl.'" class="nav-link">'.$sInstance.'</a></li>';
}
return $sReturn;
}
......@@ -494,7 +496,7 @@ class cronlogrenderer extends cronlog{
*/
public function renderLogfile($sLogfile){
$sHtml=''
. '<button style="position: fixed;" onclick="closeOverlay();"><i class="fas fa-chevron-left"></i> back</button><br><br>'
. '<button style="position: fixed;" onclick="closeOverlay();" class="btn btn-default"><i class="fas fa-chevron-left"></i> back</button><br><br>'
. '<h3>Logfile '.basename($sLogfile).'</h3>'
;
if(!$sLogfile){
......@@ -561,11 +563,14 @@ class cronlogrenderer extends cronlog{
.'>'.$sServer.'</option>';
}
$sHtml=$sHtml
? '<input id="serverfiltertext" type="text" placeholder="filter server" value=""
? ''
/*
.'<input id="serverfiltertext" type="text" placeholder="filter server" value=""
onchange="filterServers();"
onkeypress="filterServers();"
onkeyup="filterServers();"
><button onclick="$(\'#serverfiltertext\').val(\'\'); filterServers();">X</button><br><br>'
*/
.'<select'
. ' size="'.( min(array(count($this->getServers())+1 , $iMaxItemsToShow)) ).'"'
// . ' size="1"'
......
<?php
/**
* Generator for HTML Tags
*
* see getTag() ...
* it generates html code for tags
* - with and without label
* - with and without closing tag
*
* see _setAttributes($aAttributes) ...
* attribute will be inserted with given key-value array
* BUT with special attribute keys:
* - label - will be used as label
* - icon - will be added as <i class="[icon value]"></i> to the label
*
* @author Axel
*/
class htmlelements {
/**
* set of auto generated icon prefixes
* @var type
*/
var $_aIcons=array(
// 'fa-'=>'fa ',
);
var $_sLabel = '';
var $_aAttributes = array();
// ----------------------------------------------------------------------
// CONSTRUCTOR
// ----------------------------------------------------------------------
public function __construct() {
return true;
}
// ----------------------------------------------------------------------
//
// PRIVATE FUNCTIONS
//
// ----------------------------------------------------------------------
/**
* generate html attibutes with all internal attributes key -> values
* @return string
*/
protected function _addAttributes() {
$sReturn = '';
foreach ($this->_aAttributes as $sAttr => $sValue) {
if(is_array($sValue)){
echo "ERROR: an html tag was defined with array in attribute [$sAttr]:<br><pre>".print_r($this->_aAttributes, 1)."</pre>";
}
$sReturn .= ' '.$sAttr . '="' . $sValue . '"';
}
return $sReturn;
}
/**
* internal helper: fetch all attributes from key-value hash;
* Specialties here:
* - label will be extracted from key 'label'
* - and optional existing key 'icon' will be added at beginning of a label
*
* @param array $aAttributes
* @return boolean
*/
protected function _setAttributes($aAttributes){
$this->_sLabel='';
if(isset($aAttributes['icon']) && $aAttributes['icon']){
$this->_sLabel.=$this->getIcon($aAttributes['icon']);
unset($aAttributes['icon']);
}
if(isset($aAttributes['label']) && $aAttributes['label']){
$this->_sLabel .= $aAttributes['label'];
unset($aAttributes['label']);
}
$this->_aAttributes=$aAttributes;
return true;
}
// ----------------------------------------------------------------------
//
// PUBLIC FUNCTIONS
// HTML GENERIC
//
// ----------------------------------------------------------------------
/**
* generic function to get html code for a single tag
*
* @param string $sTag tag name
* @param array $aAttributes array with attributes (optional including 'icon' and 'label')
* @param boolean $bCloseTag optional: set false if tag has no closing tag (= ending with "/>")
* @return type
*/
public function getTag($sTag, $aAttributes, $bCloseTag=true){
$sTpl = $bCloseTag ? "<$sTag%s>%s</$sTag>" : "<$sTag %s/>%s";
$this->_setAttributes($aAttributes);
return sprintf($sTpl, $this->_addAttributes(), $this->_sLabel);
}
// ----------------------------------------------------------------------
//
// PUBLIC FUNCTIONS
// SIMPLE HTML ELEMENTS
//
// ----------------------------------------------------------------------
/**
* helper detect prefix of a string add prefix of a framework
* i.e. value "fa-close" detects font awesome and adds "fa " as prefix
*
* @param string $sIconclass
* @return boolean
*/
public function getIcon($sIconclass=false){
if(!$sIconclass){
return '';
}
$sPrefix='';
foreach ($this->_aIcons as $sPrefix =>$add) {
if (strpos($sIconclass, $sPrefix)===0){
$sPrefix=$add;
continue;
}
}
// do not use this .. it overrides internal attribute vars
// return $this->getTag('i', array('class'=>$sPrefix.$sIconclass));
return '<i class="'.$sPrefix.$sIconclass.'"></i> ';
}
// ----------------------------------------------------------------------
//
// PUBLIC FUNCTIONS
// HTML COMPONENTS
//
// ----------------------------------------------------------------------
/**
* get html code for an input field
*
* @param array $aAttributes attributes of the select tag
* @return string
*/
public function getFormInput($aAttributes){
$sTpl = '<input %s/>';
$this->_setAttributes($aAttributes);
return sprintf($sTpl, $this->_addAttributes());
}
/**
* get html code for an option field in a select drop down
*
* @param array $aAttributes attributes of the option tag
* @return string
*/
public function getFormOption($aAttributes){
$sTpl = '<option %s>%s</option>';
$this->_setAttributes($aAttributes);
return sprintf($sTpl, $this->_addAttributes(), $this->_sLabel);
}
/**
* get html code for a select drop down
*
* @param array $aAttributes attributes of the select tag
* @param array $aOptions array for all option fields
* @return string
*/
public function getFormSelect($aAttributes, $aOptions=array()){
// $sTpl = '<select %s>%s</select>';
if(!count($aOptions)){
return false;
}
$sOptions='';
foreach($aOptions as $aOptionAttributes){
// $sOptions.=$this->getFormOption($aOptionAttributes);
$sOptions.=$this->getTag('option', $aOptionAttributes);
}
$aAttributes['label']=$sOptions;
return $this->getTag('select', $aAttributes);
/*
$this->_setAttributes($aAttributes);
return sprintf($sTpl, $this->_addAttributes(), $sOptions);
*
*/
}
public function getTable($aHead, $aBody, $aTableAttributes=array()){
$sReturn='';
$sTdata='';
$sThead='';
$sTpl = '<table %s>'
. '<thead><tr>%s</tr></thead>'
. '<tbody>%s</tbody>'
. '</table>';
foreach($aHead as $sTh){
$sThead.='<th>'.$sTh.'</th>';
}
foreach($aBody as $aTr){
$sTdata.='<tr>';
foreach($aTr as $sTd){
$sTdata.='<td>'.$sTd.'</td>';
}
$sTdata.='</tr>';
}
$this->_setAttributes($aTableAttributes);
return sprintf($sTpl,
$this->_addAttributes(),
$sThead,
$sTdata
);
}
}
This diff is collapsed.
This diff is collapsed.
<?php
return [
'{{DIR_ADMINLTE}}' =>'/vendor/admin-lte/3.2.0',
'{{DIR_ADMINLTEPLUGINS}}' =>'/vendor/admin-lte-plugins',
'{{PAGE_SKIN}}' =>'',
'{{PAGE_TITLE}}' =>'Cronlog Viewer',
'{{PAGE_LAYOUT}}' =>'layout-navbar-fixed layout-fixed sidebar-mini',
'{{NAVI_TOP}}' =>'<nav class="main-header navbar navbar-expand navbar-white navbar-light"><ul class="navbar-nav" id="instances"></ul></nav>',
'{{BRAND}}' =>'<a href="/index.php" class="brand-link bg-red">
Cronlog viewer
<span class="brand-text font-weight-light">v2.0</span>
</a>',
'{{NAVI_LEFT}}' =>'
<br>
<div class="form-inline">
<div class="input-group">
<input id="serverfiltertext" class="form-control form-control-sidebar" type="search" placeholder="Search"
onchange="filterServers();"
onkeypress="filterServers();"
onkeyup="filterServers();"
>
<div class="input-group-append">
<button class="btn btn-sidebar"
onclick="$(\'#serverfiltertext\').val(\'\'); filterServers();" >
×
</button>
</div>
</div>
</div>
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div id="selectserver" class="active"></div>
</div>',
'{{PAGE_HEADER_LEFT}}'=>'<h2 id="lblServername">Server w&auml;hlen...</h2>
<nav id="subnav" class="navbar navbar-expand navbar-light tabs">
<ul class="navbar-nav">
<li class="nav-item">
<a href="#cronlogs" onclick="setTab(this); return false;" class="nav-link active">
<i class="far fa-file-alt"></i> Logs</a></li>
<li class="nav-item">
<a href="#cronhistory" onclick="setTab(this); return false;" class="nav-link">
<i class="fas fa-history"></i> History</a></li>
<li class="nav-item">
<a href="#graph" onclick="setTab(this); return false;" class="nav-link">
<i class="far fa-chart-bar"></i> Timeline</a></li>
</ul>
</nav>',
'{{PAGE_HEADER_RIGHT}}'=>'<span id="counter" style="float: right;"></span>',
'{{PAGE_BODY}}'=>'<div id="tabcontent">
<div id="cronlogs">
<div class="card card-primary card-outline active">
<div class="card-body" id="cronlogs-content"><br>Moment ...</div></div>
</div>
<div id="cronhistory">
<div class="card card-info card-outline">
<div class="card-body" id="cronhistory-content"><br>Moment ...</div></div>
</div>
<div id="graph">
<div class="card card-success card-outline">
<div class="card-body" id="graph-content"><br>Moment ...</div></div>
</div>
</div>
<div id="overlay" ondblclick="closeOverlay();">
<div id="showlog" class="active"><br>Moment ...</div>
</div>
',
'{{PAGE_FOOTER_LEFT}}'=>'2018 -2022 // University of Bern * Institute for Medical education',
'{{PAGE_FOOTER_RIGHT}}'=>'Source: <a href="https://git-repo.iml.unibe.ch/iml-open-source/cronlog-viewer/">git-repo.iml.unibe.ch</a>',
];
\ No newline at end of file
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta http-equiv="Pragma" content="no-cache">
<meta name="robots" content="noindex,nofollow">
<title>Cronjob-Viewer</title>
<script type="text/javascript" src="vendor/jquery/3.6.1/jquery.min.js"></script>
<script type="text/javascript" src="js/asimax.class.js"></script>
<script type="text/javascript" src="js/functions.js"></script>
<script type="text/javascript" src="vendor/vis/4.21.0/vis.min.js"></script>
<link href="vendor/vis/4.21.0/vis-timeline-graph2d.min.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="vendor/datatables/1.10.15/js/jquery.dataTables.min.js"></script>
<link href="vendor/datatables/1.10.15/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
<link href="vendor/font-awesome/5.15.4/css/all.min.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
<div id="errorlog"></div>
<header>
<div id="instances">...</div>
<h1><a href="?"><span class="imllogo"></span> CronjobViewer</a></h1>
</header>
<nav class="servers">
<div id="selectserver" class="active">...</div>
</nav>
<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>
<a href="#graph" onclick="setTab(this); return false;"><i class="far fa-chart-bar"></i> Timeline</a>
</nav><br><br>
<!--
<button onclick="refreshPage(); return false;"><i class="fas fa-sync"></i> Reload</button>
-->
<div id="tabcontent">
<div id="cronlogs" class="active"><br>Moment ...</div>
<div id="cronhistory"><br>Moment ...</div>
<div id="graph"><br>Moment ...</div>
</div>
</div>
<div style="clear: both"></div><br><br><br><br>
<footer>
&copy; 2018 -2022<br>
Source: <a href="https://git-repo.iml.unibe.ch/iml-open-source/cronlog-viewer/" target="_blank">git-repo.iml.unibe.ch</a>
</footer>
<div id="overlay" ondblclick="closeOverlay();">
<div id="showlog" class="active"><br>Moment ...</div>
</div>
</body></html>
\ No newline at end of file
index.php 0 → 100644
<?php
require_once('classes/render-adminlte.class.php');
$renderAdminLTE=new renderadminlte();
$aReplace=include("./config/page_replacements.php");
$sTemplate=file_get_contents('config/page.tpl.php');
// ---------- send content
echo $renderAdminLTE->render($sTemplate,$aReplace);
/*
Author : hahn
*/
:root{
--bg-main:#fff;
--bg-header:#eee;
--border: #cde;
}
a {color: #38a;text-decoration: none;}
a:hover {text-decoration: underline;}
body{background:var(--bg-main); color:#456; font-family: verdana,arial; font-size:1.0em; margin: 0;}
button{background:#46a; border: none; color:#fff; padding: 0.2em 1em; border-radius: 0.3em; border: 2px solid rgba(0,0,0,0.1); box-shadow: 0.2em 0.2em 0.5em #aaa;}
button.add{background:#8c8;}
button.del{background:#c88;}
button:hover{background:#68c;}
button:active{box-shadow: none; }
footer{position: fixed; bottom: 1em; right: 1em; background: var(--bg-header); border-top: 1px solid var(--border); padding: 1em; text-align: right;}
header{border-bottom: 1px solid var(--border); background:var(--bg-header); margin: 0 0 0.3em; padding: 1.5em 1em;}
h1{margin: 0 0 0.3em; padding: 0; margin: 0;}
h1 a{color: #38a;}
h1 a:hover{text-decoration: none;}
#instances{float: right;}
#instances a{border: 0px solid; padding: 0.4em;}
#instances a:hover{background: var(--bg-main);}
#instances a.active{background: var(--bg-main);border-top: 1px solid var(--border); border-left: 1px solid var(--border);}
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;}
nav.servers{float: left; margin-right: 1em;}
#selectserver{min-height: 30em; border-right: 0px dashed #cde; padding: 0 0.5em; background: #fff; }
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: #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.2em; }
option:hover{background: #eee;}
#selectserver select {border: 0; width: 100%;}
/* ----- serverlist on the left side */
#selectserver{min-height: 20em;max-height: 30em; }
#selectserver select{background: none; border: none; max-height: 100%; color: #ddd;}
p.hint{margin-bottom: 1em; background:#fed; padding: 1em; }
table{border: 1px solid #ccc;}
tr:hover{background:#eee;}
th{background:#eee; padding:0.5em;}
td{padding:0.3em;}
/* ----- head area */
#counter{border-bottom: 1px solid #ccc;}
#counter div{background:#bcd; background:#aaa; height: 5px; transition: width 0.3s ;}
.imllogo:before {background: rgb(255,0,51);color: #fff;padding: 0.5em 0.3em;content: 'IML'; font-family: "arial"; text-shadow: none;}
#subnav .nav-link.active{
background: #e0e8f0;
border-top: 0px solid;
}
/* ----- tabbed content */
#cronhistory,#cronlogs,#graph,#overlay{display: none;}
#tabcontent div.active{display: block;}
#overlay{position: fixed; width: 100%; height: 100%; background: rgba(0,0,0,0.4); top:0; left: 0;}
#showlog{background:#fff; border: 3px solid #888; padding: 1em; margin: 2%; height: 90%; overflow: scroll;}
.log-rem{color:#aaa; font-style: italic;}
.log-var{color:#088;}
.log-value{color:#008;}
pre div:hover{background:rgba(0,0,0,0.1);}
#counter{color:#abc;border-bottom: 1px solid #eee; margin-right: 1em;}
#counter div{background:#bcd; height: 5px; transition: width 1s ;}
#errorlog {background:#fcc; color:#800;}
/* ----- override datatable defaukts */
p.hint{margin-bottom: 1em; background:#fed; padding: 1em; }
/* ----- override datatable defaults */
.dataTables_wrapper{clear: none;float: left; margin: auto 1px;}
table.dataTable tbody tr.even{background: #f0f4f8;}
/* table.dataTable tbody tr.odd{} */
......@@ -86,8 +41,7 @@ table.dataTable tbody tr:hover{background:rgba(0,0,0,0.1);}
table.dataTable tbody td ul{margin: 0; padding-left: 0.8em;}
/* timeline
*/
/* ----- timeline */
.vis-item.timeline-result-error{background:#fcc; border-color: #800}
.vis-item.timeline-result-ok{background:#cfc;border-color: #080}
......@@ -106,31 +60,12 @@ table.dataTable tbody td ul{margin: 0; padding-left: 0.8em;}
border-bottom: 4px solid #abc;
}
/*
.vis-h0, .vis-h1,.vis-h2,.vis-h3, .vis-h4, .vis-h5, .vis-h6,.vis-h7,.vis-h18,.vis-h19,.vis-h20,.vis-h21,.vis-h22,.vis-h23{
background: #e0e4e8;
}
.vis-h8, .vis-h9,.vis-h10,.vis-h11, .vis-h12, .vis-h13, .vis-h14,.vis-h15,.vis-h16,.vis-h17{
background: #f0f4f8;
}
alternating column backgrounds
.vis-time-axis .vis-odd {
background: #fff;
}
.vis-time-axis .vis-even {
background: #f0f4f8;
}
.vis-time-axis{
background: #fea;
}
/* ----- overlay */
gray background in weekends, white text color
.vis-time-axis .vis-grid.vis-saturday,
.vis-time-axis .vis-grid.vis-sunday {
background: #ed8 !important;
}
.vis-time-axis .vis-text.vis-saturday,
.vis-time-axis .vis-text.vis-sunday {
}
#overlay{position: fixed; width: 100%; height: 100%; background: rgba(0,0,0,0.4); top:0; left: 0; z-index: 10000;}
#showlog{background:#fff; border: 3px solid #888; padding: 1em; margin: 2%; height: 90%; overflow: scroll;}
*/
.log-rem{color:#aaa; font-style: italic;}
.log-var{color:#088;}
.log-value{color:#008;}
pre div:hover{background:rgba(0,0,0,0.1);}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment