Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (5 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
# List of emails used for sending the feedback messages to (following the ADMINS format)
39
FEEDBACK_CONTACTS = (
40
    # ('Contact Name', 'contact_email@domain.com'),
41
)
42

    
43
# Email from which the feedback emails will be sent from
44
FEEDBACK_EMAIL_FROM = "~okeanos <no-reply@grnet.gr>"
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"]
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
# Name/description metadata for the available flavor disk templates
92
# Dict key is the disk_template value as stored in database
93
UI_FLAVORS_DISK_TEMPLATES_INFO = {
94
    'drbd': {'name': 'DRBD',
95
             'description': 'DRBD storage.'},
96
}
97

    
98

    
99
#######################
100
# UI BEHAVIOUR SETTINGS
101
#######################
102

    
103
# Whether to increase the time of recurrent requests (networks/vms update) if
104
# window loses its focus
105
UI_DELAY_ON_BLUR = False
106

    
107
# Whether not visible vm views will update their content if vm changes
108
UI_UPDATE_HIDDEN_VIEWS = False
109

    
110
# After how many timeouts of reccurent ajax requests to display the timeout
111
# error overlay
112
UI_SKIP_TIMEOUTS = 1
113

    
114
# Whether UI should display error overlay for all Javascript exceptions
115
UI_HANDLE_WINDOW_EXCEPTIONS = True
116

    
117
# A list of os names that support ssh public key assignment
118
UI_SUPPORT_SSH_OS_LIST = ['debian', 'fedora', 'okeanos', 'ubuntu', 'kubuntu',
119
                          'centos', 'archlinux']
120

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

    
128
##########################
129
# UI NETWORK VIEW SETTINGS
130
##########################
131

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

    
136
# Suggested private networks to let the user choose from when creating a private
137
# network with dhcp enabled
138
UI_NETWORK_AVAILABLE_SUBNETS = ['10.0.0.0/24', '192.168.0.0/24']
139

    
140
# Whether to display already connected vm's to the network connect overlay
141
UI_NETWORK_ALLOW_DUPLICATE_VM_NICS = False
142

    
143
# Whether to display destroy action on private networks that contain vms. If
144
# set to True, destroy action will only get displayed if user disconnect all
145
# virtual machines from the network.
146
UI_NETWORK_STRICT_DESTROY = False
147

    
148

    
149
###############
150
# UI EXTENSIONS
151
###############
152

    
153
# Glance images API endpoint
154
UI_GLANCE_API_URL = '/plankton'
155

    
156
# Whether or not UI should display images from the Glance API
157
# set in UI_GLANCE_API_URL, if setting is set to False, ui will
158
# request images from Compute API
159
UI_ENABLE_GLANCE = True
160

    
161
# a dict of image owner ids and their associate name
162
# to be displayed on images list
163
UI_SYSTEM_IMAGES_OWNERS = {
164
    'admin@synnefo.gr': 'system',
165
    'images@synnefo.gr': 'system'
166
}
167