Revision f533f224 ui/views.py
b/ui/views.py | ||
---|---|---|
5 | 5 |
from django.http import HttpResponse |
6 | 6 |
from django.utils.translation import get_language |
7 | 7 |
from django.utils import simplejson as json |
8 |
from django.shortcuts import render_to_response |
|
8 | 9 |
|
9 | 10 |
TIMEOUT = settings.TIMEOUT |
10 |
CONSOLE_WIDTH = 800 #settings.CONSOLE_WIDTH |
|
11 |
CONSOLE_HEIGHT = 600 #settings.CONSOLE_HEIGHT |
|
11 |
IMAGE_ICONS = settings.IMAGE_ICONS |
|
12 | 12 |
|
13 | 13 |
def template(name, context): |
14 | 14 |
template_path = os.path.join(os.path.dirname(__file__), "templates/") |
... | ... | |
16 | 16 |
t = loader.get_template(current_template) |
17 | 17 |
return HttpResponse(t.render(Context(context))) |
18 | 18 |
|
19 |
|
|
20 | 19 |
def home(request): |
21 | 20 |
context = {'timeout': TIMEOUT, |
22 | 21 |
'project': '+nefo', |
23 | 22 |
'request': request, |
24 |
'current_lang': get_language() or 'en'} |
|
23 |
'current_lang': get_language() or 'en', |
|
24 |
'image_icons': IMAGE_ICONS,} |
|
25 | 25 |
return template('home', context) |
26 | 26 |
|
27 |
|
|
28 | 27 |
def machines(request): |
29 |
context = {} |
|
28 |
context = {'default_keywords': settings.DEFAULT_KEYWORDS}
|
|
30 | 29 |
return template('machines', context) |
31 | 30 |
|
32 |
def machine_console(request): |
|
31 |
def machines_icon(request): |
|
32 |
context = {'default_keywords': settings.DEFAULT_KEYWORDS} |
|
33 |
return template('machines_icon', context) |
|
34 |
|
|
35 |
def machines_list(request): |
|
36 |
context = {'default_keywords': settings.DEFAULT_KEYWORDS} |
|
37 |
return template('machines_list', context) |
|
38 |
|
|
39 |
def machines_single(request): |
|
40 |
context = {'default_keywords': settings.DEFAULT_KEYWORDS} |
|
41 |
return template('machines_single', context) |
|
42 |
|
|
43 |
def machines_console(request): |
|
33 | 44 |
host, port, password = ('','','') |
34 | 45 |
host = request.GET.get('host','') |
35 | 46 |
port = request.GET.get('port','') |
36 | 47 |
password = request.GET.get('password','') |
37 |
context = {'host': host, 'port': port, 'password': password, |
|
38 |
'console_height': CONSOLE_HEIGHT, 'console_width': CONSOLE_WIDTH} |
|
39 |
return template('machine_console', context) |
|
40 |
|
|
41 |
def machines_standard(request): |
|
42 |
context = {} |
|
43 |
return template('standard', context) |
|
44 |
|
|
45 |
|
|
46 |
def machines_list(request): |
|
47 |
context = {} |
|
48 |
return template('list', context) |
|
49 |
|
|
48 |
machine = request.GET.get('machine','') |
|
49 |
host_ip = request.GET.get('host_ip','') |
|
50 |
context = {'host': host, 'port': port, 'password': password, 'machine': machine, 'host_ip': host_ip} |
|
51 |
return template('machines_console', context) |
|
50 | 52 |
|
51 | 53 |
def images(request): |
52 | 54 |
context = {} |
53 | 55 |
return template('images', context) |
54 | 56 |
|
55 |
|
|
56 | 57 |
def disks(request): |
57 | 58 |
context = {} |
58 | 59 |
return template('disks', context) |
59 | 60 |
|
60 |
|
|
61 | 61 |
def networks(request): |
62 | 62 |
context = {} |
63 | 63 |
return template('networks', context) |
64 | 64 |
|
65 |
|
|
66 |
def files(request): |
|
65 |
def files(request): |
|
67 | 66 |
context = {} |
68 | 67 |
return template('files', context) |
69 | 68 |
|
70 |
|
|
71 | 69 |
def desktops(request): |
72 | 70 |
context = {} |
73 | 71 |
return template('desktops', context) |
74 | 72 |
|
75 |
|
|
76 | 73 |
def apps(request): |
77 | 74 |
context = {} |
78 | 75 |
return template('apps', context) |
Also available in: Unified diff