diff --git a/xCAT-web/machines/groups.js b/xCAT-web/machines/groups.js index 183a8a08c..2aedf687b 100644 --- a/xCAT-web/machines/groups.js +++ b/xCAT-web/machines/groups.js @@ -5,7 +5,9 @@ $(document).ready(function(){ show: function(e,ui) { if (ui.tab.href.search('#attributes-tab$') > -1) { loadAttrTab($(ui.panel)); } if (ui.tab.href.search('#rvitals-tab$') > -1) { loadVitalsTab($(ui.panel)); } - } - }); // ends the properties passed to tabs() + if (ui.tab.href.search('#rpower-tab$') > -1) { + loadRpowerTab($(ui.panel)); + } + }}); // ends the properties passed to tabs() }); diff --git a/xCAT-web/machines/groups.php b/xCAT-web/machines/groups.php index db02704e1..d58ef1bca 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'), + 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('machines','groups')); echo "
\n"; @@ -20,8 +20,9 @@ echo "
\n"; // nrtree is the place to put the node $tabs = array('Attributes' => '#attributes-tab', 'Run Cmd' => '../manage/dsh.php?intab=1', 'Rvitals' => '#rvitals-tab', + 'Rpower' => '#rpower-tab', ); -$tabsDisabled = array('Rpower' => 'rpower.php', +$tabsDisabled = array(//'Rpower' => 'rpower.php', 'Ping' => 'ping.php', 'Copy' => 'copyfiles.php', 'SP Config' => 'spconfig.php', @@ -41,6 +42,7 @@ foreach ($tabsDisabled as $key2 => $url2) { echo "\n"; echo "
\n"; echo "
\n"; +echo "
\n"; echo "
\n"; @@ -85,4 +87,4 @@ function getGroupStatus() { } -?> \ No newline at end of file +?> diff --git a/xCAT-web/machines/noderangetree.js b/xCAT-web/machines/noderangetree.js index 1a499677d..a56090cac 100644 --- a/xCAT-web/machines/noderangetree.js +++ b/xCAT-web/machines/noderangetree.js @@ -19,6 +19,9 @@ function updatenoderange() { loadVitalsTab($('#rvitals-tab')); } } + if (index == 3) { + loadRpowerTab($('#rpower-tab')); + } } diff --git a/xCAT-web/machines/rpower.js b/xCAT-web/machines/rpower.js new file mode 100644 index 000000000..4ed6b2a85 --- /dev/null +++ b/xCAT-web/machines/rpower.js @@ -0,0 +1,13 @@ +// Javascript functions for the Rpower tab + +function loadRpowerTab(panel) { + //alert('showing rpower tab'); + var nr = ''; + if (window.noderange && window.noderange != "") { + nr = window.noderange; + } + + panel.children().remove(); //get rid of the previous contents + panel.append('

Loading node rpower...

'); + panel.load('rpower.php?noderange='+nr); +} diff --git a/xCAT-web/machines/rpower.php b/xCAT-web/machines/rpower.php index 9d3e1fd2f..414305806 100644 --- a/xCAT-web/machines/rpower.php +++ b/xCAT-web/machines/rpower.php @@ -6,12 +6,48 @@ require_once "$TOPDIR/lib/functions.php"; //echo "\n"; //echo "\n"; -echo "
\n"; + +//get the noderange +$noderange = @$_REQUEST['noderange']; +if (empty($noderange)) { + echo "

Select one or more groups or nodes for rpower.

\n"; + exit; +} +//echo "

noderange=$noderange.

\n"; + +$xml = docmd('rpower', $noderange, array('stat')); + +if (getXmlErrors($xml,$errors)) { + echo "

rpower failed:", implode(' ',$errors), "

\n"; + exit; +} +//echo "

debug
";print_r($xml);echo "
debug end

\n"; +echo '
'; +echo "

"; +foreach ($xml->children() as $response) foreach ($response->children() as $o) { + $nodename = (string)$o->name; + if(empty($nodename)) { + continue; + } + $data = & $o->data; + $contents = (string)$data->contents; + $desc = (string)$data->desc; + + echo "$nodename: $contents
\n"; +} +echo "

\n"; +echo "
\n"; + +//echo '
'; +//echo "

Rpower Actions

"; +//echo "
\n"; + +//echo "\n"; //insertButtons(array('label' => 'Show Attributes', 'id' => 'attrButton', 'onclick' => '')); -echo "
\n"; +//echo "\n"; // -insertNotDoneYet(); -?> \ No newline at end of file +//insertNotDoneYet(); +?> diff --git a/xCAT-web/machines/rvitals.php b/xCAT-web/machines/rvitals.php index 3936fc3c1..595dd616f 100644 --- a/xCAT-web/machines/rvitals.php +++ b/xCAT-web/machines/rvitals.php @@ -19,6 +19,9 @@ if (getXmlErrors($xml,$errors)) { echo "

rvitals failed: ", implod echo "

\n"; foreach ($xml->children() as $response) foreach ($response->children() as $o) { $nodename = (string)$o->name; + if(empty($nodename)) { + continue; + } $data = & $o->data; $contents = (string)$data->contents; $desc = (string)$data->desc; @@ -35,4 +38,4 @@ echo "

\n"; //echo "\n"; //insertNotDoneYet(); -?> \ No newline at end of file +?>