Navigation | Overlay |
---|---|
t Navigate files | h Toggle hits |
y Change url to tip of branch | m Toggle misses |
b / v Jump to prev/next hit line | p Toggle partial |
z / x Jump to prev/next missed or partial line | 1..9 Toggle flags |
shift + o Open current page in GitHub | a Toggle all on |
/ or ? Show keyboard shortcuts dialog | c Toggle context lines or commits |
1 | 6 |
from django.conf.urls import url |
2 | 6 |
from django.views.generic.base import TemplateView |
3 | 6 |
from django.contrib.staticfiles import views |
4 | 6 |
from django.urls import re_path |
5 |
|
|
6 |
|
|
7 | 6 |
from cyborgbackup.main.utils.tasks import catalog_is_running, celery_worker_is_running |
8 | 6 |
from cyborgbackup.main.models import Job, Policy, Repository, Schedule, Client |
9 |
|
|
10 | 6 |
app_name = 'ui' |
11 |
|
|
12 |
|
|
13 | 6 |
class IndexView(TemplateView): |
14 |
|
|
15 | 6 |
template_name = 'ui/index.html' |
16 |
|
|
17 | 6 |
def get_context_data(self, **kwargs): |
18 |
context = super(IndexView, self).get_context_data(**kwargs) |
|
19 |
context['celery'] = celery_worker_is_running() |
|
20 |
context['catalog'] = catalog_is_running() |
|
21 |
context['jobs'] = len(Job.objects.filter()) |
|
22 |
context['policies'] = len(Policy.objects.filter()) |
|
23 |
context['clients'] = len(Client.objects.filter()) |
|
24 |
context['schedules'] = len(Schedule.objects.filter()) |
|
25 |
context['repositories'] = len(Repository.objects.filter()) |
|
26 |
return context |
|
27 |
|
|
28 |
|
|
29 | 6 |
index = IndexView.as_view() |
30 |
|
|
31 | 6 |
urlpatterns = [ |
32 |
url(r'^$', index, name='index'), |
|
33 |
re_path(r'^(?P<path>.*)$', views.serve), |
|
34 |
]
|
Read our documentation on viewing source code .