Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / app_settings / default / ui.py @ 9c0ac5af

History | View | Annotate | Download (4.1 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 = '/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 user to when he logs out from the ui (if not set
49
# settings.LOGIN_URL will be used)
50
#LOGOUT_URL = ""
51

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

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

    
74
    }
75
}
76

    
77
# A list of metadata keys to clone from image
78
# to the virtual machine on its creation.
79
VM_IMAGE_COMMON_METADATA = ["OS", "loginname", "logindomain"]
80

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

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

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

    
95

    
96
#######################
97
# UI BEHAVIOUR SETTINGS
98
#######################
99

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

    
104
# Whether not visible vm views will update their content if vm changes
105
UI_UPDATE_HIDDEN_VIEWS = False
106

    
107
# After how many timeouts of reccurent ajax requests to display the timeout
108
# error overlay
109
UI_SKIP_TIMEOUTS = 1
110

    
111
# Whether UI should display error overlay for all Javascript exceptions
112
UI_HANDLE_WINDOW_EXCEPTIONS = True
113

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

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

    
124

    
125
###############
126
# UI EXTENSIONS
127
###############
128

    
129
# Glance images API endpoint
130
UI_GLANCE_API_URL = '/plankton'
131

    
132
# Whether or not UI should display images from the Glance API
133
# set in UI_GLANCE_API_URL, if setting is set to False, ui will
134
# request images from Compute API
135
UI_ENABLE_GLANCE = True
136

    
137
# a dict of image owner ids and their associate name
138
# to be displayed on images list
139
UI_SYSTEM_IMAGES_OWNERS = {
140
    'admin@synnefo.gr': 'system',
141
    'images@synnefo.gr': 'system'
142
}
143