1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #3748: Add users dashboard

This commit is contained in:
Daniel Molina 2015-06-12 18:25:54 +02:00
parent 329a6e75b6
commit f74a598dd6
4 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,18 @@
<h5 class="subheader"> <i class="fa fa-fw fa-lg fa-align-left"></i>
{{tr "User Quotas"}}
</h5>
<div class="row totals-info dashboard-widget-footer" id="quotas_tab_user">
<div class="large-12 small-12 columns">
<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>
</div>
</div>

View File

@ -0,0 +1,35 @@
<div class="row totals-info">
<div class="large-3 medium-6 small-12 columns">
<div class="small-12 large-12 columns text-center">
<h2 class="subheader">
<small>{{tr "USERS"}}</small>
<br>
<span class="subheader total_users">-</span>
<small><i class="fa fa-fw fa-user"></i> </small>
</h2>
</div>
<div class="small-12 large-12 columns text-center" style="margin-top: 20px">
<a class="button secondary radius small show_users_tab"> <i class="fa fa-lg fa-list fa-fw"></i></a>
<a class="button secondary radius small show_create_user">
<i class="fa fa-lg fa-plus fa-fw"></i></a>
</div>
</div>
<div class="large-9 medium-6 small-12 columns text-center" id="dashboard_vdc_user_accounting">
<input style="display:none;" value="user" id="acct_group_by"/>
<div class="small-12 large-6 columns">
<h4 class="subheader">
<small>{{tr "CPU hours"}}</small>
</h4>
<div class="large-12 columns centered graph text-center" id="acct_cpu_graph" style="height: 100px;">{{> ./empty-graph}}</div>
</div>
<div class="small-12 large-6 columns">
<h4 class="subheader">
<small>{{tr "Memory GB hours"}}</small>
</h4>
<div class="large-12 columns centered graph text-center" id="acct_mem_graph" style="height: 100px;">{{> ./empty-graph}}</div>
</div>
</div>
</div>
<div class="row dashboard-widget-footer">
<div class="small-3 large-3 columns text-center"></div>
</div>

View File

@ -59,12 +59,16 @@ define(function(require) {
"you_selected_multiple": Locale.tr("You selected the following groups:")
};
this.totalGroups = 0;
TabDataTable.call(this);
}
Table.prototype = Object.create(TabDataTable.prototype);
Table.prototype.constructor = Table;
Table.prototype.elementArray = _elementArray;
Table.prototype.preUpdateView = _preUpdateView;
Table.prototype.postUpdateView = _postUpdateView;
return Table;
@ -122,4 +126,12 @@ define(function(require) {
cpu
];
}
function _preUpdateView() {
this.totalGroups = 0;
}
function _postUpdateView() {
$(".total_groups").text(this.totalGroups);
}
});

View File

@ -63,12 +63,16 @@ define(function(require) {
"you_selected_multiple": Locale.tr("You selected the following users:")
};
this.totalUsers = 0;
TabDataTable.call(this);
}
Table.prototype = Object.create(TabDataTable.prototype);
Table.prototype.constructor = Table;
Table.prototype.elementArray = _elementArray;
Table.prototype.preUpdateView = _preUpdateView;
Table.prototype.postUpdateView = _postUpdateView;
return Table;
@ -77,6 +81,8 @@ define(function(require) {
*/
function _elementArray(element_json) {
this.totalUsers++;
var element = element_json[XML_ROOT];
var vms = '<span class="progress-text right" style="font-size: 12px">-</span>';
@ -122,4 +128,12 @@ define(function(require) {
hidden_template
];
}
function _preUpdateView() {
this.totalUsers = 0;
}
function _postUpdateView() {
$(".total_users").text(this.totalUsers);
}
});