initial commit of file from CVS for smeserver-phpsysinfo on Sat Sep 7 20:53:46 AEST 2024
This commit is contained in:
176
root/opt/phpsysinfo/plugins/dmraid/class.dmraid.inc.php
Normal file
176
root/opt/phpsysinfo/plugins/dmraid/class.dmraid.inc.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
/**
|
||||
* DMRaid Plugin
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_DMRaid
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version SVN: $Id: class.dmraid.inc.php 661 2012-08-27 11:26:39Z namiltd $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
/**
|
||||
* dmraid Plugin, which displays software RAID status
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_DMRaid
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version Release: 3.0
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
class DMRaid extends PSI_Plugin
|
||||
{
|
||||
/**
|
||||
* variable, which holds the content of the command
|
||||
* @var array
|
||||
*/
|
||||
private $_filecontent = "";
|
||||
|
||||
/**
|
||||
* variable, which holds the result before the xml is generated out of this array
|
||||
* @var array
|
||||
*/
|
||||
private $_result = array();
|
||||
|
||||
/**
|
||||
* read the data into an internal array and also call the parent constructor
|
||||
*
|
||||
* @param String $enc encoding
|
||||
*/
|
||||
public function __construct($enc)
|
||||
{
|
||||
$buffer = "";
|
||||
parent::__construct(__CLASS__, $enc);
|
||||
switch (strtolower(PSI_PLUGIN_DMRAID_ACCESS)) {
|
||||
case 'command':
|
||||
CommonFunctions::executeProgram("dmraid", "-s -vv 2>&1", $buffer);
|
||||
break;
|
||||
case 'data':
|
||||
CommonFunctions::rfts(APP_ROOT."/data/dmraid.txt", $buffer);
|
||||
break;
|
||||
default:
|
||||
$this->global_error->addConfigError("__construct()", "PSI_PLUGIN_DMRAID_ACCESS");
|
||||
break;
|
||||
}
|
||||
if (trim($buffer) != "") {
|
||||
$this->_filecontent = preg_split("/(\r?\n\*\*\* )|(\r?\n--> )/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
|
||||
} else {
|
||||
$this->_filecontent = array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* doing all tasks to get the required informations that the plugin needs
|
||||
* result is stored in an internal array<br>the array is build like a tree,
|
||||
* so that it is possible to get only a specific process with the childs
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
if (empty($this->_filecontent)) {
|
||||
return;
|
||||
}
|
||||
$group = "";
|
||||
foreach ($this->_filecontent as $block) {
|
||||
if (preg_match('/^(NOTICE: )|(ERROR: )/m', $block)) {
|
||||
$group = "";
|
||||
$lines = preg_split("/\r?\n/", $block, -1, PREG_SPLIT_NO_EMPTY);
|
||||
foreach ($lines as $line) {
|
||||
if (preg_match('/^NOTICE: added\s+\/dev\/(.+)\s+to RAID set\s+\"(.+)\"/', $line, $partition)) {
|
||||
$this->_result['devices'][$partition[2]]['partitions'][$partition[1]]['status'] = "";
|
||||
} elseif (preg_match('/^ERROR: .* device\s+\/dev\/(.+)\s+(.+)\s+in RAID set\s+\"(.+)\"/', $line, $partition)) {
|
||||
if ($partition[2]=="broken") {
|
||||
$this->_result['devices'][$partition[3]]['partitions'][$partition[1]]['status'] = 'F';
|
||||
} else {
|
||||
$this->_result['devices'][$partition[3]]['partitions'][$partition[1]]['status'] = 'W';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (preg_match('/^Group superset\s+(.+)/m', $block, $arrname)) {
|
||||
$group = trim($arrname[1]);
|
||||
}
|
||||
if (preg_match('/^name\s*:\s*(.*)/m', $block, $arrname)) {
|
||||
if ($group=="") {
|
||||
$group = trim($arrname[1]);
|
||||
}
|
||||
$this->_result['devices'][$group]['name'] = $arrname[1];
|
||||
if (preg_match('/^size\s*:\s*(.*)/m', $block, $size)) {
|
||||
$this->_result['devices'][$group]['size'] = trim($size[1]);
|
||||
}
|
||||
if (preg_match('/^stride\s*:\s*(.*)/m', $block, $stride)) {
|
||||
$this->_result['devices'][$group]['stride'] = trim($stride[1]);
|
||||
}
|
||||
if (preg_match('/^type\s*:\s*(.*)/m', $block, $type)) {
|
||||
$this->_result['devices'][$group]['type'] = trim($type[1]);
|
||||
}
|
||||
if (preg_match('/^status\s*:\s*(.*)/m', $block, $status)) {
|
||||
$this->_result['devices'][$group]['status'] = trim($status[1]);
|
||||
}
|
||||
if (preg_match('/^subsets\s*:\s*(.*)/m', $block, $subsets)) {
|
||||
$this->_result['devices'][$group]['subsets'] = trim($subsets[1]);
|
||||
}
|
||||
if (preg_match('/^devs\s*:\s*(.*)/m', $block, $devs)) {
|
||||
$this->_result['devices'][$group]['devs'] = trim($devs[1]);
|
||||
}
|
||||
if (preg_match('/^spares\s*:\s*(.*)/m', $block, $spares)) {
|
||||
$this->_result['devices'][$group]['spares'] = trim($spares[1]);
|
||||
}
|
||||
$group = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* generates the XML content for the plugin
|
||||
*
|
||||
* @return SimpleXMLObject entire XML content for the plugin
|
||||
*/
|
||||
public function xml()
|
||||
{
|
||||
if (empty($this->_result)) {
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
$hideRaids = array();
|
||||
if (defined('PSI_PLUGIN_DMRAID_HIDE_RAID_DEVICES') && is_string(PSI_PLUGIN_DMRAID_HIDE_RAID_DEVICES)) {
|
||||
if (preg_match(ARRAY_EXP, PSI_PLUGIN_DMRAID_HIDE_RAID_DEVICES)) {
|
||||
$hideRaids = eval(PSI_PLUGIN_DMRAID_HIDE_RAID_DEVICES);
|
||||
} else {
|
||||
$hideRaids = array(PSI_PLUGIN_DMRAID_HIDE_RAID_DEVICES);
|
||||
}
|
||||
}
|
||||
foreach ($this->_result['devices'] as $key=>$device) {
|
||||
if (!in_array($key, $hideRaids, true)) {
|
||||
$dev = $this->xml->addChild("Raid");
|
||||
$dev->addAttribute("Device_Name", $key);
|
||||
$dev->addAttribute("Type", $device["type"]);
|
||||
$dev->addAttribute("Disk_Status", $device["status"]);
|
||||
$dev->addAttribute("Name", $device["name"]);
|
||||
$dev->addAttribute("Size", $device["size"]);
|
||||
$dev->addAttribute("Stride", $device["stride"]);
|
||||
$dev->addAttribute("Subsets", $device["subsets"]);
|
||||
$dev->addAttribute("Devs", $device["devs"]);
|
||||
$dev->addAttribute("Spares", $device["spares"]);
|
||||
$disks = $dev->addChild("Disks");
|
||||
if (isset($device['partitions']) && sizeof($device['partitions']>0)) foreach ($device['partitions'] as $diskkey=>$disk) {
|
||||
$disktemp = $disks->addChild("Disk");
|
||||
$disktemp->addAttribute("Name", $diskkey);
|
||||
if ($device["status"]=='ok') {
|
||||
$disktemp->addAttribute("Status", $disk['status']);
|
||||
} else {
|
||||
$disktemp->addAttribute("Status", 'W');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
}
|
14
root/opt/phpsysinfo/plugins/dmraid/css/dmraid.css
Normal file
14
root/opt/phpsysinfo/plugins/dmraid/css/dmraid.css
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
$Id: dmraid.css 661 2012-08-27 11:26:39Z namiltd $
|
||||
*/
|
||||
.plugin_dmraid_biun {
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
margin-right: 20px;
|
||||
float: left;
|
||||
width: 64px;
|
||||
}
|
||||
|
||||
img.plugin_dmraid_biun {
|
||||
margin: auto;
|
||||
}
|
9
root/opt/phpsysinfo/plugins/dmraid/dmraid_bootstrap.html
Normal file
9
root/opt/phpsysinfo/plugins/dmraid/dmraid_bootstrap.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<div class="col-lg-12" id="block_dmraid" style="display:none">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">RAID Status</div>
|
||||
<div class="panel-body">
|
||||
<table id="dmraid" class="table borderless table-condensed">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/error.png
Normal file
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/error.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/harddrivefail.png
Normal file
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/harddrivefail.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/harddriveok.png
Normal file
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/harddriveok.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/harddrivespare.png
Normal file
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/harddrivespare.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/harddrivewarn.png
Normal file
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/harddrivewarn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
176
root/opt/phpsysinfo/plugins/dmraid/js/dmraid.js
Normal file
176
root/opt/phpsysinfo/plugins/dmraid/js/dmraid.js
Normal file
@@ -0,0 +1,176 @@
|
||||
/***************************************************************************
|
||||
* 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: dmraid.js 679 2012-09-04 10:10:11Z namiltd $
|
||||
//
|
||||
|
||||
/*global $, jQuery, buildBlock, genlang, createBar, plugin_translate, datetime */
|
||||
|
||||
"use strict";
|
||||
|
||||
var dmraid_show = false;
|
||||
|
||||
/**
|
||||
* get the details of the raid
|
||||
* @param {jQuery} xml part of the plugin-XML
|
||||
* @param {number} id id of the device
|
||||
*/
|
||||
function dmraid_buildinfos(xml, id) {
|
||||
var html = "", devname = "", devstatus = "", devtype = "",devsize = 0, devstride = 0, devsubsets = 0, devdevs = 0, devspares = 0, button = "";
|
||||
|
||||
devname = $(xml).attr("Name");
|
||||
devstatus = $(xml).attr("Disk_Status");
|
||||
devtype = $(xml).attr("Type");
|
||||
devsize = parseInt($(xml).attr("Size"), 10);
|
||||
devstride = parseInt($(xml).attr("Stride"), 10);
|
||||
devsubsets = parseInt($(xml).attr("Subsets"), 10);
|
||||
devdevs = parseInt($(xml).attr("Devs"), 10);
|
||||
devspares = parseInt($(xml).attr("Spares"), 10);
|
||||
html += "<tr><td>" + genlang(4, false, "DMRaid") + "</td><td>" + devname + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(5, false, "DMRaid") + "</td><td>" + devstatus + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(6, false, "DMRaid") + "</td><td>" + devtype + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(7, false, "DMRaid") + "</td><td>" + devsize + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(8, false, "DMRaid") + "</td><td>" + devstride + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(9, false, "DMRaid") + "</td><td>" + devsubsets + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(10, false, "DMRaid") + "</td><td>" + devdevs + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(11, false, "DMRaid") + "</td><td>" + devspares + "</td></tr>";
|
||||
button += "<h3 style=\"cursor: pointer\" id=\"sPlugin_DMRaid_Info" + id + "\"><img src=\"./gfx/bullet_toggle_plus.png\" alt=\"plus\" style=\"vertical-align:middle;\" />" + genlang(3, false, "DMRaid") + "</h3>";
|
||||
button += "<h3 style=\"cursor: pointer; display: none;\" id=\"hPlugin_DMRaid_Info" + id + "\"><img src=\"./gfx/bullet_toggle_minus.png\" alt=\"minus\" style=\"vertical-align:middle;\" />" + genlang(3, false, "DMRaid") + "</h3>";
|
||||
button += "<table id=\"Plugin_DMRaid_InfoTable" + id + "\" style=\"border-spacing:0; display:none;\">" + html + "</table>";
|
||||
return button;
|
||||
}
|
||||
|
||||
/**
|
||||
* choose the right diskdrive icon
|
||||
* @param {jQuery} xml part of the plugin-XML
|
||||
*/
|
||||
function dmraid_diskicon(xml) {
|
||||
var html = "";
|
||||
$("Disks Disk", xml).each(function dmraid_getdisk(id) {
|
||||
var diskstatus = "", diskname = "", img = "", alt = "";
|
||||
html += "<div class=\"plugin_dmraid_biun\">";
|
||||
diskstatus = $(this).attr("Status");
|
||||
diskname = $(this).attr("Name");
|
||||
switch (diskstatus) {
|
||||
case " ":
|
||||
case "":
|
||||
img = "harddriveok.png";
|
||||
alt = "ok";
|
||||
break;
|
||||
case "F":
|
||||
img = "harddrivefail.png";
|
||||
alt = "fail";
|
||||
break;
|
||||
case "S":
|
||||
img = "harddrivespare.png";
|
||||
alt = "spare";
|
||||
break;
|
||||
case "W":
|
||||
img = "harddrivewarn.png";
|
||||
alt = "fail";
|
||||
break;
|
||||
default:
|
||||
alert("--" + diskstatus + "--");
|
||||
img = "error.png";
|
||||
alt = "error";
|
||||
break;
|
||||
}
|
||||
html += "<img class=\"plugin_dmraid_biun\" src=\"./plugins/dmraid/gfx/" + img + "\" alt=\"" + alt + "\" />";
|
||||
html += "<small>" + diskname + "</small>";
|
||||
html += "</div>";
|
||||
});
|
||||
return html;
|
||||
}
|
||||
|
||||
/**
|
||||
* fill the plugin block
|
||||
* @param {jQuery} xml plugin-XML
|
||||
*/
|
||||
function dmraid_populate(xml) {
|
||||
var htmltypes = "";
|
||||
|
||||
$("#Plugin_DMRaidTable").empty();
|
||||
$("Plugins Plugin_DMRaid Raid", xml).each(function dmraid_getdevice(id) {
|
||||
var htmldisks = "", htmldisklist = "", topic = "", name = "", buildedaction = "";
|
||||
name = $(this).attr("Device_Name");
|
||||
htmldisklist += dmraid_diskicon(this);
|
||||
htmldisks += "<table style=\"width:100%;\">";
|
||||
htmldisks += "<tr><td>" + htmldisklist + "</td></tr>";
|
||||
htmldisks += "<tr><td>" + dmraid_buildinfos($(this), id) + "<td></tr>";
|
||||
htmldisks += "</table>";
|
||||
if (id) {
|
||||
topic = "";
|
||||
}
|
||||
else {
|
||||
topic = genlang(2, false, "DMRaid");
|
||||
}
|
||||
$("#Plugin_DMRaidTable").append("<tr><td>" + topic + "</td><td><div class=\"plugin_dmraid_biun\" style=\"text-align:left;\"><b>" + name + "</b></div>" + htmldisks + "</td></tr>");
|
||||
$("#sPlugin_DMRaid_Info" + id).click(function dmraid_showinfo() {
|
||||
$("#Plugin_DMRaid_InfoTable" + id).slideDown("slow");
|
||||
$("#sPlugin_DMRaid_Info" + id).hide();
|
||||
$("#hPlugin_DMRaid_Info" + id).show();
|
||||
});
|
||||
$("#hPlugin_DMRaid_Info" + id).click(function dmraid_hideinfo() {
|
||||
$("#Plugin_DMRaid_InfoTable" + id).slideUp("slow");
|
||||
$("#hPlugin_DMRaid_Info" + id).hide();
|
||||
$("#sPlugin_DMRaid_Info" + id).show();
|
||||
});
|
||||
dmraid_show = true;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* load the xml via ajax
|
||||
*/
|
||||
function dmraid_request() {
|
||||
$.ajax({
|
||||
url: "xml.php?plugin=DMRaid",
|
||||
dataType: "xml",
|
||||
error: function dmraid_error() {
|
||||
$.jGrowl("Error loading XML document for Plugin DMRaid");
|
||||
},
|
||||
success: function dmraid_buildblock(xml) {
|
||||
populateErrors(xml);
|
||||
dmraid_populate(xml);
|
||||
if (dmraid_show) {
|
||||
plugin_translate("DMRaid");
|
||||
$("#Plugin_DMRaid").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function dmraid_buildpage() {
|
||||
var html = "";
|
||||
|
||||
$("#footer").before(buildBlock("DMRaid", 1, true));
|
||||
html += " <table id=\"Plugin_DMRaidTable\" style=\"border-spacing:0;\">\n";
|
||||
html += " </table>\n";
|
||||
$("#Plugin_DMRaid").append(html);
|
||||
|
||||
$("#Plugin_DMRaid").css("width", "915px");
|
||||
|
||||
dmraid_request();
|
||||
|
||||
$("#Reload_DMRaidTable").click(function dmraid_reload(id) {
|
||||
dmraid_request();
|
||||
$("#Reload_DMRaidTable").attr("title",datetime());
|
||||
});
|
||||
});
|
95
root/opt/phpsysinfo/plugins/dmraid/js/dmraid_bootstrap.js
Normal file
95
root/opt/phpsysinfo/plugins/dmraid/js/dmraid_bootstrap.js
Normal file
@@ -0,0 +1,95 @@
|
||||
function renderPlugin_dmraid(data) {
|
||||
|
||||
function raid_diskicon(data) {
|
||||
var html = "";
|
||||
var img = "", alt = "";
|
||||
|
||||
html += "<div style=\"text-align: center; float: left; margin-bottom: 5px; margin-right: 20px; width: 64px;\">";
|
||||
switch (data["Status"]) {
|
||||
case " ":
|
||||
case "":
|
||||
img = "harddriveok.png";
|
||||
alt = "ok";
|
||||
break;
|
||||
case "F":
|
||||
img = "harddrivefail.png";
|
||||
alt = "fail";
|
||||
break;
|
||||
case "S":
|
||||
img = "harddrivespare.png";
|
||||
alt = "spare";
|
||||
break;
|
||||
case "W":
|
||||
img = "harddrivewarn.png";
|
||||
alt = "warning";
|
||||
break;
|
||||
default:
|
||||
alert("--" + data["Status"] + "--");
|
||||
img = "error.png";
|
||||
alt = "error";
|
||||
break;
|
||||
}
|
||||
html += "<img src=\"./plugins/dmraid/gfx/" + img + "\" alt=\"" + alt + "\" />";
|
||||
html += "<small>" + data["Name"] + "</small>";
|
||||
html += "</div>";
|
||||
return html;
|
||||
}
|
||||
|
||||
if (data['Plugins']['Plugin_DMRaid'] !== undefined) {
|
||||
var dmitems = items(data['Plugins']['Plugin_DMRaid']['Raid']);
|
||||
if (dmitems.length > 0) {
|
||||
var html = '';
|
||||
for (i = 0; i < dmitems.length ; i++) {
|
||||
if (i) {
|
||||
html += "<tr><td></td><td>";
|
||||
} else {
|
||||
html += "<tr><th>RAID-Devices</th><td>";
|
||||
}
|
||||
|
||||
if (dmitems[i]['Disks'] !== undefined) {
|
||||
html += "<table style=\"width:100%;\">";
|
||||
html += "<tr><td>";
|
||||
|
||||
var diskitems = items(dmitems[i]['Disks']['Disk']);
|
||||
for (j = 0; j < diskitems.length ; j++) {
|
||||
html += raid_diskicon(diskitems[j]["@attributes"]);
|
||||
}
|
||||
|
||||
html += "</td></tr><tr><td>";
|
||||
html += "<table id=\"dmraid-" + i + "\"class=\"table table-hover table-condensed\">";
|
||||
html += "<tr class=\"treegrid-dmraid-" + i + "\"><td><b>" + dmitems[i]["@attributes"]["Device_Name"] + "</b></td><td></td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Name</td><td>" + dmitems[i]["@attributes"]["Name"] + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Status</th><td>" + dmitems[i]["@attributes"]["Disk_Status"] + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>RAID-Type</th><td>" + dmitems[i]["@attributes"]["Type"] + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Size</th><td>" + parseInt(dmitems[i]["@attributes"]["Size"]) + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Stride</th><td>" + parseInt(dmitems[i]["@attributes"]["Stride"]) + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Subsets</th><td>" + parseInt(dmitems[i]["@attributes"]["Subsets"]) + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Devices</th><td>" + parseInt(dmitems[i]["@attributes"]["Devs"]) + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Spares</th><td>" + parseInt(dmitems[i]["@attributes"]["Spares"]) + "</td></tr>";
|
||||
html += "</table>";
|
||||
html += "</td></tr>";
|
||||
html += "</table>";
|
||||
}
|
||||
|
||||
html +="</td></tr>";
|
||||
}
|
||||
$('#dmraid').empty().append(html);
|
||||
|
||||
for (i = 0; i < dmitems.length ; i++) {
|
||||
if (dmitems[i]['Disks'] !== undefined) {
|
||||
$('#dmraid-'+i).treegrid({
|
||||
initialState: 'collapsed',
|
||||
expanderExpandedClass: 'normalicon normalicon-down',
|
||||
expanderCollapsedClass: 'normalicon normalicon-right'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$('#block_dmraid').show();
|
||||
} else {
|
||||
$('#block_dmraid').hide();
|
||||
}
|
||||
} else {
|
||||
$('#block_dmraid').hide();
|
||||
}
|
||||
}
|
42
root/opt/phpsysinfo/plugins/dmraid/lang/en.xml
Normal file
42
root/opt/phpsysinfo/plugins/dmraid/lang/en.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: English Created by: Michael Cramer
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_dmraid_001" name="dmraid_title">
|
||||
<exp>RAID Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_002" name="dmraid_devices">
|
||||
<exp>RAID-Devices</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_003" name="dmraid_infos">
|
||||
<exp>Additional Information </exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_004" name="dmraid_name">
|
||||
<exp>Name</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_005" name="dmraid_status">
|
||||
<exp>Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_006" name="dmraid_type">
|
||||
<exp>RAID-Type</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_007" name="dmraid_size">
|
||||
<exp>Size</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_008" name="dmraid_stride">
|
||||
<exp>Stride</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_009" name="dmraid_subsets">
|
||||
<exp>Subsets</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_010" name="dmraid_devs">
|
||||
<exp>Devices</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_011" name="dmraid_spares">
|
||||
<exp>Spares</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
41
root/opt/phpsysinfo/plugins/dmraid/lang/fr.xml
Normal file
41
root/opt/phpsysinfo/plugins/dmraid/lang/fr.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
phpSysInfo language file Language: French Created by: phpsysinfo
|
||||
-->
|
||||
<tns:translationPlugin language="french" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_dmraid_001" name="dmraid_title">
|
||||
<exp>Statut RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_002" name="dmraid_devices">
|
||||
<exp>Périphériques RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_003" name="dmraid_infos">
|
||||
<exp>Informations additionnelles</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_004" name="dmraid_name">
|
||||
<exp>Nom</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_005" name="dmraid_status">
|
||||
<exp>Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_006" name="dmraid_type">
|
||||
<exp>Type de RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_007" name="dmraid_size">
|
||||
<exp>Taille</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_008" name="dmraid_stride">
|
||||
<exp>Granularité</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_009" name="dmraid_subsets">
|
||||
<exp>Sous-ensembles</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_010" name="dmraid_devs">
|
||||
<exp>Périphériques</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_011" name="dmraid_spares">
|
||||
<exp>Rechanges</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
42
root/opt/phpsysinfo/plugins/dmraid/lang/ro.xml
Normal file
42
root/opt/phpsysinfo/plugins/dmraid/lang/ro.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: ro.xml 661 2014-05-02 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Romană Created by: Iulian Alexe
|
||||
-->
|
||||
<tns:translationPlugin language="romana" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_dmraid_001" name="dmraid_title">
|
||||
<exp>Stare RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_002" name="dmraid_devices">
|
||||
<exp>Dispozitive RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_003" name="dmraid_infos">
|
||||
<exp>Informații Aditionale </exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_004" name="dmraid_name">
|
||||
<exp>Nume</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_005" name="dmraid_status">
|
||||
<exp>Stare</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_006" name="dmraid_type">
|
||||
<exp>Tip RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_007" name="dmraid_size">
|
||||
<exp>Dimensiune</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_008" name="dmraid_stride">
|
||||
<exp>Pas</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_009" name="dmraid_subsets">
|
||||
<exp>Subseturi</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_010" name="dmraid_devs">
|
||||
<exp>Dispozitive</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_011" name="dmraid_spares">
|
||||
<exp>Piese</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
41
root/opt/phpsysinfo/plugins/dmraid/lang/ru.xml
Normal file
41
root/opt/phpsysinfo/plugins/dmraid/lang/ru.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
phpSysInfo language file Language: Russian Created by: Denis Sevostyanov (den007)
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_dmraid_001" name="dmraid_title">
|
||||
<exp>RAID Статус</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_002" name="dmraid_devices">
|
||||
<exp>RAID-Устройств</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_003" name="dmraid_infos">
|
||||
<exp>Дополнительная Информация</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_004" name="dmraid_name">
|
||||
<exp>Имя</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_005" name="dmraid_status">
|
||||
<exp>Статус</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_006" name="dmraid_type">
|
||||
<exp>RAID-Тип</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_007" name="dmraid_size">
|
||||
<exp>Размер</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_008" name="dmraid_stride">
|
||||
<exp>Шаг</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_009" name="dmraid_subsets">
|
||||
<exp>Подмножество</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_010" name="dmraid_devs">
|
||||
<exp>Устройство</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_011" name="dmraid_spares">
|
||||
<exp>Резервировано</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
Reference in New Issue
Block a user