ui.py 5 KB
Newer Older
1
2
3
4
5
# -*- coding: utf-8 -*-
#
# UI settings
###################

Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
6
7
8
# API URL
COMPUTE_API_URL = '/api/v1.1'

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
14
15
16
17
18
19
20
21
# UI requests to the API layer time out after that many milliseconds
TIMEOUT = 10 * 1000

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

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

# How often should the UI request changes from the API
25
26
27
28
29
30
31
32
33
34
35
36
UI_UPDATE_INTERVAL = 5000

# Milieconds to increase the interval after UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT calls
# of recurrent api requests
UI_UPDATE_INTERVAL_INCREASE = UI_UPDATE_INTERVAL / 4
UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT = 4

# Maximum update interval
UI_UPDATE_INTERVAL_MAX = UI_UPDATE_INTERVAL * 3

# Fast update interval
UI_UPDATE_INTERVAL_FAST = UI_UPDATE_INTERVAL / 2
37
38
39
40
41
42
43

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

# Email from which the feedback emails will be sent from
44
FEEDBACK_EMAIL_FROM = "~okeanos <no-reply@grnet.gr>"
45

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

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

52
53
54
# Cookie name to retrieve authentication data from
UI_AUTH_COOKIE_NAME = '_pithos2_a'

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

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

77
78
    }
}
79
80
81
82

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

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

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
90
VM_CREATE_NAME_TPL = "My {0} server"

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

98

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

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

107
# Whether not visible vm views will update their content if vm changes
108
109
110
111
112
113
114
115
116
UI_UPDATE_HIDDEN_VIEWS = False

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

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

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

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

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

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

# Suggested private networks to let the user choose from when creating a private
# network with dhcp enabled
138
UI_NETWORK_AVAILABLE_SUBNETS = ['10.0.0.0/24', '192.168.0.0/24']
139
140
141
142
143
144
145
146
147

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

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

Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
148
149
150
151
152

###############
# UI EXTENSIONS
###############

153
# Glance images API endpoint
Kostas Papadimitriou's avatar
Kostas Papadimitriou committed
154
UI_GLANCE_API_URL = '/plankton'
155
156
157
158
159

# Whether or not UI should display images from the Glance API
# set in UI_GLANCE_API_URL, if setting is set to False, ui will
# request images from Compute API
UI_ENABLE_GLANCE = True
160
161
162
163
164
165
166
167

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