2007-11-24 17:44:09 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Main page of the xCAT web interface
|
|
|
|
|
|
|
|
$TOPDIR = '..';
|
|
|
|
require_once "$TOPDIR/lib/functions.php";
|
|
|
|
if (isAIX()) { $aixDisabled = 'disabled'; }
|
|
|
|
|
2008-10-29 13:57:19 +00:00
|
|
|
insertHeader('xCAT Groups and Nodes', array("$TOPDIR/jq/jsTree/tree_component.css",'groups.css','attributes.css',"$TOPDIR/manage/dsh.css"),
|
2009-06-17 09:45:13 +00:00
|
|
|
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','copyfiles.js','spconfig.js'),
|
2007-12-03 18:16:38 +00:00
|
|
|
array('machines','groups'));
|
2007-11-24 17:44:09 +00:00
|
|
|
|
2008-10-29 13:57:19 +00:00
|
|
|
echo "<div id=content>\n";
|
|
|
|
|
|
|
|
// Create the noderange tree and the tabs side by side. Once again I tried to do this with css and all
|
|
|
|
// methods seemed to be inadequate
|
|
|
|
echo "<table cellspacing=0 cellpadding=0><tr valign=top>\n";
|
|
|
|
echo "<td><div id=nrtree></div></td>\n"; // nrtree is the place to put the noderange tree
|
|
|
|
|
|
|
|
$tabs = array('Attributes' => '#attributes-tab',
|
|
|
|
'Run Cmd' => '../manage/dsh.php?intab=1',
|
2008-11-19 21:26:43 +00:00
|
|
|
'Rvitals' => '#rvitals-tab',
|
2009-06-04 07:30:24 +00:00
|
|
|
'Rpower' => '#rpower-tab',
|
2009-06-09 05:09:08 +00:00
|
|
|
'Ping' => '#ping-tab',
|
2009-06-17 09:45:13 +00:00
|
|
|
'Copy' => '#copy-tab',
|
|
|
|
'SP Config' => '#spcfg-tab',
|
2008-11-19 21:26:43 +00:00
|
|
|
);
|
2009-06-17 09:45:13 +00:00
|
|
|
$tabsDisabled = array(
|
2008-10-29 13:57:19 +00:00
|
|
|
'Diagnose' => 'diagnode.php',
|
|
|
|
'Add/Remove' => 'addremove.php',
|
|
|
|
);
|
|
|
|
|
|
|
|
echo "<td width='100%'><div id=nodetabs>\n";
|
|
|
|
|
|
|
|
echo "<ul>\n";
|
|
|
|
foreach ($tabs as $key => $url) {
|
|
|
|
echo "<li class='ui-tabs-nav-item'><a id='nodetabs-a' href='$url'>$key</a></li>\n";
|
2007-11-24 17:44:09 +00:00
|
|
|
}
|
2008-11-19 21:26:43 +00:00
|
|
|
foreach ($tabsDisabled as $key2 => $url2) {
|
|
|
|
echo "<li class='ui-tabs-nav-item'><a id='nodetabs-a-disabled' href='$url2'>$key2</a></li>\n";
|
|
|
|
}
|
2008-10-29 13:57:19 +00:00
|
|
|
echo "</ul>\n";
|
|
|
|
echo "<div id='attributes-tab'></div>\n";
|
2008-11-19 21:26:43 +00:00
|
|
|
echo "<div id='rvitals-tab'></div>\n";
|
2009-06-04 07:30:24 +00:00
|
|
|
echo "<div id='rpower-tab'></div>\n";
|
2009-06-09 05:09:08 +00:00
|
|
|
echo "<div id='ping-tab'></div>\n";
|
2009-06-17 09:45:13 +00:00
|
|
|
echo "<div id='copy-tab'></div>\n";
|
|
|
|
echo "<div id='spcfg-tab'></div>\n";
|
2008-10-29 13:57:19 +00:00
|
|
|
|
|
|
|
echo "</div></td></tr></table>\n";
|
2007-11-24 17:44:09 +00:00
|
|
|
|
2008-10-29 13:57:19 +00:00
|
|
|
//echo "<div id=placeHolder></div>\n"; // since the other 2 divs are floats, need this one to give the content div some size
|
2007-11-24 17:44:09 +00:00
|
|
|
|
2008-09-26 20:25:53 +00:00
|
|
|
|
2008-10-29 13:57:19 +00:00
|
|
|
/*
|
|
|
|
echo '<table><tr>';
|
2008-09-26 20:25:53 +00:00
|
|
|
echo '<td><img src="' . getStatusImage('good') . '"> Good</td><td width=20></td>';
|
|
|
|
echo '<td><img src="' . getStatusImage('warning') . '"> Possible problem</td><td width=20></td>';
|
|
|
|
echo '<td><img src="' . getStatusImage('bad') . '"> Problem</td><td width=20></td>';
|
|
|
|
echo '<td><img src="' . getStatusImage('unknown') . '"> Unknown</td>';
|
2008-10-29 13:57:19 +00:00
|
|
|
echo '</tr></table>';
|
|
|
|
*/
|
2008-09-26 20:25:53 +00:00
|
|
|
|
2008-10-29 13:57:19 +00:00
|
|
|
echo '</div>'; // end the content div
|
2008-09-26 20:25:53 +00:00
|
|
|
insertFooter();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Returns the aggregate status of each node group in the cluster. The return value is a
|
|
|
|
// hash in which the key is the group name and the value is nodelist.status.
|
|
|
|
function getGroupStatus() {
|
|
|
|
$groups = array();
|
|
|
|
$xml = docmd('tabdump','',array('nodelist'));
|
2008-10-13 12:55:58 +00:00
|
|
|
foreach ($xml->children() as $response) foreach ($response->children() as $line) {
|
|
|
|
$line = (string) $line;
|
|
|
|
//echo "<p>"; print_r($line); "</p>\n";
|
|
|
|
if (ereg("^#", $line)) { continue; } // skip the header
|
|
|
|
$vals = splitTableFields($line);
|
|
|
|
if (empty($vals[0]) || empty($vals[1])) continue; // node or groups missing
|
|
|
|
$grplist = preg_split('/,/', $vals[1]);
|
|
|
|
if (empty($vals[2])) { $status = 'unknown'; }
|
|
|
|
else { $status = $vals[2]; }
|
|
|
|
foreach ($grplist as $g) {
|
|
|
|
if (array_key_exists($g,$groups)) { $groups[$g] = minStatus($groups[$g], $status); }
|
|
|
|
else { $groups[$g] = $status; }
|
2008-09-26 20:25:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return $groups;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-06-04 07:30:24 +00:00
|
|
|
?>
|