Blame view

src/dashboard/views.py 1.62 KB
81847ba2   haribo   Dashboard buttons...
1
2
from django.shortcuts import render, redirect
from django.core import urlresolvers
cae4b343   haribo   deleted conflicti...
3

77816f10   haribo   Workflow implemen...
4
5
6
from pyrosapp.models import Log


62229d51   haribo   began dashboard (...
7
def home(request):
62229d51   haribo   began dashboard (...
8
9
    return render(request, 'dashboard/home.html')

77816f10   haribo   Workflow implemen...
10

62229d51   haribo   began dashboard (...
11
def users(request):
81847ba2   haribo   Dashboard buttons...
12
13
    url_ = urlresolvers.reverse('admin:auth_user_changelist')
    return redirect(url_)
62229d51   haribo   began dashboard (...
14

77816f10   haribo   Workflow implemen...
15

62229d51   haribo   began dashboard (...
16
def alerts(request):
81847ba2   haribo   Dashboard buttons...
17
18
    url_ = urlresolvers.reverse('admin:pyrosapp_alert_changelist')
    return redirect(url_)
62229d51   haribo   began dashboard (...
19

77816f10   haribo   Workflow implemen...
20

62229d51   haribo   began dashboard (...
21
def routines(request):
81847ba2   haribo   Dashboard buttons...
22
23
    url_ = urlresolvers.reverse('admin:pyrosapp_request_changelist')
    return redirect(url_)
62229d51   haribo   began dashboard (...
24

77816f10   haribo   Workflow implemen...
25

62229d51   haribo   began dashboard (...
26
def weather(request):
81847ba2   haribo   Dashboard buttons...
27
28
    url_ = urlresolvers.reverse('admin:pyrosapp_weatherwatch_changelist')
    return redirect(url_)
62229d51   haribo   began dashboard (...
29

77816f10   haribo   Workflow implemen...
30

62229d51   haribo   began dashboard (...
31
def site(request):
81847ba2   haribo   Dashboard buttons...
32
33
    url_ = urlresolvers.reverse('admin:pyrosapp_sitewatch_changelist')
    return redirect(url_)
62229d51   haribo   began dashboard (...
34

77816f10   haribo   Workflow implemen...
35

62229d51   haribo   began dashboard (...
36
def devices(request):
81847ba2   haribo   Dashboard buttons...
37
38
    url_ = urlresolvers.reverse('admin:pyrosapp_device_changelist')
    return redirect(url_)
62229d51   haribo   began dashboard (...
39

77816f10   haribo   Workflow implemen...
40

62229d51   haribo   began dashboard (...
41
42
43
def system(request):
    return render(request, 'dashboard/system.html')

77816f10   haribo   Workflow implemen...
44
45
46
47
48
49
50
51
52
53
54

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())


62229d51   haribo   began dashboard (...
55
def schedule(request):
81847ba2   haribo   Dashboard buttons...
56
57
    url_ = urlresolvers.reverse('admin:pyrosapp_schedule_changelist')
    return redirect(url_)
62229d51   haribo   began dashboard (...
58

77816f10   haribo   Workflow implemen...
59

62229d51   haribo   began dashboard (...
60
def quotas(request):
81847ba2   haribo   Dashboard buttons...
61
62
    url_ = urlresolvers.reverse('admin:pyrosapp_pyrosuser_changelist')
    return redirect(url_)