Improve quotas layout

This commit is contained in:
Daniel Molina committed 2014-05-22 17:18:47 +02:00
1 parent ead27f8bce
commit 407ae8bb9f
10 files changed
+315 -183

No files matched your search

+1 -1
View File
@@ -1 +1 @@
meta.foundation-version {font-family:"/5.2.2/";}meta.foundation-mq-small {font-family:"/only screen/";width:0em;}meta.foundation-mq-medium {font-family:"/only screen and (min-width:40.063em)/";width:40.063em;}meta.foundation-mq-large {font-family:"/only screen and (min-width:64.063em)/";width:64.063em;}meta.foundation-mq-xlarge {font-family:"/only screen and (min-width:90.063em)/";width:90.063em;}meta.foundation-mq-xxlarge {font-family:"/only screen and (min-width:120.063em)/";width:120.063em;}meta.foundation-data-attribute-namespace {font-family:false;}html ,body {height:100%;}* ,*:before ,*:after {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html ,body {font-size:100%;}body {background:#ffffff;color:#555555;padding:0;margin:0;font-family:"Open Sans",sans-serif;font-weight:normal;font-style:normal;line-height:1;position:relative;cursor:default;}a:hover {cursor:pointer;}img {max-width:100%;height:auto;}img {-ms-interpolation-mode:bicubic;}#map_canvas img ,#map_canvas embed ,#map_canvas object ,.map_canvas img ,.map_canvas embed ,.map_canvas object {max-width:none !important;}.left {float:left !important;}.right {float:right !important;}.clearfix {*zoom:1;}.clearfix:before ,.clearfix:after {content:" ";display:table;}.clearfix:after {clear:both;}.hide {display:none;}.antialiased {-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}img {display:inline-block;vertical-align:middle;}textarea {height:auto;min-height:50px;}select {width:100%;}.row {width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:75rem;*zoom:1;}.row:before ,.row:after {content:" ";display:table;}.row:after {clear:both;}.row.collapse>.column ,.row.collapse>.columns {padding-left:0;padding-right:0;}.row.collapse .row {margin-left:0;margin-right:0;}.row .row {width:auto;margin-left:-0.9375rem;margin-right:-0.9375rem;margin-top:0;margin-bottom:0;max-width:none;*zoom:1;}.row .row:before ,.row .row:after {content:" ";display:table;}.row .row:after {clear:both;}.row .row.collapse {width:auto;margin:0;max-width:none;*zoom:1;}.row .row.collapse:before ,.row .row.collapse:after {content:" ";display:table;}.row .row.collapse:after {clear:both;}.column ,.columns {padding-left:0.9375rem;padding-right:0.9375rem;width:100%;float:left;}@media only screen{.small-push-0 {position:relative;left:0%;right:auto;}.small-pull-0 {position:relative;right:0%;left:auto;}.small-push-1 {position:relative;left:8.33333%;right:auto;}.small-pull-1 {position:relative;right:8.33333%;left:auto;}.small-push-2 {position:relative;left:16.66667%;right:auto;}.small-pull-2 {position:relative;right:16.66667%;left:auto;}.small-push-3 {position:relative;left:25%;right:auto;}.small-pull-3 {position:relative;right:25%;left:auto;}.small-push-4 {position:relative;left:33.33333%;right:auto;}.small-pull-4 {position:relative;right:33.33333%;left:auto;}.small-push-5 {position:relative;left:41.66667%;right:auto;}.small-pull-5 {position:relative;right:41.66667%;left:auto;}.small-push-6 {position:relative;left:50%;right:auto;}.small-pull-6 {position:relative;right:50%;left:auto;}.small-push-7 {position:relative;left:58.33333%;right:auto;}.small-pull-7 {position:relative;right:58.33333%;left:auto;}.small-push-8 {position:relative;left:66.66667%;right:auto;}.small-pull-8 {position:relative;right:66.66667%;left:auto;}.small-push-9 {position:relative;left:75%;right:auto;}.small-pull-9 {position:relative;right:75%;left:auto;}.small-push-10 {position:relative;left:83.33333%;right:auto;}.small-pull-10 {position:relative;right:83.33333%;left:auto;}.small-push-11 {position:relative;left:91.66667%;right:auto;}.small-pull-11 {position:relative;right:91.66667%;left:auto;}.column ,.columns {position:relative;padding-left:0.9375rem;padding-right:0.9375rem;float:left;}.small-1 {width:8.33333%;}.small-2 {width:16.66667%;}.small-3 {width:25%;}.small-4 {width:33.33333%;}.small-5 {width:41.66667%;}.small-6 {width:50%;}.small-7 {width:58.33333%;}.small-8 {width:66.66667%;}.small-9 {width:75%;}.small-10 {width:83.33333%;}.small-11 {width:91.66667%;}.small-12 {width:100%;}[class*="column"]+[class*="column"]:last-child {float:right;}[class*="column"]+[class*="column"].end {float:left;}.small-offset-0 {margin-left:0% !important;}.small-offset-1 {margin-left:8.33333% !important;}.small-offset-2 {margin-left:16.66667% !important;}.small-offset-3 {margin-left:25% !important;}.small-offset-4 {margin-left:33.33333% !important;}.small-offset-5 {margin-left:41.66667% !important;}.small-offset-6 {margin-left:50% !important;}.small-offset-7 {margin-left:58.33333% !important;}.small-offset-8 {margin-left:66.66667% !important;}.small-offset-9 {margin-left:75% !important;}.small-offset-10 {margin-left:83.33333% !important;}.small-offset-11 {margin-left:91.66667% !important;}.small-reset-order ,.small-reset-order {margin-left:0;margin-right:0;left:auto;right:auto;float:left;}.column.small-centered ,.columns.small-centered {margin-left:auto;margin-righLine truncated
meta.foundation-version {font-family:"/5.2.2/";}meta.foundation-mq-small {font-family:"/only screen/";width:0em;}meta.foundation-mq-medium {font-family:"/only screen and (min-width:40.063em)/";width:40.063em;}meta.foundation-mq-large {font-family:"/only screen and (min-width:64.063em)/";width:64.063em;}meta.foundation-mq-xlarge {font-family:"/only screen and (min-width:90.063em)/";width:90.063em;}meta.foundation-mq-xxlarge {font-family:"/only screen and (min-width:120.063em)/";width:120.063em;}meta.foundation-data-attribute-namespace {font-family:false;}html ,body {height:100%;}* ,*:before ,*:after {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html ,body {font-size:100%;}body {background:#ffffff;color:#555555;padding:0;margin:0;font-family:"Open Sans",sans-serif;font-weight:normal;font-style:normal;line-height:1;position:relative;cursor:default;}a:hover {cursor:pointer;}img {max-width:100%;height:auto;}img {-ms-interpolation-mode:bicubic;}#map_canvas img ,#map_canvas embed ,#map_canvas object ,.map_canvas img ,.map_canvas embed ,.map_canvas object {max-width:none !important;}.left {float:left !important;}.right {float:right !important;}.clearfix {*zoom:1;}.clearfix:before ,.clearfix:after {content:" ";display:table;}.clearfix:after {clear:both;}.hide {display:none;}.antialiased {-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}img {display:inline-block;vertical-align:middle;}textarea {height:auto;min-height:50px;}select {width:100%;}.row {width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:75rem;*zoom:1;}.row:before ,.row:after {content:" ";display:table;}.row:after {clear:both;}.row.collapse>.column ,.row.collapse>.columns {padding-left:0;padding-right:0;}.row.collapse .row {margin-left:0;margin-right:0;}.row .row {width:auto;margin-left:-0.9375rem;margin-right:-0.9375rem;margin-top:0;margin-bottom:0;max-width:none;*zoom:1;}.row .row:before ,.row .row:after {content:" ";display:table;}.row .row:after {clear:both;}.row .row.collapse {width:auto;margin:0;max-width:none;*zoom:1;}.row .row.collapse:before ,.row .row.collapse:after {content:" ";display:table;}.row .row.collapse:after {clear:both;}.column ,.columns {padding-left:0.9375rem;padding-right:0.9375rem;width:100%;float:left;}@media only screen{.small-push-0 {position:relative;left:0%;right:auto;}.small-pull-0 {position:relative;right:0%;left:auto;}.small-push-1 {position:relative;left:8.33333%;right:auto;}.small-pull-1 {position:relative;right:8.33333%;left:auto;}.small-push-2 {position:relative;left:16.66667%;right:auto;}.small-pull-2 {position:relative;right:16.66667%;left:auto;}.small-push-3 {position:relative;left:25%;right:auto;}.small-pull-3 {position:relative;right:25%;left:auto;}.small-push-4 {position:relative;left:33.33333%;right:auto;}.small-pull-4 {position:relative;right:33.33333%;left:auto;}.small-push-5 {position:relative;left:41.66667%;right:auto;}.small-pull-5 {position:relative;right:41.66667%;left:auto;}.small-push-6 {position:relative;left:50%;right:auto;}.small-pull-6 {position:relative;right:50%;left:auto;}.small-push-7 {position:relative;left:58.33333%;right:auto;}.small-pull-7 {position:relative;right:58.33333%;left:auto;}.small-push-8 {position:relative;left:66.66667%;right:auto;}.small-pull-8 {position:relative;right:66.66667%;left:auto;}.small-push-9 {position:relative;left:75%;right:auto;}.small-pull-9 {position:relative;right:75%;left:auto;}.small-push-10 {position:relative;left:83.33333%;right:auto;}.small-pull-10 {position:relative;right:83.33333%;left:auto;}.small-push-11 {position:relative;left:91.66667%;right:auto;}.small-pull-11 {position:relative;right:91.66667%;left:auto;}.column ,.columns {position:relative;padding-left:0.9375rem;padding-right:0.9375rem;float:left;}.small-1 {width:8.33333%;}.small-2 {width:16.66667%;}.small-3 {width:25%;}.small-4 {width:33.33333%;}.small-5 {width:41.66667%;}.small-6 {width:50%;}.small-7 {width:58.33333%;}.small-8 {width:66.66667%;}.small-9 {width:75%;}.small-10 {width:83.33333%;}.small-11 {width:91.66667%;}.small-12 {width:100%;}[class*="column"]+[class*="column"]:last-child {float:right;}[class*="column"]+[class*="column"].end {float:left;}.small-offset-0 {margin-left:0% !important;}.small-offset-1 {margin-left:8.33333% !important;}.small-offset-2 {margin-left:16.66667% !important;}.small-offset-3 {margin-left:25% !important;}.small-offset-4 {margin-left:33.33333% !important;}.small-offset-5 {margin-left:41.66667% !important;}.small-offset-6 {margin-left:50% !important;}.small-offset-7 {margin-left:58.33333% !important;}.small-offset-8 {margin-left:66.66667% !important;}.small-offset-9 {margin-left:75% !important;}.small-offset-10 {margin-left:83.33333% !important;}.small-offset-11 {margin-left:91.66667% !important;}.small-reset-order ,.small-reset-order {margin-left:0;margin-right:0;left:auto;right:auto;float:left;}.column.small-centered ,.columns.small-centered {margin-left:auto;margin-righLine truncated
@@ -82,6 +82,7 @@ var widgets = {
<legend class="span-dashboard"><i class="fa fa-fw fa-lg fa-hdd-o"></i> '+tr("Hosts")+'</legend>\
<div class="row totals-info">\
<div class="small-3 large-3 columns centered">\
<br>\
<div class="small-6 large-6 columns text-right">\
<h4 class="subheader">\
<span class="total_hosts subheader"/><br>\
@@ -102,55 +103,21 @@ var widgets = {
<div class="small-9 large-9 columns">\
<div class="row">\
<div class="small-6 large-6 columns">\
<div class="row graph_legend text-center">\
<div class="small-6 large-6 columns">\
<h4 class="subheader"><small>'+tr("CPU")+'</small></h4>\
</div>\
<div id="dashboard_host_allocated_cpu" style="padding: 0px 40px">\
</div>\
<div class="row">\
<h4 class="subheader">\
<small class="subheader small-4 large-4 columns right">'+tr("Allocated")+
'</small>\
</h4>\
<div class="small-8 large-8 columns" id="dash_host_allocated_cpu" >\
</div>\
</div>\
<div class="row">\
<h4 class="subheader">\
<small class="subheader small-4 large-4 columns right">'+tr("Real")+
'</small>\
</h4>\
<div class="small-8 large-8 columns" id="dash_host_real_cpu" >\
</div>\
<br>\
<div id="dashboard_host_real_cpu" style="padding: 0px 40px">\
</div>\
</div>\
<div class="small-6 large-6 columns">\
<div class="row graph_legend text-center">\
<div class="small-6 large-6 columns">\
<h4 class="subheader"><small>'+tr("MEMORY")+'</small></h4>\
</div>\
<div id="dashboard_host_allocated_mem" style="padding: 0px 40px">\
</div>\
<div class="row">\
<h4 class="subheader">\
<small class="subheader small-4 large-4 columns right">'+tr("Allocated")+
'</small>\
</h4>\
<div class="small-8 large-8 columns" id="dash_host_allocated_mem" >\
</div>\
</div>\
<div class="row">\
<h4 class="subheader">\
<small class="subheader small-4 large-4 columns right">'+tr("Real")+
'</small>\
</h4>\
<div class="small-8 large-8 columns" id="dash_host_real_mem" >\
</div>\
<br>\
<div id="dashboard_host_real_mem" style="padding: 0px 40px">\
</div>\
</div>\
</div>\
</div>\
<div class="small-1 large-1 columns">\
</div>\
</div>\
</fieldset>',
"vms" : '<fieldset class="dashboard-panel">\
@@ -176,24 +143,9 @@ var widgets = {
</div>\
<div class="small-9 large-9 columns">\
<div class="row graph_legend text-center">\
<div class="small-6 large-6 columns">\
<h4 class="subheader"><small>'+tr("REAL CAPACITY USAGE")+'</small></h4>\
<div class="small-6 large-6 columns" id="dashboard_cpu_usage" style="padding: 20px 40px">\
</div>\
</div>\
<div class="row">\
<h4 class="subheader">\
<small class="subheader small-2 large-2 columns right">'+tr("CPU")+
'</small>\
</h4>\
<div class="small-10 large-10 columns" id="dash_vm_real_cpu" >\
</div>\
</div>\
<div class="row">\
<h4 class="subheader">\
<small class="subheader small-2 large-2 columns right">'+tr("Memory")+
'</small>\
</h4>\
<div class="small-10 large-10 columns" id="dash_vm_real_mem" >\
<div class="small-6 large-6 columns" id="dashboard_memory_usage" style="padding: 20px 40px">\
</div>\
</div>\
</div>\
+10 -1
View File
@@ -491,6 +491,12 @@ function groupElementArray(group_json){
group.VM_QUOTA.VM.CPU_USED,
group.VM_QUOTA.VM.CPU,
default_group_quotas.VM_QUOTA.VM.CPU);
} else {
var vms = quotaBar(0,0,null);
var memory = quotaBarMB(0,0,null);
var cpu = quotaBarFloat(0,0,null);
}
return [
@@ -653,7 +659,8 @@ function updateGroupInfo(request,group){
var quotas_html;
if (vms_quota || cpu_quota || memory_quota || volatile_size_quota || image_quota || network_quota || datastore_quota) {
quotas_html = '<div class="large-6 columns">' + vms_quota + '</div>';
quotas_html = '<div class="quotas">';
quotas_html += '<div class="large-6 columns">' + vms_quota + '</div>';
quotas_html += '<div class="large-6 columns">' + cpu_quota + '</div>';
quotas_html += '<div class="large-6 columns">' + memory_quota + '</div>';
quotas_html += '<div class="large-6 columns">' + volatile_size_quota+ '</div>';
@@ -662,6 +669,8 @@ function updateGroupInfo(request,group){
quotas_html += '<div class="large-6 columns">' + network_quota + '</div>';
quotas_html += '<br><br>';
quotas_html += '<div class="large-12 columns">' + datastore_quota + '</div>';
quotas_html += '</div>';
} else {
quotas_html = '<div class="row">\
<div class="large-12 columns">\
+42 -11
View File
@@ -536,45 +536,76 @@ function updateHostsView (request,host_list){
updateView(host_list_array,dataTable_hosts);
var ratio_allocated_cpu = 0;
if (max_cpu > 0) {
var ratio_allocated_cpu = Math.round((allocated_cpu / max_cpu) * 100);
info_str = allocated_cpu + ' / ' + max_cpu + ' (' + ratio_allocated_cpu + '%)';
ratio_allocated_cpu = Math.round((allocated_cpu / max_cpu) * 100);
info_str = allocated_cpu + ' / ' + max_cpu ;
} else {
info_str = "";
}
$("#dash_host_allocated_cpu").html(usageBarHtml(allocated_cpu, max_cpu, info_str, true));
//$("#dash_host_allocated_cpu").html(usageBarHtml(allocated_cpu, max_cpu, info_str, true));
$("#dashboard_host_allocated_cpu").html(quotaDashboard(
"dashboard_host_allocated_cpu",
tr("ALLOCATED CPU"),
"30px",
"12px",
{"percentage": ratio_allocated_cpu, "str": info_str })
);
var ratio_real_cpu = 0;
if (max_cpu > 0) {
var ratio_real_cpu = Math.round((real_cpu / max_cpu) * 100);
info_str = real_cpu + ' / ' + max_cpu + ' (' + ratio_real_cpu + '%)';
ratio_real_cpu = Math.round((real_cpu / max_cpu) * 100);
info_str = real_cpu + ' / ' + max_cpu;
} else {
info_str = "";
}
$("#dash_host_real_cpu").html(usageBarHtml(real_cpu, max_cpu, info_str, true));
//$("#dash_host_real_cpu").html(usageBarHtml(real_cpu, max_cpu, info_str, true));
$("#dashboard_host_real_cpu").html(quotaDashboard(
"dashboard_host_real_cpu",
tr("REAL CPU"),
"30px",
"12px",
{"percentage": ratio_real_cpu, "str": info_str })
);
var ratio_allocated_mem = 0;
if (max_mem > 0) {
var ratio_allocated_mem = Math.round((allocated_mem / max_mem) * 100);
info_str = humanize_size(allocated_mem) + ' / ' + humanize_size(max_mem) + ' (' + ratio_allocated_mem + '%)';
ratio_allocated_mem = Math.round((allocated_mem / max_mem) * 100);
info_str = humanize_size(allocated_mem) + ' / ' + humanize_size(max_mem);
} else {
info_str = humanize_size(allocated_mem) + ' / -';
}
$("#dash_host_allocated_mem").html(usageBarHtml(allocated_mem, max_mem, info_str, true));
//$("#dash_host_allocated_mem").html(usageBarHtml(allocated_mem, max_mem, info_str, true));
$("#dashboard_host_allocated_mem").html(quotaDashboard(
"dashboard_host_allocated_mem",
tr("ALLOCATED MEMORY"),
"30px",
"12px",
{"percentage": ratio_allocated_mem, "str": info_str })
);
if (max_mem > 0) {
var ratio_real_mem = Math.round((real_mem / max_mem) * 100);
info_str = humanize_size(real_mem) + ' / ' + humanize_size(max_mem) + ' (' + ratio_real_mem + '%)';
info_str = humanize_size(real_mem) + ' / ' + humanize_size(max_mem);
} else {
info_str = humanize_size(real_mem) + ' / -';
}
$("#dash_host_real_mem").html(usageBarHtml(real_mem, max_mem, info_str, true));
//$("#dash_host_real_mem").html(usageBarHtml(real_mem, max_mem, info_str, true));
$("#dashboard_host_real_mem").html(quotaDashboard(
"dashboard_host_real_mem",
tr("REAL MEMORY"),
"30px",
"12px",
{"percentage": ratio_real_mem, "str": info_str })
);
$(".total_hosts").text(host_list.length);
$(".on_hosts").text(on_hosts);
+182 -64
View File
@@ -568,7 +568,7 @@ var provision_user_info = '<div id="provision_user_info" class="hidden section_c
'</div>'+
'<div class="content" id="provision_info_quotas">'+
'<div class="row">'+
'<div id="provision_user_info_quotas_div" class="large-9 large-centered columns">'+
'<div id="provision_user_info_quotas_div" class="large-9 large-centered columns quotas">'+
'</div>'+
'</div>'+
'</div>'+
@@ -775,7 +775,7 @@ var provision_manage_vdc = '<div id="provision_manage_vdc" class="hidden section
'</div>'+
'<br>'+
'<div class="row">'+
'<div class="large-10 columns large-centered" id="provision_vdc_quotas_div">'+
'<div class="large-10 columns large-centered quotas" id="provision_vdc_quotas_div">'+
'</div>'+
'</div>'+
'</div>'+
@@ -915,9 +915,55 @@ var provision_info_vdc_user = '<div id="provision_info_vdc_user" class="section
'</div>'+
'<br>'+
'<div class="row">'+
'<div id="provision_info_vdc_quotas" class="large-9 large-centered columns">'+
'<div class="large-9 large-centered columns">'+
'<div class="row">'+
'<div class="large-4 columns text-center">'+
'<span id="provision_vdc_user_rvms_percentage" style="font-size:50px"></span>'+'<span style="font-size:20px; color: #999">'+"%"+'</span>'+
'</div>'+
'<div class="large-4 columns text-center">'+
'<span id="provision_vdc_user_cpu_percentage" style="font-size:50px"></span>'+'<span style="font-size:20px; color: #999">'+"%"+'</span>'+
'</div>'+
'<div class="large-4 columns text-center">'+
'<span id="provision_vdc_user_memory_percentage" style="font-size:50px"></span>'+'<span style="font-size:20px; color: #999">'+"%"+'</span>'+
'</div>'+
'</div>'+
'<div class="row">'+
'<div class="large-4 columns text-center">'+
'<div class="progress large radius">'+
' <span id="provision_vdc_user_rvms_meter" class="meter"></span>'+
'</div>'+
'</div>'+
'<div class="large-4 columns text-center">'+
'<div class="progress large radius">'+
' <span id="provision_vdc_user_cpu_meter" class="meter"></span>'+
'</div>'+
'</div>'+
'<div class="large-4 columns text-center">'+
'<div class="progress large radius">'+
' <span id="provision_vdc_user_memory_meter" class="meter"></span>'+
'</div>'+
'</div>'+
'</div>'+
'<div class="row">'+
'<div class="large-4 columns text-center">'+
'<span>'+tr("RUNNING VMS")+'</span>'+
'<br>'+
'<span id="provision_vdc_user_rvms_str" style="color: #999; font-size: 14px;"></span>'+
'</div>'+
'<div class="large-4 columns text-center">'+
'<span>'+tr("CPU")+'</span>'+
'<br>'+
'<span id="provision_vdc_user_cpu_str" style="color: #999; font-size: 14px;"></span>'+
'</div>'+
'<div class="large-4 columns text-center">'+
'<span>'+tr("MEMORY")+'</span>'+
'<br>'+
'<span id="provision_vdc_user_memory_str" style="color: #999; font-size: 14px;"></span>'+
'</div>'+
'</div>'+
'</div>'+
'</div>'+
'<br>'+
'<div class="row">'+
'<div class="large-10 large-centered columns">'+
'<h3 class="subheader text-right">'+
@@ -1483,6 +1529,8 @@ function show_provision_dashboard() {
$(".section_content").hide();
$("#provision_dashboard").fadeIn();
$("#provision_dashboard").html("");
if (Config.provision.dashboard.isEnabled("quotas")) {
$("#provision_dashboard").append(provision_quotas_dashboard);
@@ -1494,10 +1542,6 @@ function show_provision_dashboard() {
success: function(request,user_json){
var user = user_json.USER;
var vms;
var memory;
var cpu;
if (!$.isEmptyObject(user.VM_QUOTA)){
var default_user_quotas = Quotas.default_quotas(user.DEFAULT_USER_QUOTAS);
@@ -2249,33 +2293,64 @@ function update_provision_vdc_user_info(data) {
context.attr("quotas", JSON.stringify(data.VM_QUOTA));
$("#provision_info_vdc_user_name", context).html('<i class="fa fa-fw fa-user"/>&emsp;'+data.NAME);
var default_user_quotas = Quotas.default_quotas(data.DEFAULT_USER_QUOTAS);
var vms_quota = Quotas.vms(data, default_user_quotas);
var cpu_quota = Quotas.cpu(data, default_user_quotas);
var memory_quota = Quotas.memory(data, default_user_quotas);
if (!$.isEmptyObject(data.VM_QUOTA)){
var default_user_quotas = Quotas.default_quotas(data.DEFAULT_USER_QUOTAS);
var quotas_html;
if (vms_quota || cpu_quota || memory_quota) {
quotas_html = '<div class="large-4 columns">' + vms_quota + '</div>';
quotas_html += '<div class="large-4 columns">' + cpu_quota + '</div>';
quotas_html += '<div class="large-4 columns">' + memory_quota + '</div>';
} else {
quotas_html = '<div class="row">'+
'<div class="large-8 large-centered columns">'+
'<div class="text-center">'+
'<span class="fa-stack fa-5x" style="color: #dfdfdf">'+
'<i class="fa fa-cloud fa-stack-2x"></i>'+
'<i class="fa fa-align-left fa-stack-1x fa-inverse"></i>'+
'</span>'+
'<br>'+
'<p style="font-size: 18px; color: #999">'+
tr("There are no quotas defined")+
'</p>'+
'</div>'+
'</div>'+
'</div>';
var vms = quotaBar(
data.VM_QUOTA.VM.VMS_USED,
data.VM_QUOTA.VM.VMS,
default_user_quotas.VM_QUOTA.VM.VMS,
true);
$("#provision_vdc_user_rvms_percentage").html(vms["percentage"]);
$("#provision_vdc_user_rvms_str").html(vms["str"]);
$("#provision_vdc_user_rvms_meter").css("width", vms["percentage"]+"%");
var memory = quotaBarMB(
data.VM_QUOTA.VM.MEMORY_USED,
data.VM_QUOTA.VM.MEMORY,
default_user_quotas.VM_QUOTA.VM.MEMORY,
true);
$("#provision_vdc_user_memory_percentage").html(memory["percentage"]);
$("#provision_vdc_user_memory_str").html(memory["str"]);
$("#provision_vdc_user_memory_meter").css("width", memory["percentage"]+"%");
var cpu = quotaBarFloat(
data.VM_QUOTA.VM.CPU_USED,
data.VM_QUOTA.VM.CPU,
default_user_quotas.VM_QUOTA.VM.CPU,
true);
$("#provision_vdc_user_cpu_percentage").html(cpu["percentage"]);
$("#provision_vdc_user_cpu_str").html(cpu["str"]);
$("#provision_vdc_user_cpu_meter").css("width", cpu["percentage"]+"%");
}
// TODO if no quotas set placeholder
//var quotas_html;
//if (vms_quota || cpu_quota || memory_quota) {
// quotas_html = '<div class="large-4 columns">' + vms_quota + '</div>';
// quotas_html += '<div class="large-4 columns">' + cpu_quota + '</div>';
// quotas_html += '<div class="large-4 columns">' + memory_quota + '</div>';
//} else {
// quotas_html = '<div class="row">'+
// '<div class="large-8 large-centered columns">'+
// '<div class="text-center">'+
// '<span class="fa-stack fa-5x" style="color: #dfdfdf">'+
// '<i class="fa fa-cloud fa-stack-2x"></i>'+
// '<i class="fa fa-align-left fa-stack-1x fa-inverse"></i>'+
// '</span>'+
// '<br>'+
// '<p style="font-size: 18px; color: #999">'+
// tr("There are no quotas defined")+
// '</p>'+
// '</div>'+
// '</div>'+
// '</div>';
//}
accountingGraphs(
$("#provision_info_vdc_user_acct", context),
{ fixed_user: data.ID,
@@ -2283,7 +2358,7 @@ function update_provision_vdc_user_info(data) {
$("#acct_placeholder", context).hide();
$("#provision_info_vdc_quotas").html(quotas_html);
//$("#provision_info_vdc_quotas").html(quotas_html);
}
$(document).ready(function(){
@@ -3421,49 +3496,92 @@ $(document).ready(function(){
var quota = q.QUOTAS;
if (!$.isEmptyObject(quota.VM_QUOTA)){
quotas_html = "";
quotas_html += '<li class="provision-description text-left" style="padding-top: 0px; padding-bottom: 0px;margin-left:15px; margin-top: 5px">'+tr("Running VMs")+'</li>';
quotas_html += '<li class="provision-bullet-item text-left" style="padding: 10px 25px 15px 25px; margin-bottom: 5px">';
quotas_html += quotaBar(
quotas = quotaBarFloat(
quota.VM_QUOTA.VM.VMS_USED,
quota.VM_QUOTA.VM.VMS,
default_user_quotas.VM_QUOTA.VM.VMS);
quotas_html += '</li>';
default_user_quotas.VM_QUOTA.VM.VMS,
true);
quotas_html += '<li class="provision-description text-left" style="padding-top: 0px; padding-bottom: 0px;margin-left:15px">'+tr("CPU")+'</li>';
quotas_html += '<li class="provision-bullet-item text-left" style="padding: 10px 25px 15px 25px; margin-bottom: 10px">';
quotas_html += quotaBarFloat(
quotas_html = "";
quotas_html += '<li class="provision-bullet-item text-left" style="margin-top:5px; margin-left: 5px; margin-right: 5px; font-size: 12px">'+
tr("Running VMs")+
'<span class="right">'+quotas.str+"</span>"+
'</li>'+
'<li class="provision-bullet-item text-left" style="padding-top: 0px; margin-left: 5px; margin-right: 5px">'+
'<div class="progress small radius">'+
' <span class="meter" style="width: '+quotas.percentage+'%;"></span>'+
'</div>'+
'</li>';
quotas = quotaBarFloat(
quota.VM_QUOTA.VM.CPU_USED,
quota.VM_QUOTA.VM.CPU,
default_user_quotas.VM_QUOTA.VM.CPU);
quotas_html += '</li>';
default_user_quotas.VM_QUOTA.VM.CPU,
true);
quotas_html += '<li class="provision-description text-left" style="padding-top: 0px; padding-bottom: 0px;margin-left:15px">'+tr("Memory")+'</li>';
quotas_html += '<li class="provision-bullet-item text-left" style="padding: 10px 25px 15px 25px; margin-bottom: 5px">';
quotas_html += quotaBarMB(
quotas_html += '<li class="provision-bullet-item text-left" style="margin-left: 5px; margin-right: 5px; font-size: 12px">'+
tr("CPU")+
'<span class="right">'+quotas.str+"</span>"+
'</li>'+
'<li class="provision-bullet-item text-left" style="padding-top: 0px; margin-left: 5px; margin-right: 5px">'+
'<div class="progress small radius">'+
' <span class="meter" style="width: '+quotas.percentage+'%;"></span>'+
'</div>'+
'</li>';
quotas = quotaBarMB(
quota.VM_QUOTA.VM.MEMORY_USED,
quota.VM_QUOTA.VM.MEMORY,
default_user_quotas.VM_QUOTA.VM.MEMORY);
quotas_html += '</li>';
}
}
default_user_quotas.VM_QUOTA.VM.MEMORY,
true);
if (quotas_html == undefined) {
quotas_html = "";
quotas_html += '<li class="provision-description text-left" style="padding-top: 0px; padding-bottom: 0px;margin-left:15px; margin-top: 5px">'+tr("Running VMs")+'</li>';
quotas_html += '<li class="provision-bullet-item text-left" style="padding: 10px 25px 15px 25px; margin-bottom: 5px">';
quotas_html += quotaBar(0,0,null);
quotas_html += '</li>';
quotas_html += '<li class="provision-bullet-item text-left" style="margin-left: 5px; margin-right: 5px; font-size: 12px">'+
tr("Memory")+
'<span class="right">'+quotas.str+"</span>"+
'</li>'+
'<li class="provision-bullet-item text-left" style="padding-top: 0px; margin-left: 5px; margin-right: 5px">'+
'<div class="progress small radius">'+
' <span class="meter" style="width: '+quotas.percentage+'%;"></span>'+
'</div>'+
'</li>';
} else {
quotas = quotaBarFloat(0, 0, null, true);
quotas_html += '<li class="provision-description text-left" style="padding-top: 0px; padding-bottom: 0px;margin-left:15px">'+tr("CPU")+'</li>';
quotas_html += '<li class="provision-bullet-item text-left" style="padding: 10px 25px 15px 25px; margin-bottom: 10px">';
quotas_html += quotaBarFloat(0,0,null);
quotas_html += '</li>';
quotas_html = "";
quotas_html += '<li class="provision-bullet-item text-left" style="margin-top:5px; margin-left: 5px; margin-right: 5px; font-size: 12px">'+
tr("Running VMs")+
'<span class="right">'+quotas.str+"</span>"+
'</li>'+
'<li class="provision-bullet-item text-left" style="padding-top: 0px; margin-left: 5px; margin-right: 5px">'+
'<div class="progress small radius">'+
' <span class="meter" style="width: '+quotas.percentage+'%;"></span>'+
'</div>'+
'</li>';
quotas_html += '<li class="provision-description text-left" style="padding-top: 0px; padding-bottom: 0px;margin-left:15px">'+tr("Memory")+'</li>';
quotas_html += '<li class="provision-bullet-item text-left" style="padding: 10px 25px 15px 25px; margin-bottom: 5px">';
quotas_html += quotaBarMB(0,0,null);
quotas_html += '</li>';
quotas = quotaBarFloat(0, 0, null, true);
quotas_html += '<li class="provision-bullet-item text-left" style="margin-left: 5px; margin-right: 5px; font-size: 12px">'+
tr("CPU")+
'<span class="right">'+quotas.str+"</span>"+
'</li>'+
'<li class="provision-bullet-item text-left" style="padding-top: 0px; margin-left: 5px; margin-right: 5px">'+
'<div class="progress small radius">'+
' <span class="meter" style="width: '+quotas.percentage+'%;"></span>'+
'</div>'+
'</li>';
quotas = quotaBarMB(0, 0, null, true);
quotas_html += '<li class="provision-bullet-item text-left" style="margin-left: 5px; margin-right: 5px; font-size: 12px">'+
tr("Memory")+
'<span class="right">'+quotas.str+"</span>"+
'</li>'+
'<li class="provision-bullet-item text-left" style="padding-top: 0px; margin-left: 5px; margin-right: 5px">'+
'<div class="progress small radius">'+
' <span class="meter" style="width: '+quotas.percentage+'%;"></span>'+
'</div>'+
'</li>';
}
}
+9 -1
View File
@@ -572,6 +572,12 @@ function userElementArray(user_json){
user.VM_QUOTA.VM.CPU_USED,
user.VM_QUOTA.VM.CPU,
default_user_quotas.VM_QUOTA.VM.CPU);
} else {
var vms = quotaBar(0, 0, null);
var memory = quotaBarMB(0, 0, null);
var cpu = quotaBarFloat(0, 0, null);
}
@@ -692,7 +698,8 @@ function updateUserInfo(request,user){
var quotas_html;
if (vms_quota || cpu_quota || memory_quota || volatile_size_quota || image_quota || network_quota || datastore_quota) {
quotas_html = '<div class="large-6 columns">' + vms_quota + '</div>';
quotas_html = '<div class="quotas">';
quotas_html += '<div class="large-6 columns">' + vms_quota + '</div>';
quotas_html += '<div class="large-6 columns">' + cpu_quota + '</div>';
quotas_html += '<div class="large-6 columns">' + memory_quota + '</div>';
quotas_html += '<div class="large-6 columns">' + volatile_size_quota+ '</div>';
@@ -701,6 +708,7 @@ function updateUserInfo(request,user){
quotas_html += '<div class="large-6 columns">' + network_quota + '</div>';
quotas_html += '<br><br>';
quotas_html += '<div class="large-12 columns">' + datastore_quota + '</div>';
quotas_html += '</div>';
} else {
quotas_html = '<div class="row">\
<div class="large-12 columns">\
+20 -4
View File
@@ -1308,15 +1308,31 @@ function updateVMachinesView(request, vmachine_list){
if(total_allocated_cpu != 0){
usage = parseInt(100 * total_real_cpu / total_allocated_cpu);
}
var info_str = usage+'%';
$("#dash_vm_real_cpu").html(usageBarHtml(usage, 100, info_str, true));
//var info_str = usage+'%';
//$("#dash_vm_real_cpu").html(usageBarHtml(usage, 100, info_str, true));
$("#dashboard_cpu_usage").html(quotaDashboard(
"dashboard_cpu_usage",
tr("REAL CPU USAGE"),
"40px",
"14px",
{"percentage": usage, "str": (total_real_cpu + " / " + total_allocated_cpu/100)})
);
usage = 0;
if(total_allocated_mem != 0){
usage = parseInt(100 * total_real_mem / 1024 / total_allocated_mem);
}
info_str = usage+'%';
$("#dash_vm_real_mem").html(usageBarHtml(usage, 100, info_str, true));
//info_str = usage+'%';
//$("#dash_vm_real_mem").html(usageBarHtml(usage, 100, info_str, true));
$("#dashboard_memory_usage").html(quotaDashboard(
"dashboard_memory_usage",
tr("REAL MEMORY USAGE"),
"40px",
"14px",
{"percentage": usage, "str": (humanize_size(Math.floor((total_real_mem))) + " / " + humanize_size(total_allocated_mem * 1024)) })
);
$(".total_vms").text(vmachine_list.length);
$(".active_vms").text(active_vms);
+24 -2
View File
@@ -3520,8 +3520,8 @@ function quotaBarHtml(usage, limit, info_str, not_html){
"str": info_str
}
} else {
html = '<div class="progress-container"><div class="progress secondary round"><span class="meter" style="width: '
+percentage+'%"></span></div><div class="progress-text">'+info_str+'</div></div>';
html = '<span class="progress-text right" style="font-size: 12px">'+info_str+'</span><br><div class="progress radius" style="height: 10px; margin-bottom:0px"><span class="meter" style="width: '
+percentage+'%"></div>';
return html;
}
@@ -3590,6 +3590,28 @@ function quotaFloatLimit(limit, default_limit){
return f_limit
}
function quotaDashboard(html_tag, legend, font_large_size, font_small_size, quota){
return '<div class="row">'+
'<div class="large-12 columns text-center" style="margin-bottom: 5px">'+
'<span id="'+html_tag+'_percentage" style="font-size:'+font_large_size+';">'+quota.percentage+'</span>'+'<span style="font-size:20px; color: #999">'+"%"+'</span>'+
'</div>'+
'</div>'+
'<div class="row">'+
'<div class="large-12 columns text-center">'+
'<div class="progress large radius">'+
' <span id="'+html_tag+'_meter" class="meter" style="width: '+quota.percentage+'%"></span>'+
'</div>'+
'</div>'+
'</div>'+
'<div class="row">'+
'<div class="large-12 columns text-center">'+
'<span>'+legend+'</span>'+
'<br>'+
'<span id="'+html_tag+'_str" style="color: #999; font-size: '+font_small_size+';">'+quota.str+'</span>'+
'</div>'+
'</div>';
}
var activeTab;
var outerLayout, innerLayout;
+2 -2
View File
@@ -839,11 +839,11 @@ $price-item-bottom-border: none;
// $include-html-media-classes: $include-html-classes;
// We use this to se the prog bar height
// $progress-bar-height: rem-calc(25);
$progress-bar-height: rem-calc(10);
// $progress-bar-color: #f6f6f6 ;
// We use these to control the border styles
// $progress-bar-border-color: scale-color(#fff, $lightness: -20%);
$progress-bar-border-color: #efefef;
// $progress-bar-border-size: 1px;
// $progress-bar-border-style: solid;
// $progress-bar-border-radius: $global-radius;
+16 -40
View File
@@ -460,47 +460,24 @@ fieldset {
// Progress bar
.progress-container {
position:relative;
width: 100%;
text-align: center;
background: #FFF;
line-height: 18px;
margin-top: -8px;
}
.progress {
position:absolute;
width: 100%;
height: 19px !important;
border: 1px solid #efefef;
background-color: #f7f7f7;
box-shadow: 0px 1px #dfdfdf;
}
.progress-text {
position:absolute;
width: 100%;
font-size: 12px;
color: #333 !important;
margin-top: 1px;
.quotas {
fieldset {
padding-top: 5px;
padding-bottom: 0px;
}
}
.provision-bullet-item {
.progress {
height: 10px;
background-color: #fff;
}
.progress-text {
margin-top: 4px;
}
}
.meter {
background: #cdebf5 !important;
box-shadow: 0px 1px #dfdfdf;
}
.quota_table {
margin-top: 0px !important;
@@ -510,17 +487,6 @@ fieldset {
width: 100%;
}
#provision_user_info_quotas_div, #dashboard-tab {
.progress {
height: 1.5625rem !important;
}
.progress-text {
margin-top: 4px;
}
}
ul.pagination li a {
background: #f5f5f5;
border: 1px solid #efefef;
@@ -852,3 +818,13 @@ hr {
background: #f7f7f7;
border-radius: 3px;
}
.provision_action_icons {
a {
color: #555;
&:hover {
color: $primary-color;
}
}
}