Fixed bugs caused by scrollable datatable.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10360 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
ef99f0ec7f
commit
a1b27d099b
@ -74,7 +74,7 @@
|
||||
|
||||
/*--------------- Header ---------------*/
|
||||
#header {
|
||||
height: 40px;
|
||||
height: 39px;
|
||||
width: 1000px;
|
||||
margin: 0px auto;
|
||||
background: url(../images/header-gloss-wave.png) 50% 50% repeat-x;
|
||||
@ -403,7 +403,6 @@ legend {
|
||||
|
||||
.actionBar li {
|
||||
list-style: none;
|
||||
padding: 2px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@ -458,6 +457,7 @@ legend {
|
||||
|
||||
/*** Table ***/
|
||||
.datatable {
|
||||
width: 100%;
|
||||
border: solid 1px #BDBDBD;
|
||||
border-spacing: 0px;
|
||||
border-collapse: collapse;
|
||||
@ -592,7 +592,7 @@ legend {
|
||||
}
|
||||
|
||||
.form div {
|
||||
margin: 10px 0;
|
||||
margin: 5px 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
@ -171,11 +171,14 @@ bladePlugin.prototype.loadResources = function() {
|
||||
*/
|
||||
bladePlugin.prototype.addNode = function() {
|
||||
var nodeTypeSelectDia = $('<div id="nodeTypeSelectDia" class="form"></div>');
|
||||
nodeTypeSelectDia.append('<div><label for="mgt">Node Type :</label><select id="nodeTypeSelect">' +
|
||||
'<option value="mm">AMM Node</option><option value="blade">Blade Node</option></select></div>');
|
||||
var info = createInfoBar('Add a node range');
|
||||
nodeTypeSelectDia.append(info);
|
||||
nodeTypeSelectDia.append('<div><label for="mgt">Node type:</label><select id="nodeTypeSelect">' +
|
||||
'<option value="mm">AMM</option><option value="blade">Blade</option></select></div>');
|
||||
|
||||
//append the mm div
|
||||
var mmStr = '<div id="mmNode">' +
|
||||
'<label>AMM Name: </label><input id="ammName" type="text"></input><br/><br/>' +
|
||||
'<label>AMM name: </label><input id="ammName" type="text"></input><br/><br/>' +
|
||||
'<label>AMM IP: </label><input id="ammIp" type="text"></input>' +
|
||||
'</div>';
|
||||
|
||||
|
@ -171,28 +171,50 @@ ipmiPlugin.prototype.loadResources = function() {
|
||||
* @return Nothing
|
||||
*/
|
||||
ipmiPlugin.prototype.addNode = function() {
|
||||
var diaDiv = $('<div id="addIdpDiv" class="form" title="Add iDataPlex Node"></div>');
|
||||
var showStr = '<div><label>Node Name: </label><input type="text"></div>' +
|
||||
'<div><label>Node MAC:</label><input type="text"></div>' +
|
||||
'<div><label>Node IP: </label><input type="text"></div>' +
|
||||
'<div><label>Node Groups : </label><input type="text"></div>' +
|
||||
'<div><label>BMC Name:</label><input type="text"></div>' +
|
||||
'<div><label>BMC IP:</label><input type="text"></div>' +
|
||||
'<div><label>BMC Groups:</label><input type="text"></div>';
|
||||
var diag = $('<div id="addIdpDiv" class="form" title="Add iDataPlex"></div>');
|
||||
var info = createInfoBar('Add a node range');
|
||||
diag.append(info);
|
||||
|
||||
diaDiv.append(showStr);
|
||||
diaDiv.dialog({
|
||||
// Create node inputs
|
||||
var nodeFieldSet = $('<fieldset></fieldset>');
|
||||
var legend = $('<legend>Node</legend>');
|
||||
nodeFieldSet.append(legend);
|
||||
diag.append(nodeFieldSet);
|
||||
|
||||
var nodeInputs = '<div><label>Node: </label><input type="text"></div>' +
|
||||
'<div><label>MAC:</label><input type="text"></div>' +
|
||||
'<div><label>IP: </label><input type="text"></div>' +
|
||||
'<div><label>Groups: </label><input type="text"></div>';
|
||||
nodeFieldSet.append(nodeInputs);
|
||||
|
||||
var bmcFieldSet = $('<fieldset></fieldset>');
|
||||
var legend = $('<legend>BMC</legend>');
|
||||
bmcFieldSet.append(legend);
|
||||
diag.append(bmcFieldSet);
|
||||
|
||||
// Create BMC inputs
|
||||
var bmcInputs = '<div><label>BMC:</label><input type="text"></div>' +
|
||||
'<div><label>IP:</label><input type="text"></div>' +
|
||||
'<div><label>Groups:</label><input type="text"></div>';
|
||||
bmcFieldSet.append(bmcInputs);
|
||||
|
||||
diag.dialog({
|
||||
modal: true,
|
||||
width: 400,
|
||||
close: function(){$(this).remove();},
|
||||
buttons: {
|
||||
"OK" : function(){addidataplexNode();},
|
||||
"OK" : function(){addIdataplex();},
|
||||
"Cancel": function(){$(this).dialog('close');}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function addidataplexNode(){
|
||||
/**
|
||||
* Add iDataPlex node range
|
||||
*
|
||||
* @return Nothing
|
||||
*/
|
||||
function addIdataplex(){
|
||||
var tempArray = new Array();
|
||||
var errormessage = '';
|
||||
var attr = '';
|
||||
@ -208,7 +230,7 @@ function addidataplexNode(){
|
||||
tempArray.push($(this).val());
|
||||
}
|
||||
else{
|
||||
errormessage = "You are missing some input!";
|
||||
errormessage = "You are missing some inputs!";
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@ -228,7 +250,6 @@ function addidataplexNode(){
|
||||
args = '-t;node;-o;' + tempArray[0] + ';mac=' + tempArray[1] + ';ip=' + tempArray[2] + ';groups=' +
|
||||
tempArray[3] + ';mgt=ipmi;chain="runcmd=bmcsetup";netboot=xnba;nodetype=osi;profile=compute;' +
|
||||
'bmc=' + tempArray[4];
|
||||
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
@ -242,7 +263,6 @@ function addidataplexNode(){
|
||||
|
||||
//compose all args into chdef for bmc
|
||||
args = '-t;node;-o;' + tempArray[4] + ';ip=' + tempArray[5] + ';groups=' + tempArray[6];
|
||||
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
|
@ -30,8 +30,8 @@ zvmPlugin.prototype.loadClonePage = function(node) {
|
||||
// If there is no existing clone tab
|
||||
if (!$('#' + newTabId).length) {
|
||||
// Get table headers
|
||||
var table = $('#' + node).parent().parent().parent().parent();
|
||||
var headers = table.find('thead th');
|
||||
var tableId = $('#' + node).parents('table').attr('id');
|
||||
var headers = $('#' + tableId).parents('.dataTables_scroll').find('.dataTables_scrollHead thead tr:eq(0) th');
|
||||
var cols = new Array();
|
||||
for ( var i = 0; i < headers.length; i++) {
|
||||
var col = headers.eq(i).text();
|
||||
@ -53,7 +53,7 @@ zvmPlugin.prototype.loadClonePage = function(node) {
|
||||
var statBar = createStatusBar(statBarId).hide();
|
||||
|
||||
// Create info bar
|
||||
var infoBar = createInfoBar('Clone a zvm node.');
|
||||
var infoBar = createInfoBar('Clone a zVM node.');
|
||||
|
||||
// Create clone form
|
||||
var cloneForm = $('<div class="form"></div>');
|
||||
|
@ -127,11 +127,18 @@ function checkGangliaRunning(data){
|
||||
|
||||
// Create warning bar
|
||||
var warningBar = $('<div class="ui-state-error ui-corner-all"></div>');
|
||||
var msg = $('<p></p>');
|
||||
msg.append('<span class="ui-icon ui-icon-alert"></span>');
|
||||
msg.append('Please start Ganglia Monitoring on xCAT. ');
|
||||
var msg = $('<p></p>').css({
|
||||
'display': 'inline-block',
|
||||
'width': '90%'
|
||||
});
|
||||
var icon = $('<span class="ui-icon ui-icon-alert"></span>').css({
|
||||
'display': 'inline-block',
|
||||
'margin': '10px 5px'
|
||||
});
|
||||
warningBar.append(icon);
|
||||
msg.append('Please start Ganglia on xCAT. ');
|
||||
msg.append(startLnk);
|
||||
msg.append(' to start Ganglia Monitoring.');
|
||||
msg.append(' to start Ganglia.');
|
||||
warningBar.append(msg);
|
||||
warningBar.css('margin-bottom', '10px');
|
||||
|
||||
|
@ -157,6 +157,10 @@ function loadMonitorPage() {
|
||||
|
||||
// Do not word wrap
|
||||
monTableBody.find('td:nth-child(1)').css('white-space', 'nowrap');
|
||||
monTableBody.find('td:nth-child(3)').css({
|
||||
'white-space': 'normal',
|
||||
'text-align': 'left'
|
||||
});
|
||||
|
||||
// Append info bar
|
||||
$('#monitorTab div').empty().append(createInfoBar('Select a monitoring tool to use'));
|
||||
|
@ -788,7 +788,7 @@ function loadNodes(data) {
|
||||
editProps.bind('click', function(event){
|
||||
var tgtNodes = getNodesChecked(nodesTableId).split(',');
|
||||
for (var i in tgtNodes) {
|
||||
loadEditPropsPage(tgtNodes[i]);
|
||||
editNodeProps(tgtNodes[i]);
|
||||
}
|
||||
});
|
||||
|
||||
@ -941,8 +941,8 @@ function loadNodes(data) {
|
||||
dTable.fnUpdate(value, rowPos, colPos, false);
|
||||
|
||||
// Get table headers
|
||||
var headers = $('#' + nodesTableId + ' thead tr th');
|
||||
|
||||
var headers = $('#' + nodesTableId).parents('.dataTables_scroll').find('.dataTables_scrollHead thead tr:eq(0) th');
|
||||
|
||||
// Get node name
|
||||
var node = $(this).parent().find('td a.node').text();
|
||||
// Get attribute name
|
||||
@ -2077,6 +2077,9 @@ function updatePowerStatus(data) {
|
||||
alert(rsp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust datatable column size
|
||||
adjustColumnSize();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2325,7 +2328,7 @@ function findRow(str, table, col){
|
||||
function selectAllCheckbox(event, obj) {
|
||||
// Get datatable ID
|
||||
// This will ascend from <input> <td> <tr> <thead> <table>
|
||||
var tableObj = obj.parents('table');
|
||||
var tableObj = obj.parents('.dataTables_scroll').find('.dataTables_scrollBody');
|
||||
var status = obj.attr('checked');
|
||||
tableObj.find(' :checkbox').attr('checked', status);
|
||||
event.stopPropagation();
|
||||
@ -2686,7 +2689,7 @@ function setNodeAttrs(data) {
|
||||
* Target node to set properties
|
||||
* @return Nothing
|
||||
*/
|
||||
function loadEditPropsPage(tgtNode) {
|
||||
function editNodeProps(tgtNode) {
|
||||
// Get nodes tab
|
||||
var tab = getNodesTab();
|
||||
|
||||
@ -2721,7 +2724,7 @@ function loadEditPropsPage(tgtNode) {
|
||||
}
|
||||
|
||||
// Create label and input for attribute
|
||||
div = $('<div></div>').css('display', 'inline');
|
||||
div = $('<div></div>').css('display', 'inline-table');
|
||||
label = $('<label>' + key + ':</label>').css('vertical-align', 'middle');
|
||||
input = $('<input type="text" value="' + value + '" title="' + nodeAttrs[key] + '"/>').css('margin-top', '5px');
|
||||
|
||||
@ -3121,7 +3124,7 @@ function installGanglia(node) {
|
||||
*/
|
||||
function advancedLoad(group){
|
||||
var tempIndex = 0;
|
||||
var tableHeaders = $('#' + nodesTableId + ' th');
|
||||
var tableHeaders = $('#' + nodesTableId).parents('.dataTables_scroll').find('.dataTables_scrollHead thead tr:eq(0) th');
|
||||
var colNameHash = new Object();
|
||||
var colName = '';
|
||||
var archCol = 0, hcpCol = 0;
|
||||
@ -3202,13 +3205,13 @@ function jumpProvision(tgtnodes){
|
||||
var index = 0;
|
||||
var archtype = '';
|
||||
var errormessage = '';
|
||||
var diaDiv = $('<div title="Provision(only support Linux)" class="form" id="deployDiv"></div>');
|
||||
var diaDiv = $('<div title="Provision (only supported for Linux)" class="form" id="deployDiv"></div>');
|
||||
// check the first node's arch type
|
||||
for (index in nodeArray){
|
||||
nodeName = nodeArray[index];
|
||||
// does not have arch
|
||||
if (!origAttrs[nodeName]['arch']){
|
||||
errormessage = 'All nodes should define arch first!';
|
||||
errormessage = 'All nodes should have arch defined first!';
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3218,7 +3221,7 @@ function jumpProvision(tgtnodes){
|
||||
|
||||
// all nodes should have same archtype
|
||||
if (archtype != origAttrs[nodeName]['arch']){
|
||||
errormessage = 'All nodes should belong to same arch!<br/>';
|
||||
errormessage = 'All nodes should belong to the same arch!<br/>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3226,13 +3229,13 @@ function jumpProvision(tgtnodes){
|
||||
// check the mac address
|
||||
for (index in nodeArray){
|
||||
if (!origAttrs[nodeName]['mac'] || !origAttrs[nodeName]['ip']){
|
||||
errormessage += 'All nodes should define ip and mac!<br/>';
|
||||
errormessage += 'All nodes should have the IP and MAC defined!<br/>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (-1 != archtype.indexOf('390')){
|
||||
errormessage += 'System Z should use provision page.';
|
||||
errormessage += 'Please use the provision page.';
|
||||
}
|
||||
|
||||
// error message should show in a dialog
|
||||
|
Loading…
Reference in New Issue
Block a user