Commit 43df6199 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Create vm view fixes

- Improved handling of empty images/flavor lists
- Improved name field empty error styles
parent 99e0d766
......@@ -5141,6 +5141,11 @@ table.list-machines .wave {
margin-right: 10px;
}
.form-field.error label {
color: #ff0000;
text-decoration: underline;
}
.form-field input {
border: 1px solid #aaa;
width: 200px;
......
......@@ -236,6 +236,8 @@
} else {
this.image_details.hide();
}
this.validate();
},
reset_images: function() {
......@@ -284,6 +286,14 @@
get: function() {
return {'image': this.selected_image};
},
validate: function() {
if (!this.selected_image) {
this.parent.$(".form-action.next").hide();
} else {
this.parent.$(".form-action.next").show();
}
}
});
......@@ -441,8 +451,12 @@
this.current_flavor = flv;
this.trigger("change");
this.update_selected_flavor();
this.update_selected_predefined();
if (this.current_flavor) {
this.update_selected_flavor();
this.update_selected_predefined();
}
this.validate();
},
select_default_flavor: function() {
......@@ -503,6 +517,7 @@
update_selected_flavor: function() {
var flv = this.current_flavor;
if (!flv) { return }
this.$(".option").removeClass("selected");
this.$(".option.cpu.value-" + flv.get("cpu")).addClass("selected");
......@@ -554,6 +569,7 @@
update_layout: function() {
this.update_selected_flavor();
this.update_disabled_flavors();
this.validate();
},
reset: function() {
......@@ -563,6 +579,14 @@
this.update_flavors_data();
},
validate: function() {
if (!this.current_flavor) {
this.parent.$(".form-action.next").hide();
} else {
this.parent.$(".form-action.next").show();
}
},
get: function() {
return {'flavor': this.current_flavor}
}
......@@ -648,6 +672,7 @@
update_layout: function() {
var params = this.parent.get_params();
if (!params.image || !params.flavor) { return }
if (!params.image) { return }
var vm_name = "My {0} server".format(params.image.get("name"));
......
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