Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
c995534c
Commit
c995534c
authored
Aug 03, 2011
by
Kostas Papadimitriou
Browse files
Added setting for predefined flavors in UI, Refs #815
parent
c71f9115
Changes
5
Hide whitespace changes
Inline
Side-by-side
README.upgrade
View file @
c995534c
...
...
@@ -4,6 +4,12 @@ README.Upgrade
This file documents the upgrade to newer versions of the Synnefo software.
For more information, please see README.deploy.
v0.5.4 -> v0.5.5
NEW SETTINGS
* 30-ui.conf:SUGGESTED_FLAVORS
v0.5.3 -> v0.5.4
REPOSITORY
* Split Synnefo Ganeti tools to snf-ganeti-tools, with Debian packaging
...
...
settings.d/30-ui.conf
View file @
c995534c
...
...
@@ -28,3 +28,23 @@ FEEDBACK_EMAIL_FROM = DEFAULT_FROM_EMAIL
# URL to redirect user to when he logs out from the ui (if not set
# settings.LOGIN_URL will be used)
#LOGOUT_URL = ""
# Flavor options that we provide to the user as predefined
# cpu/ram/disk combinations
SUGGESTED_FLAVORS
= {
'small'
: {
'cpu'
:
1
,
'ram'
:
1024
,
'disk'
:
20
},
'medium'
: {
'cpu'
:
2
,
'ram'
:
2048
,
'disk'
:
30
},
'large'
: {
'cpu'
:
4
,
'ram'
:
4096
,
'disk'
:
40
}
}
ui/templates/home.html
View file @
c995534c
...
...
@@ -175,11 +175,7 @@ or implied, of GRNET S.A.
'
NO_DETAILS
'
:
'
{% trans "Νο advanced details provided" %}
'
};
var
SUGGESTED_FLAVORS
=
{
'
small
'
:
{
cpu
:
1
,
ram
:
1024
,
disk
:
20
},
'
medium
'
:
{
cpu
:
2
,
ram
:
2048
,
disk
:
40
},
'
large
'
:
{
cpu
:
4
,
ram
:
4096
,
disk
:
80
}
}
var
SUGGESTED_FLAVORS
=
{{
suggested_flavors
|
safe
}};
var
SUCCESS
=
{
'
HEADER
'
:
'
{% trans "Success" %}
'
,
...
...
ui/templates/machines.html
View file @
c995534c
...
...
@@ -157,7 +157,7 @@ or implied, of GRNET S.A.
</div>
<div
class=
"machine-type"
>
<label
for=
"custom"
id=
"custom"
>
<input
type=
"radio"
name=
"machine-type"
id=
"custom"
value=
"
large
"
/>
<input
type=
"radio"
name=
"machine-type"
id=
"custom"
value=
"
custom
"
/>
<span
class=
"typebody"
id=
"custom-body"
>
{% trans "custom" %}
</span>
</label>
</div>
...
...
ui/views.py
View file @
c995534c
...
...
@@ -50,6 +50,7 @@ TIMEOUT = settings.TIMEOUT
UPDATE_INTERVAL
=
settings
.
UPDATE_INTERVAL
IMAGE_ICONS
=
settings
.
IMAGE_ICONS
LOGOUT_URL
=
getattr
(
settings
,
"LOGOUT_URL"
,
settings
.
LOGIN_URL
)
SUGGESTED_FLAVORS
=
getattr
(
settings
,
"SUGGESTED_FLAVORS"
,
{})
def
template
(
name
,
context
):
template_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"templates/"
)
...
...
@@ -65,6 +66,7 @@ def home(request):
'update_interval'
:
UPDATE_INTERVAL
,
'image_icons'
:
IMAGE_ICONS
,
'logout_redirect'
:
LOGOUT_URL
,
'suggested_flavors'
:
json
.
dumps
(
SUGGESTED_FLAVORS
),
'DEBUG'
:
settings
.
DEBUG
}
return
template
(
'home'
,
context
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment