diff --git a/server/src/com/cloud/storage/dao/VMTemplateDaoImpl.java b/server/src/com/cloud/storage/dao/VMTemplateDaoImpl.java index 5a16a932be0..3b66e3bd287 100755 --- a/server/src/com/cloud/storage/dao/VMTemplateDaoImpl.java +++ b/server/src/com/cloud/storage/dao/VMTemplateDaoImpl.java @@ -542,7 +542,8 @@ public class VMTemplateDaoImpl extends GenericDaoBase implem } } - if (!permittedAccounts.isEmpty() && !(templateFilter == TemplateFilter.featured || templateFilter == TemplateFilter.community) && !isAdmin(caller.getType()) ) { + if (!permittedAccounts.isEmpty() && !(templateFilter == TemplateFilter.featured || + templateFilter == TemplateFilter.community || templateFilter == TemplateFilter.executable) && !isAdmin(caller.getType()) ) { whereClause += attr + "t.account_id IN (" + permittedAccountsStr + ")"; } diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java index fd9c9c2099e..35fbfe01077 100755 --- a/server/src/com/cloud/user/AccountManagerImpl.java +++ b/server/src/com/cloud/user/AccountManagerImpl.java @@ -269,7 +269,8 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag @Override public boolean isAdmin(short accountType) { - return ((accountType == Account.ACCOUNT_TYPE_ADMIN) || (accountType == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) || (accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) || (accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN)); + return ((accountType == Account.ACCOUNT_TYPE_ADMIN) || (accountType == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) + || (accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) || (accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN)); } @Override diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index e7767f6442b..3af5761eaaa 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -1549,11 +1549,31 @@ }, fields: [ - { - + { displayname: { label: 'label.display.name', isEditable: true }, instancename: { label: 'label.internal.name' }, - state: { label: 'label.state' }, + state: { + label: 'label.state', + pollAgainIfValueIsIn: { + 'Starting': 1, + 'Stopping': 1 + }, + pollAgainFn: function(context) { //??? + var toClearInterval = false; + $.ajax({ + url: createURL("listVirtualMachines&id=" + context.instances[0].id), + dataType: "json", + async: false, + success: function(json) { + var jsonObj = json.listvirtualmachinesresponse.virtualmachine[0]; + if(jsonObj.state != context.instances[0].state) { + toClearInterval = true; //to clear interval + } + } + }); + return toClearInterval; + } + }, hypervisor: { label: 'label.hypervisor' }, templatename: { label: 'label.template' }, guestosid: { diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 36d4464595f..2f70ef8cb32 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -33,14 +33,17 @@ fields: { name: { label: 'label.name' }, type: { label: 'label.type' }, - //hypervisor: { label: 'label.hypervisor' }, - //vmdisplayname: { label: 'label.vm.display.name' }, - state: { + hypervisor: { label: 'label.hypervisor' }, + vmdisplayname: { label: 'label.vm.display.name' }, + + /* + state: { label: 'State', indicator: { 'Ready': 'on' } } + */ }, // List view actions @@ -943,7 +946,27 @@ { id: { label: 'ID' }, zonename: { label: 'label.zone' }, - state: { label: 'label.state' }, + state: { + label: 'label.state', + pollAgainIfValueIsIn: { + 'UploadNotStarted': 1 + }, + pollAgainFn: function(context) { //??? + var toClearInterval = false; + $.ajax({ + url: createURL("listVolumes&id=" + context.volumes[0].id), + dataType: "json", + async: false, + success: function(json) { + var jsonObj = json.listvolumesresponse.volume[0]; + if(jsonObj.state != context.volumes[0].state) { + toClearInterval = true; //to clear interval + } + } + }); + return toClearInterval; + } + }, type: { label: 'label.type' }, storagetype: { label: 'label.storage.type' }, hypervisor: { label: 'label.hypervisor' }, diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js index 860983252d6..a1d7eaa01e4 100644 --- a/ui/scripts/ui/widgets/detailView.js +++ b/ui/scripts/ui/widgets/detailView.js @@ -680,7 +680,23 @@ } else if (key != 'name') { isOddRow = true; } - + + //??? + /* + if("pollAgainIfValueIsIn" in value) { + if ((content in value.pollAgainIfValueIsIn) && (value.pollAgainFn != null)) { + //poll again + var intervalKey = setInterval(function() { + var toClearInterval = value.pollAgainFn(context); + if(toClearInterval == true) { + clearInterval(intervalKey); + $('.detail-view .toolbar .button.refresh').click(); //click Refresh button to refresh detailView + } + }, 2000); + } + } + */ + $name.html(_l(value.label)); $value.html(_s(content));