Maketank theme
This commit is contained in:
6
templates/Maketank/assets/js/autosize.min.js
vendored
Normal file
6
templates/Maketank/assets/js/autosize.min.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*!
|
||||
Autosize 3.0.15
|
||||
license: MIT
|
||||
http://www.jacklmoore.com/autosize
|
||||
*/
|
||||
!function(e,t){if("function"==typeof define&&define.amd)define(["exports","module"],t);else if("undefined"!=typeof exports&&"undefined"!=typeof module)t(exports,module);else{var n={exports:{}};t(n.exports,n),e.autosize=n.exports}}(this,function(e,t){"use strict";function n(e){function t(){var t=window.getComputedStyle(e,null);p=t.overflowY,"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),c="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(c)&&(c=0),i()}function n(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,p=t,f&&(e.style.overflowY=t),o()}function o(){var t=window.pageYOffset,n=document.body.scrollTop,o=e.style.height;e.style.height="auto";var i=e.scrollHeight+c;return 0===e.scrollHeight?void(e.style.height=o):(e.style.height=i+"px",v=e.clientWidth,document.documentElement.scrollTop=t,void(document.body.scrollTop=n))}function i(){var t=e.style.height;o();var i=window.getComputedStyle(e,null);if(i.height!==e.style.height?"visible"!==p&&n("visible"):"hidden"!==p&&n("hidden"),t!==e.style.height){var r=d("autosize:resized");e.dispatchEvent(r)}}var s=void 0===arguments[1]?{}:arguments[1],a=s.setOverflowX,l=void 0===a?!0:a,u=s.setOverflowY,f=void 0===u?!0:u;if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var c=null,p=null,v=e.clientWidth,h=function(){e.clientWidth!==v&&i()},y=function(t){window.removeEventListener("resize",h,!1),e.removeEventListener("input",i,!1),e.removeEventListener("keyup",i,!1),e.removeEventListener("autosize:destroy",y,!1),e.removeEventListener("autosize:update",i,!1),r["delete"](e),Object.keys(t).forEach(function(n){e.style[n]=t[n]})}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",y,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",i,!1),window.addEventListener("resize",h,!1),e.addEventListener("input",i,!1),e.addEventListener("autosize:update",i,!1),r.add(e),l&&(e.style.overflowX="hidden",e.style.wordWrap="break-word"),t()}}function o(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=d("autosize:destroy");e.dispatchEvent(t)}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=d("autosize:update");e.dispatchEvent(t)}}var r="function"==typeof Set?new Set:function(){var e=[];return{has:function(t){return Boolean(e.indexOf(t)>-1)},add:function(t){e.push(t)},"delete":function(t){e.splice(e.indexOf(t),1)}}}(),d=function(e){return new Event(e)};try{new Event("test")}catch(s){d=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var a=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(a=function(e){return e},a.destroy=function(e){return e},a.update=function(e){return e}):(a=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return n(e,t)}),e},a.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e},a.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e}),t.exports=a});
|
||||
143
templates/Maketank/assets/js/circular.js
Normal file
143
templates/Maketank/assets/js/circular.js
Normal file
@@ -0,0 +1,143 @@
|
||||
(function($,sr){
|
||||
var debounce = function (func, threshold, execAsap) {
|
||||
var timeout;
|
||||
|
||||
return function debounced () {
|
||||
var obj = this, args = arguments;
|
||||
function delayed () {
|
||||
if (!execAsap)
|
||||
func.apply(obj, args);
|
||||
timeout = null;
|
||||
}
|
||||
|
||||
if (timeout)
|
||||
clearTimeout(timeout);
|
||||
else if (execAsap)
|
||||
func.apply(obj, args);
|
||||
|
||||
timeout = setTimeout(delayed, threshold || 100);
|
||||
};
|
||||
};
|
||||
// smartresize
|
||||
jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
|
||||
|
||||
})(jQuery,'smartresize');
|
||||
|
||||
|
||||
$(window).smartresize(function(){
|
||||
resizecanvas();
|
||||
});
|
||||
|
||||
function resizecanvas() {
|
||||
var divwidth = $('#statsbox').width();
|
||||
var space = divwidth % 150;
|
||||
var elementspl = (divwidth - space) / 150;
|
||||
var elementwidth = 130 + Math.round(space / elementspl) - 1;
|
||||
$(".canvasbox").animate({width: elementwidth}, 500);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
resizecanvas();
|
||||
|
||||
var usedColor = "#91c46b";
|
||||
var assiColor = "#287e7e";
|
||||
var unliColor = "#56606e";
|
||||
var overColor = "#dd514c";
|
||||
|
||||
$(".circular").each(function(index, element) {
|
||||
var canvas = "#" + $(element).attr("id") + "-canvas";
|
||||
var used = parseFloat($(element).data("used"));
|
||||
var available = $(element).data("available");
|
||||
var assigned = parseFloat($(element).data("assigned"));
|
||||
var usedD, usedP, assignedP, assignedD;
|
||||
|
||||
// Draw basic circle
|
||||
circularCircle(canvas, 40, 0, 270, 8, "#d2d4d8");
|
||||
|
||||
// Draw percentages
|
||||
if (!isNaN(assigned) && available == "∞") {
|
||||
// Unlimited ressource and assigned
|
||||
if (assigned > used) {
|
||||
// Draw assigned as full circle
|
||||
circularCircle(canvas, 38, 0, 270, 4, assiColor);
|
||||
// Draw used as percentage of full circle
|
||||
usedP = Math.round(100 / assigned * used);
|
||||
usedD = 270 * usedP / 100;
|
||||
circularCircle(canvas, 42, 0, usedD, 4, usedColor);
|
||||
} else if (used > assigned) {
|
||||
// Draw used as full circle
|
||||
circularCircle(canvas, 42, 0, 270, 4, usedColor);
|
||||
// Draw assigned as percentage of full circle
|
||||
assignedP = Math.round(100 / used * assigned);
|
||||
assignedD = 270 * assignedP / 100;
|
||||
circularCircle(canvas, 38, 0, assignedD, 4, assiColor);
|
||||
} else {
|
||||
circularCircle(canvas, 42, 0, 270, 4, usedColor);
|
||||
circularCircle(canvas, 38, 0, 270, 4, assiColor);
|
||||
}
|
||||
circularText(canvas, 60, 42, 26, "∞")
|
||||
} else if (!isNaN(assigned)) {
|
||||
// Limited ressources but assigned
|
||||
available = parseFloat(available);
|
||||
|
||||
assignedP = Math.round(100 / available * assigned);
|
||||
assignedD = 270 * assignedP / 100;
|
||||
circularCircle(canvas, 38, 0, assignedD, 4, assiColor);
|
||||
|
||||
usedP = Math.round(100 / available * used);
|
||||
usedD = 270 * usedP / 100;
|
||||
circularCircle(canvas, 42, 0, usedD, 4, usedColor);
|
||||
circularText(canvas, 60, 42, 22, usedP + "%");
|
||||
} else if (available == "∞") {
|
||||
circularCircle(canvas, 40, 0, 270, 8, unliColor);
|
||||
circularText(canvas, 60, 42, 26, "∞")
|
||||
} else {
|
||||
// Limited ressources
|
||||
available = parseFloat(available);
|
||||
usedP = 100 / available * used;
|
||||
if (usedP < 1 && usedP > 0) {
|
||||
usedP = 1;
|
||||
} else {
|
||||
usedP = Math.round(usedP);
|
||||
}
|
||||
// Check if customer is over Limit
|
||||
usedD = 270 * usedP / 100;
|
||||
if (usedD > 270) { usedD = 270; }
|
||||
if (usedP > 90) {
|
||||
circularCircle(canvas, 40, 0, usedD, 8, overColor);
|
||||
} else {
|
||||
circularCircle(canvas, 40, 0, usedD, 8, usedColor);
|
||||
}
|
||||
if (usedP > 100) {
|
||||
circularText(canvas, 60, 42, 22, usedP + "%", overColor);
|
||||
} else {
|
||||
circularText(canvas, 60, 42, 22, usedP + "%")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function circularCircle(canvas, radius, start, end, stroke, color) {
|
||||
$(canvas).drawArc({
|
||||
strokeStyle: color,
|
||||
strokeWidth: stroke,
|
||||
x: 60, y: 44,
|
||||
radius: radius,
|
||||
start: start, end: end,
|
||||
rotate: -135
|
||||
});
|
||||
}
|
||||
function circularText(canvas, x, y, size, text, color) {
|
||||
color = color || "#343a41";
|
||||
$(canvas).drawText({
|
||||
fillStyle: color,
|
||||
x: x, y: y,
|
||||
fontSize: size,
|
||||
fontFamily: "Lucida Grande, Verdana, sans-serif",
|
||||
text: text
|
||||
});
|
||||
}
|
||||
5
templates/Maketank/assets/js/jcanvas.min.js
vendored
Normal file
5
templates/Maketank/assets/js/jcanvas.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
222
templates/Maketank/assets/js/main.js
Normal file
222
templates/Maketank/assets/js/main.js
Normal file
@@ -0,0 +1,222 @@
|
||||
function twoDigits(value) {
|
||||
if (value < 10) {
|
||||
return '0' + value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
$(document).ready(function() {
|
||||
// Scroll to top
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 100) {
|
||||
$('.scrollup').fadeIn();
|
||||
} else {
|
||||
$('.scrollup').fadeOut();
|
||||
}
|
||||
});
|
||||
$('.scrollup').click(function() {
|
||||
$("html, body").animate({
|
||||
scrollTop: 0
|
||||
}, 600);
|
||||
return false;
|
||||
});
|
||||
// Back buttons
|
||||
$('#historyback, .historyback').click(function() {
|
||||
parent.history.back();
|
||||
return false;
|
||||
});
|
||||
// Load Newsfeed
|
||||
var ajax_load = "<div id='newsitem'>Loading newsfeed...</div>";
|
||||
var role = "";
|
||||
if (typeof $("#newsfeed").data("role") !== "undefined") {
|
||||
role = "&role=" + $("#newsfeed").data("role");
|
||||
}
|
||||
$("#newsfeeditems").html(ajax_load).load("lib/ajax.php?action=newsfeed" + role, function() {
|
||||
if ($("#newsfeeditems").html().length > 0) {
|
||||
$(window).trigger('resize');
|
||||
$("#newsfeed").slideDown();
|
||||
}
|
||||
});
|
||||
// Enable Infobubbles
|
||||
$(".tipper").tipper({
|
||||
direction: "right"
|
||||
});
|
||||
// Enable notes
|
||||
$(".notes").click(function() {
|
||||
$("#notes_" + $(this).attr("data-id")).toggle("slow");
|
||||
});
|
||||
// Enable reset search click
|
||||
$(".resetsearch").click(function() {
|
||||
$(".searchtext").val("");
|
||||
$(".submitsearch").click();
|
||||
});
|
||||
// Make inputs with enabled unlimited checked disabled
|
||||
$("input[name$='_ul']").each(function() {
|
||||
var fieldname = $(this).attr("name").substring(0, $(this).attr("name").length - 3);
|
||||
$("input[name='" + fieldname + "']").prop({
|
||||
readonly: $(this).is(":checked")
|
||||
});
|
||||
});
|
||||
$("input[name$='_ul']").change(function() {
|
||||
var fieldname = $(this).attr("name").substring(0, $(this).attr("name").length - 3);
|
||||
$("input[name='" + fieldname + "']").prop({
|
||||
readonly: $(this).is(":checked")
|
||||
}).focus();
|
||||
});
|
||||
// Enable autoselect in configfules
|
||||
$(".shell, .filecontent").click(function() {
|
||||
$(this).select();
|
||||
});
|
||||
// Height of divs fix
|
||||
var snheight = $('#sidenavigation').height();
|
||||
var mainheight = $('#maincontent').height();
|
||||
if (snheight > mainheight && !$('#newsfeed').length) {
|
||||
$('#maincontent').css("min-height", snheight);
|
||||
}
|
||||
// this is necessary for the special setting feature (ref #1010)
|
||||
$.getQueryVariable = function(key) {
|
||||
var urlParams = decodeURI(window.location.search.substring(1));
|
||||
if (urlParams === false || urlParams === '') {
|
||||
return null;
|
||||
}
|
||||
var vars = urlParams.split("&");
|
||||
for (var i = 0; i < vars.length; i++) {
|
||||
var pair = vars[i].split("=");
|
||||
if (pair[0] === key) {
|
||||
return pair[1];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
if ($('#speciallogwarningpopup').length) {
|
||||
var $speciallogdialog = $('#speciallogwarningpopup').dialog({
|
||||
autoOpen: false,
|
||||
closeOnEscape: false,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
resizable: false
|
||||
});
|
||||
}
|
||||
// make rel="external" links open in a new window
|
||||
$("a[rel='external']").attr('target', '_blank');
|
||||
// set focus on username-field if on loginpage
|
||||
$("#loginname").focus();
|
||||
// Auto-select next field in configfile - wizard
|
||||
$('#config_distribution').change(function() {
|
||||
window.location.href = window.location.href + '&distribution=' + this.options[this.selectedIndex].value;
|
||||
});
|
||||
$('#config_service').change(function() {
|
||||
window.location.href = window.location.href + '&service=' + this.options[this.selectedIndex].value;
|
||||
});
|
||||
$('#config_daemon').change(function() {
|
||||
window.location.href = window.location.href + '&daemon=' + this.options[this.selectedIndex].value;
|
||||
});
|
||||
// Speciallogfile popup dialog
|
||||
$('input[name=speciallogfile]').click(function() {
|
||||
if ($.getQueryVariable("page") === "domains" && $.getQueryVariable("action") === "edit") {
|
||||
$speciallogdialog.dialog("open");
|
||||
$(".ui-dialog-titlebar").hide();
|
||||
}
|
||||
});
|
||||
$('#speciallogyesbutton').click(function() {
|
||||
$speciallogdialog.dialog("close");
|
||||
if ($('#delete_stats').val().toLowerCase() !== $('#delete_statistics_str').val().toLowerCase()) {
|
||||
$("#speciallogverified").val("0");
|
||||
if ($('input[name=speciallogfile]').prop("checked") !== false) {
|
||||
$('input[name=speciallogfile]').attr("checked", false);
|
||||
} else {
|
||||
$('input[name=speciallogfile]').attr("checked", true);
|
||||
}
|
||||
} else {
|
||||
$("#speciallogverified").val("1");
|
||||
}
|
||||
});
|
||||
$('input[id=speciallognobutton]').click(function() {
|
||||
$speciallogdialog.dialog("close");
|
||||
$("#speciallogverified").val("0");
|
||||
if ($('input[name=speciallogfile]').prop("checked") !== false) {
|
||||
$('input[name=speciallogfile]').attr("checked", false);
|
||||
} else {
|
||||
$('input[name=speciallogfile]').attr("checked", true);
|
||||
}
|
||||
});
|
||||
// Tablesorting on admin traffic
|
||||
$("table").each(function() {
|
||||
if ($(this).data("toggle") === "table") {
|
||||
$(this).tablesorter({
|
||||
textExtraction: (function(node) {
|
||||
// extract data from markup and return it
|
||||
if (node.innerText !== "-") {
|
||||
return node.innerText;
|
||||
} else {
|
||||
return '0 B';
|
||||
}
|
||||
}),
|
||||
headers: {
|
||||
1: {
|
||||
sorter: 'filesize'
|
||||
},
|
||||
2: {
|
||||
sorter: 'filesize'
|
||||
},
|
||||
3: {
|
||||
sorter: 'filesize'
|
||||
},
|
||||
4: {
|
||||
sorter: 'filesize'
|
||||
},
|
||||
5: {
|
||||
sorter: 'filesize'
|
||||
},
|
||||
6: {
|
||||
sorter: 'filesize'
|
||||
},
|
||||
7: {
|
||||
sorter: 'filesize'
|
||||
},
|
||||
8: {
|
||||
sorter: 'filesize'
|
||||
},
|
||||
9: {
|
||||
sorter: 'filesize'
|
||||
},
|
||||
10: {
|
||||
sorter: 'filesize'
|
||||
},
|
||||
11: {
|
||||
sorter: 'filesize'
|
||||
},
|
||||
12: {
|
||||
sorter: 'filesize'
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
// Mail Templates
|
||||
var mailTemplate = $("#mailTemplate").html();
|
||||
$("#mailLanguage").change(function() {
|
||||
var mailLanguage = $(this).val();
|
||||
var mailOptions = $(mailTemplate).filter(function() {
|
||||
return !$(this).attr("id") || $(this).attr("id") === mailLanguage;
|
||||
});
|
||||
$("#mailTemplate").html(mailOptions);
|
||||
});
|
||||
$("#mailLanguage").trigger("change");
|
||||
|
||||
// Config files
|
||||
var configfileTextareas = $("textarea.filecontent, textarea.shell");
|
||||
var lastPw = "MYSQL_PASSWORD";
|
||||
$("#configfiles_setmysqlpw").submit(function(event) {
|
||||
event.preventDefault();
|
||||
var inputVal = $("#configfiles_mysqlpw").val();
|
||||
if (!inputVal.trim()) {
|
||||
inputVal = "MYSQL_PASSWORD";
|
||||
}
|
||||
configfileTextareas.each(function() {
|
||||
this.value = this.value.replace(lastPw, inputVal);
|
||||
});
|
||||
lastPw = inputVal;
|
||||
});
|
||||
|
||||
autosize($('textarea.shell'));
|
||||
});
|
||||
10
templates/Maketank/assets/js/tipper.min.js
vendored
Normal file
10
templates/Maketank/assets/js/tipper.min.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Tipper Plugin [Formstone Library]
|
||||
* @author Ben Plum
|
||||
* @version 0.4.3
|
||||
*
|
||||
* Copyright © 2013 Ben Plum <mr@benplum.com>
|
||||
* Released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
*/
|
||||
|
||||
if(jQuery)(function(c){function n(a){e.formatter=p;return c(this).on("mouseenter.tipper",q).data("tipper",c.extend({},e,a||{}))}function q(){var a=c(this),b=a.data("tipper"),d;d='<div class="tipper-wrapper"><div class="tipper-content">'+b.formatter.apply(c("body"),[a]);d+='</div><span class="tipper-caret"></span></div>';a.data("tipper-text",a.attr("title")).attr("title",null);var g=c('<div class="tipper-positioner '+b.direction+'" />');g.append(d).appendTo("body");d=g.find(".tipper-caret");var h=a.offset(), e=a.outerWidth(),j=a.outerHeight(),k=g.outerWidth(!0),l=g.outerHeight(!0),f={},m={};"right"==b.direction||"left"==b.direction?(f.top=h.top-(l-j)/2,m.top=(l-d.outerHeight(!0))/2,"right"==b.direction?f.left=h.left+e+b.margin:"left"==b.direction&&(f.left=h.left-k-b.margin)):(f.left=h.left-(k-e)/2,m.left=(k-d.outerWidth(!0))/2,"bottom"==b.direction?f.top=h.top+j+b.margin:"top"==b.direction&&(f.top=h.top-l-b.margin));g.css(f);d.css(m);a.one("mouseleave.tipper",{$tipper:g,$target:a},r)}function p(a){return a.attr("title")} function r(a){a=a.data;a.$target.attr("title",a.$target.data("tipper-text")).data("tipper-text",null);a.$tipper.remove()}var e={direction:"right",follow:!1,formatter:function(){},margin:15},j={defaults:function(a){e=c.extend(e,a||{});return c(this)},destroy:function(){c(".tipper-wrapper").remove();return c(this).off(".tipper").data("tipper",null)}};c.fn.tipper=function(a){return j[a]?j[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"===typeof a||!a?n.apply(this,arguments):this}})(jQuery);
|
||||
135
templates/Maketank/assets/js/traffic.js
Normal file
135
templates/Maketank/assets/js/traffic.js
Normal file
@@ -0,0 +1,135 @@
|
||||
jQuery.fn.reverse = function() {
|
||||
return this.pushStack(this.get().reverse(), arguments);
|
||||
};
|
||||
$(document).ready(function() {
|
||||
var ftp = [];
|
||||
var http = [];
|
||||
var mail = [];
|
||||
var ticks = [];
|
||||
var i = 1;
|
||||
var links = [];
|
||||
$('#datatable tbody tr').reverse().each(function() {
|
||||
var row = $(this);
|
||||
var ftpd = $(row).children().first().next().text();
|
||||
var httpd = $(row).children().first().next().next().text();
|
||||
var maild = $(row).children().first().next().next().next().text();
|
||||
if ($(row).children().first().find("a").length > 0) {
|
||||
links.push($(row).children().first().html());
|
||||
ticks.push([i, $(row).children().first().find("a").html().split(" ")[0]]);
|
||||
} else {
|
||||
ticks.push([i, $(row).children().first().html()]);
|
||||
}
|
||||
ftp.push([i, parseFloat(ftpd / 1024)]);
|
||||
http.push([i, parseFloat(httpd / 1024)]);
|
||||
mail.push([i, parseFloat(maild)]);
|
||||
i++;
|
||||
});
|
||||
$('#datatable').hide();
|
||||
$('#charts').show();
|
||||
if (links.length > 0) {
|
||||
var tmp = $('<div />', {
|
||||
id: 'linkslist'
|
||||
});
|
||||
$.each(links, function(i, link) {
|
||||
tmp.append(link);
|
||||
if (i != links.length - 1) {
|
||||
tmp.append(' | ');
|
||||
}
|
||||
});
|
||||
tmp.append('<br /><br /><br />');
|
||||
tmp.insertBefore($('#datatable'));
|
||||
}
|
||||
|
||||
var ftpdata = [{
|
||||
label: 'FTP',
|
||||
data: ftp,
|
||||
color: '#1db34f'
|
||||
}];
|
||||
var httpdata = [{
|
||||
label: 'HTTP',
|
||||
data: http,
|
||||
color: '#0a90d8'
|
||||
}];
|
||||
var maildata = [{
|
||||
label: 'Mail',
|
||||
data: mail,
|
||||
color: '#f17f49'
|
||||
}];
|
||||
|
||||
var options = {
|
||||
series: {
|
||||
shadowSize: 0,
|
||||
curvedLines: {
|
||||
active: true,
|
||||
apply: false,
|
||||
fitPointDist: true
|
||||
}
|
||||
},
|
||||
lines: {
|
||||
show: true,
|
||||
fill: true
|
||||
},
|
||||
points: {
|
||||
radius: 2,
|
||||
show: true
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
grid: {
|
||||
hoverable: true,
|
||||
borderWidth: 0
|
||||
},
|
||||
xaxis: {
|
||||
tickSize: 1,
|
||||
tickLength: 0,
|
||||
ticks: ticks,
|
||||
labelAngle: 45
|
||||
},
|
||||
yaxis: {
|
||||
tickColor: '#eee',
|
||||
min: 0
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$('#ftpchart').plot(ftpdata, options);
|
||||
$('#httpchart').plot(httpdata, options);
|
||||
$('#mailchart').plot(maildata, options);
|
||||
|
||||
$("<div id='tooltip'></div>").css({
|
||||
position: "absolute",
|
||||
display: "none",
|
||||
padding: "4px 8px",
|
||||
"background-color": "#000",
|
||||
opacity: 0.85,
|
||||
color: "#fff",
|
||||
"font-size": "11px"
|
||||
}).appendTo("body");
|
||||
|
||||
$("#ftpchart, #httpchart").bind("plothover", function(event, pos, item) {
|
||||
if (item) {
|
||||
var y = item.datapoint[1].toFixed(2);
|
||||
|
||||
$("#tooltip").html(item.series.label + ": " + y + " GiB").css({
|
||||
top: item.pageY + 5,
|
||||
left: item.pageX - $("#tooltip").width() / 2
|
||||
}).fadeIn(200);
|
||||
} else {
|
||||
$("#tooltip").hide();
|
||||
}
|
||||
});
|
||||
|
||||
$("#mailchart").bind("plothover", function(event, pos, item) {
|
||||
if (item) {
|
||||
var y = item.datapoint[1].toFixed(2);
|
||||
|
||||
$("#tooltip").html(item.series.label + ": " + y + " MiB").css({
|
||||
top: item.pageY + 5,
|
||||
left: item.pageX - $("#tooltip").width() / 2
|
||||
}).fadeIn(200);
|
||||
} else {
|
||||
$("#tooltip").hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user