Statistics
| Branch: | Tag: | Revision:

root / snf-app / synnefo / settings / common / ui.py @ 483c9197

History | View | Annotate | Download (3.5 kB)

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

    
6
from admins import *
7

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

    
12
# UI requests to the API layer time out after that many milliseconds
13
TIMEOUT = 10 * 1000
14

    
15
# A list of suggested server tags (server metadata keys)
16
DEFAULT_KEYWORDS = ["OS", "Role", "Location", "Owner"]
17

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

    
23
# How often should the UI request changes from the API
24
UI_UPDATE_INTERVAL = 5000
25

    
26
# Milieconds to increase the interval after UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT calls
27
# of recurrent api requests
28
UI_UPDATE_INTERVAL_INCREASE = UI_UPDATE_INTERVAL / 4
29
UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT = 4
30

    
31
# Maximum update interval
32
UI_UPDATE_INTERVAL_MAX = UI_UPDATE_INTERVAL * 3
33

    
34
# Fast update interval
35
UI_UPDATE_INTERVAL_FAST = UI_UPDATE_INTERVAL / 2
36

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

    
42
# Email from which the feedback emails will be sent from
43
FEEDBACK_EMAIL_FROM = DEFAULT_FROM_EMAIL
44

    
45
# URL to redirect user to when he logs out from the ui (if not set
46
# settings.LOGIN_URL will be used)
47
#LOGOUT_URL = ""
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"]
77

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

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

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

    
92
#######################
93
# UI BEHAVIOUR SETTINGS
94
#######################
95

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

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

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

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

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

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