diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 725c1b33a4a..d0675acf6ba 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -81,7 +81,43 @@
}
});
}
- },
+ },
+
+ domainid: {
+ label: 'Domain',
+ select: function(args) {
+ $.ajax({
+ url: createURL('listDomains'),
+ data: { listAll: true },
+ success: function(json) {
+ args.response.success({
+ data: $.map(json.listdomainsresponse.domain, function(domain) {
+ return {
+ id: domain.id,
+ description: domain.path
+ };
+ })
+ });
+ }
+ });
+ },
+ isHidden: function(args) {
+ if(isAdmin() || isDomainAdmin())
+ return false;
+ else
+ return true;
+ }
+ },
+ account: {
+ label: 'Account',
+ isHidden: function(args) {
+ if(isAdmin() || isDomainAdmin())
+ return false;
+ else
+ return true;
+ }
+ },
+
tagKey: { label: 'Tag Key' },
tagValue: { label: 'Tag Value' }
},
diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js
index 2d22637f6d5..0aa2ac5b458 100644
--- a/ui/scripts/ui/dialog.js
+++ b/ui/scripts/ui/dialog.js
@@ -65,9 +65,14 @@
var $formItem = $('
')
.addClass('form-item')
.attr({ rel: key });
-
- if (field.hidden || field.isHidden) $formItem.hide();
-
+
+ if(field.isHidden != null) {
+ if (typeof(field.isHidden) == 'boolean' && field.isHidden == true)
+ $formItem.hide();
+ else if (typeof(field.isHidden) == 'function' && field.isHidden() == true)
+ $formItem.hide();
+ }
+
$formItem.appendTo($form);
//Handling Escape KeyPress events
@@ -91,10 +96,7 @@
closeOnEscape: false
}); */
// Label field
-
- //if( field.label == 'label.network.offering' || field.label == 'label.guest.gateway')
- // debugger;
-
+
var $name = $('
').addClass('name')
.appendTo($formItem)
.append(
@@ -198,9 +200,9 @@
selectFn = field.select;
$input = $('