mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-17 11:04:00 +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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- disable or lock an account (begin) -->
|
<div id="dialog_disable_account" title="Disable account" style="display:none">
|
||||||
<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>
|
||||||
<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>
|
</div>
|
||||||
<!-- disable or lock an account (end) -->
|
|
||||||
@ -56,10 +56,13 @@ function accountJsonToDetailsTab(jsonObj) {
|
|||||||
if (jsonObj.accounttype == roleTypeUser || jsonObj.accounttype == roleTypeDomainAdmin)
|
if (jsonObj.accounttype == roleTypeUser || jsonObj.accounttype == roleTypeDomainAdmin)
|
||||||
buildActionLinkForDetailsTab("Resource limits", accountActionMap, $actionMenu, accountListAPIMap);
|
buildActionLinkForDetailsTab("Resource limits", accountActionMap, $actionMenu, accountListAPIMap);
|
||||||
|
|
||||||
// if(jsonObj.state == "enabled")
|
if(jsonObj.state == "enabled") {
|
||||||
// buildActionLinkForDetailsTab("Disable", accountActionMap, $actionMenu, accountListAPIMap);
|
buildActionLinkForDetailsTab("Disable account", accountActionMap, $actionMenu, accountListAPIMap);
|
||||||
// else if(jsonObj.state == "disabled")
|
//buildActionLinkForDetailsTab("Lock account", accountActionMap, $actionMenu, accountListAPIMap);
|
||||||
// buildActionLinkForDetailsTab("Enable", accountActionMap, $actionMenu, accountListAPIMap);
|
}
|
||||||
|
// else if(jsonObj.state == "disabled") {
|
||||||
|
// buildActionLinkForDetailsTab("Enable account", accountActionMap, $actionMenu, accountListAPIMap);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,6 +70,16 @@ var accountActionMap = {
|
|||||||
"Resource limits": {
|
"Resource limits": {
|
||||||
customActionFn : doResourceLimits
|
customActionFn : doResourceLimits
|
||||||
}
|
}
|
||||||
|
,
|
||||||
|
"Disable account": {
|
||||||
|
isAsyncJob: true,
|
||||||
|
asyncJobResponse: "disableaccountresponse",
|
||||||
|
dialogBeforeActionFn : doDisableAccount,
|
||||||
|
inProcessText: "Disabling account....",
|
||||||
|
afterActionSeccessFn: function(jsonObj) {
|
||||||
|
accountJsonToDetailsTab(jsonObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var accountListAPIMap = {
|
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