diff --git a/xCAT-web/css/clickTree.css b/xCAT-web/css/clickTree.css deleted file mode 100644 index 2b4dd3984..000000000 --- a/xCAT-web/css/clickTree.css +++ /dev/null @@ -1,64 +0,0 @@ -ul.clickTree { - list-style: none; - margin: 0; - padding: 0; -} - -ul.clickTree li { - padding-left: 20px; -} - -ul.clickTree ul { - /*padding-left: 10px; */ - list-style: none; -} - - -ul.clickTree li.firstItem { - background: url(http://wopr.dfw.ibm.com/xcat/images/middle-line.gif) center left no-repeat; - /*padding-left: 20px;*/ -} -ul.clickTree li.lastItem { - background: url(http://wopr.dfw.ibm.com/xcat/images/line.gif) center left no-repeat; - /* padding-left: 20px; */ -} -ul.clickTree li.middleItem { - background: url(http://wopr.dfw.ibm.com/xcat/images/middle-line.gif) center left no-repeat; - /* padding-left: 20px;*/ -} -ul.clickTree .unchecked { - background: url(http://wopr.dfw.ibm.com/xcat/images/chkbox-uncheck.gif) center left no-repeat; - /* padding-left: 20px; */ -} -ul.clickTree .checked { - background: url(http://wopr.dfw.ibm.com/xcat/images/chkbox-check.gif) center left no-repeat; - /* padding-left: 20px; */ -} - -.nodeIcon { - background: url(http://wopr.dfw.ibm.com/xcat/images/node.gif) center left no-repeat; - padding-left: 20px; - -} - -.nodeGroupIcon { - background: url(http://wopr.dfw.ibm.com/xcat/images/burst.gif) center left no-repeat; - padding-left: 20px; - -} -.plus { - background: url(http://wopr.dfw.ibm.com/xcat/images/plus.gif) center left no-repeat; - padding-left: 20px; - cursor: pointer; -} - -.minus { - background: url(http://wopr.dfw.ibm.com/xcat/images/minus.gif) center left no-repeat; - padding-left: 20px; - cursor: pointer; - -} - -/* Actually show and hide sublists */ -ul.clickTree li.open ul { display: block; } -ul.clickTree li.closed ul { display: none; } diff --git a/xCAT-web/js/clickTree.js b/xCAT-web/js/clickTree.js deleted file mode 100644 index 122ac26b7..000000000 --- a/xCAT-web/js/clickTree.js +++ /dev/null @@ -1,129 +0,0 @@ - - - -processHeader = function(head,ul) { - - - /* make the head icon different */ - for (i=0; i < head.childNodes.length; i++ ) { - if(head.childNodes[i].className = "nodeIcon"){ - head.childNodes[i].className = "nodeGroupIcon"; - break; - } - } - /* add the plus and expandibility */ - myBox = document.createElement('span'); - myBox.className = 'plus'; - myBox.innerHTML = " "; - myBox.onclick = function() { - this.className = (this.className == 'plus') ? 'minus' : 'plus'; - this.parentNode.parentNode.className = (this.parentNode.parentNode.className=='open') ? 'closed' : 'open'; - return false; - } - head.insertBefore(myBox, head.childNodes[0]); - head.parentNode.className = 'closed'; -} - -processItem = function(li, lili){ - myN = document.createElement('span'); - myIcon = document.createElement('span'); - myIcon.innerHTML = " "; - myCheck = document.createElement('span'); - myIcon.className = "nodeIcon"; - myCheck.className = "unchecked"; - myCheck.onclick = function (){ - this.className = (this.className=='checked') ? "unchecked" : "checked"; - //this.parentNode. - return false; - } - - /* create form element */ - myInput = document.createElement('input'); - myInput.type = 'checkbox'; - myInput.id = 'input'; - myInput.name = 'nodes[]'; - myInput.value = lili.nodeValue; - /* end create form element */ - li.insertBefore(myN, lili); - li.removeChild(lili); - // myCheck.appendChild(lili); - // myInput.appendChild(lili); - myN.appendChild(myIcon); - // myN.appendChild(myCheck); - myN.appendChild(myInput); - myN.appendChild(lili); - return myN; -} - - - -processList = function(ul) { - if (!ul.childNodes || ul.childNodes.length == 0) return; - isFirst = ''; - isLast = ''; - tempNode = ''; - for (var i=0; i < ul.childNodes.length; i++ ) { - li = ul.childNodes[i]; - if (li.nodeName == "LI") { - var subUL = ''; - var head = ''; - for(j = 0; j < li.childNodes.length; j++) { - lili = li.childNodes[j]; - switch (lili.nodeName) { - case "#text": - myN = processItem(li, lili); - head = myN; - break; - case "UL": - subUL = lili; - processList(lili); - break; - default: - // other items may be a span. - // alert("exception:" + lili.nodeName); - break; - } - } - if (subUL) { - processHeader(head,subUL); - } else { - //alert('cl: ' + (ul.childNodes.length - 1)); - if(isFirst == ''){ - li.className = 'firstItem'; - isFirst = 1; - } - else { - if(isLast == ''){ - li.className = "lastItem"; - tempNode = li; - isLast = 1; - }else{ - tempNode.className = "middleItem"; - li.className = "lastItem"; - tempNode = li; - } - } - } - } - } -} - -makeTree = function(el) { - // see if we can create an element - if (!document.createElement) return; - ul = document.getElementById(el); - if(!ul){ - return; - } - ul.className = "clickTree"; - processList(ul); -} - -function closeTree(){ - var el = document.getElementsByClassName('minus'); - for(var i = 0; i< el.length; i++){ - el[i].className = 'plus'; - el[i].parentNode.parentNode.className = 'closed'; - } -} - diff --git a/xCAT-web/js/windows.js b/xCAT-web/js/windows.js deleted file mode 100644 index 8e19d0826..000000000 --- a/xCAT-web/js/windows.js +++ /dev/null @@ -1,58 +0,0 @@ -var winNum = 1; -var zIndex = -100; - -function winNewWin(title){ - var dob; - var d; - dob = document.getElementById('content'); - - d = document.createElement('div'); - d.className = 'block'; - var winid = 'window' + winNum; - d.id = 'window' + winNum; - d.style.zIndex = zIndex; - zIndex++; - d.appendChild(winNewTitleBar(title)); - var cont = winNewContent(); - d.appendChild(cont); - dob.appendChild(d); - new Draggable(winid, {handle: 'handle'}); - winNum++; - /* return s the place to start writing */ - return cont; -} - -function winNewTitleBar(title){ - var ti = document.createElement('h3'); - ti.className = 'handle'; - var winid = 'window' + winNum; - var newHTML = ""; - newHTML += " " - newHTML += ""; - newHTML += " "; - newHTML += title; - ti.innerHTML = newHTML; - return ti; -} - -function winNewContent(){ - var doc = document.createElement('div'); - doc.className = 'blockContent'; - doc.id = 'winContent' + winNum ; - return doc; -} - -function winKill(wid){ - // Todo: make this random effects - var w = document.getElementById(wid); - Effect.Puff(w); - w.parentNode.removeChild(w); - // var killU = w.parentNode; - // killU.removeChild(w); -} diff --git a/xCAT-web/js_xcat/event.js b/xCAT-web/js_xcat/event.js deleted file mode 100644 index 88e26b4d0..000000000 --- a/xCAT-web/js_xcat/event.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * This file registers event listeners using Prototype's - * Event API. - * - * See: - * * http://www.prototypejs.org/api/event/ - * * http://www.prototypejs.org/api/event/observe - */ - -var XCATEvent = {}; - -XCATEvent.doAll = function() { - Event.observe(window, 'load', function() { - // Add other functions here - XCATEvent.doRunCmdButton(); // dsh.php: Run Cmd button is clicked - //XCATEvent.doExpandNodes(); // index.php: plus sign is click to expand node group - }); -}; - -/** - * Register JS function with events for the RunCmdButton - */ -XCATEvent.doRunCmdButton = function() { - Event.observe('runCmdButton_top', 'click', function(event) { - XCATui.updateCommandResult(); - }); - Event.observe('runCmdButton_bottom', 'click', function(event) { - XCATui.updateCommandResult(); - }); -}; - -/** - * Register JS function with events to retrieve nodes of a group - */ -XCATEvent.doExpandNodes = function() { - /*var img_id; - for (var i = 0; i -1)) { - img_id = document.nodelist.elements[i].id; - group_name = img_id.substring(7,img_id.length-3); //the image id is of the form "img_gr_groupname-im" - Event.observe(img_id, 'click', function(event) { - XCATui.updateNodeList(group_name); - }); - } - }*/ - - for (var i = 0; i Groups - HW TypeOSModeStatusHW Ctrl PtComment + StatusComment EOS; @@ -60,19 +60,15 @@ function insertGroupTableRow($nodeGroupName, $status) { $img_string = getStatusImage(GroupNodeTable::determineStatus($status)); //echo ''; -echo ''; +echo ''; echo GroupNodeTable::getToggleString($nodeGroupName); echo <<$nodeGroupName -   -   -   - -   +   - + EOE; return; } @@ -88,13 +84,14 @@ function getNodeGroupSection($group, $nodes) { $right_arrow_gif = $imagedir . "/grey_arrow_r.gif"; $left_arrow_gif = $imagedir . "/grey_arrow_l.gif"; - $html .= "\n"; + $html .= "
\n"; + $html .= "\n"; foreach($nodes as $nodeName => $attrs) { $html .= GroupNodeTable::getNodeTableRow($nodeName, $attrs); } - $html .= "\n"; + $html .= "\n"; $html .= "
Node NameArchOSModeStatusPower MethodComment
Previous page    Next page  
Previous page    Next page  
\n"; return $html; @@ -104,18 +101,18 @@ function getNodeGroupSection($group, $nodes) { * @param The node for which we want to generate the html. */ function getNodeTableRow($nodeName, $attrs) { - $html = "\n" . - "$nodeName\n" . - "
" . $attrs['arch'] . "
\n" . - "
" . $attrs['osversion'] . "
\n" . - "
" . $attrs['mode'] . "
\n"; + $html = "\n" . + "$nodeName\n" . + "" . $attrs['arch'] . "\n" . + "" . $attrs['osversion'] . "\n" . + "" . $attrs['mode'] . "\n"; $stat = 'unknown'; //todo: implement $img_string = ''; - $html .= "
" . $img_string . "
". - "
" . $attrs['power'] . "
". - "
" . $attrs['comment'] . "
"; + $html .= "" . $img_string . "". + "" . $attrs['power'] . "". + "" . $attrs['comment'] . ""; return $html; } diff --git a/xCAT-web/lib/GroupNodeTableUpdater.js b/xCAT-web/lib/GroupNodeTableUpdater.js index 41256e04e..65e0f0064 100644 --- a/xCAT-web/lib/GroupNodeTableUpdater.js +++ b/xCAT-web/lib/GroupNodeTableUpdater.js @@ -1,73 +1,5 @@ var GroupNodeTableUpdater = {}; -GroupNodeTableUpdater.updateCommandResult = function() { - var commandQueryId = "commandQuery"; - var copyChkBoxId = "copyChkBox"; - var nodenameHiddenTxtId = "nodename"; - var nodegrpsCboBoxId = "nodegrpsCboBox"; - var pshChkBoxId = "pshChkBox"; - - var serialChkBoxId = "serialChkBox"; - var verifyChkBoxId = "verifyChkBox"; - var fanoutTxtBoxId = "fanoutTxtBox"; - var userIDTxtBoxId = "userIDTxtBox"; - var rshellTxtBoxId = "rshellTxtBox"; - var rshellTxtBoxId = "rshellTxtBox"; - var monitorChkBoxId = "monitorChkBox"; - var ret_codeChkBoxId = "ret_codeChkBox"; - - var copyChkBoxObj = $(copyChkBoxId); - var commandQueryObj = $(commandQueryId); - var nodenameHiddenTxtObj = $(nodenameHiddenTxtId); - var nodegrpsCboBoxObj = $(nodegrpsCboBoxId); - var pshChkBoxObj = $(pshChkBoxId); - - var serialChkBoxObj = $(serialChkBoxId); - var verifyChkBoxObj = $(verifyChkBoxId); - var fanoutTxtBoxObj = $(fanoutTxtBoxId); - var userIDTxtBoxObj = $(userIDTxtBoxId); - var rshellTxtBoxObj = $(rshellTxtBoxId); - var monitorChkBoxObj = $(monitorChkBoxId); - var ret_codeChkBoxObj = $(ret_codeChkBoxId); - - // Do AJAX call and get HTML here. - var url = "dsh_action.php"; - var postPara = "command=" + encodeURIComponent(commandQueryObj.value); - postPara += "&node=" + encodeURIComponent(nodenameHiddenTxtObj.value); - postPara += "&nodegrps=" + encodeURIComponent(nodegrpsCboBoxObj.options[nodegrpsCboBoxObj.selectedIndex].value); - if (copyChkBoxObj.checked == true) postPara += "©=on"; else postPara += "©=off"; - if (pshChkBoxObj.checked == true) postPara += "&psh=on"; else postPara += "&psh=off"; - if (serialChkBoxObj.checked == true) postPara += "&serial=on"; else postPara += "&serial=off"; - if (verifyChkBoxObj.checked == true) postPara += "&verify=on"; else postPara += "&verify=off"; - postPara += "&fanout=" + encodeURIComponent(fanoutTxtBoxObj.value); - postPara += "&userID=" + encodeURIComponent(userIDTxtBoxObj.value); - postPara += "&rshell=" + encodeURIComponent(rshellTxtBoxObj.value); - if (monitorChkBoxObj.checked == true) postPara += "&monitor=on"; else postPara += "&monitor=off"; - if (ret_codeChkBoxObj.checked == true) postPara += "&ret_code=on"; else postPara += "&ret_code=off"; - - new Ajax.Request(url, { - method: 'post', postBody: postPara, - onSuccess: function(transport) { - var htmlContent = transport.responseText; - - var win = new Window({className: "dialog", - width: 350, - height: 400, - zIndex: 100, - resizable: true, - title: "Running commands", - showEffect: Effect.BlindDown, - hideEffect: Effect.SwitchOff, - draggable: true, - wiredDrag: true}); - - win.getContent().innerHTML = htmlContent; - //win.setStatusBar("Status bar info"); - win.showCenter(); - } - }); -}; - /** * Hides/shows the nodes in a node group table. */ @@ -109,7 +41,7 @@ GroupNodeTableUpdater.getFailureSpanHTML = function(nodeGroupName) { GroupNodeTableUpdater.getLoadingSpanHTML = function(nodeGroupName) { var spanId = "nodegroup_" + nodeGroupName + "_loading"; - var html = ''; + var html = ''; return html; } @@ -176,8 +108,6 @@ GroupNodeTableUpdater.updateNodeList = function(nodeGroupName) { // Check whether the table already exists and has already been updated? - //var URL = "webservice.php?method=getXCATNodeRows&nodeGroupName=" + encodeURIComponent(nodeGroupName); - //alert('About to call Ajax.Updater'); new Ajax.Updater(target, URL, { method: 'post', parameters: pars, diff --git a/xCAT-web/lib/XCAT/XCATCommand/XCATCommandRunner.class.php b/xCAT-web/lib/XCAT/XCATCommand/XCATCommandRunner.class.php deleted file mode 100644 index 300132092..000000000 --- a/xCAT-web/lib/XCAT/XCATCommand/XCATCommandRunner.class.php +++ /dev/null @@ -1,132 +0,0 @@ -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(); - } - - /** - * @param String cmdString The command to execute. - * @return An array containing the command output as the first element - * and the command return status as the second element. - */ - function runCommand($cmdString) { - $cmdOutput = NULL; - $cmdReturnStat = NULL; - exec($cmdString, $cmdOutput, $cmdReturnStat); - - $outputStat = array(); - $outputStat["output"] = $cmdOutput; - $outputStat["returnStat"] = $cmdReturnStat; - - return $outputStat; - } - - /** - * Will always return an up to date list of node names belonging to the group. - * - * @param String groupName The name of the XCATNodeGroup - * @return An array containing the name of all nodes in the group. - */ - function getNodeNamesByGroupName($groupName) { - $cmdString = $this->Sudo . "nodels $groupName"; - $outputStat = $this->runCommand($cmdString); - - return $outputStat["output"]; - } - - /** - * @param String nodeName The name of the node. - */ - function getXCATNodeByName($nodeName) { - - $cmdString = $this->Sudo . "nodestat $nodeName"; - $outputStat = $this->runCommand($cmdString); - - $xcn = new XCATNode(); - $xcn->setName($nodeName); - $xcn->setStatus($this->determineNodeStatus($outputStat["output"][0])); - $xcn->setHwType("HW Type"); - $xcn->setOs("OS"); - $xcn->setMode("Mode"); - $xcn->setHwCtrlPt("HW Ctrl Pt"); - $xcn->setComment("Comment"); - - // Add the node to the manager, now that we've loaded it. - $this->XCATNodeManager->addNode($xcn); - - - return $xcn; - } - - /** - * @param String nodestatStr The status of the node as output by the nodestat command - * @return "good", "bad", or "other" - */ - function determineNodeStatus($nodestatStr) { - $status = NULL; - - if ((strpos($nodestatStr, "ready") != FALSE) || - (strpos($nodestatStr, "pbs") != FALSE) || - (strpos($nodestatStr, "sshd") != FALSE)) { - $status = 'good'; - } else if(strpos($nodestatStr, "noping") != FALSE) { - $status = 'bad'; - } else { - $status = 'other'; - } - - return $status; - } - - /** - * @return An array containing the name of every node group. - */ - function getAllGroupNames() { - $cmdString = $this->Sudo . "listattr"; - $outputStat = $this->runCommand($cmdString); - - return $outputStat["output"]; - } - - /** - * @param String groupName The name of the group we want to get. - * @return An XCATNodeGroup object representing - * the node group with the given name. This object will - * contain the XCATNodes belonging to this XCATNodeGroup. - */ - function getXCATNodeByGroupName($groupName) { - $nodeNames = $this->getNodeNamesByGroupName($groupName); - - $xcatNodes = array(); - - foreach($nodeNames as $nodeName) { - $xcatNode = $this->getXCATNodeByName($nodeName); - array_push($xcatNodes, $xcatNode); - } - - $xcatNodeGroup = new XCATNodeGroup(); - $xcatNodeGroup->setName($groupName); - $xcatNodeGroup->setNodes($xcatNodes); - - - return $xcatNodeGroup; - } - -} -?> \ No newline at end of file diff --git a/xCAT-web/lib/XCAT/XCATNode/XCATNode.class.php b/xCAT-web/lib/XCAT/XCATNode/XCATNode.class.php deleted file mode 100644 index da4d23f7a..000000000 --- a/xCAT-web/lib/XCAT/XCATNode/XCATNode.class.php +++ /dev/null @@ -1,74 +0,0 @@ -name; - } - - function getHwType() { - return $this->hwType; - } - - function getOs() { - return $this->os; - } - - function getMode() { - return $this->mode; - } - - function getStatus() { - return $this->status; - } - - function getHwCtrlPt() { - return $this->hwCtrlPt; - } - - function getComment() { - return $this->comment; - } - - function setName($pName) { - $this->name = $pName; - } - - function setHwType($pHwType) { - $this->hwType = $pHwType; - } - - function setOs($pOs) { - $this->os = $pOs; - } - - function setMode($pMode) { - $this->mode = $pMode; - } - - function setStatus($pStatus) { - $this->status = $pStatus; - } - - function setHwCtrlPt($pHwCtrlPt) { - $this->hwCtrlPt = $pHwCtrlPt; - } - - function setComment($pComment) { - $this->comment = $pComment; - } -} -?> diff --git a/xCAT-web/lib/XCAT/XCATNode/XCATNodeManager.class.php b/xCAT-web/lib/XCAT/XCATNode/XCATNodeManager.class.php deleted file mode 100644 index d1b23901c..000000000 --- a/xCAT-web/lib/XCAT/XCATNode/XCATNodeManager.class.php +++ /dev/null @@ -1,51 +0,0 @@ -nodes; - } - - function setNodes($pNodes) { - $this->nodes = $pNodes; - } - - function addNode($node) { - $this->nodes[$node->getName()] = $node; - } - - function removeNode($node) { - $this->nodes[$node->getName()] = NULL; - } - - function getNodeByName($nodeName) { - $node = NULL; - - if(array_key_exists($nodeName, $this->nodes)) { - $node = $this->nodes[$nodeName]; - } - - return $node; - } -} -?> diff --git a/xCAT-web/lib/XCAT/XCATNodeGroup/XCATNodeGroup.class.php b/xCAT-web/lib/XCAT/XCATNodeGroup/XCATNodeGroup.class.php deleted file mode 100644 index a307bb566..000000000 --- a/xCAT-web/lib/XCAT/XCATNodeGroup/XCATNodeGroup.class.php +++ /dev/null @@ -1,45 +0,0 @@ -nodes = array(); - } - - function getName() { - return $this->name; - } - - function setName($pName) { - $this->name = $pName; - } - - function getNodes() { - return $this->nodes; - } - - function getStatus() { - return $this->status; - } - - function setNodes($pNodes) { - $this->nodes = $pNodes; - } - - function setStatus($pStatus) { - $this->status = $pStatus; - } - - function addNode($node) { - $this->nodes[$node->getName()] = $node; - } - - function removeNode($node) { - $this->nodes[$node->getName()] = NULL; - } -} -?> diff --git a/xCAT-web/lib/XCAT/XCATNodeGroup/XCATNodeGroupManager.class.php b/xCAT-web/lib/XCAT/XCATNodeGroup/XCATNodeGroupManager.class.php deleted file mode 100644 index b9c6db1a5..000000000 --- a/xCAT-web/lib/XCAT/XCATNodeGroup/XCATNodeGroupManager.class.php +++ /dev/null @@ -1,51 +0,0 @@ -nodeGroups; - } - - function setNodeGroups($pNodeGroups) { - $this->nodeGroups = $pNodeGroups; - } - - function addNodeGroup($nodeGroup) { - $this->nodeGroups[$nodeGroup->getName()] = $nodeGroup; - } - - function removeNodeGroup($nodeGroup) { - $this->nodeGroups[$nodeGroup->getName()] = NULL; - } - - function getNodeGroupByName($nodeGroupName) { - $nodeGroup = NULL; - - if(array_key_exists($nodeGroupName, $this->nodeGroups)) { - $nodeGroup = $this->nodeGroups[$nodeGroupName]; - } - - return $nodeGroup; - } -} -?> diff --git a/xCAT-web/lib/functions.php b/xCAT-web/lib/functions.php index 666a32a91..2c3f4f32e 100644 --- a/xCAT-web/lib/functions.php +++ b/xCAT-web/lib/functions.php @@ -33,7 +33,6 @@ echo << \n"; //echo "\n"; //echo "\n"; @@ -46,10 +45,6 @@ EOS; //echo "\n"; //echo "\n"; -//echo "\n"; -//echo "\n"; -//echo "\n"; - if ($stylesheets) { foreach ($stylesheets as $s) { @@ -186,8 +181,8 @@ function insertMenuRow($current, $isTop, $items) { function runcmd ($cmd, $mode, &$output, $options=NULL){ //Set error output to the same source as standard output (on Linux) - if (strstr($cmd,'2>&1') == FALSE && !$options["NoRedirectStdErr"]) - $cmd .= ' 2>&1'; + if (strstr($cmd,'2>&1') == FALSE && !$options["NoRedirectStdErr"]) { $cmd .= ' 2>&1'; } + $cmd = "/bin/sudo $cmd"; //todo: change this when move to xcat 2 $ret_stat = ""; $arr_output = NULL; @@ -235,9 +230,9 @@ function dumpGlobals() { //------------------------------------ # Returns true if the given rpm file is already installed at this version or higher. function isInstalled($rpmfile) { //------------------------------------ $aixrpmopt = isAIX() ? '--ignoreos' : ''; - $lang = isWindows() ? '' : 'LANG=C'; + $lang = isWindows() ? '' : 'LANG=C'; //todo: add this back in $out = array(); - $rc = runcmd("$lang /bin/rpm -U $aixrpmopt --test $rpmfile", 2, $out); + $rc = runcmd("rpm -U $aixrpmopt --test $rpmfile", 2, $out); # The rc is not reliable in this case because it will be 1 if it is already installed # of if there is some other problem like a dependency is not satisfied. So we parse the # output instead. @@ -432,8 +427,8 @@ function getNodes($noderange, $attrs) { $nodes = array(); foreach ($attrs as $a) { $output = array(); - //echo "

/bin/sudo nodels $noderange $a

\n"; - runcmd("/bin/sudo nodels $noderange $a", 2, $output); + //echo "

nodels $noderange $a

\n"; + runcmd("nodels $noderange $a", 2, $output); foreach ($output as $line) { $vals = preg_split('/: */', $line); // vals[0] will be the node name if (!$nodes[$vals[0]]) { $nodes[$vals[0]] = array(); } @@ -454,7 +449,7 @@ function getNodes($noderange, $attrs) { function getGroups() { $groups = array(); $output = array(); - runcmd("/bin/sudo listattr", 2, $output); + runcmd("listattr", 2, $output); foreach ($output as $grp) { $groups[] = $grp; } return $groups; } @@ -465,7 +460,7 @@ function getGroups() { function getGroupStatus() { $groups = array(); $output = array(); - runcmd("/bin/sudo grpattr", 2, $output); + runcmd("grpattr", 2, $output); foreach ($output as $line) { //echo "

line=$line

"; $vals = preg_split('/: */', $line); diff --git a/xCAT-web/lib/style.css b/xCAT-web/lib/style.css index e5b713e4d..6b213864b 100644 --- a/xCAT-web/lib/style.css +++ b/xCAT-web/lib/style.css @@ -146,6 +146,7 @@ TEXTAREA {vertical-align : middle; font-size : 8pt; font-family : sans-serif; fo .TableHeader { color: black; background-color : #fffdb0; font-weight : bold; font-size : 9pt; white-space: nowrap; } .TableRow { color: black; background-color : #b3c2d9; font-size : 9pt; white-space: nowrap; } /* #d8dff1 */ +.FormTable { color: black; background-color : #CCCCCC; } .Info {color : blue;} .Error {font-weight : bold; color : red;} .Trace {color: gray; padding: 0px; margin: 0px;} diff --git a/xCAT-web/machines/dsh.php b/xCAT-web/machines/dsh.php index 6d7cd9c22..87f22c002 100644 --- a/xCAT-web/machines/dsh.php +++ b/xCAT-web/machines/dsh.php @@ -7,22 +7,21 @@ $expire_time = gmmktime(0, 0, 0, 1, 1, 2038); setcookie("history", "date;hello.sh", $expire_time); require_once "$TOPDIR/lib/functions.php"; -require_once("$TOPDIR/lib/XCAT/XCATCommand/XCATCommandRunner.class.php"); -insertHeader('Run Commands on Nodes', array('themes/default.css'), - array('javascripts/prototype.js', 'javascripts/effect.js', 'javascripts/window.js'), +insertHeader('Run Commands on Nodes', array("$TOPDIR/themes/default.css"), + array("$TOPDIR/lib/CommandWindow.js", "$TOPDIR/js/prototype.js", "$TOPDIR/js/scriptaculous.js?load=effects", "$TOPDIR/js/window.js"), array('machines','dsh')); ?>
- > + > - + + + - - - - - + - + - + + Use parallel shell (psh) command instead of xdsh. - - + + - + - + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - - + + + +
- - Run Command on Group + + Run Command on Group: - - $nodename\n"; - } - ?> - - + Run Command on:
-

Select a previous command from the history, or enter the command and options - below.  Then click on Run Cmd.

- +

Select a previous command from the history, or enter the command and options below. Then click on Run Cmd.

Command History: +

+

+
Command History:

-

-
Command:  +
Command: 
Copy command to nodes  (The command specified above will 1st be copied to /tmp on the nodes and executed from there.)
- Use parallel shell (psh) command
Options:
Options:
Streaming modeSpecifies that output is returned as it becomes available from each target, instead of waiting for the command_list to be completed on a target before returning output.Specifies that output is returned as it becomes available from each target, instead of waiting for the command to be completed on a target before returning output from that target.
VerifyVerifies that nodes are responding before sending the command to them.
MonitorPrints starting and completion messages for each node. Useful with Streaming mode.
Collaspe Identical OutputAutomatically pipe the dsh output into dshbak which will only display output once for all the nodes that display identical output. See the dshbak man page for more info.
VerifyVerifies that nodes are responding before sending the command to them.
Fanout:The maximum number of nodes the command should be run on concurrently. When the command finishes on 1 of the nodes, it will be started on an additional node (the default is 64).
Collaspe Identical OutputAutomatically pipe the xdsh output into xdshbak which will only display output once for all the nodes that display identical output. See the xdshbak man page for more info.
UserID:The user id to use to run the command on the nodes.
Fanout:The maximum number of nodes the command should be run on concurrently. When the command finishes on 1 of the nodes, it will be started on an additional node (the default is 64).
Remote Shell:The remote shell program to use to run the command on the nodes, for example /usr/bin/ssh. (The default is stored by the csmconfig command or DSH_REMOTE_CMD enviroment variable).
UserID:The user id to use to run the command on the nodes.
Shell Options:Options to pass to the remote shell being used.
Remote Shell:The remote shell program to use to run the command on the nodes. The default is /usr/bin/ssh.
MonitorPrints the results of monitoring for each node in the form of the starting and completion messages for each node.
Shell Options:Options to pass to the remote shell being used.
Code ReturnPrints the return code of the last command that was run remotely. The return code is appended at the end of the output for each node.
- - -
Code ReturnPrints the return code of the (last) command that was run remotely on each node. The return code is appended at the end of the output for each node.
Tips:
    -
  • See the psh man page for more information about this command.
  • +
  • See the xdsh man page for more information about this command.
- - + \ No newline at end of file diff --git a/xCAT-web/machines/dsh_action.php b/xCAT-web/machines/dsh_action.php index 6cc114886..6e2a9fd90 100644 --- a/xCAT-web/machines/dsh_action.php +++ b/xCAT-web/machines/dsh_action.php @@ -1,29 +1,26 @@
Command executed: ". $cmd ."

"; + //echo "

Command: ". $cmd ."

"; - $exp_cmd = "export DSH_CONTEXT=XCAT XCATROOT=/opt/xcat; "; + //$exp_cmd = "export DSH_CONTEXT=XCAT XCATROOT=/opt/xcat; "; if ($copy == "on"){ //using dcp/prcp @@ -79,38 +76,36 @@ require_once "$TOPDIR/functions.php"; $source = "/opt/xcat/bin/" . $script; //copy from $target = "/tmp"; //copy to if ($psh == "off"){ - $copy_cmd = $exp_cmd . "sudo " . $copy_cmd . $node_group . " " . $source . " " . $target; + $copy_cmd = $exp_cmd . $copy_cmd . $node_group . " " . $source . " " . $target; }else{ - $copy_cmd = "sudo " . $copy_cmd . $source . " " . $node_group . ":" . $target; + $copy_cmd = $copy_cmd . $source . " " . $node_group . ":" . $target; } runcmd($copy_cmd,1, $outp); if ($psh != "on"){ - $command_string = $exp_cmd . "sudo ". $command. $node_group . " /tmp/" . $cmd; + $command_string = $exp_cmd . $command. $node_group . " /tmp/" . $cmd; }else{ - $command_string = "sudo " . $command . $node_group . " /tmp/" . $cmd; + $command_string = $command . $node_group . " /tmp/" . $cmd; } } else{ if ($psh != "on"){ - $command_string = $exp_cmd . "sudo ". $command. $node_group . " " . $cmd; + $command_string = $exp_cmd . $command. $node_group . " " . $cmd; }else{ - $command_string = "sudo " . $command . $node_group . " " . $cmd; + $command_string = $command . $node_group . " " . $cmd; } } - //using dshbak to format the output - $command_string .= " | $SYSTEMROOT/dshbak "; + if ($collapse == "on") $command_string .= " | dshbak -c"; - if ($collapse == "on") $command_string .= "-c "; - - echo " Full command (for TEST purpose): " . $command_string . "
"; - echo "

Command Ouput:

"; //output will be returned from the runcmd function call + echo "

Command: $command_string

"; + //echo "

Command Ouput:

"; //output will be returned from the runcmd function call //run the script + $output = array(); if ($ret_code == "on"){ - $rc = runcmd($command_string,0, $outp); //mode 0 + $rc = runcmd($command_string, 0, $output); //mode 0 if ($rc == 0){ foreach ($outp as $key => $val){ echo $val. "
"; @@ -118,12 +113,10 @@ require_once "$TOPDIR/functions.php"; } }else{ - //$rc = runcmd($command_string,1, $outp); //streaming mode COMMENTED AS BY SOME WAY THIS DOESN'T WORK YET - $rc = runcmd($command_string,0, $outp); //mode 0 + //$rc = runcmd($command_string,1, $outp); //streaming mode - DOES NOT WORK YET + $rc = runcmd($command_string, 0, $output); //mode 0 if ($rc == 0){ - foreach ($outp as $key => $val){ - echo $val. "
"; - } + foreach ($output as $line){ echo "$line
"; } } } diff --git a/xCAT-web/machines/groups.css b/xCAT-web/machines/groups.css index 1f8415c0b..bd41296dd 100644 --- a/xCAT-web/machines/groups.css +++ b/xCAT-web/machines/groups.css @@ -7,3 +7,7 @@ text-align: center; margin: 5px; } + +.GroupNodeTable { margin-left: 10px; } +.GroupNodeTableHeader { color: black; background-color : #FFFF66; font-weight : bold; white-space: nowrap; } +.GroupNodeTableRow { color: black; background-color : #FFFF66; white-space: nowrap; } diff --git a/xCAT-web/machines/groups.php b/xCAT-web/machines/groups.php index dea2e64c1..45b00ed53 100644 --- a/xCAT-web/machines/groups.php +++ b/xCAT-web/machines/groups.php @@ -57,7 +57,7 @@ insertButtons(array( echo ''; -/* $output = array(); runcmd("/bin/sudo listattr", 2, $output); foreach ($output as $line) { echo "

line=$line

"; } */ +/* $output = array(); runcmd("listattr", 2, $output); foreach ($output as $line) { echo "

line=$line

"; } */ GroupNodeTable::insertGroupTableHeader(); diff --git a/xCAT-web/support/suggest.php b/xCAT-web/support/suggest.php index 7f690eec3..65834d485 100644 --- a/xCAT-web/support/suggest.php +++ b/xCAT-web/support/suggest.php @@ -22,12 +22,12 @@ See xCAT on SourceForge. Tha approximately priority order:

    -
  • Update the spec file for this web interface to have all the necessary post installation scripts.
  • -
  • One button update of this web interface from the internet.
  • -
  • Restructure the files in lib/XCAT and js_xcat to make them simpler.
  • -
  • Have the task pane save the current task in the cookie and have each page set the current task.
  • -
  • Do frame view and rack layout pages.
  • -
  • Do several of the buttons within the machines views: +
  • Update the spec file for this web interface to have all the necessary post installation scripts (Bruce)
  • +
  • One button update of this web interface from the internet (Bruce)
  • +
  • Improve the look of associating the top menu with the 2nd menu (Quyen)
  • +
  • Have the task pane save the current task in the cookie and have each page set the current task (Bruce)
  • +
  • Do frame view and rack layout pages (Bruce)
  • +
  • Do several of the buttons within the machines views (Bruce):
    • Attributes
    • Ping
    • @@ -37,9 +37,9 @@ approximately priority order:

    • Diagnose
  • -
  • Do RMC configuration pages
  • -
  • Do Cluster Settings (site table) page
  • -
  • Start set up cluster wizard page.
  • +
  • Do RMC configuration pages (Bruce)
  • +
  • Do Cluster Settings (site table) page (Bruce)
  • +
  • Start cluster wizard page (Bruce)
  • Do a summary page that lists # of bad nodes, # of jobs, etc.