home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / trial / MonitorIT 5.2.06 / monitorit_fullsetup.exe / data1.cab / Rpm / ViewHDDStatus.asp < prev    next >
Encoding:
Text File  |  2003-06-24  |  32.1 KB  |  917 lines

  1. <html>
  2.  
  3. <head>
  4.  
  5. <title>HDDWatch Monitoring</title>
  6. <link rel="stylesheet" type="text/css" href="css/rpmstyle.css">
  7.  
  8. <style type="text/css"> 
  9. .GTabBox {  height : 400; width : 630; border: none; background-color : activeborder }
  10.  
  11. .VAMainBox { position:absolute; margin:0; padding:0; border: solid thin; background-color : activeborder }
  12. .VAMainBox { border-top-color : #E0E0E0; border-left-color : #E0E0E0; border-bottom-color : #555555; border-right-color : #555555 }
  13.  
  14. .EventLog { border-style : solid; margin:0; padding:0; border-width : 1;  background-color:white }
  15. .EventLog { border-top-color : graytext; border-left-color : graytext; border-bottom-color : white; border-right-color : white}
  16.  
  17. .STabSel { border-left:solid thin white; border-top:solid thin white; border-right:solid thin black }
  18. .STabSel { height : 28px; width : 110px; background-color : activeborder; color : windowtext}
  19. .STabSel { font-size : 13pt; font-weight:bold; text-align:center; vertical-align:middle }
  20.  
  21. .STabUnsel { height : 28px; width : 110px; background-color : graytext; color : captiontext}
  22. .STabUnsel { font-size : 10pt;  text-align:center; cursor:hand; vertical-align:middle}
  23. .STabUnsel { border-bottom:solid thin white; border-top:solid thin #e8e8e8;  border-left:solid thin #e8e8e8 }
  24.  
  25. .RptStatusTextBox {  background-color: white; color: infotext; }
  26. .RptStatusTextBox { border-style : solid; border-width : thin; overflow : scroll}
  27. .RptStatusTextBox { border-top-color : graytext; border-left-color : graytext; border-bottom-color : white; border-right-color : white}
  28.  
  29. .devtext { font-size: 9pt; font-weight: 500; background-color: threedhighlight; color: windowtext; border: solid thin; }
  30. .devtext { border-top-color : graytext; border-left-color : graytext; border-bottom-color : white; border-right-color : white }
  31.  
  32. </style>
  33. </head>
  34.  
  35. <body class="bodyc" language="JavaScript" RPMHostIP="!BreakoutBot:MonitorIP!" RPMHostPort="!BreakoutBot:MonitorPort!" RPMUserName="!BreakoutBot:UserName!" BOBDone="!BreakoutBot:Done!" onload="top.banner.savePageCoord(event,document.body,'ViewHDDStatus'); SR_Init()" onunload="DiscoRpmCC_AR()" onresize="processSizeChange()" onclick="checkClick()" onkeydown="processBSP()">
  36.  
  37. <script LANGUAGE="JavaScript">
  38. <!--
  39. var    AR_CompIDArray = ""; // Computer Id Array
  40. var    Lb = "<BR>"; // Line break
  41. var    Tid = null;
  42. var    GTid = null;
  43. var    CTid = null;
  44. var   ignoreDBChangeEvent = false;
  45. var    RMode = ""; // Mode of Operation, New, Edit, Delete, Lookup
  46. var    CmpLupRecCount = 0; // Computer Lookup record count
  47. var    CmpRecLth = 7; // Computer Loopkup record length
  48. var   CurCmpStoreIdx = 0; // index into Computer Store for Selected Computer Name
  49. var     ReconnectEvent = false;
  50. var     Hp = 82;
  51. var     AR_CmpStoreArr = new Array();
  52. var     AR_GroupStoreArr = new Array();
  53. var     MostRecentHours = 6;
  54. var   DetailsArr = new Array();
  55. var    DetailsArrIx = 0;
  56. var     ELBgFlg = 0; // Log Background color toggle
  57.  
  58. // Capture and ignore script errors
  59.     window.onerror = wwScrErr;
  60. function wwScrErr() {
  61.     return true;
  62. }
  63.  
  64. /* Process OnLoad */
  65. function SR_Init() {
  66.     top.MainLoaded = true; // Flag that Main is now loaded
  67.     initButtonState(); // set initial button state for all buttons
  68.  
  69.     Hp = parseInt(document.body.RPMHostPort,10);
  70.     RpmCC_AR.Connect(document.body.RPMHostIP,Hp, "");
  71.     processSizeChange();
  72.     processLogWindow();
  73. }
  74.  
  75. function processRepReconnect() {
  76.     Tid = null;
  77.     if ( RpmCC_AR.IsConnected() ) {
  78.         Tid = setTimeout("processRepConnectionCheck()",30000); // Delay 30 secs then check connection
  79.         return;
  80.     }
  81.     RpmCC_AR.Connect(document.body.RPMHostIP,Hp, ""); 
  82. }
  83. function processRepConnectConfirmed() {
  84.     // Restore Filter and Computer Store    
  85.     if ( ReconnectEvent == false ) {
  86.         ReconnectEvent = true;
  87.         InitComputerLookup();
  88.     }
  89.     else {
  90.           //RpmCC_AR.NetStatFunction("GetServerInfoHDD");
  91.     }
  92.     
  93.     top.Rstatus.Pstat("Connected");
  94.     if ( Tid != null ) {
  95.         clearTimeout(Tid); // stop timeout routine
  96.     }
  97.     Tid = setTimeout("processRepConnectionCheck()",30000); // Delay 30 secs then check connection
  98. }
  99. function processRepConnectionCheck() {
  100.     Tid = null;
  101.     RpmCC_AR.SendKeepAlive("Check");
  102.     Tid = setTimeout("processRepConnectionCheck()",30000); // Delay 30 secs then check connection
  103. }
  104.  
  105. /* On Unload tell the Comm control to Disconnect from the Server */
  106. function DiscoRpmCC_AR() {
  107.     RpmCC_AR.Disconnect();
  108.     top.banner.processStopCommX();
  109.     if ( Tid != null ) {
  110.         clearTimeout(Tid); // stop timeout routine
  111.     }
  112.     if ( GTid != null ) {
  113.         clearTimeout(GTid); // stop timeout routine
  114.     }
  115.     if ( CTid != null ) {
  116.         clearTimeout(CTid); // stop timeout routine
  117.     }
  118.     SaveCurrentDisplayState();
  119. }
  120.  
  121. function SaveCurrentDisplayState() {
  122.     // Save current display state
  123.     var cc = (CurSelTab == "GroupTab") ? "0," : "1,";
  124.     for ( var i=0, GIndx=0; i<GrpLupRecCount; i++, GIndx+=GroupRecLength ) {
  125.         if ( AR_GroupStoreArr[GIndx+4] == 1 ) { // if Expanded
  126.             cc += AR_GroupStoreArr[GIndx+1] + ",";
  127.         }
  128.     }
  129.     top.banner.RpmCC_Ban.RegSetKey(top.banner.ServerID+"HDDWatchDisplayState",cc);     
  130. }
  131.  
  132. function processDBChanged() {
  133.     CTid = null;
  134.     top.banner.processStartComm(); 
  135.     top.Rstatus.StatDB.style.display = "none";
  136.     InitComputerLookup();
  137.     Tid = setTimeout("finishDBChange()",1000); // Delay 
  138. }
  139. function finishDBChange() {
  140.     Tid = null; // reset
  141.     top.banner.processStopCommX();
  142. }
  143.  
  144. /* Get Report Name from Store based on Report ID */
  145. function InitComputerLookup() {
  146.     CmpLupRecCount = 0; // initialize record counter
  147.     AR_CmpStoreArr.length = 0;
  148.     
  149.     if ( RpmCC_AR.ComputerLookup("*","*") ) {
  150.         top.Rstatus.Pstat("Unable to start the COMPUTER LOOKUP request",true);
  151.         processResetButton();
  152.     }
  153.     else { // waiting for OperationCompleteEvent
  154.           SetCursor("wait");
  155.         top.Rstatus.Pstat("One moment while COMPUTER LOOKUP request completes");
  156.     }
  157. }
  158.  
  159. /* Process Computer LOOKUP RECORD Event */
  160. function processComputerLookupRecord(Cid,Gid,Name,Desc,OSVer,Addr) {
  161.     var wrkarr = new Array();
  162.      CmpRecLth = 10; // Storage record length
  163.     var i = CmpLupRecCount * CmpRecLth;
  164.     AR_CmpStoreArr[i] = Name;
  165.     AR_CmpStoreArr[i+1] = Gid;
  166.     AR_CmpStoreArr[i+2] = Desc;
  167.     AR_CmpStoreArr[i+3] = Cid;
  168.     wrkarr = OSVer.split("[]");; // map OS version to Generic OS types
  169.     AR_CmpStoreArr[i+4] = wrkarr[0];
  170.     AR_CmpStoreArr[i+5] = Addr;
  171.     AR_CmpStoreArr[i+6] = 0; // status: 0=normal; 1=caution; 2=critical
  172.     AR_CmpStoreArr[i+7] = 0; // expanded 0=no; 1=yes    
  173.     AR_CmpStoreArr[i+8] = -1; // Display Index    
  174.     AR_CmpStoreArr[i+9] = ""; // Drive Info    
  175.     ++CmpLupRecCount;
  176. }
  177.  
  178. /* Process Computer Lookup Op Complete Event */
  179. function processComputerOpComplete() {
  180.     SetCursor("auto");
  181.     top.Rstatus.Pstat("Request Completed");
  182.     if (CmpLupRecCount == 0) { // check if any records found
  183.         top.Rstatus.Pstat("No record matches found for COMPUTER LOOKUP request",true);
  184.         processResetButton();
  185.     }
  186.  
  187.     GrpLupRecCount = 0; // initialize record counter
  188.     AR_GroupStoreArr.length = 0;
  189.     if ( RpmCC_AR.GroupLookup("","","") ) {
  190.         top.Rstatus.Pstat("Unable to start the GROUP LOOKUP request",true);
  191.         processResetButton();
  192.     }
  193.     else { // waiting for OperationCompleteEvent
  194.         top.Rstatus.Pstat("One moment while GROUP LOOKUP request completes");
  195.     }
  196. }
  197.  
  198. var   GrpLupRecCount = 0; // Count of records returned from Group Lookup operation
  199. var    GroupRecLength = 6; // Length of a Group Lookup record in the Store
  200. /* Process Group LOOKUP RECORD Event */
  201. function processGroupLookupRecord(Gid,GrpName,GrpDesc) {
  202.     // place data from Lookup Record into specified Store
  203.     // Add to Storage
  204.     var i = GrpLupRecCount * GroupRecLength;
  205.     AR_GroupStoreArr[i++] = GrpName;
  206.     AR_GroupStoreArr[i++] = Gid;
  207.     AR_GroupStoreArr[i++] = GrpDesc;
  208.     AR_GroupStoreArr[i++] = 0; // status: 0=normal; 1=caution; 2=critical
  209.     AR_GroupStoreArr[i++] = 0; // expanded 0=no; 1=yes    
  210.     AR_GroupStoreArr[i++] = 0; // Display Index
  211.     ++GrpLupRecCount;
  212. }
  213. /* Process DB Error in Group Lookup Operation */
  214. function processGroupOpError() {
  215.     top.Rstatus.Pstat("An error occurred during GROUP LOOKUP operation",true);
  216.     goResetWait();
  217. }
  218. function processGroupOpComplete() {
  219.     if ( GrpLupRecCount == 0 ) {
  220.         top.Rstatus.Pstat("No GROUP record matches found for LOOKUP request",true);    
  221.         processGeneralClick(GroupTab);
  222.     }
  223.     else {
  224.         var cc = top.banner.RpmCC_Ban.RegGetKey(top.banner.ServerID+"HDDWatchDisplayState");     
  225.         var wrkarr = new Array();
  226.         var Gid = "";
  227.         wrkarr = cc.split(",");
  228.         for ( var j=1; j<wrkarr.length; j++ ) {
  229.             Gid = wrkarr[j]; // ID of Expanded Group    
  230.             for ( var i=0, GIndx=0; i<GrpLupRecCount; i++, GIndx+=GroupRecLength ) {
  231.                 AR_GroupStoreArr[GIndx+3] = 0;
  232.                 if ( AR_GroupStoreArr[GIndx+1] == Gid ) { // if Match
  233.                     AR_GroupStoreArr[GIndx+4] = 1; // Set Expanded
  234.                     for ( var m=0, n=0; m<CmpLupRecCount; m++, n+=CmpRecLth ) {
  235.                         if ( AR_CmpStoreArr[n+1] == Gid ) {
  236.                            AR_CmpStoreArr[n+7] = 1; // Expanded State
  237.                         }
  238.                     }
  239.                 }
  240.             }
  241.         }        
  242.           processGeneralClick(GroupTab);
  243.         if ( wrkarr[0] == "1" ) {
  244.            processGeneralClick(DeviceTab);
  245.        }
  246.         processGetServerInfo();
  247.     }
  248. }
  249.  
  250. function processGetServerInfo() {
  251.     GTid = null;
  252.       RpmCC_AR.NetStatFunction("GetServerInfoHDD");
  253.     GTid = setTimeout("processGetServerInfo()",300000); // Delay 5 Minutes 
  254. }
  255.  
  256. /* Process Click on Enable Report Status Tab or Schedule Report Tab*/
  257. function enableDeviceStatus() {
  258.     processGeneralClick(DeviceTab);
  259. }
  260.  
  261. function enableGroupStatus() {
  262.     processGeneralClick(GroupTab);
  263. }
  264.  
  265.  
  266. // Process to Toggle the Hide and Show of the Banner & Menu Frames
  267. var hideToggle = 0;
  268. var TitleDivSize = 117;
  269. function processBannerMenu() {
  270.     if ( hideToggle == 0 ) {
  271.         top.BannerMenuHide(); hideToggle = 1;
  272.         NetStatusTitleDiv.style.display = "none"; 
  273.         TitleDivSize = 72; 
  274.     }
  275.     else {
  276.         top.BannerMenuShow(); hideToggle = 0;   
  277.         NetStatusTitleDiv.style.display = "";  
  278.         TitleDivSize = 117;
  279.     }   
  280. }
  281.  
  282. /* Set initial button state for all buttons */
  283. function initButtonState() {
  284. }
  285. function sButtonState(bObj,bst) {
  286.     bObj.disabled = (bst == "0") ? "" : "disabled";
  287.     //bObj.className = (bst == "0") ? "SBoxButton" : "SBoxButtonD";
  288. }
  289. function ButtonState(bObj,bst) {
  290.     bObj.disabled = (bst == "0") ? "" : "disabled";
  291.     //bObj.className = (bst == "0") ? "BoxButton" : "BoxButtonD";
  292. }
  293.  
  294. var SCbsy = false;
  295. var borderSz = 20; // Thin Bord is 2pixels
  296. function processSizeChange() {
  297.     if ( SCbsy ) 
  298.         return;
  299.     SCbsy = true;
  300.     // Display Height and Width
  301.     bCh = document.body.clientHeight;
  302.     bCw = document.body.clientWidth;
  303.     
  304.     // Minimums
  305.     bCh = (bCh < 240) ? 240 : bCh;
  306.     bCw = (bCw < 330) ? 330 : bCw;
  307.    document.body.scroll = (bCw <= 330 || bCh <= 240) ? "yes" : "no";
  308.    
  309.       //PopUpContext Menu
  310.    PopUpContextSize(bCw);
  311.   
  312.    // Set Height/Widths for Chart and Button areas
  313.     GTabBx.style.height = bCh-2;
  314.     GTabBx.style.width = bCw-borderSz;
  315.     GTab.style.top = bCh-borderSz-90;
  316.     DeviceUI.style.height = GroupUI.style.height = GTabBx.style.posHeight-TitleDivSize;
  317.     DeviceUI.style.width = GroupUI.style.width = GTab.style.width = GTabBx.style.posWidth-4;
  318.     Groupwin.style.height = GroupUI.style.posHeight-50;
  319.     Devicewin.style.height = GroupUI.style.posHeight-71;
  320.     GTabBx.style.display = "";
  321.     
  322.     GroupTab.className="STabUnsel";
  323.     DeviceTab.className="STabUnsel";
  324.     document.all[CurSelTab].className="STabSel";
  325.     
  326.     SCbsy = false;
  327. }
  328.  
  329. /* Process Click on selected Tab */
  330. var CurSelTab = "GroupTab"; // current selected tab
  331. var RTid = null;
  332. function processGeneralClick(th) {
  333.     if ( th.style.cursor =="auto" ) 
  334.         return; // ignore disabled
  335.  
  336.     top.Rstatus.Pstat("");
  337.     GroupUI.style.display="none";
  338.     DeviceUI.style.display="none";
  339.     GroupTab.className="STabUnsel";
  340.     DeviceTab.className="STabUnsel";
  341.     th.className="STabSel";
  342.     CurSelTab = th.id;
  343.     switch ( th.id ) {
  344.    case "GroupTab" : 
  345.       GroupUI.style.display=""; // Enable this Tab's view
  346.        outputGroupStatusDisplay(); 
  347.      break;
  348.    case "DeviceTab" : 
  349.          DeviceUI.style.display="";
  350.        outputDeviceStatusDisplay(); 
  351.     break;
  352.     }
  353. }
  354.  
  355. function outputGroupStatusDisplay() {
  356.     /* Format Details for output */
  357.     var GDispArr = new Array();
  358.     GDispArr.length = 0;
  359.     for ( var i=0, j=0; i<GrpLupRecCount; i++, j+=GroupRecLength ) {
  360.           GDispArr[i] = AR_GroupStoreArr[j].toLowerCase()+"    [+]"+j;
  361.     }
  362.     GDispArr.sort();
  363.  
  364.     var percent=10, rowcount=10, ExpImg="plus", StatImg="Normal";
  365.     if ( GrpLupRecCount < 10 ) { percent = 33; rowcount = 3; }
  366.     else if ( GrpLupRecCount < 20 ) { percent = 25; rowcount = 4; }
  367.     else if ( GrpLupRecCount < 30 ) { percent = 20; rowcount = 5; }
  368.     else if ( GrpLupRecCount < 40 ) { percent = 14; rowcount = 7; }
  369.     
  370.     var warr = new Array();
  371.     Groupwin.innerHTML = ""; // clear details
  372.       sob = "<center><table border='0' cellpadding='1' cellSpacing='2' width='100%'>";
  373.       for ( var j=0; j<GrpLupRecCount;  ) {
  374.         sob += "<tr>";
  375.         for ( var i=0; i<rowcount && j<GrpLupRecCount; i++, j++ ) {
  376.             warr = GDispArr[j].split("[+]");
  377.             var GIndx = parseInt(warr[1],10);
  378.             ExpImg = ( AR_GroupStoreArr[GIndx+4] ) ? "minus" : "plus";
  379.             if ( AR_GroupStoreArr[GIndx+3] == 0 ) { 
  380.                 StatImg = "Normal";
  381.             }
  382.             else if ( AR_GroupStoreArr[GIndx+3] == 1 ) { 
  383.                 StatImg = "Caution";
  384.             }
  385.             else { 
  386.                 StatImg = "Critical";
  387.             }
  388.             AR_GroupStoreArr[GIndx+5] = j; // Display Index
  389.             
  390.             sob += "<td width='"+percent+"%' align='center' class='statuslabel'>";
  391.             sob += "<img id='GroupStatus_"+j+"' src='images/"+StatImg+".gif' align='absmiddle' height='12' width='12'>";
  392.              sob += "<img id='Expand_"+j+"' src='images/"+ ExpImg+".gif' width='11' height='11' style='cursor:hand'";
  393.              sob += " onclick='processGroupExpand(this.id)' ";
  394.              sob += "title='Click to show or hide the Group`s associated servers/workstations in the `Servers` tab view'><br>";
  395.             sob += "<span title='" + AR_GroupStoreArr[GIndx+2] +"'>"+ AR_GroupStoreArr[GIndx]+"</span></td>";
  396.         }
  397.         for ( ; i<rowcount; i++ ) {
  398.              sob += "<td width='"+percent+"%' align='center' class='statuslabel'> </td>";
  399.         }
  400.         sob += "</tr>";    
  401.     }
  402.     sob += "</table></center>";
  403.     Groupwin.insertAdjacentHTML("beforeEnd",sob);
  404. }
  405.  
  406. function processGroupExpand(isx) {
  407.     if ( isx.charAt(0) != "E" ) 
  408.                 return;
  409.     var ix = isx.substring(7,isx.length); // Strip off index
  410.     var GIndx = ix * GroupRecLength;
  411.     AR_GroupStoreArr[GIndx+4] ^= 1; // toggle expand state
  412.     var Gid = AR_GroupStoreArr[GIndx+1];
  413.     var State = AR_GroupStoreArr[GIndx+4]; // Expand State
  414.     ExpImg = ( AR_GroupStoreArr[GIndx+4] ) ? "minus" : "plus";
  415.     document.all[isx].src="images/"+ ExpImg+".gif";
  416.     for ( var i=0, j=0; i<CmpLupRecCount; i++, j+=CmpRecLth ) {
  417.         if ( AR_CmpStoreArr[j+1] == Gid ) {
  418.            AR_CmpStoreArr[j+7] = State;
  419.         }
  420.     }
  421. }
  422.  
  423. var CDispArr = new Array();
  424. function outputDeviceStatusDisplay() {
  425.     var warr = new Array();
  426.     var darr = new Array();
  427.     var TBytes = 0, UBytes=0, FBytes=0, PctFree=0;
  428.  
  429.     // Reset Group Status
  430.       for ( var n=0; n<GrpLupRecCount; ++n  ) {
  431.         AR_GroupStoreArr[(n*GroupRecLength)+3] = 0;
  432.     }
  433.     // Find how many to display
  434.     CDispArr.length = 0;
  435.     for ( var i=0, j=0, k=0; i<CmpLupRecCount; i++, j+=CmpRecLth ) {
  436.         AR_CmpStoreArr[j+8] = -1; // Reset Display Index
  437.         AR_CmpStoreArr[j+6] = 0; // Reset Status
  438.         if ( AR_CmpStoreArr[j+7] == 1 ) { // if Display
  439.            CDispArr[k++] = AR_CmpStoreArr[j].toLowerCase()+"    [+]"+j;
  440.         }
  441.         else {
  442.             darr = AR_CmpStoreArr[j+9].split("~");
  443.             for ( var m=6; m+2<darr.length; m+=3 ) {
  444.                 TBytes = parseInt( darr[m+1], 10);
  445.                 FBytes = parseInt( darr[m+2], 10);
  446.                 UBytes = TBytes - FBytes;
  447.                 PctFree = ""+(FBytes*100)/TBytes; 
  448.                 if ( PctFree <= 10 ) {
  449.                     AR_CmpStoreArr[j+6] = 2;
  450.                 }
  451.                 else if ( PctFree <= 20 && AR_CmpStoreArr[j+6] == 0) {
  452.                     AR_CmpStoreArr[j+6] = 1;
  453.                 }
  454.             }        
  455.         }
  456.     }
  457.     CDispArr.sort();
  458.     
  459.     Devicewin.innerHTML = ""; // clear details
  460.     var FOps = "";
  461.      for ( var j=0; j<CDispArr.length; ++j ) {
  462.         warr = CDispArr[j].split("[+]");
  463.         var CI = parseInt(warr[1],10);
  464.         darr = AR_CmpStoreArr[CI+9].split("~");
  465.         
  466.         for ( var k=6; k+2<darr.length; k+=3 ) {
  467.             FOps += "<table border='0' cellpadding='1' cellSpacing='1' width='100%' ";    
  468.             if ((ELBgFlg ^= 1) == 0) {
  469.                 FOps += "id='Logline"+CI+"' style='background-color:white'><tr>";
  470.             }
  471.             else {
  472.                 FOps += "id='Logline"+CI+"' style='background-color:e8e8e8'><tr>";
  473.             }
  474.             FOps += "<td width='140' colspan='1' class='optext'>";
  475.             if ( k == 6 ) {
  476.                 FOps += AR_CmpStoreArr[CI+0] + "</td>";
  477.             }
  478.             else {
  479.                 FOps += " </td>";
  480.             }
  481.             FOps += "<td width='36' colspan='1' class='optext' align='center'>";
  482.             FOps += darr[k].substring(0,2) + "</td>";        
  483.             FOps += "<td width='79' colspan='1' class='optext' align='right'>";
  484.             FOps += InsertCommas(darr[k+1]) + "</td>";
  485.             
  486.             TBytes = parseInt( darr[k+1], 10);
  487.             FBytes = parseInt( darr[k+2], 10);
  488.             UBytes = TBytes - FBytes;
  489.             PctFree = ""+(Math.round((FBytes*10000)/TBytes))/100; 
  490.         
  491.             FOps += "<td width='92' colspan='1' class='optext' align='right'>";
  492.             FOps += InsertCommas(""+UBytes) + "</td>";
  493.             FOps += "<td width='92' colspan='1' class='optext' align='right'>";
  494.             FOps += InsertCommas(""+FBytes) + "</td>";
  495.             FOps += "<td width='56' colspan='1' class='optext' align='center'>";
  496.             FOps += PctFree + "</td>";
  497.         
  498.             // set percentages 
  499.             if ( PctFree == 0 ) { PctFree = 1; }
  500.             Cavg = (100-PctFree)+"%";
  501.             Bavg = PctFree+"%";
  502.             Aavg = Davg = "0%";
  503.              FOps += "<td width='*' colspan='1' class='optext'>"
  504.             FOps += "<table border='0' cellpadding='0' cellSpacing='0' height='12' width='100%'><tr>";
  505.             if ( PctFree <= 10 ) {
  506.                 FOps += "<td width='"+Bavg+"' align='center' style='background-color:red'></td>";
  507.                 AR_CmpStoreArr[CI+6] = 2;
  508.             }
  509.             else if ( PctFree <= 20 ) {
  510.                 FOps += "<td width='"+Bavg+"' align='center' style='background-color:yellow'></td>";
  511.                 if ( AR_CmpStoreArr[CI+6] == 0 ) {
  512.                     AR_CmpStoreArr[CI+6] = 1;
  513.                 }
  514.             }
  515.             else {
  516.                 FOps += "<td width='"+Bavg+"' align='center' style='background-color:green'></td>";
  517.             }
  518.             FOps += "<td width='"+Cavg+"'></td>";
  519.             FOps += "</tr></table>";    
  520.             FOps += "</td>";
  521.             FOps += "</tr></table>";        
  522.         }
  523.     }
  524.     Devicewin.insertAdjacentHTML("beforeEnd",FOps);
  525.     SaveCurrentDisplayState();
  526.     
  527.     var GStat = 0;        
  528.     for ( var p=0, GIndx=0; p<GrpLupRecCount; p++, GIndx+=GroupRecLength ) {
  529.         for ( var m=0, n=0; m<CmpLupRecCount; m++, n+=CmpRecLth ) {
  530.             if ( AR_GroupStoreArr[GIndx+1] == AR_CmpStoreArr[n+1] ) { // if match on Gid
  531.                 if ( AR_CmpStoreArr[n+6] == 2 ) {
  532.                     GStat = 2;
  533.                     break;
  534.                 }
  535.                 if ( AR_CmpStoreArr[n+6] == 1 ) {
  536.                     GStat = 1;
  537.                 }
  538.             }
  539.         }
  540.           if ( AR_GroupStoreArr[GIndx+3] != GStat ) { // Status changed
  541.             AR_GroupStoreArr[GIndx+3] = GStat;
  542.             // Update Group icon 
  543.             if ( GStat == 0 ) StatImg = "Normal";
  544.             else if ( GStat == 1 ) StatImg = "Caution";
  545.             else StatImg = "Critical";
  546.             document.all["GroupStatus_"+AR_GroupStoreArr[GIndx+5]].src="images/"+StatImg+".gif";
  547.         }
  548.         GStat = 0;
  549.     }
  550. }
  551.  
  552. /* Initialize the Log and Filter Windows */
  553. function processLogWindow() {
  554.     // Format Output to Log Window 
  555.     FOps = "<table border='0' cellpadding='1' cellSpacing='1' width='100%'><tr>";
  556.     FOps += "<td width='140' align='center' style='background-color:activeborder' class='optextb'>";
  557.     FOps += "Server Name" + "</td>";
  558.     FOps += "<td width='36' align='center' style='background-color:activeborder' class='optextb'>";
  559.     FOps += "Drive" + "</td>";
  560.     FOps += "<td width='79' align='center' style='background-color:activeborder' class='optextb'>";
  561.     FOps += "Capacity(Mb)" + "</td>";
  562.     FOps += "<td width='92' align='center' style='background-color:activeborder' class='optextb'>";
  563.     FOps += "Used Space(Mb)" + "</td>";
  564.     FOps += "<td width='92' align='center' style='background-color:activeborder' class='optextb'>";
  565.     FOps += "Free Space(Mb)" + "</td>";
  566.     FOps += "<td width='56' align='center' style='background-color:activeborder' class='optextb'>";
  567.     FOps += "% Free" + "</td>";
  568.     FOps += "<td width='*' align='center' style='background-color:activeborder' class='optextb'>";
  569.     FOps += "Free Space Meter" + "</td>";
  570.     FOps += "</tr></table>";
  571.     ELogWin.insertAdjacentHTML("afterBegin",FOps);
  572. }
  573.  
  574. function GetGrpNameFromID(Gid) {
  575.     for ( var i=0, GIndx=0; i<GrpLupRecCount; i++, GIndx+=GroupRecLength ) {
  576.         if ( AR_GroupStoreArr[GIndx+1] == Gid ) {
  577.             return AR_GroupStoreArr[GIndx];
  578.         }
  579.     }
  580.     return "";
  581. }
  582.  
  583. function processSelect(Type) {
  584.     State = ( Type == "0" ) ? 1 : 0;
  585.     for ( var i=0, GIndx=0; i<GrpLupRecCount; i++, GIndx+=GroupRecLength ) {
  586.         AR_GroupStoreArr[GIndx+4] = State; // set state
  587.         var Gid = AR_GroupStoreArr[GIndx+1];
  588.         ExpImg = ( State ) ? "minus" : "plus";
  589.         document.all["Expand_"+i].src="images/"+ ExpImg+".gif";
  590.     }
  591.     for ( var j=0, k=0; j<CmpLupRecCount; j++, k+=CmpRecLth ) {
  592.         AR_CmpStoreArr[k+7] = State;
  593.     }
  594.     if ( State ) {
  595.         enableDeviceStatus();
  596.         outputDeviceStatusDisplay();
  597.     }
  598. }
  599. function processHDDInfo(csArg) {
  600.     var wrkarr = new Array();
  601.     wrkarr = csArg.split("~");
  602.     
  603.     if ( wrkarr[1] == "Done" ) {
  604.        outputDeviceStatusDisplay();
  605.        return;
  606.     }
  607.     for ( var i=0, j=0; i<CmpLupRecCount; i++, j+=CmpRecLth ) {
  608.         if ( AR_CmpStoreArr[j+3] == wrkarr[1] ) { // Match on Computer ID
  609.             AR_CmpStoreArr[j+9] = csArg;
  610.             break;
  611.         } // end If match
  612.     } // end For on Computer search
  613. }
  614.  
  615. function InsertCommas( szNum ) {
  616.     var csInt = "";
  617.     var csRemainder = "";
  618.     var cs = "";
  619.  
  620.     var Decimal = szNum.indexOf( "." );
  621.     if ( -1 != Decimal )    {
  622.         csInt       = szNum.substr( 0, Decimal );
  623.         csRemainder = szNum.substr( Decimal+1 );
  624.     }
  625.     else
  626.         csInt = szNum;
  627.         
  628.     switch ( csInt.length )    {
  629.         case 9:
  630.             cs = csInt.charAt(0)+""+csInt.charAt(1)+""+csInt.charAt(2)+",";
  631.             cs += csInt.charAt(3)+""+csInt.charAt(4)+""+csInt.charAt(5)+",";
  632.             cs += csInt.charAt(6)+""+csInt.charAt(7)+""+csInt.charAt(8);
  633.             break;
  634.  
  635.         case 8:
  636.             cs = csInt.charAt(0)+""+csInt.charAt(1)+","+csInt.charAt(2)+"";
  637.             cs += csInt.charAt(3)+""+csInt.charAt(4)+","+csInt.charAt(5)+"";
  638.             cs += csInt.charAt(6)+""+csInt.charAt(7);
  639.             break;
  640.  
  641.         case 7:
  642.             cs = csInt.charAt(0)+","+csInt.charAt(1)+""+csInt.charAt(2)+"";
  643.             cs += csInt.charAt(3)+","+csInt.charAt(4)+""+csInt.charAt(5)+"";
  644.             cs += csInt.charAt(6);
  645.             break;
  646.  
  647.         case 6:
  648.             cs = csInt.charAt(0)+""+csInt.charAt(1)+""+csInt.charAt(2)+",";
  649.             cs += csInt.charAt(3)+""+csInt.charAt(4)+""+csInt.charAt(5);
  650.             break;
  651.  
  652.         case 5:
  653.             cs = csInt.charAt(0)+""+csInt.charAt(1)+","+csInt.charAt(2)+"";
  654.             cs += csInt.charAt(3)+""+csInt.charAt(4);
  655.             break;
  656.  
  657.         case 4:
  658.             cs = csInt.charAt(0)+","+csInt.charAt(1)+""+csInt.charAt(2)+"";
  659.             cs += csInt.charAt(3);
  660.             break;
  661.  
  662.         case 3:
  663.         case 2:
  664.         case 1:
  665.         case 0:
  666.         default:
  667.             cs = csInt;
  668.     }
  669.     cs += csRemainder;
  670.  
  671.     return cs;
  672. }
  673.  
  674. function processResetButton() {
  675.       SetCursor("auto");
  676. }
  677.  
  678. function PopUpContextOpen() {
  679. }
  680. function PopUpContextClose() {
  681. }
  682.  
  683. function processKeyPress() {
  684.     /* get KeyCode and check if invalid */
  685.     kc = event.keyCode;
  686.     stat = 1; // default to OK
  687.  
  688.     // Keys:   ~            %           [           ]           #           !
  689.     if (kc == 126 ||    kc == 37 || kc == 91 ||    kc == 93 || kc == 35 || kc == 33) { // Not acceptable 
  690.         stat = 0;
  691.     } // Keys:        *           ?
  692.     else if ( (kc == 42 || kc == 63) &&  event.srcElement.name != "AR_Rpt" ) { //Not acceptable
  693.         stat = 0;
  694.     }
  695.     if (stat == 0) { // if Not Acceptable
  696.         event.returnValue=false;
  697.         top.Rstatus.Pstat("Keys ~%*?[]#! are not accepted for this field");    
  698.         alert("Keys ~%*?[]#! are not accepted for this field");    
  699.     }
  700.     else {
  701.         top.Rstatus.Pstat(""); // clear status line
  702.     }
  703. }    
  704. // Print Display
  705. var DiscStatWindow = null;
  706. function processPrintStatus() {
  707.     if ( !top.banner.IE55orBetter ) {
  708.         alert("Print requires IE 5.5/SP1 or greater. Download current, free IE update from Microsoft's web site");
  709.         return;
  710.     }
  711.     FakeBut.click();    // simulate event to call "savePageCoord(...)"
  712.     var wprop = "height="+top.banner.bCh+",width="+top.banner.bCw
  713.     wprop += ",top="+(top.banner.bY-28)+",left="+(top.banner.bX-4)+",scrollbars";
  714.     var rName = ""+Math.random(); // use Random number to get unique Window name
  715.     rName = rName.substring(2,rName.length);
  716.     DiscStatWindow = window.open("",rName,wprop);
  717.     if ( DiscStatWindow == null ) {
  718.         return;   
  719.     }
  720.     var dh = "<html><head><title>MonitorIT - Logical Drive Status Report</title>";
  721.     dh += "<link rel='stylesheet' type='text/css' href='css/rpmstyle.css'></head><body";
  722.     dh += " title='Exit to Close Window when Printing is complete'>"; 
  723.     dh += ELogWin.innerHTML;
  724.     dh += Devicewin.innerHTML;
  725.     dh += '<script LANGUAGE="JavaScript">window.focus();';
  726.     dh += ' </script></body></html>';
  727.     DiscStatWindow.document.open();
  728.     DiscStatWindow.document.write(dh)
  729.     DiscStatWindow.document.close();
  730.     DiscStatWindow.print();
  731. }
  732. //-->
  733. </script>
  734.  
  735. <script LANGUAGE="JavaScript" src="js/MiscFunc.js"></script>
  736. <script LANGUAGE="JavaScript" src="js/ButtonFunc.js"></script>
  737. <script LANGUAGE="JavaScript" src="js/AlertFunc.js"></script>
  738.  
  739. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="NetStatNotify(csArg)">
  740. <!--
  741. var wrkarr = new Array();
  742. wrkarr = csArg.split("~");
  743. if ( wrkarr[0] == "SIHDD" ) {
  744.     processHDDInfo(csArg);
  745. }
  746. //-->
  747. </script> 
  748.  
  749. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="Connected()">
  750. <!--
  751. processRepConnectConfirmed();
  752. //-->
  753. </script> 
  754.  
  755. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="Disconnected()">
  756. <!--
  757. top.Rstatus.Pstat("Disconnected",true);
  758. if ( Tid != null ) {
  759.     clearTimeout(Tid); // stop timeout routine
  760. }
  761. Tid = setTimeout("processRepReconnect()",10000); // Delay 10 secs then try reconnnect
  762. //-->
  763. </script>
  764.  
  765. <script
  766. LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="DBChanged(cdata)">
  767. <!--
  768. var warr = new Array();
  769. warr = cdata.split("~"); // parse the event data
  770. // process only if Computer, Watch/Alert or Group Table change
  771. if ( (warr[0] == "1" || warr[0] == "2" || warr[0] == "5") && ignoreDBChangeEvent == false ) {
  772.     top.Rstatus.StatDB.style.display = "";
  773.     if ( CTid == null ) {
  774.         CTid = setTimeout("processDBChanged()",30000); // Delay 30 secs then process
  775.     }
  776. }
  777. //-->
  778. </script>
  779.  
  780. <script FOR="RpmCC_AR" EVENT="ComputerLookupRecord(Cid,Gid,Sid,Nme,Desc,Pswd,OSVer,Addr,Port)">
  781. <!--
  782. processComputerLookupRecord(Cid,Gid,Nme,Desc,OSVer,Addr);
  783. //-->
  784. </script>
  785.  
  786. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="ComputerOpComplete()">
  787. <!--
  788. processComputerOpComplete();
  789. //-->
  790. </script>
  791.  
  792. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="ComputerOpError()">
  793. <!--
  794. processComputerOpError();
  795. //-->
  796. </script> 
  797.  
  798. <script FOR="RpmCC_AR" EVENT="GroupLookupRecord(Gid,GNme,GDesc)">
  799. <!--
  800. processGroupLookupRecord(Gid,GNme,GDesc);
  801. //-->
  802. </script> 
  803.  
  804. <script FOR="RpmCC_AR" EVENT="GroupOpComplete()">
  805. <!--
  806. processGroupOpComplete();
  807. //-->
  808. </script> 
  809. <script FOR="RpmCC_AR" EVENT="GroupOpError()">
  810. <!--
  811. processGroupOpError();
  812. //-->
  813. </script>
  814.  
  815. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="StartCommunication()">
  816. <!--
  817. top.banner.processStartComm();
  818. //-->
  819. </script> 
  820.  
  821. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="StopCommunication()">
  822. <!--
  823. top.banner.processStopComm();
  824. //-->
  825. </script> 
  826.  
  827. <script LANGUAGE="JavaScript" src="js/PopUpMenuFunc.js"></script>
  828.  
  829. <object ID="RpmCC_AR" NAME="RpmCC_AR" WIDTH="14" HEIGHT="1" style="display:none" CLASSID="CLSID:D88C2358-FC83-11D1-BF49-00104B2D6F80" CODEBASE="controls/RPMComm.cab#version=5,2,0,0">
  830.   <param name="_Version" value="65536">
  831.   <param name="_ExtentX" value="2646">
  832.   <param name="_ExtentY" value="1341">
  833.   <param name="_StockProps" value="0">
  834. </object>
  835.  
  836. <!-- Invisible Object to Support Simulated Click Event -->
  837. <button id="FakeBut" style="display:none" onclick="top.banner.savePageCoord(event,document.body,'ViewHDDStatus')">
  838. </button>
  839.  
  840. <select ONCHANGE="processAlertName()" SIZE="1" NAME="AL_AlertSel" id="AL_AlertSel" class="idis" style="width: 185pt" style="display: none"></select> 
  841.  
  842. <!-- Define Images used in dynamic HTML generation to force loading and caching now -->
  843. <div style="display:none">
  844. <img src="images/sViewAlerts.gif"><img src="images/selectall.gif"><img src="images/Unchecked.gif">
  845. <img src="images/unselectall.gif"><img src="images/Computer.gif"><img src="images/Printer.gif">
  846. <img src="images/Checked.gif"><img src="images/CloseImg.gif"><img src="images/NetStatusSm.bmp">
  847. <img src="images/FullView.gif"><img src="images/Normal.gif"><img src="images/Caution.gif">
  848. <img src="images/Critical.gif">
  849. </div>
  850.  
  851. <div id="GTabBx" class="GTabBox" border="0" align="left" style="display:none">
  852.  <div id="NetStatusTitleDiv" align="left" width="98%">
  853.  <table border="1"  borderColor="activeborder" align="left">
  854.     <tr><td borderColorDark="graytext" borderColorLight="white" style="font-weight:800; font-size:12pt; background-color:threedhighlight; color:windowtext"> <img src="images/HDDWatch.gif" align="absmiddle" height="16" width="16"> HDDWatch Monitoring </td>         
  855.    </tr>
  856.  </table><BR CLEAR=ALL><HR align="left">
  857.  </div>
  858.  
  859.  
  860. <div id="GTab" align="left" >
  861.     <table width="100%" border="0" cellspacing="0" cellpadding="0">
  862.         <tr>
  863.         <td valign="center" id="GroupTab"  class="STabSel" onclick="processGeneralClick(this)">Groups</td>
  864.         <td valign="center" id="DeviceTab"  class="STabUnsel" onclick="processGeneralClick(this)">Servers</td>
  865.         <td width="*" style="border-bottom: solid thin white"> </td>
  866.       </tr>
  867.     </table>
  868.  
  869. <div id="GroupUI" class="Lbr_border" style="border-left:solid thin white; border-bottom:solid thin graytext; border-right:solid thin graytext" SelDate="" align="center">
  870.  
  871.   <table width="100%" height="100%" border="0" cellspacing="3" cellpadding="2" >
  872.     <tr>
  873.           <td height="25px" align="center" class="inputlabel">Group Logical Drive Status</td>
  874.       </tr>
  875.        <tr>
  876.         <td height="*" width="92%">      
  877.         <div align="center" class="RptStatusTextBox" Name="Groupwin" ID="Groupwin" ></div>
  878.       </td>
  879.      </tr>
  880.    
  881.      <tr>
  882.        <td height="30px" width="92%">
  883.           <div classFlag="idis" ><table border="1" cellspacing="1" cellpadding="1" height="30" width="100%"><tr><td width="23%" align="left" class="inputlabel"> </td><td width="54%" align="center"><button title="Show status of all servers/devices for all the Groups in the 'Devices' tab view" onclick="processSelect('0')" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" style="width:95px; height:24px" id="bSelC" ><img src="images/FullView.gif" align="absmiddle" height="16" width="16"> Expand All</button>  <button title="Hide status of all servers/devices for all the Groups in the 'Devices' tab view" onclick="processSelect('1')" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" style="width:95px; height:24px" id="bUselC" ><img src="images/Collapse.gif" align="absmiddle" height="14" width="16">Collapse All</button></td><td width="23%" align="right" class="inputlabel"><button onclick="processBannerMenu()" title="Press to Toggle Hide/Show of Menu and Banner Frames"><img src="images/FullView.gif" align="absmiddle" height="16" width="16"></button></td></tr></table></div>
  884.         </td>
  885.        </tr>
  886.     </table>
  887.             
  888. </div>
  889.  
  890. <div id="DeviceUI" class="Lbr_border" style="display:none; border-left:solid thin white; border-bottom:solid thin graytext; border-right:solid thin graytext" SelDate="" align="center">
  891.  
  892.   <table width="100%" height="100%" border="0" cellspacing="3" cellpadding="2" >
  893.     <tr>
  894.           <td height="25px" align="center" class="inputlabel">Server/Workstation Logical Drive Status</td>
  895.       </tr>
  896.        <tr>
  897.         <td height="*" width="92%">  
  898.          <div class="EventLog" ID="ELogWin" style="width:100%" align="center" ></div>
  899.             
  900.         <div align="center" class="RptStatusTextBox" Name="Devicewin" ID="Devicewin" classFlag ="idis" ></div>
  901.       </td>
  902.      </tr>
  903.    
  904.      <tr>
  905.        <td height="30px" width="92%">
  906.           <div classFlag="idis" ><table border="1" cellspacing="1" cellpadding="1" height="30" width="100%"><tr><td width="40%" align="left" class="inputlabel"> </td><td width="20%" align="center"><button id="StatusPrintButton" title="Print Logical Drive Status Display" onclick="if (this.bdis == '0') processPrintStatus();" bdis="0" style="width:85px; height:24px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand"><img src="images/Printer.gif" align="absmiddle" height="15" width="17"> Print</button></td><td width="40%" align="right" class="statuslabel"><button onclick="processBannerMenu()" title="Press to Toggle Hide/Show of Menu and Banner Frames"><img src="images/FullView.gif" align="absmiddle" height="16" width="16"></button></td></tr></table></div>
  907.         </td>
  908.        </tr>
  909.     </table>
  910. </div>
  911.  
  912. </div>
  913.  
  914. </div>
  915. </body>
  916. </html>
  917.