Enabled multiple volumes to be removed. Allowed delete button to delete using noderm instead of rmvm if checked.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16085 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
315a7a3c4a
commit
a21935e9c7
@ -3475,7 +3475,7 @@ function loadDiskPoolTable(data) {
|
||||
var actionBar = $('<div id="zvmDiskResourceActions" class="actionBar"></div>').css("width", "450px");
|
||||
|
||||
// Create an action menu
|
||||
var actionsMenu = createMenu([addLnk, removeLnk, refreshLnk, [advancedLnk, advancedMenu]]);
|
||||
var actionsMenu = createMenu([refreshLnk, addLnk, removeLnk, [advancedLnk, advancedMenu]]);
|
||||
actionsMenu.superfish();
|
||||
actionsMenu.css('display', 'inline-block');
|
||||
actionBar.append(actionsMenu);
|
||||
@ -3675,11 +3675,24 @@ function openRemoveDiskFromPoolDialog(disks2remove) {
|
||||
var hcp2zvm = new Object();
|
||||
hcp2zvm = getHcpZvmHash();
|
||||
|
||||
var args = disks2remove.split('-');
|
||||
var tgtHcp = args[0];
|
||||
var tgtPool = args[1];
|
||||
var tgtVol = args[2];
|
||||
var disks = new Array();
|
||||
if (disks2remove.indexOf(',') > -1)
|
||||
disks = disks2remove.split(',');
|
||||
else
|
||||
disks.push(disks2remove);
|
||||
|
||||
// Pick the last zHCP and pool it finds
|
||||
var args, tgtHcp = "", tgtPool = "", tgtVol = "";
|
||||
for (var i in disks) {
|
||||
args = disks[i].split('-');
|
||||
tgtHcp = args[0];
|
||||
tgtPool = args[1];
|
||||
tgtVol += args[2] + ',';
|
||||
}
|
||||
|
||||
// Strip out last comma
|
||||
tgtVol = tgtVol.slice(0, -1);
|
||||
|
||||
// Create info bar
|
||||
var info = createInfoBar('Remove a disk from a disk pool defined in the EXTENT CONTROL.');
|
||||
deleteDiskForm.append(info);
|
||||
|
@ -2023,22 +2023,30 @@ function loadDeletePage(tgtNodes) {
|
||||
|
||||
// Confirm delete
|
||||
var instr = $('<p>Are you sure you want to delete <b>' + tgtNodesStr + '</b>?</p>').css('word-wrap', 'break-word');
|
||||
var dbOnly = $('<div><input type="checkbox" name="db-only"/>Only delete entries in database</div>');
|
||||
confirmAttr.append(instr);
|
||||
confirmAttr.append(dbOnly);
|
||||
|
||||
/**
|
||||
* Delete
|
||||
*/
|
||||
var deleteBtn = createButton('Delete');
|
||||
deleteBtn.click(function() {
|
||||
var cmd = "rmvm";
|
||||
// Only delete entries in database if checked
|
||||
if ($("#" + newTabId + " input[name='db-only']").attr('checked')) {
|
||||
cmd = "noderm";
|
||||
}
|
||||
|
||||
// Delete the virtual server
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'rmvm',
|
||||
cmd : cmd,
|
||||
tgt : tgtNodes,
|
||||
args : '',
|
||||
msg : 'out=' + statBarId + ';cmd=rmvm;tgt=' + tgtNodes
|
||||
msg : 'out=' + statBarId + ';cmd=' + cmd + ';tgt=' + tgtNodes
|
||||
},
|
||||
|
||||
success : updateStatusBar
|
||||
@ -2135,6 +2143,13 @@ function updateStatusBar(data) {
|
||||
|
||||
// Enable buttons
|
||||
$('#' + statBarId).parent().find('button').removeAttr('disabled');
|
||||
} else if (cmd == 'noderm') {
|
||||
// Hide loader
|
||||
$('#' + statBarId).find('img').hide();
|
||||
|
||||
// Write ajax response to status bar
|
||||
var prg = $('<pre>Entries deleted in database</pre>');
|
||||
$('#' + statBarId).find('div').append(prg);
|
||||
} else {
|
||||
// Hide loader
|
||||
$('#' + statBarId).find('img').hide();
|
||||
|
@ -6303,7 +6303,12 @@ sub changeHypervisor {
|
||||
|
||||
# Define region as full volume and add to group
|
||||
if ($funct eq "4") {
|
||||
$volume = $args->[3];
|
||||
$volume = $args->[3];
|
||||
# In case multiple regions/volumes are specified, just use the same name
|
||||
if (scalar(@regions) > 1) {
|
||||
$volume = $_;
|
||||
}
|
||||
|
||||
$group = $args->[4];
|
||||
$tmp = `ssh $::SUDOER\@$hcp "$::SUDO $::DIR/smcli Image_Volume_Space_Define_DM -T $hcpUserId -f $funct -g $_ -v $volume -p $group -y 0"`;
|
||||
xCAT::zvmUtils->printSyslog("smcli Image_Volume_Space_Define_DM -T $hcpUserId -f $funct -g $_ -v $volume -p $group -y 0");
|
||||
|
Loading…
Reference in New Issue
Block a user