Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (6.2 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
# Cookie name to retrieve authentication data from
47
UI_AUTH_COOKIE_NAME = '_pithos2_a'
48

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

    
64
    },
65
    'large': {
66
        'cpu': 4,
67
        'ram': 4096,
68
        'disk': 40,
69
        'disk_template': 'drbd'
70

    
71
    }
72
}
73

    
74
# A list of metadata keys to clone from image
75
# to the virtual machine on its creation.
76
VM_IMAGE_COMMON_METADATA = ["OS", "loginname", "logindomain", "users",
77
                            "remote"]
78

    
79
# A list of suggested vm roles to display to user on create wizard
80
VM_CREATE_SUGGESTED_ROLES = ["Database server", "File server", "Mail server",
81
                             "Web server", "Proxy"]
82

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

    
87
# Template to use to build vm hostname
88
UI_VM_HOSTNAME_FORMAT = 'snf-%(id)s.vm.synnefo.org'
89

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

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

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

    
123

    
124
#######################
125
# UI BEHAVIOUR SETTINGS
126
#######################
127

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

    
132
# Whether not visible vm views will update their content if vm changes
133
UI_UPDATE_HIDDEN_VIEWS = False
134

    
135
# After how many timeouts of reccurent ajax requests to display the timeout
136
# error overlay
137
UI_SKIP_TIMEOUTS = 1
138

    
139
# Whether UI should display error overlay for all Javascript exceptions
140
UI_HANDLE_WINDOW_EXCEPTIONS = True
141

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

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

    
153
##########################
154
# UI NETWORK VIEW SETTINGS
155
##########################
156

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

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

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

    
169
# Whether to display already connected vm's to the network connect overlay
170
UI_NETWORK_ALLOW_DUPLICATE_VM_NICS = False
171

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

    
177
# Whether or not to group public networks nics in a single network view
178
UI_GROUP_PUBLIC_NETWORKS = True
179

    
180
# The name of the grouped network view
181
UI_GROUPED_PUBLIC_NETWORK_NAME = 'Internet'
182

    
183

    
184
###############
185
# UI EXTENSIONS
186
###############
187

    
188
# Whether or not UI should display images from the Glance API
189
# set in UI_GLANCE_API_URL, if setting is set to False, ui will
190
# request images from Compute API
191
UI_ENABLE_GLANCE = True
192

    
193
# a dict of image owner ids and their associate name
194
# to be displayed on images list
195
UI_SYSTEM_IMAGES_OWNERS = {
196
    'admin@synnefo.org': 'system',
197
    'images@synnefo.org': 'system'
198
}