views.py
1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from django.shortcuts import render, redirect
from django.core import urlresolvers
from pyrosapp.models import Log
def home(request):
return render(request, 'dashboard/home.html')
def users(request):
url_ = urlresolvers.reverse('admin:auth_user_changelist')
return redirect(url_)
def alerts(request):
url_ = urlresolvers.reverse('admin:pyrosapp_alert_changelist')
return redirect(url_)
def routines(request):
url_ = urlresolvers.reverse('admin:pyrosapp_request_changelist')
return redirect(url_)
def weather(request):
url_ = urlresolvers.reverse('admin:pyrosapp_weatherwatch_changelist')
return redirect(url_)
def site(request):
url_ = urlresolvers.reverse('admin:pyrosapp_sitewatch_changelist')
return redirect(url_)
def devices(request):
url_ = urlresolvers.reverse('admin:pyrosapp_device_changelist')
return redirect(url_)
def system(request):
return render(request, 'dashboard/system.html')
def system_retrieve_logs(request):
if request.is_ajax():
alert_logs = Log.objects.filter(agent='Alert manager')
scheduler_logs = Log.objects.filter(agent='Scheduler')
majordome_logs = Log.objects.filter(agent='Majordome')
obs_logs = Log.objects.filter(agent='Observation manager')
analyzer_logs = Log.objects.filter(agent='Analyzer')
return render(request, 'dashboard/system_logs.html', locals())
def schedule(request):
url_ = urlresolvers.reverse('admin:pyrosapp_schedule_changelist')
return redirect(url_)
def quotas(request):
url_ = urlresolvers.reverse('admin:pyrosapp_pyrosuser_changelist')
return redirect(url_)