mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	-bug fixing forthe page of RMC "lsevent" on Linux/AIX.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4758 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -40,6 +40,7 @@ | ||||
|     float: left; | ||||
|     width: 180px; | ||||
|     padding-left: 15px; | ||||
|     border-right: 1px solid gray; | ||||
| } | ||||
|  | ||||
| #settings | ||||
| @@ -99,7 +100,8 @@ fieldset { | ||||
|     display: block; | ||||
|     position: relative; | ||||
|     z-index: 1; | ||||
|     font-size: 1.3em; | ||||
|     font-size: 0.9em; | ||||
|     color: green; | ||||
|     padding-right: 1em; | ||||
|     line-height: 1; | ||||
|     padding: .5em 0 .5em 30px; | ||||
| @@ -141,7 +143,7 @@ fieldset { | ||||
|     float:left; | ||||
|     display: block; | ||||
|     width: 94%; | ||||
|     border: 1px solid lime; | ||||
|     border: 1px solid gray; | ||||
| } | ||||
|  | ||||
| #avail_cond { | ||||
| @@ -149,7 +151,7 @@ fieldset { | ||||
|     margin: 3px; | ||||
|     padding: 3px; | ||||
|     float: left; | ||||
|     border: 1px solid lime; | ||||
|     border: 1px solid gray; | ||||
| } | ||||
|  | ||||
| #avail_resp { | ||||
| @@ -157,7 +159,7 @@ fieldset { | ||||
|     margin: 3px; | ||||
|     padding: 3px; | ||||
|     float: left; | ||||
|     border: 1px solid lime; | ||||
|     border: 1px solid gray; | ||||
| } | ||||
|  | ||||
| /*For the RMC resources and their attributes*/ | ||||
|   | ||||
| @@ -195,7 +195,7 @@ function clearEventDisplay() | ||||
|     $(':input[name=responses][checked]').attr('checked', false); | ||||
| } | ||||
|  | ||||
| //control_RMCAssoc() | ||||
| //function control_RMCAssoc() | ||||
| //is used to update the association table in rmc_event_define.php | ||||
| function control_RMCAssoc(cond, node, resp, action) | ||||
| { | ||||
| @@ -204,7 +204,7 @@ function control_RMCAssoc(cond, node, resp, action) | ||||
|     $.get("monitor/updateCondResp.php", | ||||
|         {c: cond, n: node, r: resp, a: action}, | ||||
|         function(data) { | ||||
|             $("#association").html(data); | ||||
|             $("#association table tbody").load("monitor/updateCondRespTable.php"); | ||||
|         } | ||||
|     ); | ||||
| } | ||||
|   | ||||
| @@ -132,41 +132,12 @@ TOS6; | ||||
|         //TODO: insert the button here | ||||
|         echo "<td>"; | ||||
|         if($record[7] == "Active") { | ||||
|             echo "<button class='fg-button ui-corner-all'>Disable</button>"; | ||||
|             echo "<button class='fg-button ui-corner-all ui-state-active' onclick='control_RMCAssoc(\"$record[1]\", \"$record[5]\", \"$record[3]\", \"stop\")'>Disable</button>"; | ||||
|         }else { | ||||
|             echo "<button class='fg-button ui-corner-all'>Enable</button>"; | ||||
|             echo "<button class='fg-button ui-corner-all ui-state-active' onclick='control_RMCAssoc(\"$record[1]\", \"$record[5]\", \"$record[3]\", \"start\")'>Enable</button>"; | ||||
|         } | ||||
|         echo "</td>"; | ||||
|         echo "</tr>"; | ||||
| //        $association = explode("=", $data); | ||||
| // | ||||
| //        $ooe = 0; | ||||
| //        $line = 0; | ||||
| //        foreach($association as $elem) { | ||||
| //            $ooe = $ooe%2; | ||||
| //            //the format should be | ||||
| //            //"NodeReachability"\t"EmailRootOffShift"\t"hv8plus01.ppd.pok.ibm.com"\t"Active" | ||||
| //            $record = explode("\"", $elem); | ||||
| //            $cond = $record[1]; | ||||
| //            $resp = $record[3]; | ||||
| //            $node = $record[5]; | ||||
| //            $state = $record[7]; | ||||
| //            echo "<tr class='ListLine$ooe' id='row$line'>"; | ||||
| //            echo "<td>$cond</td>"; | ||||
| //            echo "<td>$resp</td>"; | ||||
| //            echo "<td>$node</td>"; | ||||
| //            echo "<td>$state</td>"; | ||||
| //            echo "<td>"; | ||||
| //            if($state == "Active") { | ||||
| //                insertButtons(array('label'=>'DeActivate', 'id'=>'deactivate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"stop\")")); | ||||
| //            }else if($state == "Not active"){ | ||||
| //                insertButtons(array('label'=>'Activate', 'id'=>'activate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"start\")")); | ||||
| //            } | ||||
| //            echo "</td>"; | ||||
| //            echo "</tr>"; | ||||
| //            $ooe++; | ||||
| //            $line++; | ||||
| //        } | ||||
|     } | ||||
|     echo "</tbody></table></div>"; | ||||
|     return 0; | ||||
| @@ -271,7 +242,7 @@ JS00; | ||||
|     echo "<div id='showOpt4association' style='display:block; border:1px solid lime;' class='ui-state-active'>"; | ||||
| echo <<<TOS00 | ||||
| <span class="ui-icon ui-icon-triangle-1-e" style="position:absolute"></span> | ||||
| <p>Click here if you want to create new associations...</p> | ||||
| <p class='ui-state-active'>Click here if you want to create new associations...</p> | ||||
| TOS00; | ||||
|     echo "</div>"; | ||||
|     echo "<div id=notify_me></div>"; | ||||
| @@ -280,8 +251,8 @@ TOS00; | ||||
|     echo "<div style='border: 1px dotted orange; float:right; width:73%'>"; | ||||
| echo <<<BTN00 | ||||
|     <div id="assobuttonsets" style="display:none"> | ||||
|         <button id="addAssociation" class="fg-button ui-corner-all">Apply</button> | ||||
|         <button id="cancelAssociation" class="fg-button ui-corner-all">Cancel</button> | ||||
|         <button id="addAssociation" class="fg-button ui-corner-all ui-state-active">Apply</button> | ||||
|         <button id="cancelAssociation" class="fg-button ui-corner-all ui-state-active">Cancel</button> | ||||
|     </div> | ||||
| BTN00; | ||||
|     echo "<div>"; | ||||
| @@ -359,26 +330,25 @@ function displayRMCEvnetLog() | ||||
| echo '<div id=lseventLog>'; | ||||
| echo <<<TOS8 | ||||
| <script type="text/javascript" type"utf-8"> | ||||
| $("#lseventLog").dataTable({ | ||||
|     "bLengthChange": false, | ||||
| $("#lseventLog table").dataTable({ | ||||
|     "bLengthChange": true, | ||||
|     "bFilter": true, | ||||
|     "bSort": true | ||||
| }); | ||||
| </script> | ||||
| TOS8; | ||||
| echo <<<TOS9 | ||||
| <table> | ||||
| <table style='width:100%'> | ||||
| <thead> | ||||
|     <tr> | ||||
|         <th>Time</th> | ||||
|         <th>Category</th> | ||||
|         <th>Message</th> | ||||
|         <th>Description</th> | ||||
|         <th>Time</th> | ||||
| </thead> | ||||
| <tbody> | ||||
| TOS9; | ||||
|     RMCEventLogToTable(); | ||||
|     echo "</tbody></table>"; | ||||
|     //TODO: the following javascript doesn't work well. | ||||
|     echo "</div>"; | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -69,7 +69,7 @@ $(function() { | ||||
| }); | ||||
| </script> | ||||
|  | ||||
| <div id="plist" class="ui-state-default ui-corner-all"> | ||||
| <div id="plist" class="ui-corner-all"> | ||||
| <?php displayMList(); ?> | ||||
| </div> | ||||
| <div id="settings"> | ||||
|   | ||||
| @@ -15,9 +15,7 @@ $name = $_REQUEST['name']; | ||||
|  | ||||
| //echo $name; | ||||
|  | ||||
| displayMapper(array('home'=>'main.php', 'monitor' =>'')); | ||||
|  | ||||
| displayTips(array("You can view the latest 60 RMC events here")); | ||||
| displayMapper(array('home'=>'main.php', 'monitor' =>'monitor/monlist.php', 'RMC EventLog' => '')); | ||||
|  | ||||
| //Following the "Syslog Entries" web page | ||||
| displayRMCEvnetLog(); | ||||
|   | ||||
| @@ -1,7 +1,10 @@ | ||||
| <?php | ||||
|  | ||||
| //activate/deactivate the specified condition&response association; | ||||
| //then, update the content of the table in <div id="association">; | ||||
| // For RMC Event control; | ||||
| // use "startcondresp" and "stopcondresp" commands to activate/deactivate the specified condition&response; | ||||
| // the file "updateCondRespTable.php" is used to update the contents in the table of "association". | ||||
|  | ||||
|  | ||||
| if(!isset($TOPDIR)) { $TOPDIR="..";} | ||||
|  | ||||
| require_once "$TOPDIR/lib/security.php"; | ||||
| @@ -10,7 +13,7 @@ require_once "$TOPDIR/lib/display.php"; | ||||
| require_once "$TOPDIR/lib/monitor_display.php"; | ||||
|  | ||||
| $cond = '"' . $_REQUEST['c'] . '"'; | ||||
| $node = '"' . $_REQUEST['n'] . '"'; | ||||
| $node = $_REQUEST['n']; | ||||
| $resp = '"' . $_REQUEST['r'] . '"'; | ||||
| $action = $_REQUEST['a']; | ||||
|  | ||||
| @@ -24,60 +27,8 @@ if(getXmlErrors($xml,$errors)) { | ||||
|     echo "<p class=Error>",implode(' ', $errors), "</p>"; | ||||
|     exit; | ||||
| } | ||||
|  | ||||
| //the following code is copied from displayAssociation() in the file: monitor_display.php | ||||
| echo <<<TOS5 | ||||
| <b>Available Condition/Response Associations</b> | ||||
| <table id="tabTable" class="tabTable" cellspacing="1"> | ||||
|     <thead> | ||||
|         <tr class="colHeaders"> | ||||
|             <td>Condition</td> | ||||
|             <td>Response</td> | ||||
|             <td>Node</td> | ||||
|             <td>State</td> | ||||
|             <td>Action</td> | ||||
|         </tr> | ||||
|     </thead> | ||||
|     <tbody> | ||||
| TOS5; | ||||
| $xml = docmd("webrun", "", array("lscondresp")); | ||||
| if(getXmlErrors($xml,$errors)) { | ||||
|     echo "<p class=Error>",implode(' ', $errors), "</p>"; | ||||
| else { | ||||
|     echo "successful"; | ||||
|     exit; | ||||
| } | ||||
| //get all the condition&response associations for RMC | ||||
| foreach ($xml->children() as $response) foreach($response->children() as $data) { | ||||
|     //get the data from xcatd | ||||
|     $association = explode("=", $data); | ||||
|  | ||||
|     $ooe = 0; | ||||
|     $line = 0; | ||||
|     foreach($association as $elem) { | ||||
|         $ooe = $ooe%2; | ||||
|         //the format should be | ||||
|         //"NodeReachability"\t"EmailRootOffShift"\t"hv8plus01.ppd.pok.ibm.com"\t"Active" | ||||
|         $record = explode("\"", $elem); | ||||
|         $cond = $record[1]; | ||||
|         $resp = $record[3]; | ||||
|         $node = $record[5]; | ||||
|         $state = $record[7]; | ||||
|         echo "<tr class='ListLine$ooe' id='row$line'>"; | ||||
|         echo "<td>$cond</td>"; | ||||
|         echo "<td>$resp</td>"; | ||||
|         echo "<td>$node</td>"; | ||||
|         echo "<td>$state</td>"; | ||||
|         echo "<td>"; | ||||
|         if($state == "Active") { | ||||
|             insertButtons(array('label'=>'DeActivate', 'id'=>'deactivate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"stop\")")); | ||||
|         }else if($state == "Not active"){ | ||||
|             insertButtons(array('label'=>'Activate', 'id'=>'activate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"start\")")); | ||||
|         } | ||||
|         echo "</td>"; | ||||
|         echo "</tr>"; | ||||
|         $ooe++; | ||||
|         $line++; | ||||
|     } | ||||
| } | ||||
| echo "</tbody></table>"; | ||||
|  | ||||
| ?> | ||||
|   | ||||
| @@ -10,73 +10,31 @@ require_once "$TOPDIR/lib/security.php"; | ||||
| require_once "$TOPDIR/lib/display.php"; | ||||
| require_once "$TOPDIR/js/jsonwrapper.php"; | ||||
|  | ||||
| //echo <<<TOS5 | ||||
| //<table> | ||||
| //    <thead> | ||||
| //        <tr> | ||||
| //            <th>Condition</td> | ||||
| //            <th>Response</td> | ||||
| //            <th>Node</td> | ||||
| //            <th>State</td> | ||||
| //            <th>Action</td> | ||||
| //        </tr> | ||||
| //    </thead> | ||||
| //    <tbody> | ||||
| //TOS5; | ||||
|     $xml = docmd("webrun", "", array("lscondresp")); | ||||
|     if(getXmlErrors($xml,$errors)) { | ||||
|         echo "<p class=Error>",implode(' ', $errors), "</p>"; | ||||
|         exit; | ||||
|     } | ||||
|     //get all the condition&response associations for RMC | ||||
|     foreach ($xml->children() as $response) foreach($response->children() as $data) { | ||||
|         //get the data from xcatd | ||||
|         $record = split('"',$data); | ||||
|         echo "<tr>"; | ||||
| $xml = docmd("webrun", "", array("lscondresp")); | ||||
| if(getXmlErrors($xml,$errors)) { | ||||
|     echo "<p class=Error>",implode(' ', $errors), "</p>"; | ||||
|     exit; | ||||
| } | ||||
| //get all the condition&response associations for RMC | ||||
| foreach ($xml->children() as $response) foreach($response->children() as $data) { | ||||
|     //get the data from xcatd | ||||
|     $record = split('"',$data); | ||||
|     echo "<tr>"; | ||||
| echo <<<TOS6 | ||||
|             <td>$record[1]</td> | ||||
|             <td>$record[3]</td> | ||||
|             <td>$record[5]</td> | ||||
|             <td>$record[7]</td> | ||||
|         <td>$record[1]</td> | ||||
|         <td>$record[3]</td> | ||||
|         <td>$record[5]</td> | ||||
|         <td>$record[7]</td> | ||||
| TOS6; | ||||
|         //TODO: insert the button here | ||||
|         echo "<td>"; | ||||
|         if($record[7] == "Active") { | ||||
|             echo "<button class='fg-button ui-corner-all'>Disable</button>"; | ||||
|         }else { | ||||
|             echo "<button class='fg-button ui-corner-all'>Enable</button>"; | ||||
|         } | ||||
|         echo "</td>"; | ||||
|         echo "</tr>"; | ||||
| //        $association = explode("=", $data); | ||||
| // | ||||
| //        $ooe = 0; | ||||
| //        $line = 0; | ||||
| //        foreach($association as $elem) { | ||||
| //            $ooe = $ooe%2; | ||||
| //            //the format should be | ||||
| //            //"NodeReachability"\t"EmailRootOffShift"\t"hv8plus01.ppd.pok.ibm.com"\t"Active" | ||||
| //            $record = explode("\"", $elem); | ||||
| //            $cond = $record[1]; | ||||
| //            $resp = $record[3]; | ||||
| //            $node = $record[5]; | ||||
| //            $state = $record[7]; | ||||
| //            echo "<tr class='ListLine$ooe' id='row$line'>"; | ||||
| //            echo "<td>$cond</td>"; | ||||
| //            echo "<td>$resp</td>"; | ||||
| //            echo "<td>$node</td>"; | ||||
| //            echo "<td>$state</td>"; | ||||
| //            echo "<td>"; | ||||
| //            if($state == "Active") { | ||||
| //                insertButtons(array('label'=>'DeActivate', 'id'=>'deactivate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"stop\")")); | ||||
| //            }else if($state == "Not active"){ | ||||
| //                insertButtons(array('label'=>'Activate', 'id'=>'activate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"start\")")); | ||||
| //            } | ||||
| //            echo "</td>"; | ||||
| //            echo "</tr>"; | ||||
| //            $ooe++; | ||||
| //            $line++; | ||||
| //        } | ||||
|     //TODO: insert the button here | ||||
|     echo "<td>"; | ||||
|     if($record[7] == "Active") { | ||||
|         echo "<button class='fg-button ui-corner-all ui-state-active' onclick='control_RMCAssoc(\"$record[1]\", \"$record[5]\", \"$record[3]\", \"stop\")'>Disable</button>"; | ||||
|     }else { | ||||
|         echo "<button class='fg-button ui-corner-all ui-state-active' onclick='control_RMCAssoc(\"$record[1]\", \"$record[5]\", \"$record[3]\", \"start\")'>Enable</button>"; | ||||
|     } | ||||
|     echo "</td>"; | ||||
|     echo "</tr>"; | ||||
| } | ||||
| //    echo "</tbody></table>"; | ||||
| ?> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user