/*************************************************************************** * Copyright (C) 2008 by phpSysInfo - A PHP System Information Script * * http://phpsysinfo.sourceforge.net/ * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ //$Id: docker.js 661 2014-01-08 11:26:39 aolah76 $ /*global $, jQuery, buildBlock, datetime, plugin_translate, genlang, createBar */ "use strict"; var docker_show = false, docker_table; /** * insert content into table * @param {jQuery} xml plugin-XML */ function docker_populate(xml) { var hostname = ""; docker_table.fnClearTable(); hostname = $("Plugins Plugin_Docker", xml).attr('Hostname'); if (hostname !== undefined) { $('span[class=Hostname_Docker]').html(hostname); } $("Plugins Plugin_Docker Docker Item", xml).each(function docker_getitem(id) { var name = "", cpuu= 0, memu = 0, used = 0, limit = 0, netio = "", blockio = "", pids = 0; name = $(this).attr("Name"); cpuu = parseInt($(this).attr("CPUUsage"), 10); memu = parseInt($(this).attr("MemoryUsage"), 10); used = parseInt($(this).attr("MemoryUsed"), 10); limit = parseInt($(this).attr("MemoryLimit"), 10); netio = $(this).attr("NetIO"); blockio = $(this).attr("BlockIO"); pids = parseInt($(this).attr("PIDs"), 10); docker_table.fnAddData(["
" + name, " " + createBar(cpuu), " " + createBar(memu), " " + formatBytes(used, xml), " " + formatBytes(limit, xml), " " + netio, " " + blockio, " " + pids]); docker_show = true; }); } function docker_buildTable() { var html = ""; html += "" + genlang(101, "docker") + " | \n"; html += "" + genlang(102, "docker") + " | \n"; html += "" + genlang(103, "docker") + " | \n"; html += "" + genlang(104, "docker") + " | \n"; html += "" + genlang(105, "docker") + " | \n"; html += "" + genlang(106, "docker") + " | \n"; html += "" + genlang(107, "docker") + " | \n"; html += "" + genlang(108, "docker") + " | \n"; html += "
---|