Statistics
| Branch: | Tag: | Revision:

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

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
28
# UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT calls
29
# of recurrent api requests
30
UI_UPDATE_INTERVAL_INCREASE = UI_UPDATE_INTERVAL / 4
31
UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT = 4
32

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

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

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

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

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

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

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

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

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

    
77
    }
78
}
79

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

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

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

    
91
# Template to use to build vm hostname
92
UI_VM_HOSTNAME_FORMAT = 'snf-%(id)s.vm.synnefo.org'
93

    
94
# Name/description metadata for the available flavor disk templates
95
# Dict key is the disk_template value as stored in database
96
UI_FLAVORS_DISK_TEMPLATES_INFO = {
97
    'drbd': {'name': 'DRBD',
98
             'description': 'DRBD storage.'},
99
}
100

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

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

    
127

    
128
#######################
129
# UI BEHAVIOUR SETTINGS
130
#######################
131

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
187

    
188
###############
189
# UI EXTENSIONS
190
###############
191

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

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

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