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

VM creation view improvement, Refs #3012

warn user against untrustworthy image owners
parent 496631c2
......@@ -6032,6 +6032,15 @@ table.list-machines .wave {
height: 250px;
}
.create-vm .image-warning {
display: none;
background-color: #987249;
color: #fff;
padding: 10px 15px;
font-size: 0.9em;
border-bottom: 1px solid #AAA;
}
.create-vm .create-step-cont .rename input.rename-field {
font-size: 1.4em;
padding: 5px;
......
......@@ -261,6 +261,16 @@
return this.get('owner') || _.keys(synnefo.config.system_images_owners)[0];
},
is_system_image: function() {
var owner = this.get_owner();
return _.include(_.keys(synnefo.config.system_images_owners), owner)
},
owned_by: function(user) {
if (!user) { user = synnefo.user }
return user.username == this.get_owner();
},
display_owner: function() {
var owner = this.get_owner();
if (_.include(_.keys(synnefo.config.system_images_owners), owner)) {
......
......@@ -314,6 +314,14 @@
hide_list_loading: function() {
this.$(".images-list-cont").removeClass("loading");
},
display_warning_for_image: function(image) {
if (!image.is_system_image() && !image.owned_by(synnefo.user)) {
$(".create-vm .image-warning").show();
} else {
$(".create-vm .image-warning").hide();
}
},
select_image: function(image) {
if (image && image.get('id') && !_.include(this.images_ids, image.get('id'))) {
......@@ -332,6 +340,7 @@
if ((!this.selected_image && image) || (this.selected_image != image))
this.trigger("change", image);
this.display_warning_for_image(image);
this.selected_image = image;
......
{% load i18n %}
<div id="createvm-overlay-content" class="hidden create-vm">
<div class="steps-history clearfix">
<div class="steps-history-cont step1h completed step-header"
id="vm-create-step-history-1">
......@@ -79,6 +78,13 @@
</div>
</div>
</div>
<div class="image-warning">
<p>
{% blocktrans %}You have selected a user-provided Image, which is not
officially endorsed by ~okeanos. Please make sure it is from a
trustworthy source.{% endblocktrans %}
</p>
</div>
<div class="steps-container clearfix">
<div class="step-1 select-image wide create-step-cont clearfix">
<div class="clearfix step-header">
......
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