mirror of https://github.com/apache/cloudstack.git
new UI - accounts page - implement Lock Account action.
This commit is contained in:
parent
13181b79f8
commit
e2114b1950
|
|
@ -45,7 +45,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="grid_container">
|
||||
<div class="grid_rows odd">
|
||||
<div class="grid_rows even">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
<%=t.t("id")%>:</div>
|
||||
|
|
@ -180,6 +180,10 @@
|
|||
<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>
|
||||
|
||||
<div id="dialog_lock_account" title="Lock account" style="display:none">
|
||||
<p>Please confirm you want to lock account that will prevent account access to the cloud.</p>
|
||||
</div>
|
||||
|
||||
<div id="dialog_enable_account" title="Enable account" style="display:none">
|
||||
<p>Please confirm you want to enable account.</p>
|
||||
</div>
|
||||
|
|
@ -12,6 +12,11 @@ function afterLoadAccountJSP() {
|
|||
modal: true,
|
||||
zIndex: 2000
|
||||
}));
|
||||
activateDialog($("#dialog_lock_account").dialog({
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
zIndex: 2000
|
||||
}));
|
||||
activateDialog($("#dialog_enable_account").dialog({
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
|
|
@ -62,7 +67,7 @@ function accountJsonToDetailsTab(jsonObj) {
|
|||
|
||||
if(jsonObj.state == "enabled") {
|
||||
buildActionLinkForDetailsTab("Disable account", accountActionMap, $actionMenu, accountListAPIMap);
|
||||
//buildActionLinkForDetailsTab("Lock account", accountActionMap, $actionMenu, accountListAPIMap);
|
||||
buildActionLinkForDetailsTab("Lock account", accountActionMap, $actionMenu, accountListAPIMap);
|
||||
}
|
||||
else if(jsonObj.state == "disabled" || jsonObj.state == "locked") {
|
||||
buildActionLinkForDetailsTab("Enable account", accountActionMap, $actionMenu, accountListAPIMap);
|
||||
|
|
@ -86,6 +91,16 @@ var accountActionMap = {
|
|||
}
|
||||
}
|
||||
,
|
||||
"Lock account": {
|
||||
isAsyncJob: false,
|
||||
dialogBeforeActionFn : doLockAccount,
|
||||
inProcessText: "Locking account....",
|
||||
afterActionSeccessFn: function(jsonObj) {
|
||||
$("#midmenuItem_"+jsonObj.id).data("jsonObj", jsonObj);
|
||||
accountJsonToDetailsTab(jsonObj);
|
||||
}
|
||||
}
|
||||
,
|
||||
"Enable account": {
|
||||
isAsyncJob: false,
|
||||
dialogBeforeActionFn : doEnableAccount,
|
||||
|
|
@ -210,6 +225,22 @@ function doDisableAccount($actionLink, listAPIMap, $detailsTab) {
|
|||
}).dialog("open");
|
||||
}
|
||||
|
||||
function doLockAccount($actionLink, listAPIMap, $detailsTab) {
|
||||
var jsonObj = $detailsTab.data("jsonObj");
|
||||
|
||||
$("#dialog_lock_account")
|
||||
.dialog('option', 'buttons', {
|
||||
"Yes": function() {
|
||||
$(this).dialog("close");
|
||||
var apiCommand = "command=lockAccount&account="+jsonObj.name+"&domainId="+jsonObj.domainid;
|
||||
doActionToDetailsTab(jsonObj.id, $actionLink, apiCommand, listAPIMap);
|
||||
},
|
||||
"Cancel": function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}).dialog("open");
|
||||
}
|
||||
|
||||
function doEnableAccount($actionLink, listAPIMap, $detailsTab) {
|
||||
var jsonObj = $detailsTab.data("jsonObj");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue