mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 18:43:26 +01:00
new UI - accounts page - implement Disable account action.
This commit is contained in:
parent
461149a390
commit
ae453b2961
@ -176,23 +176,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- disable or lock an account (begin) -->
|
||||
<div id="dialog_disable_account" title="Disable Account" style="display:none">
|
||||
<p>Select <b>"Disable"</b> to prevent account access to the cloud and to shut down all existing virtual instances.<br></br>
|
||||
Select <b>"Lock"</b> to ONLY prevent account access to the cloud. <br></br>
|
||||
</p>
|
||||
<div class="dialog_formcontent">
|
||||
<form action="#" method="post" id="form1">
|
||||
<ol>
|
||||
<li>
|
||||
<label>Action: </label>
|
||||
<select class="select" id="change_state_type">
|
||||
<option value="disable" selected>Disable</option>
|
||||
<option value="lock">Lock</option>
|
||||
</select>
|
||||
</li>
|
||||
</ol>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- disable or lock an account (end) -->
|
||||
<div id="dialog_disable_account" title="Disable account" style="display:none">
|
||||
<p>Please confirm you want to disable account that will prevent account access to the cloud and shut down all existing virtual instances.</p>
|
||||
</div>
|
||||
@ -56,17 +56,30 @@ function accountJsonToDetailsTab(jsonObj) {
|
||||
if (jsonObj.accounttype == roleTypeUser || jsonObj.accounttype == roleTypeDomainAdmin)
|
||||
buildActionLinkForDetailsTab("Resource limits", accountActionMap, $actionMenu, accountListAPIMap);
|
||||
|
||||
// if(jsonObj.state == "enabled")
|
||||
// buildActionLinkForDetailsTab("Disable", accountActionMap, $actionMenu, accountListAPIMap);
|
||||
// else if(jsonObj.state == "disabled")
|
||||
// buildActionLinkForDetailsTab("Enable", accountActionMap, $actionMenu, accountListAPIMap);
|
||||
if(jsonObj.state == "enabled") {
|
||||
buildActionLinkForDetailsTab("Disable account", accountActionMap, $actionMenu, accountListAPIMap);
|
||||
//buildActionLinkForDetailsTab("Lock account", accountActionMap, $actionMenu, accountListAPIMap);
|
||||
}
|
||||
// else if(jsonObj.state == "disabled") {
|
||||
// buildActionLinkForDetailsTab("Enable account", accountActionMap, $actionMenu, accountListAPIMap);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
var accountActionMap = {
|
||||
"Resource limits": {
|
||||
customActionFn : doResourceLimits
|
||||
}
|
||||
}
|
||||
,
|
||||
"Disable account": {
|
||||
isAsyncJob: true,
|
||||
asyncJobResponse: "disableaccountresponse",
|
||||
dialogBeforeActionFn : doDisableAccount,
|
||||
inProcessText: "Disabling account....",
|
||||
afterActionSeccessFn: function(jsonObj) {
|
||||
accountJsonToDetailsTab(jsonObj);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var accountListAPIMap = {
|
||||
@ -165,3 +178,19 @@ function doResourceLimits () {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function doDisableAccount($actionLink, listAPIMap, $detailsTab) {
|
||||
var jsonObj = $detailsTab.data("jsonObj");
|
||||
|
||||
$("#dialog_disable_account")
|
||||
.dialog('option', 'buttons', {
|
||||
"Yes": function() {
|
||||
$(this).dialog("close");
|
||||
var apiCommand = "command=disableAccount&account="+jsonObj.name+"&domainId="+jsonObj.domainid;
|
||||
doActionToDetailsTab(jsonObj.id, $actionLink, apiCommand, listAPIMap);
|
||||
},
|
||||
"Cancel": function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}).dialog("open");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user