cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [3/50] [abbrv] git commit: refs/heads/marvin-refactor - CLOUDSTACK-1661: UI for Delete/Archive Events/Alerts
Date Mon, 18 Mar 2013 12:27:11 GMT
CLOUDSTACK-1661: UI for Delete/Archive Events/Alerts


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

Branch: refs/heads/marvin-refactor
Commit: 2a337d5b01109e4a4793e8115e94cc90d6a68fd0
Parents: 845e332
Author: Pranav Saxena <pranav.saxena@citrix.com>
Authored: Thu Mar 14 13:59:52 2013 +0530
Committer: Pranav Saxena <pranav.saxena@citrix.com>
Committed: Thu Mar 14 13:59:52 2013 +0530

----------------------------------------------------------------------
 ui/scripts/docs.js   |   53 ++++++++
 ui/scripts/events.js |  310 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 363 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2a337d5b/ui/scripts/docs.js
----------------------------------------------------------------------
diff --git a/ui/scripts/docs.js b/ui/scripts/docs.js
index 34835d6..4a70ca1 100755
--- a/ui/scripts/docs.js
+++ b/ui/scripts/docs.js
@@ -16,6 +16,59 @@
 // under the License.
 cloudStack.docs = {
 
+ //Delete/archive events
+  helpEventsDeleteType:{
+
+   desc:'Delete all the events by specifying its TYPE eg . USER.LOGIN',
+   externalLink:''
+
+  },
+
+  helpEventsDeleteDate:{
+
+  desc:'Delete all the events which have been created after this date ',
+  externalLink:''
+  },
+
+  helpEventsArchiveType:{
+
+    desc:'Archive all the events by specifying its TYPE (integer number)',
+    externalLink:''
+  },
+
+  helpEventsArchiveDate:{
+
+   desc:'Archive all the events which have been created after this date',
+   externalLink:''
+  },
+
+  //Delete/archive Alerts
+  helpAlertsDeleteType:{
+
+   desc:'Delete all the alerts by specifying its TYPE eg . USER.LOGIN',
+   externalLink:''
+
+  },
+
+  helpAlertsDeleteDate:{
+
+  desc:'Delete all the alerts which have been created after this date ',
+  externalLink:''
+  },
+
+  helpAlertsArchiveType:{
+
+    desc:'Archive all the alerts by specifying its TYPE (integer number)',
+    externalLink:''
+  },
+
+  helpAlertsArchiveDate:{
+
+   desc:'Archive all the alerts which have been created after this date',
+   externalLink:''
+  },
+
+
  //Ldap
   helpLdapQueryFilter: {
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2a337d5b/ui/scripts/events.js
----------------------------------------------------------------------
diff --git a/ui/scripts/events.js b/ui/scripts/events.js
index 38f7728..b18acd7 100644
--- a/ui/scripts/events.js
+++ b/ui/scripts/events.js
@@ -41,6 +41,103 @@
 						account: { label: 'label.account' },
             created: { label: 'label.date', converter: cloudStack.converters.toLocalDate
}
           },
+
+          actions: {
+            // Remove multiple events
+            remove: {
+              label: 'Delete Events',
+              isHeader: true,
+              addRow: false,
+              messages: {
+                notification: function(args) {
+                  return 'Events Deleted';
+                }
+              },
+              createForm: {
+                title:'Delete Events',
+                desc: '',
+                fields: {
+                  type: { label: 'By event type'  , docID:'helpEventsDeleteType'},
+                  date: { label: 'By date (older than)' ,docID:'helpEventsDeleteDate'}
+                }
+              },
+             action: function(args) {
+
+                var data={};
+
+                if(args.data.type != "")
+                  $.extend(data, { type:args.data.type });
+
+                if(args.data.date != "")
+                  $.extend(data, {date:args.data.date });
+   
+                $.ajax({
+
+                     url:createURL("deleteEvents"),
+                     data:data,
+                     dataType:'json',
+                     async: false,
+
+                  success:function(data){
+
+                  args.response.success();
+               
+                    }  
+                   });
+                                  // Reloads window with events removed
+                $(window).trigger('cloudStack.fullRefresh');
+              }
+            },
+
+            // Archive multiple events
+            archive: {
+              label: 'Archive Events',
+              isHeader: true,
+              addRow: false,
+              messages: {
+                notification: function(args) {
+                  return 'Archive events';
+                }
+              },
+              createForm: {
+                title:'Archive Events',
+                desc: '',
+                fields: {
+                  type: { label: 'By event type' , docID:'helpEventsArchiveType'},
+                  date: { label: 'By date (older than)' , docID:'helpEventsArchiveDate'}
+                }
+              },
+              action: function(args) {
+                   var data={};
+
+                if(args.data.type != "")
+                  $.extend(data, { type:args.data.type });
+
+                if(args.data.date != "")
+                  $.extend(data, {date:args.data.date });
+
+                $.ajax({
+
+                     url:createURL("archiveEvents"),
+                     data:data,
+                     dataType:'json',
+                     async: false,
+
+                  success:function(data){
+
+                  args.response.success();
+
+                    }
+                   });
+
+                // Reloads window with events removed
+                $(window).trigger('cloudStack.fullRefresh');
+              }
+            }
+
+          },
+
+
 										
 					advSearchFields: {	
             level: {
@@ -132,6 +229,64 @@
           },
 					detailView: {
             name: 'label.details',
+              actions: {
+
+              // Remove single event
+              remove: {
+                label: 'Delete',
+                messages: {
+                  notification: function(args) {
+                    return 'Event Deleted';
+                  },
+                  confirm: function() {
+                    return 'Are you sure you want to remove this event?';
+                  }
+                },
+                action: function(args) {
+
+                  $.ajax({
+                       url:createURL("deleteEvents&ids=" +args.context.events[0].id),
+                       success:function(json){  
+
+                  args.response.success();
+                             
+                       }
+
+                       });
+                    $(window).trigger('cloudStack.fullRefresh');
+
+                }
+              },
+
+              // Archive single event
+              archive: {
+                label: 'Archive',
+                messages: {
+                  notification: function(args) {
+                    return 'Event Archived';
+                  },
+                  confirm: function() {
+                    return 'Please confirm that you want to archive this event.';
+                  }
+                },
+                action: function(args) {
+                    
+                  $.ajax({
+                       url:createURL("archiveEvents&ids=" +args.context.events[0].id),
+                       success:function(json){
+
+                  args.response.success();        
+                             
+                       }
+
+                       });
+                  
+
+                  // Reloads window with item archived
+                  $(window).trigger('cloudStack.fullRefresh');
+                }
+              }
+           },
             tabs: {
               details: {
                 title: 'label.details',
@@ -174,6 +329,102 @@
             description: { label: 'label.description' },
             sent: { label: 'label.date', converter: cloudStack.converters.toLocalDate }
           },
+
+           actions: {
+            // Remove multiple Alerts
+            remove: {
+              label: 'Delete Alerts',
+              isHeader: true,
+              addRow: false,
+              messages: {
+                notification: function(args) {
+                  return 'Alerts Deleted';
+                }
+              },
+              createForm: {
+                title:'Delete Alerts',
+                desc: '',
+                fields: {
+                  type: { label: 'By event type' , docID:'helpAlertsDeleteType'},
+                  date: { label: 'By date (older than)' ,docID:'helpAlertsDeleteDate' }
+                }
+              },
+             action: function(args) {
+
+                var data={};
+
+                if(args.data.type != "")
+                  $.extend(data, { type:args.data.type });
+
+                if(args.data.date != "")
+                  $.extend(data, {date:args.data.date });
+
+                $.ajax({
+
+                     url:createURL("deleteAlerts"),
+                     data:data,
+                     dataType:'json',
+                     async: false,
+
+                  success:function(data){
+
+                  args.response.success();
+
+                    }
+                   });
+                                  // Reloads window with events removed
+                $(window).trigger('cloudStack.fullRefresh');
+              }
+            },
+          
+           // Archive multiple Alerts
+            archive: {
+              label: 'Archive Alerts',
+              isHeader: true,
+              addRow: false,
+              messages: {
+                notification: function(args) {
+                  return 'Alerts Archived';
+                }
+              },
+              createForm: {
+                title:'Archive Alerts',
+                desc: '',
+                fields: {
+                  type: { label: 'By event type', docID:'helpAlertsArchiveType' },
+                  date: { label: 'By date (older than)' , docID:'helpAlertsArchiveDate'}
+                }
+              },
+              action: function(args) {
+                   var data={};
+
+                if(args.data.type != "")
+                  $.extend(data, { type:args.data.type });
+
+                if(args.data.date != "")
+                  $.extend(data, {date:args.data.date });
+
+                $.ajax({
+
+                     url:createURL("archiveAlerts"),
+                     data:data,
+                     dataType:'json',
+                     async: false,
+
+                  success:function(data){
+
+                  args.response.success();
+
+                    }
+                   });
+
+                // Reloads window with events removed
+                $(window).trigger('cloudStack.fullRefresh');
+              }
+            }
+
+          },
+
           dataProvider: function(args) {
 					  var data = {};
 						listViewDataProvider(args, data);		
@@ -190,6 +441,65 @@
           },
           detailView: {
             name: 'Alert details',
+              actions: {
+
+              // Remove single Alert
+              remove: {
+                label: 'Delete',
+                messages: {
+                  notification: function(args) {
+                    return 'Alert Deleted';
+                  },
+                  confirm: function() {
+                    return 'Are you sure you want to delete this alert ?';
+                  }
+                },
+                action: function(args) {
+
+                  $.ajax({
+                       url:createURL("deleteAlerts&ids=" +args.context.alerts[0].id),
+                       success:function(json){
+
+                  args.response.success();
+
+                       }
+
+                       });
+                    $(window).trigger('cloudStack.fullRefresh');
+
+                }
+              },
+
+               archive: {
+                label: 'Archive',
+                messages: {
+                  notification: function(args) {
+                    return 'Alert Archived';
+                  },
+                  confirm: function() {
+                    return 'Please confirm that you want to archive this alert.';
+                  }
+                },
+                action: function(args) {
+
+                  $.ajax({
+                       url:createURL("archiveAlerts&ids=" +args.context.alerts[0].id),
+                       success:function(json){
+
+                  args.response.success();
+
+                       }
+
+                       });
+
+
+                  // Reloads window with item archived
+                  $(window).trigger('cloudStack.fullRefresh');
+                }
+              }
+
+            },  
+
             tabs: {
               details: {
                 title: 'label.details',


Mime
View raw message