def history_system(request, alert_id): alert = alerts_model.get_by_id(alert_id) server = server_model.get_by_id(alert['server']) page = request.GET.get('page', 1) page = int(page) skip = 0 if page > 1: skip = 100 * (page - 1) total = alerts_history_model.count_notifications(alert_id=alert['_id']) on_page = 100 if total > on_page: total_pages = total//on_page else: total_pages = 1 total_pages = range(total_pages) notifications = alerts_history_model.get_notifications_list(alert_id=alert['_id'], limit=100, skip=skip) return render(request, 'alerts/history.html', { 'notifications': notifications, 'alert': alert, 'server': server, "total_pages": total_pages, "page": page })
def history_system(request, alert_id): alert = alerts_model.get_by_id(alert_id) server = server_model.get_by_id(alert['server']) page = request.GET.get('page', 1) page = int(page) skip = 0 if page > 1: skip = 100 * (page - 1) total = alerts_history_model.count_notifications(alert_id=alert['_id']) on_page = 100 if total > on_page: total_pages = total/on_page else: total_pages = 1 total_pages = range(total_pages) notifications = alerts_history_model.get_notifications_list(alert_id=alert['_id'], limit=100, skip=skip) return render(request, 'alerts/history.html', { 'notifications': notifications, 'alert': alert, 'server': server, "total_pages": total_pages, "page": page })
def ajax_alert_triggers(request, alert_id=None): alert = alerts_model.get_by_id(alert_id) notifications = alerts_history_model.get_notifications_list(alert_id=alert['_id'], limit=5) return render(request, 'alerts/ajax_history.html', { "notifications": notifications, "rule": alert })
def ajax_alert_triggers(request, alert_id=None): alert = alerts_model.get_by_id(alert_id) notifications = alerts_history_model.get_notifications_list(alert_id=alert['_id'], limit=5) return render(request, 'alerts/ajax_history.html', { "notifications": notifications, "rule": alert })
def history_health_check(request, alert_id): data = {} alert = alerts_model.get_by_id(alert_id) notifications = alerts_history_model.get_notifications_list(alert_id=alert['_id'], limit=100) return render(request, 'alerts/history.html', { 'notifications': notifications, 'alert': alert, 'data': data })
def history_health_check(request, alert_id): data = {} alert = alerts_model.get_by_id(alert_id) notifications = alerts_history_model.get_notifications_list(alert_id=alert['_id'], limit=100) return render(request, 'alerts/history.html', { 'notifications': notifications, 'alert': alert, 'data': data })
def ajax_alert_triggers(request, alert_id=None): alert = alerts_model.get_by_id(alert_id) notifications = alerts_history_model.get_notifications_list( alert_id=alert['_id'], limit=5) return render_to_response('alerts/ajax_history.html', { "notifications": notifications, "rule": alert }, context_instance=RequestContext(request))
def history_health_check(request, alert_id): data = {} alert = alerts_model.get_by_id(alert_id) notifications = alerts_history_model.get_notifications_list( alert_id=alert['_id'], limit=100) return render_to_response('alerts/history.html', { 'notifications': notifications, 'alert': alert, 'data': data }, context_instance=RequestContext(request))