mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
CLOUDSTACK-1661: UI for Delete/Archive Events/Alerts
This commit is contained in:
parent
845e332dbf
commit
2a337d5b01
@ -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: {
|
||||
|
||||
|
||||
@ -42,6 +42,103 @@
|
||||
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: {
|
||||
label: 'label.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',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user