2010-07-28 20:24:29 +00:00
|
|
|
/**
|
|
|
|
* Execute when the DOM is fully loaded
|
|
|
|
*/
|
|
|
|
$(document).ready(function() {
|
|
|
|
// Load utility scripts
|
2010-07-20 18:49:31 +00:00
|
|
|
});
|
|
|
|
|
2010-07-22 19:56:09 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
* @return Nothing
|
|
|
|
*/
|
2010-07-23 18:47:54 +00:00
|
|
|
var fspPlugin = function() {
|
2010-07-28 20:24:29 +00:00
|
|
|
|
2010-07-22 19:56:09 +00:00
|
|
|
};
|
|
|
|
|
2010-07-20 18:49:31 +00:00
|
|
|
/**
|
|
|
|
* Load node inventory
|
|
|
|
*
|
|
|
|
* @param data
|
|
|
|
* Data from HTTP request
|
|
|
|
* @return Nothing
|
|
|
|
*/
|
2010-07-23 18:47:54 +00:00
|
|
|
fspPlugin.prototype.loadInventory = function(data) {
|
2010-07-28 20:24:29 +00:00
|
|
|
|
2010-07-22 19:56:09 +00:00
|
|
|
};
|
2010-07-20 18:49:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Load clone page
|
|
|
|
*
|
|
|
|
* @param node
|
|
|
|
* Source node to clone
|
|
|
|
* @return Nothing
|
|
|
|
*/
|
2010-07-23 18:47:54 +00:00
|
|
|
fspPlugin.prototype.loadClonePage = function(node) {
|
2010-07-28 20:24:29 +00:00
|
|
|
|
2010-07-22 19:56:09 +00:00
|
|
|
};
|
2010-07-20 18:49:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Load provision page
|
|
|
|
*
|
|
|
|
* @param tabId
|
|
|
|
* The provision tab ID
|
|
|
|
* @return Nothing
|
|
|
|
*/
|
2010-07-23 18:47:54 +00:00
|
|
|
fspPlugin.prototype.loadProvisionPage = function(tabId) {
|
2010-07-28 20:24:29 +00:00
|
|
|
// Get OS image names
|
2010-07-20 18:49:31 +00:00
|
|
|
$.ajax( {
|
|
|
|
url : 'lib/cmd.php',
|
|
|
|
dataType : 'json',
|
|
|
|
data : {
|
|
|
|
cmd : 'tabdump',
|
|
|
|
tgt : '',
|
|
|
|
args : 'osimage',
|
|
|
|
msg : ''
|
|
|
|
},
|
|
|
|
|
|
|
|
success : setOSImageCookies
|
|
|
|
});
|
|
|
|
|
|
|
|
// Get groups
|
|
|
|
$.ajax( {
|
|
|
|
url : 'lib/cmd.php',
|
|
|
|
dataType : 'json',
|
|
|
|
data : {
|
|
|
|
cmd : 'extnoderange',
|
|
|
|
tgt : '/.*',
|
|
|
|
args : 'subgroups',
|
|
|
|
msg : ''
|
|
|
|
},
|
|
|
|
|
|
|
|
success : setGroupsCookies
|
|
|
|
});
|
|
|
|
|
2010-07-28 20:24:29 +00:00
|
|
|
// Get provision tab instance
|
2010-07-20 18:49:31 +00:00
|
|
|
var inst = tabId.replace('fspProvisionTab', '');
|
|
|
|
|
|
|
|
// Create provision form
|
|
|
|
var provForm = $('<div class="form"></div>');
|
|
|
|
|
|
|
|
// Create status bar
|
2010-07-28 20:24:29 +00:00
|
|
|
var statBarId = 'fspProvisionStatBar' + inst;
|
|
|
|
var statBar = createStatusBar(statBarId);
|
2010-07-20 18:49:31 +00:00
|
|
|
statBar.hide();
|
|
|
|
provForm.append(statBar);
|
|
|
|
|
|
|
|
// Create loader
|
|
|
|
var loader = createLoader('fspProvisionLoader' + inst);
|
|
|
|
loader.hide();
|
|
|
|
statBar.append(loader);
|
|
|
|
|
|
|
|
// Create info bar
|
2010-07-28 20:24:29 +00:00
|
|
|
var infoBar = createInfoBar('Provision a fsp node');
|
2010-07-20 18:49:31 +00:00
|
|
|
provForm.append(infoBar);
|
|
|
|
|
|
|
|
// Append to provision tab
|
|
|
|
$('#' + tabId).append(provForm);
|
|
|
|
|
2010-07-28 20:24:29 +00:00
|
|
|
// Create provision type drop down
|
|
|
|
var provType = $('<div></div>');
|
|
|
|
var typeLabel = $('<label>Provision:</label>');
|
|
|
|
var typeSelect = $('<select></select>');
|
|
|
|
var provNewNode = $('<option value="new">New node</option>');
|
|
|
|
var provExistNode = $('<option value="existing">Existing node</option>');
|
|
|
|
typeSelect.append(provNewNode);
|
|
|
|
typeSelect.append(provExistNode);
|
|
|
|
provType.append(typeLabel);
|
|
|
|
provType.append(typeSelect);
|
|
|
|
provForm.append(provType);
|
2010-07-20 18:49:31 +00:00
|
|
|
|
|
|
|
/**
|
2010-07-28 20:24:29 +00:00
|
|
|
* Create provision new node division
|
2010-07-20 18:49:31 +00:00
|
|
|
*/
|
2010-07-28 20:24:29 +00:00
|
|
|
var provNew = createProvisionNew('fsp', inst);
|
|
|
|
provForm.append(provNew);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create provision existing node division
|
|
|
|
*/
|
|
|
|
var provExisting = createProvisionExisting('fsp', inst);
|
|
|
|
provForm.append(provExisting);
|
|
|
|
|
|
|
|
// Toggle provision new/existing on select
|
|
|
|
typeSelect.change(function() {
|
|
|
|
var selected = $(this).val();
|
|
|
|
if (selected == 'new') {
|
|
|
|
provNew.toggle();
|
|
|
|
provExisting.toggle();
|
|
|
|
} else {
|
|
|
|
provNew.toggle();
|
|
|
|
provExisting.toggle();
|
|
|
|
}
|
2010-07-20 18:49:31 +00:00
|
|
|
});
|
2010-07-22 19:56:09 +00:00
|
|
|
};
|
2010-07-20 18:49:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Load resources
|
|
|
|
*
|
|
|
|
* @return Nothing
|
|
|
|
*/
|
2010-07-23 18:47:54 +00:00
|
|
|
fspPlugin.prototype.loadResources = function() {
|
2010-07-28 20:24:29 +00:00
|
|
|
|
2010-09-22 16:52:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2010-09-24 02:27:04 +00:00
|
|
|
* Add node range
|
2010-09-22 16:52:41 +00:00
|
|
|
*
|
|
|
|
* @return Nothing
|
|
|
|
*/
|
2010-09-23 20:43:10 +00:00
|
|
|
fspPlugin.prototype.addNode = function() {
|
2010-09-22 16:52:41 +00:00
|
|
|
|
2010-07-22 19:56:09 +00:00
|
|
|
};
|