Statistics
| Branch: | Tag: | Revision:

root / snf-app / synnefo / app_settings / default / ui.py @ 2ce0636e

History | View | Annotate | Download (3.6 kB)

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

    
6
from synnefo.webproject.settings.default.site import *
7
from synnefo.settings.default.admins import *
8

    
9
# base url for ui static files
10
# if not set, defaults to MEDIA_URL + 'snf-<latest_ui_version>/'
11
UI_MEDIA_URL = '/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 = DEFAULT_FROM_EMAIL
45

    
46
# URL to redirect user to when he logs out from the ui (if not set
47
# settings.LOGIN_URL will be used)
48
#LOGOUT_URL = ""
49

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

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

    
72
    }
73
}
74

    
75
# A list of metadata keys to clone from image
76
# to the virtual machine on its creation.
77
VM_IMAGE_COMMON_METADATA = ["OS", "loginname", "logindomain"]
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", "Web server", "Proxy"]
81

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

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

    
93
#######################
94
# UI BEHAVIOUR SETTINGS
95
#######################
96

    
97
# Whether to increase the time of recurrent requests (networks/vms update) if
98
# window loses its focus
99
UI_DELAY_ON_BLUR = False
100

    
101
# Whether not visible vm views will update their content if vm changes
102
UI_UPDATE_HIDDEN_VIEWS = False
103

    
104
# After how many timeouts of reccurent ajax requests to display the timeout
105
# error overlay
106
UI_SKIP_TIMEOUTS = 1
107

    
108
# Whether UI should display error overlay for all Javascript exceptions
109
UI_HANDLE_WINDOW_EXCEPTIONS = True
110

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

    
114
# OS/username map to identify default user name for the specified os
115
UI_OS_DEFAULT_USER_MAP = {
116
    'debian':'root', 'fedora': 'root', 'okeanos': 'root',
117
    'ubuntu': 'root', 'kubuntu': 'root', 'centos': 'root',
118
    'windows': 'Administrator'
119
}