cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [3/3] git commit: updated refs/heads/master to 2e07c45
Date Thu, 31 Oct 2013 23:40:22 GMT
Alerts UI: Implement multi-select delete/archive alerts


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2e07c452
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2e07c452
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2e07c452

Branch: refs/heads/master
Commit: 2e07c452e3718e8c24818a78f7a9c6f5d6be78c6
Parents: e8f8185
Author: Brian Federle <brian.federle@citrix.com>
Authored: Thu Oct 31 16:39:42 2013 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Thu Oct 31 16:40:01 2013 -0700

----------------------------------------------------------------------
 ui/scripts/events.js | 69 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e07c452/ui/scripts/events.js
----------------------------------------------------------------------
diff --git a/ui/scripts/events.js b/ui/scripts/events.js
index f432bc4..fdc496e 100644
--- a/ui/scripts/events.js
+++ b/ui/scripts/events.js
@@ -453,6 +453,7 @@
                 listView: {
                     id: 'alerts',
                     label: 'label.menu.alerts',
+                    multiSelect: true,
                     fields: {
                         description: {
                             label: 'label.description'
@@ -468,6 +469,40 @@
 
                     actions: {
                         // Remove multiple Alerts
+                        removeMulti: {
+                            label: 'label.delete.alerts',
+                            isHeader: true,
+                            addRow: false,
+                            isMultiSelectAction: true,
+                            messages: {
+                                confirm: function(args) {
+                                    return 'Please confirm you would like to remove the selected
alerts';
+                                },
+                                notification: function(args) {
+                                    return 'label.delete.alerts';
+                                }
+                            },
+                            action: function(args) {
+                                var events = args.context.alerts;
+                                
+                                $.ajax({
+                                    url: createURL("deleteAlerts"),
+                                    data: {
+                                        ids: $(events).map(function(index, event) {
+                                            return event.id;
+                                        }).toArray().join(',')
+                                    },
+                                    success: function(data) {
+                                        args.response.success();
+                                        $(window).trigger('cloudStack.fullRefresh');
+                                    },
+                                    error:function(data) {
+                                        args.response.error(parseXMLHttpResponse(data));
+                                    }
+                                }); 
+                            }
+                        },
+                        
                         remove: {
                             label: 'label.delete.alerts',
                             isHeader: true,
@@ -533,6 +568,40 @@
                         },
 
                         // Archive multiple Alerts
+                        archiveMulti: {
+                            label: 'label.archive.alerts',
+                            isHeader: true,
+                            addRow: false,
+                            isMultiSelectAction: true,
+                            messages: {
+                                confirm: function(args) {
+                                    return 'Please confirm you would like to archive the
selected alerts';
+                                },
+                                notification: function(args) {
+                                    return 'label.archive.alerts';
+                                }
+                            },
+                            action: function(args) {
+                                var events = args.context.alerts;
+                                
+                                $.ajax({
+                                    url: createURL("archiveAlerts"),
+                                    data: {
+                                        ids: $(events).map(function(index, event) {
+                                            return event.id;
+                                        }).toArray().join(',')
+                                    },
+                                    success: function(data) {
+                                        args.response.success();
+                                        $(window).trigger('cloudStack.fullRefresh');
+                                    },
+                                    error:function(data) {
+                                        args.response.error(parseXMLHttpResponse(data));
+                                    }
+                                }); 
+                            }
+                        },
+                        
                         archive: {
                             label: 'label.archive.alerts',
                             isHeader: true,


Mime
View raw message