PHP Classes

File: javascript/functions.min.js

Recommend this page to a friend!
  Classes of Axel Hahn  >  Pimped Apache Status  >  javascript/functions.min.js  >  Download  
File: javascript/functions.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Pimped Apache Status
Display the requests handled by an Apache server
Author: By
Last change:
Date: 2 years ago
Size: 5,533 bytes
 

Contents

Class file image Download
/* https://www.axel-hahn.de/ */
function initDrawH3list(){var d="";var a=".sidebar-menu>li.active>span.submenu";var c=false;var b=0;$("h3").each(function(){c=this.id?this.id:"h3"+this.innerHTML.replace(/\W/g,"");if(!this.id){this.id=c}if(this.id!=="h3menu"){b++;d+='<li><a href="#'+c+'" class="scroll-link"><i class="fa fa-angle-right"></i>'+this.innerHTML.replace(/(<([^>]+)>)/ig,"")+"</a></li>"}});if(b<2){d="";$(a).hide()}else{$(a).html('<ul class="treeview-menu" style="display: block;">'+d+"</ul>")}}function initSoftscroll(){$(function(){$("a.scroll-link").click(function(){if(location.pathname.replace(/^\//,"")===this.pathname.replace(/^\//,"")&&location.hostname===this.hostname){var a=$(this.hash);a=a.length?a:$("[name="+this.hash.slice(1)+"]");if(a.length){$("html,body").animate({scrollTop:a.offset().top-70},300);return false}}})})}function filterServer(a){var c=0;if(a==="null"){a=""}localStorage.setItem("apachestatusFilterServer",a);$("#serverlist ul li a").each(function(){if(!a||$(this).html().indexOf(a)>=0){c++;$(this).css("display","block")}else{$(this).css("display","none")}});$("#srvcounter").html(a?c:"");$("#serverlist ul li.active a").each(function(){$(this).css("display","block")});var b=c<25;$("#serverlist>li ").each(function(){b?$(this).removeClass("dropdown-submenu"):$(this).addClass("dropdown-submenu");$(this).attr("onmouseover",b?"":"$(this).addClass('open');");$(this).attr("onmouseout",b?"":"$(this).removeClass('open');")});$("#serverlist li ul").each(function(){b?$(this).removeClass("dropdown-menu"):$(this).addClass("dropdown-menu");iCountItems=$(this).find("li>a").length;iCountVisibleItems=0;oUL=$(this);$(oUL).find("li>a").each(function(){if($(this).css("display")==="block"){iCountVisibleItems++}});sInfotext=iCountVisibleItems!=iCountItems?iCountVisibleItems+"/ "+iCountItems:iCountItems;$(oUL).prev().children(".info").html(" ("+sInfotext+")");$(oUL).prev().css("display",iCountVisibleItems?"block":"none")})}function initServerFilter(){var b=0;$("#serverlist li").each(function(){b++});var a=localStorage.getItem("apachestatusFilterServer")+"";if(a===undefined){a=""}if(b>5){$("#serverlist >li>a").append('<span class="info" style="margin-right: 1em;">-</span>');var c='<li><form class="form-inline">\n            <div class="form-group" style="margin-bottom: 0.5em; min-width: 20em;">\n                <input type="text" id="esrvfilter" style="margin-left: 1em;" \n                    onkeypress="filterServer(this.value);" class="form-control" onkeydown="filterServer(this.value);" onkeyup="filterServer(this.value);" \n                    placeholder="'+aLang.srvFilterPlaceholder+'"\n                    value="'+a+'" />\n                <span id="srvcounter"></span>\n            </div></form></li>';$("#serverlist").prepend(c)}filterServer(a)}function initKnob(){var b=0;var e=false;var a=false;var c=$(".tile .dial").css("color");var d=$(".tile .dial").css("background-color");$(".tile .dial").each(function(){b++;sId=$(this).attr("id").replace(/^dial\-/,"");sSrv=sId.replace(/\-.*/,"");e=sId.replace(/^.*\-/,"");if(e){var f=new counterhistory(sSrv,e);a=f.getLast(50);aDataLast=f.getLast(1);currentVal=aDataLast.max;if(a){$(this).knob({readOnly:true,fgColor:c,bgColor:d,max:a.max*1000,width:"90px",height:"90px",thickness:0.04});$(this).val(currentVal*1000).trigger("change");$("#progress-"+sId).css("width",(currentVal/a.max*100)+"%")}}})}function initPage(){initDrawH3list();initSoftscroll();initServerFilter();initKnob();$("body").append('<div id="'+sDivPlotter+'" class="plotter"></div>')}function showTab(a){mydiv=".subh2 ";$(mydiv+" > h3").hide();$(mydiv+" > .subh3").hide();$(mydiv+" > "+a).show();$(mydiv+" > "+a+" + div.subh3").show();$(mydiv+" li a").blur();return false}var sDivPlotter="divPlotter";var bPlotterSticky=false;function stickyGraph(d,b,c){var a=bPlotterSticky;bPlotterSticky=false;$("#"+sDivPlotter+" .btnclose").hide();showGraph(d,b,c);if(!a){bPlotterSticky=true;$("#"+sDivPlotter+" .btnclose").show()}}function showGraph(d,a,c){if(bPlotterSticky){return false}var b=new counterhistory(d,a);renderHistory(sDivPlotter,b.getLast(50),c)}function hideGraph(a){if(a){bPlotterSticky=false}if(bPlotterSticky){return false}$("#"+sDivPlotter).hide()}function twodigits(a){return a>9?a:"0"+a}function renderHistory(a,e,l){if(!e||!e.data||e.data.length<10||!e.max){return false}var j="",g="",c=250,k=600,d=false,h=false,b=false;j+='<div class="btnclose" onclick="hideGraph(1);"> X </div><div class="graph"><div class="title">'+l+"</div>";for(var f=e.data.length-1;f>=0;f--){val=e.data[f][1]/1;b=new Date(e.data[f][0]);iH=val/e.max*c;iW=k/e.data.length;d=(f===0)?"barcur":"";h=val+"\n\n"+twodigits(b.getDate())+"."+twodigits(b.getMonth()+1)+"."+b.getFullYear()+"\n"+twodigits(b.getHours())+":"+twodigits(b.getMinutes())+":"+twodigits(b.getSeconds());j+='<div class="barcontainer" style="width:'+iW+"px; height: "+c+'px" title="'+h+'"><div class="bar '+d+'" style="width:'+iW+"px; height: "+iH+"px; margin-top:"+(c-iH)+'px; "> </div></div>'}ihAvg=e.avg/e.max*c;ihCurrent=e.data[0][1]/e.max*c;if(aLang){g+=(aLang.statsCurrent)?aLang.statsCurrent+": "+e.data[0][1]+"<br>":"";g+=(aLang.statsMin)?aLang.statsMin+": "+e.min+"<br>":"";g+=(aLang.statsMax)?aLang.statsMax+": "+e.max+"<br>":"";g+=(aLang.statsAvg)?aLang.statsAvg+": "+e.avg+"<br>":""}j+='<div class="avg" style="margin-top:'+(c-ihAvg)+'px; "> </div><div class="current" style="margin-top:'+(c-ihCurrent)+'px; "> </div>'+(g?'<div class="infos">'+g+"</div>":"")+"</div>";$("#"+a).html(j).show();return true};

For more information send a message to info at phpclasses dot org.