root / snf-cyclades-app / synnefo / app_settings / default / ui.py @ ebf4619d
History | View | Annotate | Download (5 kB)
1 |
# -*- coding: utf-8 -*-
|
---|---|
2 |
#
|
3 |
# UI settings
|
4 |
###################
|
5 |
|
6 |
from synnefo.settings.default.admins import * |
7 |
|
8 |
# API URL
|
9 |
COMPUTE_API_URL = '/api/v1.1'
|
10 |
|
11 |
# base url for ui static files
|
12 |
# if not set, defaults to MEDIA_URL + 'snf-<latest_ui_version>/'
|
13 |
UI_MEDIA_URL = '/static/ui/static/snf/'
|
14 |
|
15 |
# UI requests to the API layer time out after that many milliseconds
|
16 |
TIMEOUT = 10 * 1000 |
17 |
|
18 |
# A list of suggested server tags (server metadata keys)
|
19 |
DEFAULT_KEYWORDS = ["OS", "Role", "Location", "Owner"] |
20 |
|
21 |
# A list of allowed icons for OS Images
|
22 |
IMAGE_ICONS = ["redhat", "ubuntu", "debian", "windows", "gentoo", "archlinux", |
23 |
"centos", "fedora", "freebsd", "netbsd", "openbsd", "slackware", |
24 |
"suse", "kubuntu"] |
25 |
|
26 |
# How often should the UI request changes from the API
|
27 |
UI_UPDATE_INTERVAL = 5000
|
28 |
|
29 |
# Milieconds to increase the interval after UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT calls
|
30 |
# of recurrent api requests
|
31 |
UI_UPDATE_INTERVAL_INCREASE = UI_UPDATE_INTERVAL / 4
|
32 |
UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT = 4
|
33 |
|
34 |
# Maximum update interval
|
35 |
UI_UPDATE_INTERVAL_MAX = UI_UPDATE_INTERVAL * 3
|
36 |
|
37 |
# Fast update interval
|
38 |
UI_UPDATE_INTERVAL_FAST = UI_UPDATE_INTERVAL / 2
|
39 |
|
40 |
# List of emails used for sending the feedback messages to (following the ADMINS format)
|
41 |
FEEDBACK_CONTACTS = ( |
42 |
# ('Contact Name', 'contact_email@domain.com'),
|
43 |
) |
44 |
|
45 |
# Email from which the feedback emails will be sent from
|
46 |
FEEDBACK_EMAIL_FROM = DEFAULT_FROM_EMAIL |
47 |
|
48 |
# URL to redirect not authenticated users
|
49 |
UI_LOGIN_URL = "/im/login"
|
50 |
|
51 |
# URL to redirect user to when he logs out from the ui
|
52 |
UI_LOGOUT_URL = "/im/logout"
|
53 |
|
54 |
# Cookie name to retrieve authentication data from
|
55 |
UI_AUTH_COOKIE_NAME = '_pithos2_a'
|
56 |
|
57 |
# Flavor options that we provide to the user as predefined
|
58 |
# cpu/ram/disk combinations on vm create wizard
|
59 |
VM_CREATE_SUGGESTED_FLAVORS = { |
60 |
'small': {
|
61 |
'cpu': 1, |
62 |
'ram': 1024, |
63 |
'disk': 20, |
64 |
'disk_template': 'drbd' |
65 |
}, |
66 |
'medium': {
|
67 |
'cpu': 2, |
68 |
'ram': 2048, |
69 |
'disk': 30, |
70 |
'disk_template': 'drbd' |
71 |
|
72 |
}, |
73 |
'large': {
|
74 |
'cpu': 4, |
75 |
'ram': 4096, |
76 |
'disk': 40, |
77 |
'disk_template': 'drbd' |
78 |
|
79 |
} |
80 |
} |
81 |
|
82 |
# A list of metadata keys to clone from image
|
83 |
# to the virtual machine on its creation.
|
84 |
VM_IMAGE_COMMON_METADATA = ["OS", "loginname", "logindomain", "users", "remote"] |
85 |
|
86 |
# A list of suggested vm roles to display to user on create wizard
|
87 |
VM_CREATE_SUGGESTED_ROLES = ["Database server", "File server", "Mail server", "Web server", "Proxy"] |
88 |
|
89 |
# Template to be used for suggesting the user a default name for newly created
|
90 |
# vms. {0} gets replaced by the image OS value
|
91 |
VM_CREATE_NAME_TPL = "My {0} server"
|
92 |
|
93 |
# Name/description metadata for the available flavor disk templates
|
94 |
# Dict key is the disk_template value as stored in database
|
95 |
UI_FLAVORS_DISK_TEMPLATES_INFO = { |
96 |
'drbd': {'name': 'DRBD', |
97 |
'description': 'DRBD storage.'}, |
98 |
} |
99 |
|
100 |
|
101 |
#######################
|
102 |
# UI BEHAVIOUR SETTINGS
|
103 |
#######################
|
104 |
|
105 |
# Whether to increase the time of recurrent requests (networks/vms update) if
|
106 |
# window loses its focus
|
107 |
UI_DELAY_ON_BLUR = False
|
108 |
|
109 |
# Whether not visible vm views will update their content if vm changes
|
110 |
UI_UPDATE_HIDDEN_VIEWS = False
|
111 |
|
112 |
# After how many timeouts of reccurent ajax requests to display the timeout
|
113 |
# error overlay
|
114 |
UI_SKIP_TIMEOUTS = 1
|
115 |
|
116 |
# Whether UI should display error overlay for all Javascript exceptions
|
117 |
UI_HANDLE_WINDOW_EXCEPTIONS = True
|
118 |
|
119 |
# A list of os names that support ssh public key assignment
|
120 |
UI_SUPPORT_SSH_OS_LIST = ['debian', 'fedora', 'okeanos', 'ubuntu', 'kubuntu', |
121 |
'centos', 'archlinux'] |
122 |
|
123 |
# OS/username map to identify default user name for the specified os
|
124 |
UI_OS_DEFAULT_USER_MAP = { |
125 |
'debian':'root', 'fedora': 'root', 'okeanos': 'root', |
126 |
'ubuntu': 'root', 'kubuntu': 'root', 'centos': 'root', |
127 |
'windows': 'Administrator' |
128 |
} |
129 |
|
130 |
##########################
|
131 |
# UI NETWORK VIEW SETTINGS
|
132 |
##########################
|
133 |
|
134 |
# Available network types for use to choose when creating a private network
|
135 |
# If only one set, no select options will be displayed
|
136 |
UI_NETWORK_AVAILABLE_NETWORK_TYPES = {'PRIVATE_FILTERED': 'mac-filtering'} |
137 |
|
138 |
# Suggested private networks to let the user choose from when creating a private
|
139 |
# network with dhcp enabled
|
140 |
UI_NETWORK_AVAILABLE_SUBNETS = ['10.0.0.1/24', '192.168.1.1/24'] |
141 |
|
142 |
# Whether to display already connected vm's to the network connect overlay
|
143 |
UI_NETWORK_ALLOW_DUPLICATE_VM_NICS = False
|
144 |
|
145 |
# Whether to display destroy action on private networks that contain vms. If
|
146 |
# set to True, destroy action will only get displayed if user disconnect all
|
147 |
# virtual machines from the network.
|
148 |
UI_NETWORK_STRICT_DESTROY = False
|
149 |
|
150 |
|
151 |
###############
|
152 |
# UI EXTENSIONS
|
153 |
###############
|
154 |
|
155 |
# Glance images API endpoint
|
156 |
UI_GLANCE_API_URL = '/plankton'
|
157 |
|
158 |
# Whether or not UI should display images from the Glance API
|
159 |
# set in UI_GLANCE_API_URL, if setting is set to False, ui will
|
160 |
# request images from Compute API
|
161 |
UI_ENABLE_GLANCE = True
|
162 |
|
163 |
# a dict of image owner ids and their associate name
|
164 |
# to be displayed on images list
|
165 |
UI_SYSTEM_IMAGES_OWNERS = { |
166 |
'admin@synnefo.gr': 'system', |
167 |
'images@synnefo.gr': 'system' |
168 |
} |
169 |
|