- Cleaned up code
- Enable editable datatable - Fixed Ganglia monitoring plot git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10131 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
1ed33ac074
commit
0f6b950c92
@ -192,11 +192,11 @@ body {
|
||||
}
|
||||
|
||||
#groups .grouplabel {
|
||||
/*background-color: #A9D0F5;*/
|
||||
padding: 5px 0px 5px 10px;
|
||||
font-weight: bold;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
#groups .groupdiv{
|
||||
padding-left: 10px;
|
||||
}
|
||||
@ -452,7 +452,7 @@ legend {
|
||||
|
||||
/*** Table ***/
|
||||
.datatable {
|
||||
width: 660px;
|
||||
width: 100%;
|
||||
border-width: 1px;
|
||||
border-spacing: 0px;
|
||||
border-style: solid;
|
||||
|
@ -184,7 +184,7 @@ function createBackButton(){
|
||||
function getDiscoverEnv(envName){
|
||||
if (discoverEnv[envName]){
|
||||
return discoverEnv[envName];
|
||||
}
|
||||
}
|
||||
else{
|
||||
return '';
|
||||
}
|
||||
@ -331,7 +331,6 @@ function initSelectPlatform(){
|
||||
temp += '<p>This wizard will guide you through the process of defining the naming conventions within' +
|
||||
'your cluster, discovering the hardware on your network, and automatically defining it in the xCAT' +
|
||||
'database.<br/>Choose which type of hardware you want to discover, and then click Next.</p>';
|
||||
|
||||
temp += '<input type="radio" name="platform" disabled="true"><span style="color:gray;"> System x hardware (not implemented yet)</span></input><br/>';
|
||||
temp += '<input type="radio" name="platform" id="ih"> System p hardware (P7 IH)</input><br/>';
|
||||
temp += '<input type="radio" name="platform" id="nonih"> System p hardware (Non P7 IH)</input><br/>';
|
||||
@ -359,9 +358,9 @@ function initSelectPlatform(){
|
||||
function getPlatform(){
|
||||
var radioValue = $('#discoverContentDiv :checked').attr('id');
|
||||
setDiscoverEnv('machineType', radioValue);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 2: Cluster basic patterns
|
||||
* users can input the switches' name range, the number of port, start ip and port prefix
|
||||
@ -413,7 +412,6 @@ function initBasicPattern(){
|
||||
showString += '</tbody></table></div>';
|
||||
|
||||
$('#discoverContentDiv').append(showString);
|
||||
|
||||
$('#discoverContentDiv [title]').tooltip({
|
||||
position: "center right",
|
||||
offset: [-2, 10],
|
||||
@ -640,6 +638,7 @@ function checkSupernode(operType){
|
||||
cmd : 'echo -e "' + args + '" > /tmp/websupernode.txt'
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -811,6 +810,7 @@ function calcEndIp(ipStart, num){
|
||||
ipArray[0] = ipArray[0] + parseInt(sum / 255);
|
||||
return (ipArray.join('.'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 4: check the input are all filled
|
||||
*
|
||||
@ -936,7 +936,6 @@ function initDiscoverFrames(){
|
||||
for (var i in frameArray){
|
||||
$('#frameTd').append('<p><input name="frameradio" type="radio" onclick="createMap(this)"><span>' +
|
||||
frameArray[i] + '</span></p>');
|
||||
|
||||
}
|
||||
|
||||
for (var i in mtmsArray){
|
||||
@ -1082,6 +1081,7 @@ function initConfig(operType){
|
||||
|
||||
createSetupFile();
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 7: create the xcat configure file
|
||||
*
|
||||
@ -1175,6 +1175,7 @@ function runSetup(){
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 7: create the dhcp configure file
|
||||
*
|
||||
@ -1341,9 +1342,9 @@ function lsslpWriteHMC(){
|
||||
tempSpan.addClass('ui-icon-check');
|
||||
lsslpWriteCec();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -203,20 +203,20 @@ 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>');
|
||||
'<option value="mm">AMM Node</option><option value="blade">Blade Node</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 IP : </label><input id="ammIp" type="text"></input>' +
|
||||
'<label>AMM Name: </label><input id="ammName" type="text"></input><br/><br/>' +
|
||||
'<label>AMM IP: </label><input id="ammIp" type="text"></input>' +
|
||||
'</div>';
|
||||
|
||||
//append the blade div
|
||||
var bladeStr = '<div id="bladeNode" style="display:none;">' +
|
||||
'<label>Blade Name : </label><input id="bladeName" type="text"></input><br/><br/>' +
|
||||
'<label>Blade Group : </label><input id="bladeGroup" type="text"></input><br/><br/>' +
|
||||
'<label>Blade Id : </label><input id="bladeId" type="text"></input><br/><br/>' +
|
||||
'<label>Blade Series : </label><input type="radio" name="series" value="js"/>JS<input type="radio" name="series" value="ls"/>LS<br/><br/>' +
|
||||
'<label>Blade Mpa : </label><select id="mpaSelect"></select>';
|
||||
'<label>Blade Name: </label><input id="bladeName" type="text"></input><br/><br/>' +
|
||||
'<label>Blade Group: </label><input id="bladeGroup" type="text"></input><br/><br/>' +
|
||||
'<label>Blade ID: </label><input id="bladeId" type="text"></input><br/><br/>' +
|
||||
'<label>Blade Series: </label><input type="radio" name="series" value="js"/>JS<input type="radio" name="series" value="ls"/>LS<br/><br/>' +
|
||||
'<label>Blade MPA: </label><select id="mpaSelect"></select>';
|
||||
nodeTypeSelectDia.append(mmStr);
|
||||
nodeTypeSelectDia.append(bladeStr);
|
||||
|
||||
@ -298,7 +298,7 @@ function addMmNode(){
|
||||
var ip = $('#ammIp').val();
|
||||
|
||||
if ((!name) || (!ip)){
|
||||
$('#nodeTypeSelectDia').prepend(createWarnBar("You miss some inputs."));
|
||||
$('#nodeTypeSelectDia').prepend(createWarnBar("You are missing some inputs!"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -203,12 +203,12 @@ ipmiPlugin.prototype.loadResources = function() {
|
||||
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 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>';
|
||||
'<div><label>BMC Groups:</label><input type="text"></div>';
|
||||
|
||||
diaDiv.append(showStr);
|
||||
diaDiv.dialog({
|
||||
|
@ -3,6 +3,7 @@ function loadGuidePage(){
|
||||
var tab = new Tab();
|
||||
tab.init();
|
||||
$('#content').append(tab.object());
|
||||
|
||||
//add the help content
|
||||
var helpForm = $('<div class="form"></div>');
|
||||
helpForm.append('<fieldset><legend>Quick Start</legend><ol>' +
|
||||
|
@ -31,7 +31,7 @@ function loadGangliaMon() {
|
||||
gangliaTab.append(nodes);
|
||||
|
||||
// Create info bar
|
||||
var info = createInfoBar('Select a group to view its nodes');
|
||||
var info = createInfoBar('Select a group to view the nodes summary');
|
||||
nodes.append(info);
|
||||
|
||||
// Get groups
|
||||
@ -147,128 +147,69 @@ function checkGangliaRPMs(data) {
|
||||
function loadGroups4Ganglia(data) {
|
||||
// Remove loader
|
||||
$('#groups').find('img').remove();
|
||||
|
||||
|
||||
// Save group in cookie
|
||||
var groups = data.rsp;
|
||||
setGroupsCookies(data);
|
||||
|
||||
// Create a list of groups
|
||||
var ul = $('<ul></ul>');
|
||||
var item = $('<li id="root"><h3>Groups</h3></li>');
|
||||
ul.append(item);
|
||||
var subUL = $('<ul></ul>');
|
||||
item.append(subUL);
|
||||
|
||||
$('#groups').append('<div class="grouplabel">Groups</div>');
|
||||
var grouplist= $('<div class="groupdiv"></div>');
|
||||
// Create a link for each group
|
||||
for ( var i = groups.length; i--;) {
|
||||
var subItem = $('<li id="' + groups[i] + '"></li>');
|
||||
var link = $('<a>' + groups[i] + '</a>');
|
||||
subItem.append(link);
|
||||
subUL.append(subItem);
|
||||
for (var i = groups.length; i--;) {
|
||||
grouplist.append('<div><a href="#">' + groups[i] + '</a></div>');
|
||||
}
|
||||
|
||||
$('#groups').append(grouplist);
|
||||
|
||||
// Bind the click event
|
||||
$('#groups .groupdiv div').bind('click', function(){
|
||||
$('#nodes .jqplot-target').remove();
|
||||
|
||||
// Create loader
|
||||
var loader = createLoader();
|
||||
loader.css('padding', '5px');
|
||||
$('#nodes').append(loader);
|
||||
|
||||
var thisGroup = $(this).text();
|
||||
$('#groups .groupdiv div').removeClass('selectgroup');
|
||||
$(this).addClass('selectgroup');
|
||||
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'nodels',
|
||||
tgt : thisGroup,
|
||||
args : '',
|
||||
msg : thisGroup
|
||||
},
|
||||
|
||||
// Turn groups list into a tree
|
||||
$('#groups').append(ul);
|
||||
$('#groups').jstree( {
|
||||
core : {
|
||||
"initially_open" : [ "root" ]
|
||||
},
|
||||
themes : {
|
||||
"theme" : "default",
|
||||
"dots" : false, // No dots
|
||||
"icons" : false // No icons
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Get node definitions
|
||||
*
|
||||
* @param data
|
||||
* Data returned from HTTP request
|
||||
* @return Nothing
|
||||
*/
|
||||
success : function(data) {
|
||||
var group = data.msg;
|
||||
|
||||
// Get nodes definitions
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'nodestat',
|
||||
tgt : group,
|
||||
args : '',
|
||||
msg : group
|
||||
},
|
||||
|
||||
// Load nodes onclick
|
||||
$('#groups').bind('select_node.jstree', function(event, data) {
|
||||
// If there are subgroups, remove them
|
||||
data.rslt.obj.children('ul').remove();
|
||||
var thisGroup = jQuery.trim(data.rslt.obj.text());
|
||||
if (thisGroup) {
|
||||
// Clear nodes division
|
||||
$('#nodes').children().remove();
|
||||
|
||||
// Create link to Ganglia
|
||||
var gangliaLnk = $('<a href="#">Click here</a>');
|
||||
gangliaLnk.css( {
|
||||
'color' : 'blue',
|
||||
'text-decoration' : 'none'
|
||||
});
|
||||
gangliaLnk.click(function() {
|
||||
// Open a new window for Ganglia
|
||||
window.open('../ganglia/');
|
||||
});
|
||||
|
||||
// Create info bar
|
||||
var info = $('<div class="ui-state-highlight ui-corner-all"></div>');
|
||||
info.append('<span class="ui-icon ui-icon-info" style="display: inline-block; margin: 10px 5px;"></span>');
|
||||
var msg = $('<p style="display: inline-block; width: 95%;"></p>');
|
||||
msg.append('Below is a summary of nodes within the selected group. ');
|
||||
msg.append(gangliaLnk);
|
||||
msg.append(' to open the Ganglia page.');
|
||||
info.append(msg);
|
||||
info.css('margin-bottom', '10px');
|
||||
$('#nodes').append(info);
|
||||
|
||||
// Create loader
|
||||
var loader = $('<center></center>').append(createLoader());
|
||||
$('#nodes').append(loader);
|
||||
|
||||
// To improve performance, get all nodes within selected group
|
||||
// Get node definitions only for first 50 nodes
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'nodels',
|
||||
tgt : thisGroup,
|
||||
args : '',
|
||||
msg : thisGroup
|
||||
},
|
||||
|
||||
/**
|
||||
* Get node definitions
|
||||
*
|
||||
* @param data
|
||||
* Data returned from HTTP request
|
||||
* @return Nothing
|
||||
*/
|
||||
success : function(data) {
|
||||
var group = data.msg;
|
||||
|
||||
// Get nodes definitions
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'nodestat',
|
||||
tgt : group,
|
||||
args : '',
|
||||
msg : group
|
||||
},
|
||||
|
||||
success : loadGangliaSummary
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Get subgroups within selected group
|
||||
// only when this is the parent group and not a subgroup
|
||||
if (data.rslt.obj.attr('id').indexOf('Subgroup') < 0) {
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'extnoderange',
|
||||
tgt : thisGroup,
|
||||
args : 'subgroups',
|
||||
msg : thisGroup
|
||||
},
|
||||
|
||||
success : loadSubgroups
|
||||
});
|
||||
success : loadGangliaSummary
|
||||
});
|
||||
}
|
||||
} // End of if (thisGroup)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -341,16 +282,18 @@ function loadGangliaStatus(data) {
|
||||
for ( var i in ganglia) {
|
||||
// ganglia[0] = nodeName and ganglia[1] = state
|
||||
node = jQuery.trim(ganglia[i][0]);
|
||||
monitored = jQuery.trim(ganglia[i][1]);
|
||||
ping = gangliaData[node]['status'];
|
||||
|
||||
// If the node is monitored, increment count
|
||||
if (ping == 'sshd' && monitored == 'on') {
|
||||
pingWGanglia++;
|
||||
} else if (ping == 'sshd' && monitored == 'off') {
|
||||
pingWOGanglia++;
|
||||
} else {
|
||||
noping++;
|
||||
if (node) {
|
||||
monitored = jQuery.trim(ganglia[i][1]);
|
||||
ping = gangliaData[node]['status'];
|
||||
|
||||
// If the node is monitored, increment count
|
||||
if (ping == 'sshd' && monitored == 'on') {
|
||||
pingWGanglia++;
|
||||
} else if (ping == 'sshd' && monitored == 'off') {
|
||||
pingWOGanglia++;
|
||||
} else {
|
||||
noping++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -362,25 +305,27 @@ function loadGangliaStatus(data) {
|
||||
var details = $('<div id="ganglia_details"></div>');
|
||||
$('#nodes').append(details);
|
||||
|
||||
var pie = [['Ping & monitored', pingWGanglia], ['Ping & not monitored', pingWOGanglia], ['Noping', noping]];
|
||||
var chart = $.jqplot('ganglia_sum', [ pie ], {
|
||||
seriesDefaults : {
|
||||
renderer : $.jqplot.PieRenderer
|
||||
},
|
||||
seriesColors : [
|
||||
'#3CB548', '#FE9A2E', '#848484' // Green, orange, grey
|
||||
],
|
||||
legend : {
|
||||
show : true
|
||||
},
|
||||
grid : {
|
||||
background : 'transparent',
|
||||
borderColor : 'white',
|
||||
borderWidth : '0px',
|
||||
shadow : false
|
||||
},
|
||||
show : true
|
||||
});
|
||||
var pie = [['Ping + monitored', pingWGanglia], ['Ping + not monitored', pingWOGanglia], ['Noping', noping]];
|
||||
var plot = $.jqplot('ganglia_sum',
|
||||
[pie], {
|
||||
seriesDefaults: {
|
||||
renderer: $.jqplot.PieRenderer,
|
||||
rendererOptions: {
|
||||
padding: 5,
|
||||
fill:true,
|
||||
shadow:true,
|
||||
shadowOffset: 2,
|
||||
shadowDepth: 5,
|
||||
shadowAlpha: 0.07,
|
||||
dataLabels : 'value',
|
||||
showDataLabels: true
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: true,
|
||||
location: 'e'
|
||||
}
|
||||
});
|
||||
|
||||
// Change CSS styling for legend
|
||||
summary.find('table').css({
|
||||
@ -388,16 +333,7 @@ function loadGangliaStatus(data) {
|
||||
}).find('td').css({
|
||||
'border-style': 'none'
|
||||
});
|
||||
|
||||
// Show details on mouse-over
|
||||
$('#ganglia_sum').bind('jqplotDataMouseOver', function(env, srIndex, ptIndex, data) {
|
||||
// Show for 8 seconds before sliding up
|
||||
$('#ganglia_details').children().remove();
|
||||
$('#ganglia_details').show();
|
||||
$('#ganglia_details').append($('<p>' + data[1] + ' node(s) ' + data[0] + '</p>'));
|
||||
$('#ganglia_details').delay(8000).slideUp();
|
||||
});
|
||||
|
||||
|
||||
// Open nodes page on-click
|
||||
$('#ganglia_sum').bind('jqplotDataClick', function(env, srIndex, ptIndex, data) {
|
||||
window.open('../xcat/index.php');
|
||||
|
@ -6,15 +6,15 @@ var globalCondition = '';
|
||||
var globalResponse = new Object();
|
||||
|
||||
function loadRmcMon() {
|
||||
// find the rmcmon tab
|
||||
//find the rmcmon tab
|
||||
var rmcMonTab = $('#rmcmon');
|
||||
|
||||
// add the stauts bar first. id = 'rmcMonStatus'
|
||||
//add the stauts bar first. id = 'rmcMonStatus'
|
||||
var rmcStatusBar = createStatusBar('rmcMonStatus');
|
||||
rmcStatusBar.find('div').append(createLoader());
|
||||
rmcMonTab.append(rmcStatusBar);
|
||||
|
||||
// add the configure button.
|
||||
//add the configure button.
|
||||
var configButton = createButton('Configure');
|
||||
configButton.hide();
|
||||
configButton.click(function() {
|
||||
@ -27,18 +27,18 @@ function loadRmcMon() {
|
||||
});
|
||||
rmcMonTab.append(configButton);
|
||||
|
||||
// add configure div
|
||||
//add configure div
|
||||
rmcMonTab.append("<div id='rmcMonConfig'></div>");
|
||||
$('#rmcMonConfig').hide();
|
||||
|
||||
// load the configure div's content
|
||||
//load the configure div's content
|
||||
loadRmcMonConfigure();
|
||||
|
||||
// add the content of the rmcmon, id = 'rmcMonTab'
|
||||
//add the content of the rmcmon, id = 'rmcMonTab'
|
||||
rmcMonTab.append("<div id='rmcMonShow'><div id='rmcmonSummary'></div><div id='rmcmonDetail'></div><div id='nodeDetail'></div></div>");
|
||||
$('#nodeDetail').hide();
|
||||
|
||||
// check the software work status by platform(linux and aix)
|
||||
//check the software work status by platform(linux and aix)
|
||||
$.ajax( {
|
||||
url : 'lib/systemcmd.php',
|
||||
dataType : 'json',
|
||||
@ -51,11 +51,11 @@ function loadRmcMon() {
|
||||
}
|
||||
|
||||
function loadRmcMonConfigure(){
|
||||
// get the configure div and clean its content.
|
||||
//get the configure div and clean its content.
|
||||
var rmcmonCfgDiv = $('#rmcMonConfig');
|
||||
rmcmonCfgDiv.empty();
|
||||
|
||||
// add the start button
|
||||
//add the start button
|
||||
var startButton = createButton('Start');
|
||||
rmcmonCfgDiv.append(startButton);
|
||||
startButton.click(function(){
|
||||
@ -76,7 +76,7 @@ function loadRmcMonConfigure(){
|
||||
});
|
||||
});
|
||||
|
||||
// add the stop button
|
||||
//add the stop button
|
||||
var stopButton = createButton('Stop');
|
||||
rmcmonCfgDiv.append(stopButton);
|
||||
stopButton.click(function(){
|
||||
@ -106,7 +106,7 @@ function loadRmcMonConfigure(){
|
||||
}
|
||||
|
||||
function rsctRpmCheck(data){
|
||||
// linux had to check the rscp first
|
||||
//linux had to check the rscp first
|
||||
if ('aix' != data.rsp){
|
||||
$.ajax( {
|
||||
url : 'lib/systemcmd.php',
|
||||
@ -144,21 +144,21 @@ function xcatrmcRpmCheck(){
|
||||
var softInstallStatus = data.rsp.split(/\n/);
|
||||
var needHelp = false;
|
||||
$('#rmcMonStatus div').empty();
|
||||
// check the xcat-rmc
|
||||
//check the xcat-rmc
|
||||
if (-1 != softInstallStatus[0].indexOf("not")){
|
||||
needHelp = true;
|
||||
$('#rmcMonStatus div').append(
|
||||
'Please install the <a href="http://xcat.sourceforge.net/#download" target="install_window">xCAT-rmc</a> first.<br/>');
|
||||
}
|
||||
|
||||
// check the rrdtool
|
||||
//check the rrdtool
|
||||
if (-1 != softInstallStatus[1].indexOf("not")){
|
||||
needHelp = true;
|
||||
$('#rmcMonStatus div').append(
|
||||
'Please install the <a href="http://oss.oetiker.ch/rrdtool/download.en.html" target="install_window">RRD-tool</a> first.<br/>');
|
||||
}
|
||||
|
||||
// add help info or load the rmc show
|
||||
//add help info or load the rmc show
|
||||
if (needHelp){
|
||||
$('#rmcMonStatus div').append(
|
||||
'You can find more support form <a href="http://xcat.svn.sourceforge.net/viewvc/xcat/xcat-core/trunk/xCAT-client/share/doc/xCAT2-Monitoring.pdf" target="pdf_window">xCAT2-Monitoring.pdf</a>');
|
||||
@ -201,11 +201,12 @@ function removeStatusBar(){
|
||||
|
||||
$('#rmcmonDetail [title]').tooltip({position:['center','right']});
|
||||
}
|
||||
|
||||
function loadRmcMonShow(){
|
||||
$('#rmcMonStatus div').empty().append("Getting Summary Data.");
|
||||
$('#rmcMonStatus div').append(createLoader());
|
||||
|
||||
// load the rmc status summary
|
||||
//load the rmc status summary
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
@ -234,7 +235,7 @@ function showRmcSummary(returnData) {
|
||||
|
||||
//update the rmc status area
|
||||
$('#rmcMonStatus div').empty().append("Getting Nodes' Data").append(createLoader());
|
||||
// load each nodes' status
|
||||
//load each nodes' status
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
@ -250,8 +251,8 @@ function showRmcSummary(returnData) {
|
||||
}
|
||||
});
|
||||
|
||||
// create the timestamp, the flot only use the UTC time, so had to change
|
||||
// the value, to show the right time
|
||||
//create the timestamp, the flot only use the UTC time, so had to change
|
||||
//the value, to show the right time
|
||||
var tempDate = new Date();
|
||||
var tempOffset = tempDate.getTimezoneOffset();
|
||||
var tempTime = tempDate.getTime() - 3600000;
|
||||
@ -260,7 +261,7 @@ function showRmcSummary(returnData) {
|
||||
globalTimeStamp.push(tempDate.getTime());
|
||||
}
|
||||
|
||||
// show the summary data
|
||||
//show the summary data
|
||||
$('#rmcmonSummary').empty().append('<h3>Overview</h3><hr />');
|
||||
$('#rmcmonSummary').append(summaryTable);
|
||||
|
||||
@ -497,9 +498,9 @@ function showNode(nodeName) {
|
||||
*
|
||||
*/
|
||||
function loadRmcEvent(){
|
||||
// find the rmcevent tab
|
||||
//find the rmcevent tab
|
||||
|
||||
// add the stauts bar first. id = 'rmcMonStatus'
|
||||
//add the stauts bar first. id = 'rmcMonStatus'
|
||||
var rmcStatusBar = createStatusBar('rmcEventStatus');
|
||||
rmcStatusBar.find('div').append(createLoader());
|
||||
$('#rmcevent').append(rmcStatusBar);
|
||||
@ -558,7 +559,7 @@ function getConditions(){
|
||||
*/
|
||||
function getResponse(){
|
||||
var tempFlag = false;
|
||||
// get all response first
|
||||
//get all response first
|
||||
for (var i in globalResponse){
|
||||
tempFlag = true;
|
||||
break;
|
||||
@ -605,10 +606,10 @@ function showEventLog(data){
|
||||
var eventDiv = $('#rmcEventDiv');
|
||||
eventDiv.empty();
|
||||
|
||||
// add the configure button
|
||||
//add the configure button
|
||||
loadRmcEventConfig();
|
||||
|
||||
// get conditions and responses, save in the global
|
||||
//get conditions and responses, save in the global
|
||||
getConditions();
|
||||
getResponse();
|
||||
|
||||
@ -629,7 +630,7 @@ function showEventLog(data){
|
||||
'iDisplayLength' :10
|
||||
});
|
||||
|
||||
// unsort on the content column
|
||||
//unsort on the content column
|
||||
$('#lsEventTable thead tr th').eq(2).unbind('click');
|
||||
}
|
||||
|
||||
@ -676,7 +677,7 @@ function mkCondRespDia(){
|
||||
var diaDiv = $('<div title="Configure Association" id="mkAssociation" class="tab"></div>');
|
||||
var mkAssociationTable = '<center><table><thead><tr><th>Condition Name</th><th>Response Name</th></tr></thead>';
|
||||
mkAssociationTable += '<tbody><tr><td id="mkAssCond">';
|
||||
// add the conditions into fieldset
|
||||
//add the conditions into fieldset
|
||||
if ('' == globalCondition){
|
||||
mkAssociationTable += 'Getting predefined conditions, open this dislogue later.';
|
||||
}
|
||||
@ -687,7 +688,7 @@ function mkCondRespDia(){
|
||||
mkAssociationTable += '</td><td id="mkAssResp">Plase select condition first.</td></tr></tbody></table></center>';
|
||||
diaDiv.append(mkAssociationTable);
|
||||
diaDiv.append('<div id="selectedResp" style="display: none;" ><div>');
|
||||
// change the response field when click the condition
|
||||
//change the response field when click the condition
|
||||
diaDiv.find('input:radio').bind('click', function(){
|
||||
diaDiv.find('#mkAssResp').empty().append('Getting response').append(createLoader());
|
||||
$.ajax({
|
||||
@ -745,7 +746,8 @@ function mkCondRespDia(){
|
||||
var oldResp = new Object();
|
||||
var oldString = '';
|
||||
var newString = '';
|
||||
// get the old seelected responses
|
||||
|
||||
//get the old seelected responses
|
||||
var conditionName = $(this).find('#mkAssCond :checked').attr('value');
|
||||
if (!conditionName){
|
||||
return;
|
||||
@ -758,7 +760,8 @@ function mkCondRespDia(){
|
||||
for (var i in tempArray){
|
||||
oldResp[tempArray[i]] = 1;
|
||||
}
|
||||
// get the new selected responses
|
||||
|
||||
//get the new selected responses
|
||||
$(this).find('#mkAssResp input:checked').each(function(){
|
||||
var respName = $(this).attr('value');
|
||||
newResp[respName] = 1;
|
||||
@ -771,7 +774,7 @@ function mkCondRespDia(){
|
||||
}
|
||||
}
|
||||
|
||||
// add the response which are delete.
|
||||
//add the response which are delete.
|
||||
for (var i in oldResp){
|
||||
oldString += ',"' + i + '"';
|
||||
}
|
||||
@ -779,7 +782,7 @@ function mkCondRespDia(){
|
||||
oldString = oldString.substr(1);
|
||||
}
|
||||
|
||||
// add the response which are new add
|
||||
//add the response which are new add
|
||||
for (var i in newResp){
|
||||
newString += ',"' + i +'"';
|
||||
}
|
||||
@ -823,7 +826,7 @@ function chCondScopeDia(){
|
||||
var tableContent = '<center><table id="changeScopeTable" ><thead><tr><th>Condition Name</th><th>Group Name</th></tr></thead>';
|
||||
|
||||
tableContent += '<tbody><tr><td id="changePreCond">';
|
||||
// add the conditions into fieldset
|
||||
//add the conditions into fieldset
|
||||
if ('' == globalCondition){
|
||||
tableContent += 'Getting predefined conditions, open this dislogue later.';
|
||||
}
|
||||
@ -832,7 +835,7 @@ function chCondScopeDia(){
|
||||
}
|
||||
tableContent += '</td><td id="changeGroup">';
|
||||
|
||||
// add the groups into table
|
||||
//add the groups into table
|
||||
var groups = $.cookie('groups').split(',');
|
||||
for (var i in groups){
|
||||
tableContent += '<input type="checkbox" value="' + groups[i] + '">' + groups[i] + '<br/>';
|
||||
@ -840,9 +843,9 @@ function chCondScopeDia(){
|
||||
|
||||
tableContent += '</td></tr></tbody></table></center>';
|
||||
diaDiv.append(tableContent);
|
||||
// fieldset to show status
|
||||
//fieldset to show status
|
||||
diaDiv.append('<fieldset id="changeStatus"></fieldset>');
|
||||
// create the dislogue
|
||||
//create the dislogue
|
||||
diaDiv.dialog({
|
||||
modal: true,
|
||||
width: 500,
|
||||
|
@ -74,12 +74,9 @@ function loadXcatMonSetting(data){
|
||||
|
||||
//create contariner for new contents use for update the monsetting table
|
||||
var newCont =new Object();
|
||||
newCont[0]=rsp[0].split(","); // table header
|
||||
// create container for other monsetting lines not xcatmon
|
||||
newCont[0]=rsp[0].split(","); //table header
|
||||
//create container for other monsetting lines not xcatmon
|
||||
var otherCont =new Array();
|
||||
|
||||
|
||||
|
||||
|
||||
$('#xcatmonTable').append(XcatmonTable.object()); //add table object
|
||||
var m=1; //the count for origCont
|
||||
@ -108,7 +105,8 @@ function loadXcatMonSetting(data){
|
||||
|
||||
cols.push('<input type="checkbox" name="'+cols[0]+'" title="Click this checkbox will add/remove the app from the configure apps value." />');
|
||||
cols.unshift('<span class="ui-icon ui-icon-close" onclick="deleteRow1(this)"></span>');
|
||||
//add teh column tho the table.
|
||||
|
||||
//add the column tho the table
|
||||
XcatmonTable.add(cols);
|
||||
|
||||
origCont[m++]=cols;
|
||||
@ -130,6 +128,7 @@ function loadXcatMonSetting(data){
|
||||
apps_flag=1; //set the flag to 1 to avoid this subroute
|
||||
}
|
||||
}
|
||||
|
||||
//get into the ping setting subroute
|
||||
if (!ping_flag){
|
||||
//check the ping-interval config
|
||||
@ -368,8 +367,6 @@ function loadXcatMonSetting(data){
|
||||
//delete the last "," of the apps value
|
||||
appValue=appValue.substring(0,(appValue.length-1));
|
||||
apps[2]=appValue;
|
||||
|
||||
// tmp =apps;
|
||||
|
||||
//newCont add the apps row
|
||||
newCont[count++]=apps;
|
||||
|
@ -13,6 +13,7 @@ var nodesList;
|
||||
var nodesTableId = 'nodesDatatable';
|
||||
// provision clock for provision progress stop
|
||||
var provisionClock;
|
||||
|
||||
/**
|
||||
* Set node tab
|
||||
*
|
||||
@ -156,7 +157,7 @@ function drawPieSummary(index, valuepair){
|
||||
}
|
||||
|
||||
container.empty();
|
||||
var plot=$.jqplot(container.attr('id'),
|
||||
var plot = $.jqplot(container.attr('id'),
|
||||
[dataArray],
|
||||
{
|
||||
title: chattitle,
|
||||
@ -164,8 +165,8 @@ function drawPieSummary(index, valuepair){
|
||||
renderer: $.jqplot.PieRenderer,
|
||||
rendererOptions: {
|
||||
padding: 5,
|
||||
fill:true,
|
||||
shadow:true,
|
||||
fill: true,
|
||||
shadow: true,
|
||||
shadowOffset: 2,
|
||||
shadowDepth: 5,
|
||||
shadowAlpha: 0.07,
|
||||
@ -233,13 +234,14 @@ function loadGroups(data) {
|
||||
}
|
||||
|
||||
$('#groups').append(grouplist);
|
||||
//bind the click event
|
||||
|
||||
// bind the click event
|
||||
$('#groups .groupdiv div').bind('click', function(){
|
||||
var thisgroup=$(this).text();
|
||||
var thisGroup = $(this).text();
|
||||
$('#groups .groupdiv div').removeClass('selectgroup');
|
||||
|
||||
$(this).addClass('selectgroup');
|
||||
drawNodesArea(thisgroup,'',thisgroup);
|
||||
drawNodesArea(thisGroup,'',thisGroup);
|
||||
});
|
||||
|
||||
// Make a link to add nodes
|
||||
@ -257,7 +259,7 @@ function loadGroups(data) {
|
||||
* @return
|
||||
*/
|
||||
function drawNodesArea(targetgroup, cmdargs, message){
|
||||
// Clear nodes division
|
||||
// Clear nodes division
|
||||
$('#nodes').empty();
|
||||
|
||||
// Create loader
|
||||
@ -272,8 +274,7 @@ function drawNodesArea(targetgroup, cmdargs, message){
|
||||
tab.add('graphTab', 'Graphic', '', false);
|
||||
|
||||
$('#nodesPageTabs').bind('tabsselect', function(event, ui){
|
||||
// for the graphical tab, we should check the graphical data
|
||||
// first
|
||||
// for the graphical tab, we should check the graphical data first
|
||||
if (1 == ui.index){
|
||||
createPhysicalLayout(nodesList);
|
||||
}
|
||||
@ -342,6 +343,7 @@ function drawNodesArea(targetgroup, cmdargs, message){
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a link to add nodes
|
||||
*
|
||||
@ -360,9 +362,9 @@ function mkAddNodeLink() {
|
||||
addNodeForm.append('<div><label for="mgt">Hardware management:</label>'
|
||||
+ '<select id="mgt" name="mgt">'
|
||||
+ '<option value="ipmi">iDataPlex</option>'
|
||||
+ '<option value="blade">Blade Center</option>'
|
||||
+ '<option>hmc</option>'
|
||||
+ '<option>zvm</option>'
|
||||
+ '<option value="blade">BladeCenter</option>'
|
||||
+ '<option value="hmc">System p</option>'
|
||||
+ '<option value="zvm">System z</option>'
|
||||
+ '</select>'
|
||||
+ '</div>');
|
||||
|
||||
@ -498,9 +500,7 @@ function loadNodes(data) {
|
||||
|
||||
// Variable to send command and request node status
|
||||
var getNodeStatus = true;
|
||||
|
||||
// Clear cookie containing list of nodes where their attributes need to be updated
|
||||
$.cookie('nodes2update', '');
|
||||
|
||||
// Clear hash table containing node attributes
|
||||
origAttrs = '';
|
||||
|
||||
@ -649,7 +649,7 @@ function loadNodes(data) {
|
||||
$('#nodesTab').children().remove();
|
||||
|
||||
// Create info bar for nodes tab
|
||||
var info = createInfoBar('Click on a cell to edit. Click outside the table to write to the cell. Hit the Escape key to ignore changes. Once you are satisfied with how the table looks, click on Save.');
|
||||
var info = createInfoBar('Click on a cell to edit. Click outside the table to save changes. Hit the Escape key to ignore changes.');
|
||||
$('#nodesTab').append(info);
|
||||
|
||||
// Create action bar
|
||||
@ -839,35 +839,8 @@ function loadNodes(data) {
|
||||
actionBar.append(actionsMenu);
|
||||
|
||||
// Insert action bar and nodes datatable
|
||||
//$('#nodesTab').append(actionBar);
|
||||
$('#nodesTab').append(nodesTable.object());
|
||||
|
||||
/**
|
||||
* Create menu to save and undo table changes
|
||||
*/
|
||||
/*
|
||||
// Save changes
|
||||
var saveLnk = $('<a>Save</a>');
|
||||
saveLnk.bind('click', function(event){
|
||||
updateNodeAttrs(group);
|
||||
});
|
||||
|
||||
// Undo changes
|
||||
var undoLnk = $('<a>Undo</a>');
|
||||
undoLnk.bind('click', function(event){
|
||||
restoreNodeAttrs();
|
||||
|
||||
// Hide table menu actions
|
||||
tableActionsMenu.hide();
|
||||
});
|
||||
|
||||
// It will be hidden until a change is made
|
||||
var tableActionsMenu = createMenu([saveLnk, undoLnk]);
|
||||
tableActionsMenu.css('display', 'inline-block');
|
||||
tableActionsMenu.attr('id', 'tableActionMenu');
|
||||
actionsDiv.append(tableActionsMenu.hide());
|
||||
*/
|
||||
|
||||
// Turn table into a datatable
|
||||
var nodesDatatable = $('#' + nodesTableId).dataTable({
|
||||
'iDisplayLength': 50,
|
||||
@ -962,13 +935,9 @@ function loadNodes(data) {
|
||||
/**
|
||||
* Enable editable columns
|
||||
*/
|
||||
/*
|
||||
// Do not make 1st, 2nd, 3rd, 4th, 5th, or 6th column editable
|
||||
$('#' + nodesTableId + ' td:not(td:nth-child(1),td:nth-child(2),td:nth-child(3),td:nth-child(4),td:nth-child(5),td:nth-child(6))').editable(
|
||||
function(value, settings) {
|
||||
// Change text color to red
|
||||
$(this).css('color', 'red');
|
||||
|
||||
// Get column index
|
||||
var colPos = this.cellIndex;
|
||||
|
||||
@ -979,23 +948,41 @@ function loadNodes(data) {
|
||||
// Update datatable
|
||||
dTable.fnUpdate(value, rowPos, colPos, false);
|
||||
|
||||
// Get table headers
|
||||
var headers = $('#' + nodesTableId + ' thead tr th');
|
||||
|
||||
// Get node name
|
||||
var node = $(this).parent().find('td a.node').text();
|
||||
// Get attribute name
|
||||
var attrName = jQuery.trim(headers.eq(colPos).text());
|
||||
// Get column value
|
||||
var value = $(this).text();
|
||||
|
||||
// Flag node to update
|
||||
flagNode2Update(node);
|
||||
// Build argument
|
||||
var args = attrName + '=' + value;
|
||||
|
||||
// Show table menu actions
|
||||
tableActionsMenu.show();
|
||||
// Send command to change node attributes
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'chdef',
|
||||
tgt : '',
|
||||
args : '-t;node;-o;' + node + ';' + args,
|
||||
msg : 'out=nodesTab;tgt=' + node
|
||||
},
|
||||
|
||||
return (value);
|
||||
success: showChdefOutput
|
||||
});
|
||||
|
||||
return value;
|
||||
}, {
|
||||
onblur : 'submit', // Clicking outside editable area submits changes
|
||||
type : 'textarea',
|
||||
placeholder: ' ',
|
||||
height : '30px' // The height of the text area
|
||||
});
|
||||
/*
|
||||
|
||||
/**
|
||||
* Get the node status and definable node attributes
|
||||
*/
|
||||
@ -1155,9 +1142,6 @@ function addNodes2Table(data) {
|
||||
// Variable to send command and request node status
|
||||
var getNodeStatus = true;
|
||||
|
||||
// Clear cookie containing list of nodes where their attributes need to be updated
|
||||
$.cookie('nodes2update', '');
|
||||
|
||||
// Go through each attribute
|
||||
var node, args;
|
||||
for (var i in rsp) {
|
||||
@ -1287,13 +1271,10 @@ function addNodes2Table(data) {
|
||||
/**
|
||||
* Enable editable columns
|
||||
*/
|
||||
/*
|
||||
// Do not make 1st, 2nd, 3rd, 4th, or 5th column editable
|
||||
$('#' + nodesTableId + ' td:not(td:nth-child(1),td:nth-child(2),td:nth-child(3),td:nth-child(4),td:nth-child(5))').editable(
|
||||
alert('I am here');
|
||||
// Do not make 1st, 2nd, 3rd, 4th, 5th, or 6th column editable
|
||||
$('#' + nodesTableId + ' td:not(td:nth-child(1),td:nth-child(2),td:nth-child(3),td:nth-child(4),td:nth-child(5),td:nth-child(6))').editable(
|
||||
function(value, settings) {
|
||||
// Change text color to red
|
||||
$(this).css('color', 'red');
|
||||
|
||||
// Get column index
|
||||
var colPos = this.cellIndex;
|
||||
|
||||
@ -1304,23 +1285,40 @@ function addNodes2Table(data) {
|
||||
// Update datatable
|
||||
dTable.fnUpdate(value, rowPos, colPos, false);
|
||||
|
||||
// Get table headers
|
||||
var headers = $('#' + nodesTableId + ' thead tr th');
|
||||
|
||||
// Get node name
|
||||
var node = $(this).parent().find('td a.node').text();
|
||||
// Get attribute name
|
||||
var attrName = jQuery.trim(headers.eq(colPos).text());
|
||||
// Get column value
|
||||
var value = $(this).text();
|
||||
|
||||
// Flag node to update
|
||||
flagNode2Update(node);
|
||||
// Build argument
|
||||
var args = attrName + '=' + value;
|
||||
|
||||
// Show table menu actions
|
||||
$('#tableActionMenu').show();
|
||||
// Send command to change node attributes
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'chdef',
|
||||
tgt : '',
|
||||
args : '-t;node;-o;' + node + ';' + args,
|
||||
msg : 'out=nodesTab;tgt=' + node
|
||||
},
|
||||
|
||||
return (value);
|
||||
success: showChdefOutput
|
||||
});
|
||||
|
||||
return value;
|
||||
}, {
|
||||
onblur : 'submit', // Clicking outside editable area submits changes
|
||||
type : 'textarea',
|
||||
placeholder: ' ',
|
||||
height : '30px' // The height of the text area
|
||||
});
|
||||
*/
|
||||
|
||||
// If request to get node status is made
|
||||
if (getNodeStatus) {
|
||||
@ -2324,7 +2322,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.parent().parent().parent().parent();
|
||||
var tableObj = obj.parents('table');
|
||||
var status = obj.attr('checked');
|
||||
tableObj.find(' :checkbox').attr('checked', status);
|
||||
event.stopPropagation();
|
||||
@ -2358,148 +2356,6 @@ function loadRconsPage(tgtNodes){
|
||||
window.open(redirectUrl + "?rconsnd=" + tgtNodes, '', "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=670,height=436");
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag the node in the group table to update
|
||||
*
|
||||
* @param node
|
||||
* The node name
|
||||
* @return Nothing
|
||||
*/
|
||||
function flagNode2Update(node) {
|
||||
// Get list containing current nodes to update
|
||||
var nodes = $.cookie('nodes2update');
|
||||
|
||||
// If the node is not in the list
|
||||
if (nodes.indexOf(node) == -1) {
|
||||
// Add the new node to list
|
||||
nodes += node + ';';
|
||||
$.cookie('nodes2update', nodes);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update node attributes
|
||||
*
|
||||
* @param group
|
||||
* The node group name
|
||||
* @return Nothing
|
||||
*/
|
||||
function updateNodeAttrs(group) {
|
||||
// Get the nodes datatable
|
||||
var dTable = $('#' + nodesTableId).dataTable();
|
||||
// Get all nodes within the datatable
|
||||
var rows = dTable.fnGetNodes();
|
||||
|
||||
// Get table headers
|
||||
var headers = $('#' + nodesTableId + ' thead tr th');
|
||||
|
||||
// Get list of nodes to update
|
||||
var nodesList = $.cookie('nodes2update');
|
||||
var nodes = nodesList.split(';');
|
||||
|
||||
// Create the arguments
|
||||
var args;
|
||||
var rowPos, colPos, value;
|
||||
var attrName;
|
||||
// Go through each node where an attribute was changed
|
||||
for (var i in nodes) {
|
||||
if (nodes[i]) {
|
||||
args = '';
|
||||
|
||||
// Get the row containing the node link
|
||||
rowPos = findRow(nodes[i], '#' + nodesTableId, 1);
|
||||
$(rows[rowPos]).find('td').each(function (){
|
||||
if ($(this).css('color') == 'red' || $(this).css('color') == 'rgb(255, 0, 0)') {
|
||||
// Change color back to normal
|
||||
$(this).css('color', '');
|
||||
|
||||
// Get column position
|
||||
colPos = $(this).parent().children().index($(this));
|
||||
// Get column value
|
||||
value = $(this).text();
|
||||
|
||||
// Get attribute name
|
||||
attrName = jQuery.trim(headers.eq(colPos).text());
|
||||
|
||||
// Build argument string
|
||||
if (args) {
|
||||
// Handle subsequent arguments
|
||||
args += ';' + attrName + '=' + value;
|
||||
} else {
|
||||
// Handle the 1st argument
|
||||
args += attrName + '=' + value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Send command to change node attributes
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'chdef',
|
||||
tgt : '',
|
||||
args : '-t;node;-o;' + nodes[i] + ';' + args,
|
||||
msg : 'out=nodesTab;tgt=' + nodes[i]
|
||||
},
|
||||
|
||||
success: showChdefOutput
|
||||
});
|
||||
} // End of if
|
||||
} // End of for
|
||||
|
||||
// Clear cookie containing list of nodes where
|
||||
// their attributes need to be updated
|
||||
$.cookie('nodes2update', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore node attributes to their original content
|
||||
*
|
||||
* @return Nothing
|
||||
*/
|
||||
function restoreNodeAttrs() {
|
||||
// Get list of nodes to update
|
||||
var nodesList = $.cookie('nodes2update');
|
||||
var nodes = nodesList.split(';');
|
||||
|
||||
// Get the nodes datatable
|
||||
var dTable = $('#' + nodesTableId).dataTable();
|
||||
// Get table headers
|
||||
var headers = $('#' + nodesTableId + ' thead tr th');
|
||||
// Get all nodes within the datatable
|
||||
var rows = dTable.fnGetNodes();
|
||||
|
||||
// Go through each node where an attribute was changed
|
||||
var rowPos, colPos;
|
||||
var attrName, origVal;
|
||||
for (var i in nodes) {
|
||||
if (nodes[i]) {
|
||||
// Get the row containing the node link
|
||||
rowPos = findRow(nodes[i], '#' + nodesTableId, 1);
|
||||
$(rows[rowPos]).find('td').each(function (){
|
||||
if ($(this).css('color') == 'red' || $(this).css('color') == 'rgb(255, 0, 0)') {
|
||||
// Change color back to normal
|
||||
$(this).css('color', '');
|
||||
|
||||
// Get column position
|
||||
colPos = $(this).parent().children().index($(this));
|
||||
// Get attribute name
|
||||
attrName = jQuery.trim(headers.eq(colPos).text());
|
||||
// Get original content
|
||||
origVal = origAttrs[nodes[i]][attrName];
|
||||
|
||||
// Update column
|
||||
dTable.fnUpdate(origVal, rowPos, colPos, false);
|
||||
}
|
||||
});
|
||||
} // End of if
|
||||
} // End of for
|
||||
|
||||
// Clear cookie containing list of nodes where their attributes need to be updated
|
||||
$.cookie('nodes2update', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a tool tip for comments
|
||||
*
|
||||
@ -2807,8 +2663,7 @@ function setNodeAttrs(data) {
|
||||
// Remove arrow brackets
|
||||
descr = descr.replace(new RegExp('<|>', 'g'), '');
|
||||
|
||||
// Set hash table where key = attribute name and value =
|
||||
// description
|
||||
// Set hash table where key = attribute name and value = description
|
||||
nodeAttrs[key] = descr;
|
||||
} else {
|
||||
// Remove arrow brackets
|
||||
@ -3267,10 +3122,10 @@ function advancedLoad(group){
|
||||
var colNameHash = new Object();
|
||||
var colName = '';
|
||||
var archCol = 0, hcpCol = 0;
|
||||
//find out the column name and their index
|
||||
// find out the column name and their index
|
||||
for (tempIndex = 0; tempIndex < tableHeaders.size(); tempIndex++){
|
||||
var header = tableHeaders.eq(tempIndex);
|
||||
//if link header(status, power, monitor) can dump to next one
|
||||
// if link header(status, power, monitor) can dump to next one
|
||||
if (header.find('a').size() > 0){
|
||||
continue;
|
||||
}
|
||||
@ -3282,7 +3137,7 @@ function advancedLoad(group){
|
||||
}
|
||||
}
|
||||
|
||||
//there is not arch column, can not distinguish hardware type return directly
|
||||
// there is not arch column, can not distinguish hardware type return directly
|
||||
if (!colNameHash['arch']){
|
||||
return;
|
||||
}
|
||||
@ -3345,10 +3200,10 @@ function openQuickProvisionDia(tgtnodes){
|
||||
var archtype = '';
|
||||
var errormessage = '';
|
||||
var diaDiv = $('<div title="Provision(only support Linux)" class="form" id="deployDiv"></div>');
|
||||
//check the first node's arch type
|
||||
// check the first node's arch type
|
||||
for (index in nodeArray){
|
||||
nodeName = nodeArray[index];
|
||||
//does not have arch
|
||||
// does not have arch
|
||||
if (!origAttrs[nodeName]['arch']){
|
||||
errormessage = 'All nodes should define arch first!';
|
||||
break;
|
||||
@ -3358,14 +3213,14 @@ function openQuickProvisionDia(tgtnodes){
|
||||
archtype = origAttrs[nodeName]['arch'];
|
||||
}
|
||||
|
||||
//all nodes should have same archtype
|
||||
// all nodes should have same archtype
|
||||
if (archtype != origAttrs[nodeName]['arch']){
|
||||
errormessage = 'All nodes should belong to same arch!<br/>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//check the mac address
|
||||
// check the mac address
|
||||
for (index in nodeArray){
|
||||
if (!origAttrs[nodeName]['mac'] || !origAttrs[nodeName]['ip']){
|
||||
errormessage += 'All nodes should define ip and mac!<br/>';
|
||||
@ -3377,7 +3232,7 @@ function openQuickProvisionDia(tgtnodes){
|
||||
errormessage += 'System Z should use provision page.';
|
||||
}
|
||||
|
||||
//error message should show in a dialog
|
||||
// error message should show in a dialog
|
||||
if ('' != errormessage){
|
||||
diaDiv.append(createWarnBar(errormessage));
|
||||
diaDiv.dialog({
|
||||
@ -3393,7 +3248,7 @@ function openQuickProvisionDia(tgtnodes){
|
||||
return;
|
||||
}
|
||||
|
||||
//organize the provison dialog
|
||||
// organize the provison dialog
|
||||
var showstr = '<table><tbody>';
|
||||
showstr += '<tr><td>Target node:</td><td><input id="nodesinput" value="' + tgtnodes + '" readonly="readonly"></td></tr>';
|
||||
showstr += '<tr><td>Arch:</td><td><input id="archinput" value="' + archtype + '" disabled="disabled"></td></tr>';
|
||||
@ -3488,7 +3343,7 @@ function quickProvision(){
|
||||
provisionArg = argsArray.join(',');
|
||||
url = 'lib/cmd.php?cmd=webrun&tgt=&args=provision;' + nodesName + ';' + imageName + ';' + provisionArg + '&msg=&opts=flush';
|
||||
|
||||
//show the result
|
||||
// show the result
|
||||
$('#deployDiv').empty().append(createLoader()).append('<br/>');
|
||||
$('#deployDiv').dialog( "option", "buttons", {'Close': function(){$(this).remove();clearTimeout(provisionClock);}});
|
||||
$('#deployDiv').dialog( "option", "width", 600);
|
||||
|
@ -229,6 +229,7 @@ function fillList(nodeName){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* create the physical graphical layout
|
||||
*
|
||||
@ -248,10 +249,13 @@ function createGraphical(bpa, fsp, area){
|
||||
row = $('<tr></tr>');
|
||||
graphTable.append(row);
|
||||
}
|
||||
|
||||
elementNum ++;
|
||||
|
||||
var td = $('<td style="padding:0;border-color: transparent;"></td>');
|
||||
var frameDiv = $('<div class="frameDiv"></div>');
|
||||
frameDiv.append('<div style="height:27px;" title="' + bpaName + '"><input type="checkbox" class="fspcheckbox" name="check_'+ bpaName +'"></div>');
|
||||
|
||||
//for P7-IH, all the cecs are insert into the frame from down to up, so we had to show the cecs same as the
|
||||
//physical layout.
|
||||
var tempBlankDiv = $('<div></div>');
|
||||
@ -269,6 +273,7 @@ function createGraphical(bpa, fsp, area){
|
||||
|
||||
tempHeight += coculateBlank(fsp[fspName]['mtm']);
|
||||
}
|
||||
|
||||
//now the tempHeight are all cecs' height, so we should minus bpa div height and cecs' div height
|
||||
tempHeight = 428 - tempHeight;
|
||||
tempBlankDiv.css('height', tempHeight);
|
||||
@ -418,7 +423,6 @@ function updateSelectNodeDiv(){
|
||||
$('#selectNodeDiv').empty();
|
||||
|
||||
//add buttons
|
||||
|
||||
$('#selectNodeDiv').append('Nodes: ');
|
||||
for(var lparName in selectNode){
|
||||
$('#selectNodeDiv').append(lparName + ' ');
|
||||
@ -671,6 +675,7 @@ function createFspTip(fspName, mtm, fsp){
|
||||
else{
|
||||
temp = mtm;
|
||||
}
|
||||
|
||||
if (hardwareInfo[temp]){
|
||||
tip.append('<h3>' + fspName + '(' + hardwareInfo[temp][0] + ')</h3><br/>');
|
||||
}
|
||||
|
@ -43,8 +43,6 @@ function loadImages(data) {
|
||||
// Image attributes
|
||||
var headers = new Object();
|
||||
|
||||
// Clear cookie containing list of images where their attributes need to be updated
|
||||
$.cookie('images2update', '');
|
||||
// Clear hash table containing image attributes
|
||||
origAttrs = '';
|
||||
|
||||
@ -118,12 +116,9 @@ function loadImages(data) {
|
||||
$('#imagesTab').children().remove();
|
||||
|
||||
// Create info bar for images tab
|
||||
var info = createInfoBar('Click on a cell to edit. Click outside the table to write to the cell. Hit the Escape key to ignore changes. Once you are satisfied with how the table looks, click on Save.');
|
||||
var info = createInfoBar('Click on a cell to edit. Click outside the table to save changes. Hit the Escape key to ignore changes.');
|
||||
$('#imagesTab').append(info);
|
||||
|
||||
// Create action bar
|
||||
var actionBar = $('<div class="actionBar"></div>');
|
||||
|
||||
/**
|
||||
* The following actions are available for images:
|
||||
* copy Linux distribution and edit image properties
|
||||
@ -149,28 +144,7 @@ function loadImages(data) {
|
||||
loadEditImagePage(tgtImages[i]);
|
||||
}
|
||||
});
|
||||
|
||||
// Create save button
|
||||
var saveBtn = createButton('Save');
|
||||
// Do not show button until table is edited
|
||||
saveBtn.css({
|
||||
'display': 'inline',
|
||||
'margin-left': '550px'
|
||||
}).hide();
|
||||
saveBtn.bind('click', function(event){
|
||||
updateImageAttrs();
|
||||
});
|
||||
|
||||
// Create undo button
|
||||
var undoBtn = createButton('Undo');
|
||||
// Do not show button until table is edited
|
||||
undoBtn.css({
|
||||
'display': 'inline'
|
||||
}).hide();
|
||||
undoBtn.bind('click', function(event){
|
||||
restoreImageAttrs();
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Create an action bar
|
||||
*/
|
||||
@ -178,8 +152,6 @@ function loadImages(data) {
|
||||
actionsBar.append(copyLinuxBtn);
|
||||
actionsBar.append(newBtn);
|
||||
actionsBar.append(editBtn);
|
||||
actionsBar.append(saveBtn);
|
||||
actionsBar.append(undoBtn);
|
||||
$('#imagesTab').append(actionsBar);
|
||||
|
||||
// Insert table
|
||||
@ -203,9 +175,6 @@ function loadImages(data) {
|
||||
// Do not make 1st, 2nd, 3rd, 4th, or 5th column editable
|
||||
$('#imagesDataTable td:not(td:nth-child(1),td:nth-child(2))').editable(
|
||||
function(value, settings) {
|
||||
// Change text color to red
|
||||
$(this).css('color', 'red');
|
||||
|
||||
// Get column index
|
||||
var colPos = this.cellIndex;
|
||||
|
||||
@ -218,15 +187,32 @@ function loadImages(data) {
|
||||
|
||||
// Get image name
|
||||
var image = $(this).parent().find('td:eq(1)').text();
|
||||
|
||||
// Flag image to update
|
||||
flagImage2Update(image);
|
||||
|
||||
// Show table menu actions
|
||||
saveBtn.show();
|
||||
undoBtn.show();
|
||||
|
||||
// Get table headers
|
||||
var headers = $('#imagesDataTable thead tr th');
|
||||
|
||||
return (value);
|
||||
// Get attribute name
|
||||
var attrName = jQuery.trim(headers.eq(colPos).text());
|
||||
// Get column value
|
||||
var value = $(this).text();
|
||||
// Build argument
|
||||
var args = attrName + '=' + value;
|
||||
|
||||
// Send command to change image attributes
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'chdef',
|
||||
tgt : '',
|
||||
args : '-t;osimage;-o;' + image + ';' + args,
|
||||
msg : 'out=imagesTab;tgt=' + image
|
||||
},
|
||||
|
||||
success: showChdefOutput
|
||||
});
|
||||
|
||||
return value;
|
||||
}, {
|
||||
onblur : 'submit', // Clicking outside editable area submits changes
|
||||
type : 'textarea', // Input type to use
|
||||
@ -249,145 +235,6 @@ function loadImages(data) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag the image in the table to update
|
||||
*
|
||||
* @param image
|
||||
* The image name
|
||||
* @return Nothing
|
||||
*/
|
||||
function flagImage2Update(image) {
|
||||
// Get list containing current images to update
|
||||
var images = $.cookie('images2update');
|
||||
|
||||
// If the node is not in the list
|
||||
if (images.indexOf(image) == -1) {
|
||||
// Add the new node to list
|
||||
images += image + ';';
|
||||
$.cookie('images2update', images);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the image attributes
|
||||
*
|
||||
* @return Nothing
|
||||
*/
|
||||
function updateImageAttrs() {
|
||||
// Get the nodes datatable
|
||||
var dTable = $('#imagesDataTable').dataTable();
|
||||
// Get all nodes within the datatable
|
||||
var rows = dTable.fnGetNodes();
|
||||
|
||||
// Get table headers
|
||||
var headers = $('#imagesDataTable thead tr th');
|
||||
|
||||
// Get list of nodes to update
|
||||
var imagesList = $.cookie('images2update');
|
||||
var images = imagesList.split(';');
|
||||
|
||||
// Create the arguments
|
||||
var args;
|
||||
var rowPos, colPos, value;
|
||||
var attrName;
|
||||
// Go through each node where an attribute was changed
|
||||
for (var i in images) {
|
||||
if (images[i]) {
|
||||
args = '';
|
||||
|
||||
// Get the row containing the image name
|
||||
rowPos = findRow(images[i], '#imagesDataTable', 1);
|
||||
$(rows[rowPos]).find('td').each(function (){
|
||||
if ($(this).css('color') == 'red') {
|
||||
// Change color back to normal
|
||||
$(this).css('color', '');
|
||||
|
||||
// Get column position
|
||||
colPos = $(this).parent().children().index($(this));
|
||||
// Get column value
|
||||
value = $(this).text();
|
||||
|
||||
// Get attribute name
|
||||
attrName = jQuery.trim(headers.eq(colPos).text());
|
||||
|
||||
// Build argument string
|
||||
if (args) {
|
||||
// Handle subsequent arguments
|
||||
args += ';' + attrName + '=' + value;
|
||||
} else {
|
||||
// Handle the 1st argument
|
||||
args += attrName + '=' + value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Send command to change image attributes
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'chdef',
|
||||
tgt : '',
|
||||
args : '-t;osimage;-o;' + images[i] + ';' + args,
|
||||
msg : 'out=imagesTab;tgt=' + images[i]
|
||||
},
|
||||
|
||||
success: showChdefOutput
|
||||
});
|
||||
} // End of if
|
||||
} // End of for
|
||||
|
||||
// Clear cookie containing list of images where their attributes need to be updated
|
||||
$.cookie('images2update', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore image attributes to their original content
|
||||
*
|
||||
* @return Nothing
|
||||
*/
|
||||
function restoreImageAttrs() {
|
||||
// Get list of images to restore
|
||||
var imagesList = $.cookie('images2update');
|
||||
var images = imagesList.split(';');
|
||||
|
||||
// Get the image datatable
|
||||
var dTable = $('#imagesDataTable').dataTable();
|
||||
// Get table headers
|
||||
var headers = $('#imagesDataTable thead tr th');
|
||||
// Get all nodes within the datatable
|
||||
var rows = dTable.fnGetNodes();
|
||||
|
||||
// Go through each node where an attribute was changed
|
||||
var rowPos, colPos;
|
||||
var attrName, origVal;
|
||||
for (var i in images) {
|
||||
if (images[i]) {
|
||||
// Get the row containing the image name
|
||||
rowPos = findRow(images[i], '#imagesDataTable', 1);
|
||||
$(rows[rowPos]).find('td').each(function (){
|
||||
if ($(this).css('color') == 'red') {
|
||||
// Change color back to normal
|
||||
$(this).css('color', '');
|
||||
|
||||
// Get column position
|
||||
colPos = $(this).parent().children().index($(this));
|
||||
// Get attribute name
|
||||
attrName = jQuery.trim(headers.eq(colPos).text());
|
||||
// Get original content
|
||||
origVal = origAttrs[images[i]][attrName];
|
||||
|
||||
// Update column
|
||||
dTable.fnUpdate(origVal, rowPos, colPos);
|
||||
}
|
||||
});
|
||||
} // End of if
|
||||
} // End of for
|
||||
|
||||
// Clear cookie containing list of images where their attributes need to be updated
|
||||
$.cookie('images2update', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set definable image attributes
|
||||
*
|
||||
@ -527,6 +374,7 @@ function createHpcSelect(container) {
|
||||
|
||||
container.append(hpcFieldset);
|
||||
}
|
||||
|
||||
var softwareList = {
|
||||
"rsct" : [ "rsct.core.utils", "rsct.core", "src" ],
|
||||
"pe" : [ "IBMJava2-142-ppc64-JRE", "ibm_lapi_ip_rh6p", "ibm_lapi_us_rh6p", "IBM_pe_license", "ibm_pe_rh6p", "ppe_pdb_ppc64_rh600", "sci_ppc_32bit_rh600", "sci_ppc_64bit_rh600", "vac.cmp",
|
||||
@ -643,7 +491,6 @@ function rpmCopyCheck(data) {
|
||||
*/
|
||||
function genRpmCmd(softwareName) {
|
||||
var cmdString;
|
||||
var packageLength;
|
||||
cmdString = "rpm -q ";
|
||||
for (var i in softwareList[softwareName]) {
|
||||
cmdString += softwareList[softwareName][i] + " ";
|
||||
@ -756,7 +603,7 @@ function loadEditImagePage(tgtImage) {
|
||||
setPropsForm.append(infoBar);
|
||||
|
||||
// Create an input for each definable attribute
|
||||
var div, label, input, descr, value;
|
||||
var div, label, input, value;
|
||||
// Set node attribute
|
||||
origAttrs[tgtImage]['imagename'] = tgtImage;
|
||||
for (var key in defAttrs) {
|
||||
|
@ -461,7 +461,6 @@ function initPage() {
|
||||
includeJs("js/jquery/superfish.min.js");
|
||||
includeJs("js/jquery/hoverIntent.min.js");
|
||||
includeJs("js/jquery/jquery.jstree.min.js");
|
||||
includeJs("js/jquery/jquery.flot.min.js");
|
||||
includeJs("js/jquery/tooltip.min.js");
|
||||
includeJs("js/jquery/jquery.serverBrowser.min.js");
|
||||
includeJs("js/jquery/jquery.jqplot.min.js");
|
||||
@ -489,16 +488,7 @@ function initPage() {
|
||||
|
||||
// Show the page
|
||||
$("#content").children().remove();
|
||||
if (page == 'index.php') {
|
||||
includeJs("js/jquery/jquery.topzindex.min.js");
|
||||
includeJs("js/nodes/nodeset.js");
|
||||
includeJs("js/nodes/rnetboot.js");
|
||||
includeJs("js/nodes/updatenode.js");
|
||||
includeJs("js/nodes/physical.js");
|
||||
includeJs("js/nodes/mtm.js");
|
||||
headers.eq(0).css('background-color', '#A9D0F5');
|
||||
loadNodesPage();
|
||||
} else if (page == 'configure.php') {
|
||||
if (page == 'configure.php') {
|
||||
includeJs("js/configure/update.js");
|
||||
includeJs("js/configure/discover.js");
|
||||
headers.eq(1).css('background-color', '#A9D0F5');
|
||||
@ -518,6 +508,7 @@ function initPage() {
|
||||
headers.eq(4).css('background-color', '#A9D0F5');
|
||||
loadGuidePage();
|
||||
} else {
|
||||
// Load nodes page by default
|
||||
includeJs("js/jquery/jquery.topzindex.min.js");
|
||||
includeJs("js/nodes/nodeset.js");
|
||||
includeJs("js/nodes/rnetboot.js");
|
||||
|
@ -9,12 +9,12 @@ $(document).ready(function() {
|
||||
var diaheight = $('#logdialog').css('height');
|
||||
diaheight = diaheight.substr(0, diaheight.length - 2);
|
||||
diaheight = Number(diaheight);
|
||||
|
||||
// the window's height is to small to show the dialog
|
||||
var tempheight = 0;
|
||||
if ((winheight - 50) < diaheight){
|
||||
tempheight = 0;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
tempheight = parseInt((winheight - diaheight - 50) / 2);
|
||||
}
|
||||
|
||||
@ -29,6 +29,7 @@ $(document).ready(function() {
|
||||
$("#logstatus").html("You are using an unencrypted session!");
|
||||
$("#logstatus").css("color", "#ff0000");
|
||||
}
|
||||
|
||||
if ($("#username").val() == "") {
|
||||
$("#username").focus();
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user