Commit c995534c authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Added setting for predefined flavors in UI, Refs #815

parent c71f9115
......@@ -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
......
......@@ -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
}
}
......@@ -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" %}',
......
......@@ -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>
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment