mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +01:00
Account page - Add Account dialog - change domain dropdown to input text field that has autoComplete function.
This commit is contained in:
parent
77fadf5c7f
commit
c082425b16
@ -14,6 +14,7 @@ label.download.progress=Download Progress
|
||||
label.total.cpu=Total CPU
|
||||
label.cpu.utilized=CPU Utilized
|
||||
label.cpu.allocated.for.VMs=CPU Allocated for VMs
|
||||
label.not.found=Not Found
|
||||
|
||||
#Labels
|
||||
label.cpu.allocated=CPU Allocated
|
||||
|
||||
@ -14,6 +14,7 @@ label.download.progress=Progreso de la descarga
|
||||
label.total.cpu=Total CPU
|
||||
label.cpu.utilized=CPU Utilizado
|
||||
label.cpu.allocated.for.VMs=CPU asignado para máquinas virtuales
|
||||
label.not.found=No se ha encontrado
|
||||
|
||||
#Labels
|
||||
label.cpu.allocated = CPU asignado
|
||||
|
||||
@ -14,6 +14,7 @@ label.download.progress=ダウンロードの進捗状況
|
||||
label.total.cpu=合計CPU
|
||||
label.cpu.utilized=CPUが活用さ
|
||||
label.cpu.allocated.for.VMs=CPUはVMの割り当て
|
||||
label.not.found=が見つかりません
|
||||
|
||||
#Labels
|
||||
label.cpu.allocated = CPU割り当て
|
||||
|
||||
@ -14,6 +14,7 @@ label.download.progress=下载进度
|
||||
label.total.cpu=总的CPU
|
||||
label.cpu.utilized=CPU的利用率
|
||||
label.cpu.allocated.for.VMs=分配给虚拟机的CPU
|
||||
label.not.found=找不到
|
||||
|
||||
#Labels
|
||||
label.cpu.allocated = 已分配CPU
|
||||
|
||||
@ -81,6 +81,7 @@
|
||||
'label.maximum': '<fmt:message key="label.maximum"/>',
|
||||
'label.character': '<fmt:message key="label.character"/>',
|
||||
'label.double.quotes.are.not.allowed': '<fmt:message key="label.double.quotes.are.not.allowed"/>',
|
||||
'label.not.found': '<fmt:message key="label.not.found"/>',
|
||||
'label.example': '<fmt:message key="label.example"/>',
|
||||
'label.by.zone': '<fmt:message key="label.by.zone"/>',
|
||||
'label.by.pod': '<fmt:message key="label.by.pod"/>',
|
||||
|
||||
@ -459,10 +459,17 @@ dictionary = {
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label for="add_user_domain">
|
||||
<label for="domain">
|
||||
<fmt:message key="label.domain"/>:</label>
|
||||
|
||||
<input class="text" type="text" id="domain" />
|
||||
<div id="domain_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||
|
||||
<!--
|
||||
<select class="select" id="domain_dropdown">
|
||||
</select>
|
||||
-->
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<label for="add_user_timezone">
|
||||
|
||||
@ -134,6 +134,26 @@ function bindAddAccountButton() {
|
||||
|
||||
var $dialogAddAccount = $("#dialog_add_account");
|
||||
|
||||
var domainObjs = [];
|
||||
$dialogAddAccount.find("#domain").autocomplete({
|
||||
source: function(request, response) {
|
||||
$.ajax({
|
||||
data: createURL("command=listDomains&keyword=" + request.term),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
domainObjs = json.listdomainsresponse.domain;
|
||||
var array1 = [];
|
||||
if(domainObjs != null && domainObjs.length > 0) {
|
||||
for(var i=0; i < domainObjs.length; i++)
|
||||
array1.push(fromdb(domainObjs[i].name));
|
||||
}
|
||||
response(array1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
$.ajax({
|
||||
data: createURL("command=listDomains"),
|
||||
dataType: "json",
|
||||
@ -146,6 +166,7 @@ function bindAddAccountButton() {
|
||||
}
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
$("#add_account_button").unbind("click").bind("click", function(event) {
|
||||
$dialogAddAccount
|
||||
@ -161,6 +182,25 @@ function bindAddAccountButton() {
|
||||
isValid &= validateString("First name", $thisDialog.find("#add_user_firstname"), $thisDialog.find("#add_user_firstname_errormsg"), false); //required
|
||||
isValid &= validateString("Last name", $thisDialog.find("#add_user_lastname"), $thisDialog.find("#add_user_lastname_errormsg"), false); //required
|
||||
isValid &= validateString("Account", $thisDialog.find("#add_user_account"), $thisDialog.find("#add_user_account_errormsg"), true); //optional
|
||||
isValid &= validateString("Domain", $thisDialog.find("#domain"), $thisDialog.find("#domain_errormsg"), false); //required
|
||||
|
||||
var domainName = $thisDialog.find("#domain").val();
|
||||
var domainId;
|
||||
if(domainName != null && domainName.length > 0) {
|
||||
if(domainObjs != null && domainObjs.length > 0) {
|
||||
for(var i=0; i < domainObjs.length; i++) {
|
||||
if(fromdb(domainObjs[i].name) == domainName) {
|
||||
domainId = domainObjs[i].id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(domainId == null) {
|
||||
showError(false, $thisDialog.find("#domain"), $thisDialog.find("#domain_errormsg"), g_dictionary["label.not.found"]);
|
||||
isValid &= false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isValid)
|
||||
return;
|
||||
|
||||
@ -188,7 +228,9 @@ function bindAddAccountButton() {
|
||||
array1.push("&account="+todb(account));
|
||||
|
||||
var accountType = $thisDialog.find("#add_user_account_type").val();
|
||||
var domainId = $thisDialog.find("#domain_dropdown").val();
|
||||
|
||||
//var domainId = $thisDialog.find("#domain_dropdown").val();
|
||||
|
||||
if (parseInt(domainId) != rootDomainId && accountType == "1") {
|
||||
accountType = "2"; // Change to domain admin
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user