(function(g){var h=new function(){this.RAID=function(){this.category="Hardware";this.name="RAID";this.subnavigationicon="sec-nav-raid.png";var c=void 0;this.Init=function(){c=this;if(void 0==c||null==c)return!1;c.setCycleTime(2E3);c.setCommunicationObj(g.DevMan.getCommunicationModule(g.DevMan.CommunicationType.mdp));c.addParameter("RAID_Property_ControllerInfo_State",!0);c.addParameter("RAID_Property_ControllerInfo_OfflineReason",!0);c.addParameter("RAID_Property_SetsType_Len",!0);c.addParameter("RAID_Property_SetsStateInfo_Len",
!0);c.addParameter("RAID_Property_SetsDrives_Len",!0);c.addParameter("RAID_Property_DrivesSerialNumber_Len",!0);c.addParameter("RAID_Property_DrivesState_Len",!0);c.setOnInitStaticPage(h);c.setOnDisplayValues(l);return!0};var h=function(a){var b="";if(a[0].getHasValues()||a[1].getHasValues())b+="<h3>RAID Controller</h3><table>",a[0].getHasValues()&&(b+='<tr><td class="td_FirstColumn">State</td><td><div id="'+a[0].parameterName+'"></div></td></tr> '),a[1].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Offline reason</td><td><div id="'+
a[1].parameterName+'"></div></td></tr> '),b+="</table>",b+="<br>";if(a[2].getHasValues()||a[3].getHasValues()||a[4].getHasValues()){var e=0;a[2].getHasValues()&&(e=a[2].values[0].length);var f=0;a[3].getHasValues()&&(f=a[3].values[0].length);var d=0;a[4].getHasValues()&&(d=a[4].values[0].length);e=Math.max(e,f,d);for(f=0;f<e;f++)b+="<h3>RAID Set "+f+"</h3>",b+="<table>",a[2].getHasValues()&&(b+='<tr><td class="td_FirstColumn">Type</td><td><div id="'+a[2].parameterName+f+'"></div></td></tr> '),a[3].getHasValues()&&
(b+='<tr><td class="td_FirstColumn">State & Info</td><td><div id="'+a[3].parameterName+f+'"></div></td></tr> '),b+="</table>",b+="<br>",a[4].getHasValues()&&(b+='<div id="'+a[4].parameterName+f+'"></div>'),b+="<br>"}b+='<div id="status"></div>';c.writeActivePage(b);return!0},l=function(a){a[0].getHasValues()&&c.writeElement(a[0].parameterName,g.Helper.getRaidState(a[0].values[0].data));a[1].getHasValues()&&c.writeElement(a[1].parameterName,g.Helper.getRaidOfflineReason(a[1].values[0].data));if(a[2].getHasValues()||
a[3].getHasValues()||a[4].getHasValues()){var b=0;a[2].getHasValues()&&(b=a[2].values[0].length);var e=0;a[3].getHasValues()&&(e=a[3].values[0].length);var f=0;a[4].getHasValues()&&(f=a[4].values[0].length);b=Math.max(b,e,f);for(e=0;e<b;e++)if(a[2].values[0].length>e&&c.writeElement(a[2].parameterName+e,g.Helper.getRaidSetType(a[2].values[0][e].data)),a[3].values[0].length>e&&c.writeElement(a[3].parameterName+e,g.Helper.getRaidSetStateAndInfo(a[3].values[0][e].data)),a[4].values[0].length>e&&(f=g.Helper.getRaidSetsHarddisks(a[4].values[0][e].data),
0<f.length)){for(var d="",d=d+"<table>",d=d+"<tr><th></th><th>Serialnumber</th><th>Status</th></tr>",h=0;h<f.length;h++){var k=f[h],d=d+"<tr>",d=d+'<td class="td_FirstColumn">Harddisk</td>';0<a[5].values.length&&a[5].values[0].length>k&&(d+="<td>"+a[5].values[0][k].data+"</td>");0<a[6].values.length&&a[6].values[0].length>k&&(d+="<td>"+g.Helper.getRaidSetHarddiskState(a[6].values[0][k].data)+"</td>");d+="</tr>"}d+="</table>";c.writeElement(a[4].parameterName+e,d)}}}};this.RAID.prototype=new g.Page_Template.Template};
g.DevMan.RegisterModule(new h.RAID,g.DevMan.ModuleType.Website)})(window);
