Commit 15f679ef authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Handle suspended VM's in ui

UI now displays notice for vm's flagged as suspended. User may click on
suspended notice to contact support.
parent bdd3a463
......@@ -4560,6 +4560,7 @@ table.list-machines .wave {
overflow-y: scroll;
overflow-x: hidden;
}
.overlay .overlay-content .description.subinfo, .overlay .extra-info {
margin-bottom:0;
border-bottom: none;
......@@ -4575,6 +4576,11 @@ table.list-machines .wave {
color: #800000;
}
.overlay .overlay-content .description.noborder {
margin-bottom:0;
border:0;
}
.overlay .overlay-content .description {
color: #444;
border-bottom: 1px solid #64a6c4;
......@@ -4583,6 +4589,7 @@ table.list-machines .wave {
font-size: 0.9em;
line-height: 1.6em;
}
.overlay .overlay-content .empty-message {
margin-bottom: 5px;
}
......@@ -6961,3 +6968,34 @@ input.has-errors {
border: none;
color: #800;
}
.single .suspended-notice {
right: 180px;
top: 0px;
padding: 7px;
padding-bottom: 6px;
}
.icon .suspended-notice {
right: 192px;
top: 50px;
}
.suspended-notice {
display: inline-block;
padding: 4px;
background-color: #8f1915;
cursor: pointer;
position: absolute;
color: #fff;
font-size: 0.6em;
display: none;
}
.suspended .suspended-notice {
display: block;
}
.suspended .action-indicator {
display: none !important;
}
......@@ -84,6 +84,33 @@
});
views.SuspendedVMView = views.FeedbackView.extend({
view_id: "suspended_info_view",
css_class: 'overlay-api-info overlay-error non-critical',
overlay_id: "overlay-api-info",
subtitle: "",
title: "VM Suspended",
beforeOpen: function() {
views.SuspendedVMView.__super__.beforeOpen.apply(this);
$(this.$(".description p")[0]).html($("#suspended-vm-overlay .description").html())
},
show: function(vm, data, collect_data, extra_data, cb) {
this.vm = vm;
data = "Suspended VM Details";
data += "\n====================";
data += "\nID: " + vm.id;
data += "\nName: " + vm.get('name');
data += "\nPublic IP: " + vm.get_public_nic().get('ipv4');
data += "\n\n";
views.SuspendedVMView.__super__.show.call(this, data, collect_data, extra_data, cb);
}
});
views.ApiInfoView = views.Overlay.extend({
view_id: "api_info_view",
......@@ -549,6 +576,7 @@
this.create_vm_view = new views.CreateVMView();
this.api_info_view = new views.ApiInfoView();
this.details_view = new views.DetailsView();
this.suspended_view = new views.SuspendedVMView();
//this.notice_view = new views.NoticeView();
},
......
......@@ -208,6 +208,9 @@
// initialize vm specific event handlers
this.__set_vm_handlers(vm);
vm_view.find(".suspended-notice").click(function(){
synnefo.ui.main.suspended_view.show(vm);
})
return vm_view;
},
......@@ -322,6 +325,13 @@
this.action_views[vm.id].update_layout();
}
var el = this.vm(vm);
if (vm.get('suspended')) {
el.addClass("suspended");
} else {
el.removeClass("suspended");
}
try {
this.post_update_vm(vm);
} catch (err) {};
......
......@@ -504,6 +504,12 @@
</div>
</div>
<div id="suspended-vm-overlay" class="overlay-content overlay-info hidden">
<div class="description noborder">
You VM has been suspended, please contact us for more details.
</div>
</div>
<div id="api-info-overlay" class="overlay-content overlay-info hidden">
<div class="description">
<p>{% blocktrans with EXTERNAL_CLIENT_URL as EXTERNAL_CLIENT_URL %}Use the following API key along with the <a
......
......@@ -4,6 +4,7 @@
<div class="machine clearfix" id="machine-template">
<div class="machine-data-cont clearfix">
<div class="suspended-notice">SUSPENDED</div>
<div class="machine-data clearfix">
<div class="machine-info clearfix">
<div class="machine-connect">
......
......@@ -27,6 +27,7 @@
</div>
</div>
<div class="title machine-detail name">My Desktop</div>
<div class="suspended-notice">SUSPENDED</div>
<div class="column2">
<div class="machine-labels">
<div class="machine-label cpus">{% trans "CPUs" %}:</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