mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-28 17:57:22 +03:00
parent
e07d81a285
commit
30a93dde2b
@ -1736,6 +1736,8 @@ SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \
|
||||
src/sunstone/public/images/favicon.ico \
|
||||
src/sunstone/public/images/login_over.png \
|
||||
src/sunstone/public/images/login.png \
|
||||
src/sunstone/public/images/advanced_layout.png \
|
||||
src/sunstone/public/images/cloud_layout.png \
|
||||
src/sunstone/public/images/opennebula-sunstone-big.png \
|
||||
src/sunstone/public/images/opennebula-sunstone-small.png \
|
||||
src/sunstone/public/images/opennebula-sunstone-v4.0.png \
|
||||
|
BIN
src/sunstone/public/images/advanced_layout.png
Normal file
BIN
src/sunstone/public/images/advanced_layout.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 95 KiB |
BIN
src/sunstone/public/images/cloud_layout.png
Normal file
BIN
src/sunstone/public/images/cloud_layout.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 175 KiB |
@ -394,63 +394,131 @@ Sunstone.addActions(group_actions);
|
||||
Sunstone.addMainTab('groups-tab',groups_tab);
|
||||
Sunstone.addInfoPanel("group_info_panel",group_info_panel);
|
||||
|
||||
function generateViewTable(views, dialog_name) {
|
||||
var headers = "<tr><th/>";
|
||||
var row = "<tr><td>"+tr("Users")+"</td>";
|
||||
var admin_row = "<tr><td>"+tr("Admins")+"</td>";
|
||||
var default_row = "<tr><td>"+tr("Users default")+"</td>";
|
||||
var default_admin_row = "<tr><td>"+tr("Admins default")+"</td>";
|
||||
|
||||
$.each(views, function(id, view){
|
||||
headers += "<th>" +
|
||||
view.name +
|
||||
'<span class="tip">'+view.description+'</span>'+
|
||||
"</th>";
|
||||
|
||||
var checked = view.id == 'cloud' ? "checked" : "";
|
||||
|
||||
row += '<td>\
|
||||
<input type="checkbox" \
|
||||
id="group_view_'+dialog_name+'_'+view.id+'" \
|
||||
value="'+view.id+'" '+checked+'/>\
|
||||
</td>';
|
||||
|
||||
checked = view.id == 'groupadmin' ? "checked" : "";
|
||||
|
||||
admin_row += '<td>\
|
||||
<input type="checkbox" \
|
||||
id="group_admin_view_'+dialog_name+'_'+view.id+'" \
|
||||
value="'+view.id+'" '+checked+'/>\
|
||||
</td>';
|
||||
|
||||
default_row += '<td>\
|
||||
<input type="radio" \
|
||||
name="group_default_view_'+dialog_name+'" \
|
||||
id="group_default_view_'+dialog_name+'_'+view.id+'" \
|
||||
value="'+view.id+'"/>\
|
||||
</td>'
|
||||
|
||||
default_admin_row += '<td>\
|
||||
<input type="radio" \
|
||||
name="group_default_admin_view_'+dialog_name+'" \
|
||||
id="group_default_admin_view_'+dialog_name+'_'+view.id+'" \
|
||||
value="'+view.id+'"/>\
|
||||
</td>'
|
||||
});
|
||||
|
||||
headers += "</tr>";
|
||||
row += "</tr>";
|
||||
admin_row += "</tr>";
|
||||
default_row += "</tr>";
|
||||
default_admin_row += "</tr>";
|
||||
|
||||
return '<table class="dataTable extended_table">'+
|
||||
headers+
|
||||
row+
|
||||
default_row+
|
||||
admin_row+
|
||||
default_admin_row+
|
||||
"</table>";
|
||||
}
|
||||
|
||||
function insert_views(dialog_name){
|
||||
var headers = "<tr><th/>";
|
||||
var row = "<tr><td>"+tr("Users")+"</td>";
|
||||
var admin_row = "<tr><td>"+tr("Admins")+"</td>";
|
||||
var default_row = "<tr><td>"+tr("Users default")+"</td>";
|
||||
var default_admin_row = "<tr><td>"+tr("Admins default")+"</td>";
|
||||
var filtered_views = {
|
||||
advanced : [],
|
||||
cloud : [],
|
||||
vcenter : [],
|
||||
other : []
|
||||
}
|
||||
|
||||
var views_array = config['all_views'];
|
||||
|
||||
for (var i = 0; i < views_array.length; i++){
|
||||
headers += "<th>"+views_array[i]+"</th>";
|
||||
|
||||
var checked = views_array[i] == 'cloud' ? "checked" : "";
|
||||
|
||||
row += '<td>\
|
||||
<input type="checkbox" \
|
||||
id="group_view_'+dialog_name+'_'+views_array[i]+'" \
|
||||
value="'+views_array[i]+'" '+checked+'/>\
|
||||
</td>';
|
||||
|
||||
checked = views_array[i] == 'groupadmin' ? "checked" : "";
|
||||
|
||||
admin_row += '<td>\
|
||||
<input type="checkbox" \
|
||||
id="group_admin_view_'+dialog_name+'_'+views_array[i]+'" \
|
||||
value="'+views_array[i]+'" '+checked+'/>\
|
||||
</td>';
|
||||
|
||||
default_row += '<td>\
|
||||
<input type="radio" \
|
||||
name="group_default_view_'+dialog_name+'" \
|
||||
id="group_default_view_'+dialog_name+'_'+views_array[i]+'" \
|
||||
value="'+views_array[i]+'"/>\
|
||||
</td>'
|
||||
|
||||
default_admin_row += '<td>\
|
||||
<input type="radio" \
|
||||
name="group_default_admin_view_'+dialog_name+'" \
|
||||
id="group_default_admin_view_'+dialog_name+'_'+views_array[i]+'" \
|
||||
value="'+views_array[i]+'"/>\
|
||||
</td>'
|
||||
var view_info;
|
||||
$.each(config['all_views'], function(index, view_id) {
|
||||
view_info = views_info[view_id];
|
||||
if (view_info) {
|
||||
switch (view_info.type) {
|
||||
case 'advanced':
|
||||
filtered_views.advanced.push(view_info);
|
||||
break;
|
||||
case 'cloud':
|
||||
filtered_views.cloud.push(view_info);
|
||||
break;
|
||||
case 'vcenter':
|
||||
filtered_views.vcenter.push(view_info);
|
||||
break;
|
||||
default:
|
||||
filtered_views.other.push({
|
||||
id: view_id,
|
||||
name: view_id,
|
||||
description: null,
|
||||
type: "other"
|
||||
});
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
filtered_views.other.push({
|
||||
id: view_id,
|
||||
name: view_id,
|
||||
description: null,
|
||||
type: "other"
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
headers += "</tr>";
|
||||
row += "</tr>";
|
||||
admin_row += "</tr>";
|
||||
default_row += "</tr>";
|
||||
default_admin_row += "</tr>";
|
||||
var str = "";
|
||||
$.each(filtered_views, function(view_type, views){
|
||||
// todo description
|
||||
//
|
||||
|
||||
if (views.length > 0) {
|
||||
str += '<div class="row">'+
|
||||
'<div class="large-12 columns">'+
|
||||
'<h4>'+view_types[view_type].name+'</h4>'+
|
||||
'</div>'+
|
||||
'<div class="large-6 columns">'+
|
||||
'<p>'+view_types[view_type].description+'</p>'+
|
||||
'</div>'+
|
||||
'<div class="large-6 columns">'+
|
||||
(view_types[view_type].preview ?
|
||||
'<img src="images/' + view_types[view_type].preview +'">' :
|
||||
'') +
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
return '<table style="table-layout:fixed">'+
|
||||
headers+
|
||||
row+
|
||||
default_row+
|
||||
headers+
|
||||
admin_row+
|
||||
default_admin_row+
|
||||
"</table>";
|
||||
str += generateViewTable(views, dialog_name);
|
||||
}
|
||||
})
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
function groupElements(){
|
||||
|
@ -8399,3 +8399,71 @@ function enableSPICE(vm){
|
||||
graphics.TYPE.toLowerCase() == "spice" &&
|
||||
$.inArray(state, VNCstates)!=-1);
|
||||
}
|
||||
|
||||
var view_types = {
|
||||
advanced : {
|
||||
name: 'Advanced',
|
||||
description : tr("This layout exposes a complete view of the cloud, allowing administrators and advanced users to have full control of any physical or virtual resource of the cloud."),
|
||||
preview: "advanced_layout.png"
|
||||
},
|
||||
cloud : {
|
||||
name: 'Cloud',
|
||||
description : tr("This layout exposes a simplified version of the cloud where group administrators and cloud end-users will be able to manage any virtual resource of the cloud, without taking care of the physical resources management."),
|
||||
preview: "cloud_layout.png"
|
||||
},
|
||||
vcenter : {
|
||||
name: 'vCenter',
|
||||
description : tr("Set of views to present the valid operation against a vCenter infrastructure"),
|
||||
preview: null
|
||||
},
|
||||
other : {
|
||||
name: 'Other',
|
||||
description : '',
|
||||
preview: null
|
||||
}
|
||||
};
|
||||
|
||||
var views_info = {
|
||||
admin : {
|
||||
id: 'admin',
|
||||
name: "Admin",
|
||||
description: tr("This view provides full control of the cloud"),
|
||||
type: "advanced"
|
||||
},
|
||||
user : {
|
||||
id: 'user',
|
||||
name: "User",
|
||||
description: tr("In this view users will not be able to manage nor retrieve the hosts and clusters of the cloud. They will be able to see Datastores and Virtual Networks in order to use them when creating a new Image or Virtual Machine, but they will not be able to create new ones."),
|
||||
type: "advanced"
|
||||
},
|
||||
groupadmin : {
|
||||
id: 'groupadmin',
|
||||
name: "Group Admin",
|
||||
description: tr("This view provides control of all the resources belonging to a group, but with no access to resources outside that group, that is, restricted to the physical and virtual resources of the group. This view features the ability to create new users within the group as well as set and keep track of user quotas."),
|
||||
type: "cloud"
|
||||
},
|
||||
cloud : {
|
||||
id: 'cloud',
|
||||
name: "Cloud",
|
||||
description: tr("This is a simplified view mainly intended for user that just require a portal where they can provision new virtual machines easily from pre-defined Templates."),
|
||||
type: "cloud"
|
||||
},
|
||||
admin_vcenter : {
|
||||
id: 'admin_vcenter',
|
||||
name: "Admin vCenter",
|
||||
description: tr("View designed to present the valid operations against a vCenter infrastructure to a cloud administrator"),
|
||||
type: "vcenter"
|
||||
},
|
||||
groupadmin_vcenter : {
|
||||
id: 'groupadmin_vcenter',
|
||||
name: "Group Admin vCenter",
|
||||
description: tr("View designed to present the valid operations agaist a vCenter infrastructure to a group administrator"),
|
||||
type: "vcenter"
|
||||
},
|
||||
cloud_vcenter : {
|
||||
id: 'cloud_vcenter',
|
||||
name: "Cloud vCenter",
|
||||
description: tr("View designed to present the valid operations against a vCenter infrastructure to a cloud consumer"),
|
||||
type: "vcenter"
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user