Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (5.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
# 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
# Name/description metadata for the available flavor disk templates
96
# Dict key is the disk_template value as stored in database
97
UI_FLAVORS_DISK_TEMPLATES_INFO = {
98
    'drbd': {'name': 'DRBD',
99
             'description': 'DRBD storage.'},
100
}
101

    
102

    
103
#######################
104
# UI BEHAVIOUR SETTINGS
105
#######################
106

    
107
# Whether to increase the time of recurrent requests (networks/vms update) if
108
# window loses its focus
109
UI_DELAY_ON_BLUR = False
110

    
111
# Whether not visible vm views will update their content if vm changes
112
UI_UPDATE_HIDDEN_VIEWS = False
113

    
114
# After how many timeouts of reccurent ajax requests to display the timeout
115
# error overlay
116
UI_SKIP_TIMEOUTS = 1
117

    
118
# Whether UI should display error overlay for all Javascript exceptions
119
UI_HANDLE_WINDOW_EXCEPTIONS = True
120

    
121
# A list of os names that support ssh public key assignment
122
UI_SUPPORT_SSH_OS_LIST = ['debian', 'fedora', 'okeanos', 'ubuntu', 'kubuntu',
123
                          'centos', 'archlinux']
124

    
125
# OS/username map to identify default user name for the specified os
126
UI_OS_DEFAULT_USER_MAP = {
127
    'debian':'root', 'fedora': 'root', 'okeanos': 'root',
128
    'ubuntu': 'root', 'kubuntu': 'root', 'centos': 'root',
129
    'windows': 'Administrator'
130
}
131

    
132
##########################
133
# UI NETWORK VIEW SETTINGS
134
##########################
135

    
136
# Available network types for use to choose when creating a private network
137
# If only one set, no select options will be displayed
138
UI_NETWORK_AVAILABLE_NETWORK_TYPES = {'PRIVATE_FILTERED': 'mac-filtering'}
139

    
140
# Suggested private networks to let the user choose from when creating a private
141
# network with dhcp enabled
142
UI_NETWORK_AVAILABLE_SUBNETS = ['10.0.0.0/24', '192.168.0.0/24']
143

    
144
# Whether to display already connected vm's to the network connect overlay
145
UI_NETWORK_ALLOW_DUPLICATE_VM_NICS = False
146

    
147
# Whether to display destroy action on private networks that contain vms. If
148
# set to True, destroy action will only get displayed if user disconnect all
149
# virtual machines from the network.
150
UI_NETWORK_STRICT_DESTROY = True
151

    
152
# Whether or not to group public networks nics in a single network view
153
UI_GROUP_PUBLIC_NETWORKS = True
154

    
155
# The name of the grouped network view
156
UI_GROUPED_PUBLIC_NETWORK_NAME = 'Internet'
157

    
158

    
159
###############
160
# UI EXTENSIONS
161
###############
162

    
163
# Glance images API endpoint
164
UI_GLANCE_API_URL = '/plankton'
165

    
166
# Whether or not UI should display images from the Glance API
167
# set in UI_GLANCE_API_URL, if setting is set to False, ui will
168
# request images from Compute API
169
UI_ENABLE_GLANCE = True
170

    
171
# a dict of image owner ids and their associate name
172
# to be displayed on images list
173
UI_SYSTEM_IMAGES_OWNERS = {
174
    'admin@synnefo.gr': 'system',
175
    'images@synnefo.gr': 'system'
176
}
177