Commit 248d4c9b authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

ui: Hide password when image does not support it

Make the final step of the VM creation wizard to not display the
password of the VM, if it using an image that does not support
setting a password (e.g. snapshots).
parent 7cc133ca
......@@ -32,6 +32,8 @@ Cyclades UI
* Improve handling of terminated projects in reassign view.
* Remove the COPYRECT encoding from the preferred noVNC client encodings, and
prefer TIGHT_PNG by default.
* Fix handling of SSH keys and password customization steps to images that
do not support them, e.g. snapshots.
Stats
......
......@@ -4287,6 +4287,18 @@ h3.overlay-inner-title {
position: relative;
}
#creation-password-overlay div.disabled.password-cont .password-label {
color: #fff !important;
float: none;
}
#creation-password-overlay div.disabled.password-cont {
border: 2px solid #888;
background-color: #aaa;
text-align: center;
padding: 10px;
}
#creation-password-overlay {
position: relative;
}
......
......@@ -203,15 +203,27 @@
this.show_password();
},
show: function(pass, vm_id) {
show: function(pass, vm_id, image) {
this.pass = pass;
this.vm_id = vm_id;
this.image = image;
var self = this;
this.password.unbind("click").click(function() {
self.password.selectRange(0);
});
views.VMCreationPasswordView.__super__.show.apply(this, arguments);
if (this.image.supports("password")) {
this.$(".password-cont").show();
this.$(".subinfo.description").show();
this.$(".disabled.password-cont").hide();
this.$(".disabled.subinfo.description").hide();
} else {
this.$(".password-cont").hide();
this.$(".subinfo.description").hide();
this.$(".disabled.password-cont").show();
this.$(".disabled.subinfo.description").show();
}
}
})
......@@ -1996,8 +2008,9 @@
ip.set({'status': 'connecting'});
});
this.close_all();
this.password_view.show(data.server.adminPass,
data.server.id);
this.password_view.show(data.server.adminPass,
data.server.id,
this.get_params().image);
var self = this;
window.setTimeout(function() {
self.submiting = false;
......
......@@ -331,11 +331,20 @@
<input class="password reset" readonly id="new-machine-password"/>
<div class="clipboard new-vm-password-copy"></div>
</div>
<div class="password-cont disabled clearfix hidden">
<div class="password-label">Not setting a new password for this machine.</div>
</div>
<div class="description subinfo">
<p>{% blocktrans %}You will need this later to connect to your machine.{% endblocktrans %}</p>
<p class="important">{% blocktrans %}After closing this window you will <em>NOT</em> be able to retrieve it again
{% endblocktrans %}</p>
</div>
<div class="description subinfo disabled hidden">
<p class="important">{% blocktrans %}This Image/Snapshot already contains valid login credentials,
{% endblocktrans %}</p>
<p class="important">{% blocktrans %}which have been left unchanged.
{% endblocktrans %}</p>
</div>
<div class="form-action show-machine">{% trans "OK" %}</div>
</div>
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