Some clean up of command running

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@32 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
bp-sawyers 2007-11-01 18:35:41 +00:00
parent e8e287bf0f
commit a27d244c84
5 changed files with 60 additions and 184 deletions

View File

@ -209,7 +209,7 @@ $plusgif = "$TOPDIR/images/plus-sign.gif";
foreach ($list as $key => $link) {
if ($key == $currentLink){
echo "<TR><TD id='menu_level3' class='current'><IMG src='$TOPDIR/images/h3bg_new.gif'>&nbsp;$link[1]</TD></TR>\n";
echo "<TR><TD id='menu_level3' class='CurrentMenuItem'><IMG src='$TOPDIR/images/h3bg_new.gif'>&nbsp;$link[1]</TD></TR>\n";
}else{
echo "<TR><TD id='menu_level3'><A href='$link[0]'><IMG src='$TOPDIR/images/h3bg_new.gif'>&nbsp;$link[1]</A></TD></TR>\n";
}

View File

@ -5,6 +5,7 @@
$TOPDIR = '.';
require_once "$TOPDIR/functions.php";
//require_once "$TOPDIR/nav.php";
if (isAIX()) { $aixDisabled = 'disabled'; }
//require_once("globalconfig.php");
require_once("lib/XCAT/HTML/HTMLProducer.class.php");
@ -13,35 +14,39 @@ require_once("lib/XCAT/XCATCommand/XCATCommandRunner.class.php");
insertHeader('Nodes', NULL, NULL);
insertNav('nodes');
if (isAIX()) { $aixDisabled = 'disabled'; }
?>
<div id=content align=center>
<h1 class=PageHeading>Cluster Groups and Nodes</h1>
<table border=0 cellspacing=0>
<tr class="BlueBack">
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC"><div align="center"><a href="#">Attribute</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC"><div align="center"><a href="#">Define Like</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC"><div align="center"><a href="#">Create Group</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC"><div align="center"><a href="#">Ping</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC"><div align="center"><a href="#">Update</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC"><div align="center"><a href="#">Run Cmd</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC"><div align="center"><a href="#">Copy Files</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC"><div align="center"><a href="#"></a></div></td>
</tr>
<tr>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC" class="BlueBack"><div align="center"><a href="#">Soft Maint</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC" class="BlueBack"><div align="center"><a href="#">HW Ctrl</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC" class="BlueBack"><div align="center"><a href="#">RSA/MM/FSP</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC" class="BlueBack"><div align="center"><a href="#">Install</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC" class="BlueBack"><div align="center"><a href="#">Perf Mon</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC" class="BlueBack"><div align="center"><a href="#">Webmin</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC" class="BlueBack"><div align="center"><a href="#">Diagnose</a></div></td>
<td width="90" height="20" background="images/baractive2.gif" bgcolor="#CCCCCC" class="BlueBack"><div align="center"><a href="#">Remove</a></div></td>
</tr>
</table>
<br>
<form name="nodelist">
<?php
echo "<div id=content align=center> <h1 class=PageHeading>Cluster Groups and Nodes</h1>";
insertButtons(array(
array(
'name=propButton value="Attributes"',
'name=defineButton value="Create Like"',
'name=createGroupButton value="Create Group"',
'name=pingNodesButton value="Ping"',
//'name=updateButton value="Updatenode"',
'name=runcmdButton value="Run Cmd"',
'name=copyFilesButton value="Copy Files"'
),
array(
//'name=softMaintButton value="Soft Maint" onclick="this.form.nodesNeeded=1;"',
'name=hwctrlButton value="HW Ctrl"',
'name=rsaButton value="RSA/MM/FSP" onclick="this.form.nodesNeeded=1;"',
'name=installButton value="Install"',
'name=perfmonButton value="Perf Mon"',
//'name=webminButton value="Webmin" onclick="this.form.nodesNeeded=1;"',
'name=diagButton value="Diagnose" onclick="this.form.nodesNeeded=1;"',
'name=removeButton value="Remove"'
),
));
echo '<br><form name="nodelist">';
/*
$output = array();
runcmd("\bin\sudo listattr", 2, $output);
foreach ($output as $line) { echo "<p>line=$line</p>"; }
*/
echo HTMLProducer::getXCATNodeTableHeader();

View File

@ -14,8 +14,9 @@ class XCATCommandRunner {
var $XCATNodeGroupManager;
function XCATCommandRunner() {
$this->XCATRoot = '/opt/xcat/bin'; //todo: get rid of these
$this->CurrDir = '/opt/xcat/web';
$this->XCATRoot = ''; //'/opt/xcat/bin'; //todo: get rid of these
$this->CurrDir = ''; //'/opt/xcat/web';
$this->Sudo = '\bin\sudo ';
$this->XCATNodeManager = &XCATNodeManager::getInstance();
$this->XCATNodeGroupManager = &XCATNodeGroupManager::getInstance();
@ -44,7 +45,7 @@ class XCATCommandRunner {
* @return An array containing names of all nodes.
*/
function getAllNodeNames() {
$cmdString = "sudo " . $this->XCATRoot . "/nodels";
$cmdString = $this->Sudo . $this->XCATRoot . "/nodels";
$outputStat = $this->runCommand($cmdString);
return $outputStat["output"];
@ -57,7 +58,7 @@ class XCATCommandRunner {
* @return An array containing the name of all nodes in the group.
*/
function getNodeNamesByGroupName($groupName) {
$cmdString = "sudo " . $this->XCATRoot . "/nodels $groupName";
$cmdString = $this->Sudo . $this->XCATRoot . "/nodels $groupName";
$outputStat = $this->runCommand($cmdString);
return $outputStat["output"];
@ -68,7 +69,7 @@ class XCATCommandRunner {
*/
function getXCATNodeByName($nodeName) {
$cmdString = "sudo " . $this->XCATRoot . "/nodestat $nodeName";
$cmdString = $this->Sudo . $this->XCATRoot . "/nodestat $nodeName";
$outputStat = $this->runCommand($cmdString);
$xcn = new XCATNode();
@ -91,7 +92,7 @@ class XCATCommandRunner {
* @return An array containing the name of every node group.
*/
function getAllGroupNames() {
$cmdString = "sudo " . $this->XCATRoot . "/listattr";
$cmdString = $this->Sudo . $this->XCATRoot . "/listattr";
$outputStat = $this->runCommand($cmdString);
return $outputStat["output"];
@ -136,6 +137,7 @@ class XCATCommandRunner {
$groupStatArr = $this->getGroupStatus(); //get the status of all the groups
foreach($xcatGroupNames as $groupName) {
//echo "<p>group=$groupName</p>";
$xcatGroup = $this->getXCATGroupByName($groupName, $groupStatArr);
array_push($xcatGroups, $xcatGroup);
}
@ -160,7 +162,7 @@ class XCATCommandRunner {
* @return An array containing the status of all the groups
*/
function getGroupStatus() {
$cmdString = "sudo " . $this->CurrDir . "/cmds/grpattr";
$cmdString = $this->Sudo . $this->CurrDir . "/grpattr"; // "/cmds/grpattr";
$outputStat = $this->runCommand($cmdString);
$groupStats = $outputStat["output"];
$groupStatArr = array();
@ -178,7 +180,7 @@ class XCATCommandRunner {
function getNodeOrGroupStatus($nodegroupName, $group) {
$stat = "";
if ($group == FALSE){
$cmdString = "sudo " . $this->XCATRoot . "/nodestat " . $nodegroupName;
$cmdString = $this->Sudo . $this->XCATRoot . "/nodestat " . $nodegroupName;
$outputStat = $this->runCommand($cmdString);
$nodegroupStat = $outputStat["output"][0];

View File

@ -57,6 +57,11 @@ tr.indent td { padding:0px 0 0px 10px; }
/* LEFT VERTICAL MENU/Navigation area */
#nav TD{
white-space: nowrap;
vertical-align : middle;
}
#menu_level1 {
float: left;
color: #3F5B7F;
@ -122,128 +127,5 @@ tr.indent td { padding:0px 0 0px 10px; }
#menu_level3 a img { border: 0 none; }
#menu_level3 a:hover { background: #999999; color: #fff; }
/* #menu_level3 a.current { background: #999999; color: #fff; } */
#menu_level3.current { background: #FFFFFF ; }
#menu_level3.CurrentMenuItem { background: #FFFFFF ; }
/* CONTENT WRAPPER */
/* #main { width: 900px; margin: 25px auto 0 auto; } */
/* TOP LEFT LOGO - not used...
#logo { float: left; }
#logo h1 { color: #FFFFFF; background: inherit;}
#logo h3 { color: #999999; background: inherit;}
*/
/* .main_table { border-collapse:collapse; } */
/* TOP RIGHT HORIZONTAL MENU - not used...
#menu {
float: right;
/*background: #fff url(images/barul.gif) no-repeat bottom right; *//*
color: #808080;
padding: 18px 1px 11px 0;
margin: 0;
}
#menu li {
padding: 14px 18px 14px 18px;
color: #444;
/*background: #fff url(images/bar.gif) no-repeat bottom left; *//*
display: inline;
}
#menu li.active {
/*background: #fff url(images/baractive.gif) no-repeat bottom left; *//*
color: #FFFF00;
font-weight: bold;
padding: 14px 18px 14px 18px;
margin: 0 1px 0 0;
}
#menu li a {
/*background: #f8f8f8; *//*
color: #808080;
text-decoration: none; font: bold 2em "Trebuchet MS", Helvetica, Sans-Serif; margin: 0; color: #fff; background-color:transparent;
}
#menu li a:hover {
color: #000;
/*background: #f8f8f8; *//*
}
.key { text-decoration: underline; } /* ACCESKEY UNDERLINED LETTER */
/* LEFT INTRO SIDE - not used
#intro_left {
clear: left;
float: left;
width: 250px;
background: #8D9CAF url(images/leftintrobg.gif) repeat-x;
color: #E5EAF2;
margin: 0 0 1px 0;
}
#intro_left a { color: #fff; background: inherit; }
#intro_left p { padding: 14px 15px; margin: 0; }
*/
/* RIGHT INTRO SIDE - not used...
#intro_right {
float: right;
width: 340px;
padding: 25px 280px 0 20px;
background: #BCCEDA url(images/intro.jpg) no-repeat;
color: #547592;
margin: 0 0 6px 0;
height: 174px;
border: 2px solid #e2e2e2;
}
#intro_right h1 { margin: 0 0 20px 0; }
#intro_right .white { color: #FFF; background-color:transparent; }
*/
/* LEFT SIDE - not used...
#left {
float: left;
width: 250px;
}
.box {
padding: 4px 15px;
border: 1px solid #ccc;
margin: 0 0 10px 0;
}
.note {
padding: 15px 15px 20px 100px;
border: 1px solid #CFCB66;
margin: 0 0 5px 0;
background: #FFFFAD url(images/package.gif) no-repeat;
color: #585616;
}
*/
/* RIGHT SIDE - not used...
#right {
float: right;
width: 643px;
}
.leftcol {
float: left;
padding: 12px 15px;
width: 285px;
border:#ccc 1px solid;
text-align: justify;
margin: 0 0 10px 0;
}
.rightcol {
float: right;
padding: 10px 15px;
width: 285px;
border:#ccc 1px solid;
margin: 0 0 10px 0;
}
.special {
clear: both;
margin:0px 0 20px 0;
padding: 5px 20px;
border: 1px solid #ccc;
background: #eee;
color: #444;
}
*/
/* FOOTER - not used...
#footer { clear: both; padding: 5px; border-top: 1px solid #ccc; }
*/

View File

@ -8,8 +8,8 @@ div#nav {
div#content {
background-color : #fcfaeb;
position: absolute;
left: 125px;
top: 95px;
left: 120px;
top: 90px;
}
/* not used...
@ -87,6 +87,7 @@ P#logo {
.txtfld {font-size : 8pt; font-family : sans-serif; font-weight : bold;}
/* this was used to make buttons out of table cells...
.bt {
font-size : 8pt;
font-weight : bold;
@ -94,18 +95,17 @@ P#logo {
background-image : url(images/bt.gif);
text-align: center;
}
*/
INPUT {vertical-align : middle; font-size : 8pt; font-family : sans-serif; font-weight : bold;}
SELECT {vertical-align : middle; font-size : 8pt; font-family : sans-serif; font-weight : bold;}
TEXTAREA {vertical-align : middle; font-size : 8pt; font-family : sans-serif; font-weight : bold;}
TABLE {font-size : 10pt; font-family : Arial;}
BODY {font-size : 10pt; font-family : Arial;
}
/* The rest of the styles are for the navigation area */
BODY {font-size : 10pt; font-family : Arial; }
/* The rest of the styles were for the navigation area, but are not used any more...
table#navtable {
/* width: 105px; */
width: 105px;
font-size : 8pt;
padding-left : 1px;
border: 0px;
@ -114,9 +114,7 @@ table#navtable {
.NavCurLink { background-color: #fcfaeb; }
#nav A{
/* text-decoration : none; */
font-weight : bold;
font-family : sans-serif;
}
@ -131,17 +129,7 @@ table#navtable {
vertical-align : middle;
}
#nav TD{
white-space: nowrap;
vertical-align : middle;
font-weight : bold;
font-family : sans-serif;
/* border: 1px solid gray; */
}
#nav IMG {
border: 0px;
}
#nav IMG { border: 0px; }
.InnerTable{
margin-left : 0px;
@ -154,11 +142,10 @@ table#navtable {
white-space: nowrap;
}
/* OuterTable is not currently used */
.OuterTable{
margin-left : 1px;
margin-right : 1px;
margin-top : 0px;
margin-bottom : 0px;
}
*/