Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (6.6 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
# List of emails used for sending the feedback messages to (following the ADMINS format)
43
FEEDBACK_CONTACTS = (
44
    # ('Contact Name', 'contact_email@domain.com'),
45
)
46

    
47
# Email from which the feedback emails will be sent from
48
FEEDBACK_EMAIL_FROM = "~okeanos <no-reply@grnet.gr>"
49

    
50
# URL to redirect not authenticated users
51
UI_LOGIN_URL = "/im/login"
52

    
53
# URL to redirect user to when he logs out from the ui
54
UI_LOGOUT_URL = "/im/logout"
55

    
56
# Cookie name to retrieve authentication data from
57
UI_AUTH_COOKIE_NAME = '_pithos2_a'
58

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

    
74
    },
75
    'large': {
76
        'cpu': 4,
77
        'ram': 4096,
78
        'disk': 40,
79
        'disk_template': 'drbd'
80

    
81
    }
82
}
83

    
84
# A list of metadata keys to clone from image
85
# to the virtual machine on its creation.
86
VM_IMAGE_COMMON_METADATA = ["OS", "loginname", "logindomain", "users", "remote"]
87

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

    
91
# Template to be used for suggesting the user a default name for newly created
92
# vms. {0} gets replaced by the image OS value
93
VM_CREATE_NAME_TPL = "My {0} server"
94

    
95
# Template to use to build vm hostname
96
UI_VM_HOSTNAME_FORMAT = 'snf-%(id)s.vm.okeanos.grnet.gr'
97

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

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

    
127
# extend rdp file content. May be a string with format parameters similar to
128
# those used in UI_CONNECT_PROMPT_MESSAGES `ssh_message` or a callable object.
129
UI_EXTRA_RDP_CONTENT = None
130

    
131

    
132
#######################
133
# UI BEHAVIOUR SETTINGS
134
#######################
135

    
136
# Whether to increase the time of recurrent requests (networks/vms update) if
137
# window loses its focus
138
UI_DELAY_ON_BLUR = False
139

    
140
# Whether not visible vm views will update their content if vm changes
141
UI_UPDATE_HIDDEN_VIEWS = False
142

    
143
# After how many timeouts of reccurent ajax requests to display the timeout
144
# error overlay
145
UI_SKIP_TIMEOUTS = 1
146

    
147
# Whether UI should display error overlay for all Javascript exceptions
148
UI_HANDLE_WINDOW_EXCEPTIONS = True
149

    
150
# A list of os names that support ssh public key assignment
151
UI_SUPPORT_SSH_OS_LIST = ['debian', 'fedora', 'okeanos', 'ubuntu', 'kubuntu',
152
                          'centos', 'archlinux']
153

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

    
161
##########################
162
# UI NETWORK VIEW SETTINGS
163
##########################
164

    
165
# Available network types for use to choose when creating a private network
166
# If only one set, no select options will be displayed
167
UI_NETWORK_AVAILABLE_NETWORK_TYPES = {'PRIVATE_MAC_FILTERED': 'mac-filtering'}
168

    
169
# Suggested private networks to let the user choose from when creating a private
170
# network with dhcp enabled
171
UI_NETWORK_AVAILABLE_SUBNETS = ['10.0.0.0/24', '192.168.0.0/24']
172

    
173
# UI will use this setting to find an available network subnet if user requests
174
# automatic subnet selection.
175
UI_AUTOMATIC_NETWORK_RANGE_FORMAT = "192.168.%d.0/24"
176

    
177
# Whether to display already connected vm's to the network connect overlay
178
UI_NETWORK_ALLOW_DUPLICATE_VM_NICS = False
179

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

    
185
# Whether or not to group public networks nics in a single network view
186
UI_GROUP_PUBLIC_NETWORKS = True
187

    
188
# The name of the grouped network view
189
UI_GROUPED_PUBLIC_NETWORK_NAME = 'Internet'
190

    
191

    
192
###############
193
# UI EXTENSIONS
194
###############
195

    
196
# Glance images API endpoint
197
UI_GLANCE_API_URL = '/plankton'
198

    
199
# Whether or not UI should display images from the Glance API
200
# set in UI_GLANCE_API_URL, if setting is set to False, ui will
201
# request images from Compute API
202
UI_ENABLE_GLANCE = True
203

    
204
# a dict of image owner ids and their associate name
205
# to be displayed on images list
206
UI_SYSTEM_IMAGES_OWNERS = {
207
    'admin@synnefo.gr': 'system',
208
    'images@synnefo.gr': 'system'
209
}
210