System, secondary storage UI fixes

-Add state field ('resourcestate') to list view

-Fix destroy action to have proper UI feedback
This commit is contained in:
Brian Federle 2012-02-23 15:07:43 -08:00
parent ea7ea4ce6f
commit 856f41bdf8
3 changed files with 18 additions and 7 deletions

View File

@ -1,6 +1,5 @@
#new labels (begin) ********************************************************************************************** #new labels (begin) **********************************************************************************************
state.Enabled=Enabled
#new labels (end) ************************************************************************************************ #new labels (end) ************************************************************************************************

View File

@ -1617,6 +1617,7 @@
<script language="javascript"> <script language="javascript">
dictionary = { dictionary = {
'state.Enabled': '<fmt:message key="state.Enabled"/>',
'label.system.wide.capacity': '<fmt:message key="label.system.wide.capacity"/>', 'label.system.wide.capacity': '<fmt:message key="label.system.wide.capacity"/>',
'label.management': '<fmt:message key="label.management"/>', 'label.management': '<fmt:message key="label.management"/>',
'label.guest': '<fmt:message key="label.guest"/>', 'label.guest': '<fmt:message key="label.guest"/>',

View File

@ -6321,7 +6321,18 @@
section: 'seconary-storage', section: 'seconary-storage',
fields: { fields: {
name: { label: 'label.name' }, name: { label: 'label.name' },
created: { label: 'label.created', converter: cloudStack.converters.toLocalDate } created: { label: 'label.created', converter: cloudStack.converters.toLocalDate },
resourcestate: {
label: 'label.state',
indicator: {
'Enabled': 'on',
'Disabled': 'off',
'Destroyed': 'off'
},
converter: function(str) {
return 'state.' + str;
}
}
}, },
dataProvider: function(args) { dataProvider: function(args) {
@ -6410,7 +6421,7 @@
detailView: { detailView: {
name: 'Secondary storage details', name: 'Secondary storage details',
actions: { actions: {
'delete': { destroy: {
label: 'label.action.delete.secondary.storage' , label: 'label.action.delete.secondary.storage' ,
messages: { messages: {
confirm: function(args) { confirm: function(args) {
@ -6426,12 +6437,12 @@
dataType: "json", dataType: "json",
async: true, async: true,
success: function(json) { success: function(json) {
args.response.success({data:{}}); args.response.success();
} }
}); });
}, },
notification: { notification: {
poll: function(args) { args.complete(); } poll: function(args) { args.complete({ data: { resourcestate: 'Destroyed' } }); }
} }
} }
@ -7258,7 +7269,7 @@
var secondarystorageActionfilter = function(args) { var secondarystorageActionfilter = function(args) {
var jsonObj = args.context.item; var jsonObj = args.context.item;
var allowedActions = []; var allowedActions = [];
allowedActions.push("delete"); allowedActions.push("destroy");
return allowedActions; return allowedActions;
} }