mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-17 10:23:58 +09:00
Add refresh to dashboard, remove quotas-tab from yaml files
This commit is contained in:
1 parent
c5ea1669f2
commit
e8a150bfde
7 files changed
+72
-45
No files matched your search
@@ -2,7 +2,6 @@
|
||||
logo: images/opennebula-sunstone-v4.0.png
|
||||
available_tabs:
|
||||
- dashboard-tab
|
||||
- quotas-tab
|
||||
- system-tab
|
||||
- users-tab
|
||||
- groups-tab
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
small_logo: images/opennebula-sunstone-v4.0-small.png
|
||||
enabled_tabs:
|
||||
dashboard-tab: true
|
||||
quotas-tab: false
|
||||
system-tab: true
|
||||
users-tab: true
|
||||
groups-tab: true
|
||||
@@ -25,6 +24,8 @@ tabs:
|
||||
dashboard-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
Dashboard.refresh: false
|
||||
Sunstone.toggle_top: false
|
||||
widgets_three_per_row:
|
||||
- storage
|
||||
- users
|
||||
@@ -35,10 +36,6 @@ tabs:
|
||||
- hosts
|
||||
widgets_one_footer:
|
||||
# - quotas
|
||||
quotas-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
Quotas.refresh: true
|
||||
system-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
small_logo: images/opennebula-sunstone-v4.0-small.png
|
||||
enabled_tabs:
|
||||
dashboard-tab: true
|
||||
quotas-tab: true
|
||||
system-tab: false
|
||||
users-tab: false
|
||||
groups-tab: false
|
||||
@@ -24,6 +23,8 @@ tabs:
|
||||
dashboard-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
Dashboard.refresh: false
|
||||
Sunstone.toggle_top: false
|
||||
widgets_three_per_row:
|
||||
#- users
|
||||
widgets_two_per_row:
|
||||
@@ -35,10 +36,6 @@ tabs:
|
||||
- vms
|
||||
widgets_one_footer:
|
||||
- quotas
|
||||
quotas-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
Quotas.refresh: true
|
||||
system-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
small_logo: images/opennebula-sunstone-v4.0-small.png
|
||||
enabled_tabs:
|
||||
dashboard-tab: true
|
||||
quotas-tab: true
|
||||
system-tab: true
|
||||
users-tab: true
|
||||
groups-tab: false
|
||||
@@ -24,6 +23,8 @@ tabs:
|
||||
dashboard-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
Dashboard.refresh: false
|
||||
Sunstone.toggle_top: false
|
||||
widgets_three_per_row:
|
||||
- users
|
||||
- network
|
||||
@@ -35,10 +36,6 @@ tabs:
|
||||
- vms
|
||||
widgets_one_footer:
|
||||
- quotas
|
||||
quotas-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
Quotas.refresh: true
|
||||
system-tab:
|
||||
panel_tabs:
|
||||
actions:
|
||||
|
||||
@@ -228,13 +228,58 @@ var widgets = {
|
||||
</fieldset>'
|
||||
}
|
||||
|
||||
var widget_refresh = {
|
||||
"storage" : function(){
|
||||
Sunstone.runAction("Datastore.list");
|
||||
},
|
||||
"users" : function(){
|
||||
Sunstone.runAction("User.list");
|
||||
},
|
||||
"network" : function(){
|
||||
Sunstone.runAction("Network.list");
|
||||
},
|
||||
"hosts" : function(){
|
||||
Sunstone.runAction("Host.list");
|
||||
},
|
||||
"vms" : function(){
|
||||
Sunstone.runAction("VM.list");
|
||||
},
|
||||
"quotas" : refreshDashboardQuotas
|
||||
}
|
||||
|
||||
var dashboard_tab_actions = {
|
||||
"Dashboard.refresh" : {
|
||||
type: "custom",
|
||||
call: refreshDashboard
|
||||
},
|
||||
"dashboard-tab.refresh" : {
|
||||
type: "custom",
|
||||
call: refreshDashboard
|
||||
},
|
||||
}
|
||||
|
||||
var quotas_tab_buttons = {
|
||||
"Dashboard.refresh" : {
|
||||
type: "action",
|
||||
layout: "refresh",
|
||||
alwaysActive: true
|
||||
},
|
||||
"Sunstone.toggle_top" : {
|
||||
type: "custom",
|
||||
layout: "top",
|
||||
alwaysActive: true
|
||||
}
|
||||
}
|
||||
|
||||
var dashboard_tab = {
|
||||
title: '<i class="fa fa-tachometer"></i>'+tr("Dashboard"),
|
||||
buttons: quotas_tab_buttons,
|
||||
content: dashboard_tab_content,
|
||||
showOnTopMenu: false,
|
||||
list_header: '<i class="fa fa-tachometer"></i> '+tr("Dashboard")
|
||||
}
|
||||
|
||||
Sunstone.addActions(dashboard_tab_actions);
|
||||
Sunstone.addMainTab('dashboard-tab',dashboard_tab);
|
||||
|
||||
var $dashboard;
|
||||
@@ -250,9 +295,13 @@ function fillUserQuotasInfo(){
|
||||
});
|
||||
}
|
||||
|
||||
var dashboard_current_gid = "-1";
|
||||
|
||||
function updateUserQuotasInfo(request,user_json) {
|
||||
var info = user_json.USER;
|
||||
|
||||
dashboard_current_gid = user_json.USER.GID;
|
||||
|
||||
var default_user_quotas = Quotas.default_quotas(info.DEFAULT_USER_QUOTAS)
|
||||
var quotas_tab_html = Quotas.vms(info, default_user_quotas);
|
||||
quotas_tab_html += Quotas.cpu(info, default_user_quotas);
|
||||
@@ -304,13 +353,13 @@ function updateGroupQuotasInfo(request,group_json){
|
||||
$("#quotas_tab_group_TabBody", $dashboard).html(quotas_tab_html);
|
||||
}
|
||||
|
||||
function refreshQuotasTab(){
|
||||
function refreshDashboardQuotas(){
|
||||
fillUserQuotasInfo();
|
||||
|
||||
gid = $("#quotas_tab_group_sel .resource_list_select", $dashboard).val();
|
||||
|
||||
if (gid == ""){
|
||||
gid = "-1";
|
||||
if (gid == "" || gid == undefined){
|
||||
gid = dashboard_current_gid;
|
||||
}
|
||||
|
||||
fillGroupQuotasInfo(gid);
|
||||
@@ -318,16 +367,16 @@ function refreshQuotasTab(){
|
||||
insertSelectOptions('div#quotas_tab_group_sel', $dashboard, "Group", gid, false);
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$quotas_tab = $('#quotas-tab', main_tabs_context);
|
||||
function refreshDashboard(){
|
||||
widget_types = ['widgets_three_per_row', 'widgets_two_per_row',
|
||||
'widgets_one_per_row', 'widgets_one_footer'];
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
// All monitoring calls and config are called from the Sunstone plugins.
|
||||
|
||||
function dashboardQuotasHTML(){}
|
||||
$.each(widget_types, function(index, widget_type){
|
||||
$.each(Config.dashboardWidgets(widget_type), function(id, widget){
|
||||
widget_refresh[widget]();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
var tab_name = 'dashboard-tab';
|
||||
@@ -364,19 +413,6 @@ $(document).ready(function(){
|
||||
}
|
||||
});
|
||||
|
||||
fillUserQuotasInfo();
|
||||
|
||||
OpenNebula.Group.show({
|
||||
data : {
|
||||
id: '-1'
|
||||
},
|
||||
success: function(request, group_json){
|
||||
updateGroupQuotasInfo(request, group_json);
|
||||
|
||||
insertSelectOptions('div#quotas_tab_group_sel', $dashboard, "Group", group_json.GROUP.ID, false);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).foundation();
|
||||
}
|
||||
});
|
||||
@@ -611,9 +611,6 @@ function updateUsersView(request,users_list,quotas_list){
|
||||
var user_list_array = [];
|
||||
|
||||
$.each(users_list,function(){
|
||||
//if (this.USER.ID == uid)
|
||||
// dashboardQuotasHTML(this.USER);
|
||||
|
||||
// Inject the VM user quota. This info is returned separately in the
|
||||
// pool info call, but the userElementArray expects it inside the USER,
|
||||
// as it is returned by the individual info call
|
||||
|
||||
@@ -3636,7 +3636,11 @@ function showTab(tabname,highlight_tab){
|
||||
if (res){
|
||||
Sunstone.runAction(res+".list");
|
||||
} else {
|
||||
// $(".fa-refresh", $('#'+activeTab)).click();
|
||||
var action = activeTab+".refresh";
|
||||
|
||||
if(SunstoneCfg["actions"][action]){
|
||||
Sunstone.runAction(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user