diff --git a/xCAT-web/machines/groups.js b/xCAT-web/machines/groups.js index 2aedf687b..e5ca80f6c 100644 --- a/xCAT-web/machines/groups.js +++ b/xCAT-web/machines/groups.js @@ -7,7 +7,10 @@ $(document).ready(function(){ if (ui.tab.href.search('#rvitals-tab$') > -1) { loadVitalsTab($(ui.panel)); } if (ui.tab.href.search('#rpower-tab$') > -1) { loadRpowerTab($(ui.panel)); - } + } + if (ui.tab.href.search('#ping-tab$') > -1) { + loadPingTab($(ui.panel)); + } }}); // ends the properties passed to tabs() }); diff --git a/xCAT-web/machines/groups.php b/xCAT-web/machines/groups.php index d58ef1bca..ab68a67f6 100644 --- a/xCAT-web/machines/groups.php +++ b/xCAT-web/machines/groups.php @@ -7,7 +7,7 @@ require_once "$TOPDIR/lib/functions.php"; if (isAIX()) { $aixDisabled = 'disabled'; } insertHeader('xCAT Groups and Nodes', array("$TOPDIR/jq/jsTree/tree_component.css",'groups.css','attributes.css',"$TOPDIR/manage/dsh.css"), - array("$TOPDIR/jq/jsTree/css.js","$TOPDIR/jq/jsTree/jquery.listen.js","$TOPDIR/jq/jsTree/tree_component.js","$TOPDIR/jq/jquery.cookie.js",'noderangetree.js','groups.js','attributes.js','rvitals.js','rpower.js'), + array("$TOPDIR/jq/jsTree/css.js","$TOPDIR/jq/jsTree/jquery.listen.js","$TOPDIR/jq/jsTree/tree_component.js","$TOPDIR/jq/jquery.cookie.js",'noderangetree.js','groups.js','attributes.js','rvitals.js','rpower.js','ping.js'), array('machines','groups')); echo "<div id=content>\n"; @@ -21,9 +21,10 @@ $tabs = array('Attributes' => '#attributes-tab', 'Run Cmd' => '../manage/dsh.php?intab=1', 'Rvitals' => '#rvitals-tab', 'Rpower' => '#rpower-tab', + 'Ping' => '#ping-tab', ); $tabsDisabled = array(//'Rpower' => 'rpower.php', - 'Ping' => 'ping.php', + //'Ping' => 'ping.php', 'Copy' => 'copyfiles.php', 'SP Config' => 'spconfig.php', 'Diagnose' => 'diagnode.php', @@ -43,6 +44,7 @@ echo "</ul>\n"; echo "<div id='attributes-tab'></div>\n"; echo "<div id='rvitals-tab'></div>\n"; echo "<div id='rpower-tab'></div>\n"; +echo "<div id='ping-tab'></div>\n"; echo "</div></td></tr></table>\n"; diff --git a/xCAT-web/machines/noderangetree.js b/xCAT-web/machines/noderangetree.js index a56090cac..9eeca4e50 100644 --- a/xCAT-web/machines/noderangetree.js +++ b/xCAT-web/machines/noderangetree.js @@ -22,6 +22,9 @@ function updatenoderange() { if (index == 3) { loadRpowerTab($('#rpower-tab')); } + if (index == 4) { + loadPingTab($('#ping-tab')); + } } diff --git a/xCAT-web/machines/ping.php b/xCAT-web/machines/ping.php index 414bf0e0e..4542033cb 100644 --- a/xCAT-web/machines/ping.php +++ b/xCAT-web/machines/ping.php @@ -5,13 +5,62 @@ require_once "$TOPDIR/lib/functions.php"; //echo "<LINK rel=stylesheet href='$TOPDIR/manage/dsh.css' type='text/css'>\n"; //echo "<script type='text/javascript' src='$TOPDIR/manage/dsh.js'></script>\n"; +echo "<LINK rel=stylesheet href='$TOPDIR/jq/theme/jquery-ui-themeroller.css' type='text/css'>\n"; +echo "<script type='text/javascript' src='$TOPDIR/jq/jquery.min.js'></script>\n"; +echo "<script type='text/javascript' src='$TOPDIR/jq/jquery-ui-all.min.js'></script>\n"; +//use the attributes.css for help +echo "<LINK rel=stylesheet href='$TOPDIR/machines/attributes.css' type='text/css'>\n"; -echo "<FORM NAME=pingForm>\n"; +echo <<<CSS1 +<style> +body {font-size: 8pt; } +</style> +CSS1; + +//Get the noderange +$noderange = @$_REQUEST['noderange']; +if(empty($noderange)) { echo "<p>Select one or more groups or nodes for ping.</p>\n"; exit; } + +//pping is one local command, which doesn't use xcat client/server protocol; +$xml = docmd('webrun',$noderange,array("pping $noderange",));#The default pping option is NULL + +if(getXmlErrors($xml,$errors)) { echo "<p class=Error>ping failed: ", implode(' ',$errors), "</p>\n"; exit; } + +//show the result of "pping" +//TODO +echo "<p>\n"; +echo <<<TAB1 +<table id=nodeAttrTable> +<tr class='colHeaders'> +<th>Node Name</th> +<th>Ping Status</th> +</tr> +TAB1; +foreach ($xml->children() as $response) foreach ($response->children() as $o) { + $nodename=$o->name; + if(empty($nodename)) { + continue; + } + $contents = $o->data->contents; + //echo "$nodename: $contents<br>\n"; + echo "<tr>\n"; + echo "<td>$nodename</td>"; + echo "<td>$contents</td>"; + echo "</tr>\n"; + + //echo "$nodename: $contents<br>\n"; +} +echo <<<TAB2 +</table> +TAB2; +echo "</p>\n"; + +//echo "<FORM NAME=pingForm>\n"; //insertButtons(array('label' => 'Show Attributes', 'id' => 'attrButton', 'onclick' => '')); -echo "</FORM>\n"; +//echo "</FORM>\n"; //<script type='text/javascript'>dshReady();</script> -insertNotDoneYet(); -?> \ No newline at end of file +//insertNotDoneYet(); +?> diff --git a/xCAT-web/machines/rpower.php b/xCAT-web/machines/rpower.php index 414305806..48518c341 100644 --- a/xCAT-web/machines/rpower.php +++ b/xCAT-web/machines/rpower.php @@ -5,7 +5,7 @@ require_once "$TOPDIR/lib/functions.php"; //echo "<LINK rel=stylesheet href='$TOPDIR/manage/dsh.css' type='text/css'>\n"; //echo "<script type='text/javascript' src='$TOPDIR/manage/dsh.js'></script>\n"; - +echo "<LINK rel=stylesheet href='$TOPDIR/machines/attributes.css' type='text/css'>\n"; //get the noderange $noderange = @$_REQUEST['noderange']; @@ -24,6 +24,13 @@ if (getXmlErrors($xml,$errors)) { //echo "<p>debug<br>";print_r($xml);echo "<br>debug end</p>\n"; echo '<div>'; echo "<p>"; +echo <<<TAB1 +<table id=nodeAttrTable> +<tr class='colHeaders'> +<th>Node Name</th> +<th>Rpower Status</th> +</tr> +TAB1; foreach ($xml->children() as $response) foreach ($response->children() as $o) { $nodename = (string)$o->name; if(empty($nodename)) { @@ -33,15 +40,20 @@ foreach ($xml->children() as $response) foreach ($response->children() as $o) { $contents = (string)$data->contents; $desc = (string)$data->desc; - echo "$nodename: $contents<br>\n"; + echo "<tr>\n"; + echo "<td>$nodename</td>"; + echo "<td>$contents</td>"; + echo "</tr>\n"; + + //echo "$nodename: $contents<br>\n"; } + +echo <<<TAB2 +</table> +TAB2; echo "</p>\n"; echo "</div>\n"; -//echo '<div>'; -//echo "<p>Rpower Actions</p>"; -//echo "</div>\n"; - //echo "<FORM NAME=rpowerForm>\n"; //insertButtons(array('label' => 'Show Attributes', 'id' => 'attrButton', 'onclick' => '')); diff --git a/xCAT-web/machines/rvitals.php b/xCAT-web/machines/rvitals.php index 595dd616f..6f4cd4162 100644 --- a/xCAT-web/machines/rvitals.php +++ b/xCAT-web/machines/rvitals.php @@ -27,7 +27,7 @@ foreach ($xml->children() as $response) foreach ($response->children() as $o) { $desc = (string)$data->desc; //echo "<p>"; print_r($data); echo "</p>\n"; echo "$nodename: $desc: $contents<br>\n"; - } +} echo "</p>\n";