Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / app_settings / default / ui.py @ 6e27e449

History | View | Annotate | Download (6.4 kB)

1
# -*- coding: utf-8 -*-
2
#
3
# UI settings
4
###################
5

    
6
# API URL
7
COMPUTE_API_URL = '/api/v1.1'
8

    
9
# base url for ui static files
10
# if not set, defaults to MEDIA_URL + 'snf-<latest_ui_version>/'
11
UI_MEDIA_URL = '/static/ui/static/snf/'
12

    
13
# UI requests to the API layer time out after that many milliseconds
14
TIMEOUT = 10 * 1000
15

    
16
# A list of suggested server tags (server metadata keys)
17
DEFAULT_KEYWORDS = ["OS", "Role", "Location", "Owner"]
18

    
19
# A list of allowed icons for OS Images
20
IMAGE_ICONS = ["redhat", "ubuntu", "debian", "windows", "gentoo", "archlinux",
21
               "centos", "fedora", "freebsd", "netbsd", "openbsd", "slackware",
22
               "suse", "kubuntu"]
23

    
24
# How often should the UI request changes from the API
25
UI_UPDATE_INTERVAL = 5000
26

    
27
# Milieconds to increase the interval after UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT calls
28
# of recurrent api requests
29
UI_UPDATE_INTERVAL_INCREASE = UI_UPDATE_INTERVAL / 4
30
UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT = 4
31

    
32
# Maximum update interval
33
UI_UPDATE_INTERVAL_MAX = UI_UPDATE_INTERVAL * 3
34

    
35
# Fast update interval
36
UI_UPDATE_INTERVAL_FAST = UI_UPDATE_INTERVAL / 2
37

    
38
# Miliseconds to remove from the previous server response time used in
39
# consecutive API calls (aligning changes-since attribute).
40
UI_CHANGES_SINCE_ALIGNMENT = 0
41

    
42
# How often to check for user usage changes
43
UI_QUOTAS_UPDATE_INTERVAL = 10000
44

    
45
# URL to redirect not authenticated users
46
UI_LOGIN_URL = "/im/login"
47

    
48
# URL to redirect user to when he logs out from the ui
49
UI_LOGOUT_URL = "/im/logout"
50

    
51
# Cookie name to retrieve authentication data from
52
UI_AUTH_COOKIE_NAME = '_pithos2_a'
53

    
54
# Flavor options that we provide to the user as predefined
55
# cpu/ram/disk combinations on vm create wizard
56
VM_CREATE_SUGGESTED_FLAVORS = {
57
    'small': {
58
        'cpu': 1,
59
        'ram': 1024,
60
        'disk': 20,
61
        'disk_template': 'drbd'
62
    },
63
    'medium': {
64
        'cpu': 2,
65
        'ram': 2048,
66
        'disk': 30,
67
        'disk_template': 'drbd'
68

    
69
    },
70
    'large': {
71
        'cpu': 4,
72
        'ram': 4096,
73
        'disk': 40,
74
        'disk_template': 'drbd'
75

    
76
    }
77
}
78

    
79
# A list of metadata keys to clone from image
80
# to the virtual machine on its creation.
81
VM_IMAGE_COMMON_METADATA = ["OS", "loginname", "logindomain", "users", "remote"]
82

    
83
# A list of suggested vm roles to display to user on create wizard
84
VM_CREATE_SUGGESTED_ROLES = ["Database server", "File server", "Mail server", "Web server", "Proxy"]
85

    
86
# Template to be used for suggesting the user a default name for newly created
87
# vms. {0} gets replaced by the image OS value
88
VM_CREATE_NAME_TPL = "My {0} server"
89

    
90
# Template to use to build vm hostname
91
UI_VM_HOSTNAME_FORMAT = 'snf-%(id)s.vm.okeanos.grnet.gr'
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
# Override default connect prompt messages. The setting gets appended to the
101
# ui default values so you only need to modify parameters you need to alter.
102
#
103
# Indicative format:
104
# {
105
#    '<browser os1>': {
106
#        '<vm os family1>': ['top message....', 'bottom message'],
107
#        '<vm os family 2>': ['top message....', 'bottom message'],
108
#        'ssh_message': 'ssh %(user)s@%(hostname)s'
109
# }
110
#
111
# you may use the following parameters to format ssh_message:
112
#
113
# * server_id: the database pk of the vm
114
# * ip_address: the ipv4 address of the public vm nic
115
# * hostname: vm hostname
116
# * user: vm username
117
#
118
# you may assign a callable python object to the ssh_message, if so the above
119
# parameters get passed as arguments to the provided object.
120
UI_CONNECT_PROMPT_MESSAGES = {}
121

    
122
# extend rdp file content. May be a string with format parameters similar to
123
# those used in UI_CONNECT_PROMPT_MESSAGES `ssh_message` or a callable object.
124
UI_EXTRA_RDP_CONTENT = None
125

    
126

    
127
#######################
128
# UI BEHAVIOUR SETTINGS
129
#######################
130

    
131
# Whether to increase the time of recurrent requests (networks/vms update) if
132
# window loses its focus
133
UI_DELAY_ON_BLUR = False
134

    
135
# Whether not visible vm views will update their content if vm changes
136
UI_UPDATE_HIDDEN_VIEWS = False
137

    
138
# After how many timeouts of reccurent ajax requests to display the timeout
139
# error overlay
140
UI_SKIP_TIMEOUTS = 1
141

    
142
# Whether UI should display error overlay for all Javascript exceptions
143
UI_HANDLE_WINDOW_EXCEPTIONS = True
144

    
145
# A list of os names that support ssh public key assignment
146
UI_SUPPORT_SSH_OS_LIST = ['debian', 'fedora', 'okeanos', 'ubuntu', 'kubuntu',
147
                          'centos', 'archlinux']
148

    
149
# OS/username map to identify default user name for the specified os
150
UI_OS_DEFAULT_USER_MAP = {
151
    'debian':'root', 'fedora': 'root', 'okeanos': 'root',
152
    'ubuntu': 'root', 'kubuntu': 'root', 'centos': 'root',
153
    'windows': 'Administrator'
154
}
155

    
156
##########################
157
# UI NETWORK VIEW SETTINGS
158
##########################
159

    
160
# Available network types for use to choose when creating a private network
161
# If only one set, no select options will be displayed
162
UI_NETWORK_AVAILABLE_NETWORK_TYPES = {'MAC_FILTERED': 'mac-filtering'}
163

    
164
# Suggested private networks to let the user choose from when creating a private
165
# network with dhcp enabled
166
UI_NETWORK_AVAILABLE_SUBNETS = ['10.0.0.0/24', '192.168.0.0/24']
167

    
168
# UI will use this setting to find an available network subnet if user requests
169
# automatic subnet selection.
170
UI_AUTOMATIC_NETWORK_RANGE_FORMAT = "192.168.%d.0/24"
171

    
172
# Whether to display already connected vm's to the network connect overlay
173
UI_NETWORK_ALLOW_DUPLICATE_VM_NICS = False
174

    
175
# Whether to display destroy action on private networks that contain vms. If
176
# set to True, destroy action will only get displayed if user disconnect all
177
# virtual machines from the network.
178
UI_NETWORK_STRICT_DESTROY = True
179

    
180
# Whether or not to group public networks nics in a single network view
181
UI_GROUP_PUBLIC_NETWORKS = True
182

    
183
# The name of the grouped network view
184
UI_GROUPED_PUBLIC_NETWORK_NAME = 'Internet'
185

    
186

    
187
###############
188
# UI EXTENSIONS
189
###############
190

    
191
# Glance images API endpoint
192
UI_GLANCE_API_URL = '/plankton'
193

    
194
# Whether or not UI should display images from the Glance API
195
# set in UI_GLANCE_API_URL, if setting is set to False, ui will
196
# request images from Compute API
197
UI_ENABLE_GLANCE = True
198

    
199
# a dict of image owner ids and their associate name
200
# to be displayed on images list
201
UI_SYSTEM_IMAGES_OWNERS = {
202
    'admin@synnefo.gr': 'system',
203
    'images@synnefo.gr': 'system'
204
}