Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (4.2 kB)

1
# -*- coding: utf-8 -*-
2
#
3
# UI settings
4
###################
5

    
6
from synnefo.settings.default.admins import *
7

    
8
# API URL
9
COMPUTE_API_URL = '/api/v1.1'
10

    
11
# base url for ui static files
12
# if not set, defaults to MEDIA_URL + 'snf-<latest_ui_version>/'
13
UI_MEDIA_URL = '/static/ui/static/snf/'
14

    
15
# UI requests to the API layer time out after that many milliseconds
16
TIMEOUT = 10 * 1000
17

    
18
# A list of suggested server tags (server metadata keys)
19
DEFAULT_KEYWORDS = ["OS", "Role", "Location", "Owner"]
20

    
21
# A list of allowed icons for OS Images
22
IMAGE_ICONS = ["redhat", "ubuntu", "debian", "windows", "gentoo", "archlinux",
23
               "centos", "fedora", "freebsd", "netbsd", "openbsd", "slackware",
24
               "suse", "kubuntu"]
25

    
26
# How often should the UI request changes from the API
27
UI_UPDATE_INTERVAL = 5000
28

    
29
# Milieconds to increase the interval after UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT calls
30
# of recurrent api requests
31
UI_UPDATE_INTERVAL_INCREASE = UI_UPDATE_INTERVAL / 4
32
UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT = 4
33

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

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

    
40
# List of emails used for sending the feedback messages to (following the ADMINS format)
41
FEEDBACK_CONTACTS = (
42
    # ('Contact Name', 'contact_email@domain.com'),
43
)
44

    
45
# Email from which the feedback emails will be sent from
46
FEEDBACK_EMAIL_FROM = DEFAULT_FROM_EMAIL
47

    
48
# URL to redirect not authenticated users
49
UI_LOGIN_URL = "/im/login"
50

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

    
54
# Cookie name to retrieve authentication data from
55
UI_AUTH_COOKIE_NAME = '_pithos2_a'
56

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

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

    
79
    }
80
}
81

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

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

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

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

    
100

    
101
#######################
102
# UI BEHAVIOUR SETTINGS
103
#######################
104

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

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

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

    
116
# Whether UI should display error overlay for all Javascript exceptions
117
UI_HANDLE_WINDOW_EXCEPTIONS = True
118

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

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

    
129

    
130
###############
131
# UI EXTENSIONS
132
###############
133

    
134
# Glance images API endpoint
135
UI_GLANCE_API_URL = '/plankton'
136

    
137
# Whether or not UI should display images from the Glance API
138
# set in UI_GLANCE_API_URL, if setting is set to False, ui will
139
# request images from Compute API
140
UI_ENABLE_GLANCE = True
141

    
142
# a dict of image owner ids and their associate name
143
# to be displayed on images list
144
UI_SYSTEM_IMAGES_OWNERS = {
145
    'admin@synnefo.gr': 'system',
146
    'images@synnefo.gr': 'system'
147
}
148