1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-26 06:50:09 +03:00

feature #2746: Use same header and size for resource attributes

This commit is contained in:
Daniel Molina 2014-03-11 13:56:54 +01:00
parent 15cb7aaa85
commit ba91bf7dfc
17 changed files with 334 additions and 256 deletions

File diff suppressed because one or more lines are too long

View File

@ -1236,7 +1236,7 @@ function updateClusterInfo(request,cluster){
title : tr("Info"),
icon: "fa-info-circle",
content :
'<form class="custom"><div class="">\
'<form class="custom"><div class="row">\
<div class="large-6 columns">\
<table id="info_cluster_table" class="dataTable extended_table">\
<thead>\
@ -1257,21 +1257,26 @@ function updateClusterInfo(request,cluster){
</tr>\
</tbody>\
</table>\
</div>\
<div class="large-6 columns">'
+ insert_extended_template_table(cluster_template,
</div>\
<div class="large-6 columns">' +
'</div>\
</div>\
<div class="row">\
<div class="large-9 columns">'+
insert_extended_template_table(cluster_template,
"Cluster",
cluster_info.ID,
"Tags") +
'</div>\
</div></form>'
tr("Attributes")) +
'</div>\
</div>\
</form>'
}
var cluster_host_tab = {
title: tr("Hosts"),
icon: "fa-hdd-o",
content : '<div class="columns twelve">\
<div id="datatable_cluster_hosts_info_div">\
content : '<div class="row">\
<div id="datatable_cluster_hosts_info_div" class="large-12 columns">\
<table id="datatable_cluster_hosts_info_panel" class="table twelve">' +
host_datatable_table_tmpl +
'</table>\
@ -1282,8 +1287,8 @@ function updateClusterInfo(request,cluster){
var cluster_vnet_tab = {
title: tr("VNets"),
icon: "fa-globe",
content : '<div class="columns twelve">\
<div id="datatable_cluster_vnets_info_div">\
content : '<div class="row">\
<div id="datatable_cluster_vnets_info_div" class="large-12 columns">\
<table id="datatable_cluster_vnets_info_panel" class="table twelve">' +
vnet_datatable_table_tmpl +
'</table>\
@ -1294,8 +1299,8 @@ function updateClusterInfo(request,cluster){
var cluster_datastore_tab = {
title: tr("Datastores"),
icon: "fa-folder-open",
content : '<div class="columns twelve">\
<div id="datatable_cluster_datastores_info_div">\
content : '<div class="row">\
<div id="datatable_cluster_datastores_info_div" class="large-12 columns">\
<table id="datatable_cluster_datastores_info_panel" class="table twelve">' +
datastore_datatable_table_tmpl +
'</table>\

View File

@ -653,7 +653,7 @@ function updateDatastoreInfo(request,ds){
var is_system_ssh = (info.TEMPLATE.SHARED == "NO")
var info_tab_content = '<div class="">\
var info_tab_content = '<div class="row">\
<div class="large-6 columns">\
<table id="info_datastore_table" class="dataTable extended_table">\
<thead>\
@ -699,12 +699,8 @@ function updateDatastoreInfo(request,ds){
<td class="value_td" colspan="2">'+(is_system_ssh || (typeof info.TEMPLATE.LIMIT_MB == "undefined") ? '-' : humanize_size_from_mb(info.TEMPLATE.LIMIT_MB))+'</td>\
</tr>\
</tbody>\
</table>'
+ insert_extended_template_table(info.TEMPLATE,
"Datastore",
info.ID,
"Configuration Attributes") +
'</div>\
</table>\
</div>\
<div class="large-6 columns">'
+ insert_permissions_table('datastores-tab',
"Datastore",
@ -712,9 +708,17 @@ function updateDatastoreInfo(request,ds){
info.UNAME,
info.GNAME,
info.UID,
info.GID)
info.GID)+
'</div>\
</div>'
</div>\
<div class="row">\
<div class="large-9 columns">' +
insert_extended_template_table(info.TEMPLATE,
"Datastore",
info.ID,
"Attributes") +
'</div>\
</div>';
var info_tab = {
@ -726,7 +730,13 @@ function updateDatastoreInfo(request,ds){
var datastore_info_tab = {
title: tr("Images"),
icon: "fa-upload",
content : '<div id="datatable_datastore_images_info_div" class="large-12 columns"><table id="datatable_datastore_images_info_panel" class="table twelve">' + datastore_image_table_tmpl + '</table></div>'
content : '<div id="datatable_datastore_images_info_div" class="row">\
<div class="large-12 columns">\
<table id="datatable_datastore_images_info_panel" class="table twelve">' +
datastore_image_table_tmpl +
'</table>\
</div>\
</div>'
}
$("#div_edit_rename_link").die();

View File

@ -467,7 +467,7 @@ function updateFileInfo(request,file){
title : tr("Info"),
icon: "fa-info-circle",
content:
'<form class="custom"><div class="">\
'<form class="custom"><div class="row">\
<div class="large-6 columns">\
<table id="info_file_table" class="dataTable extended_table">\
<thead>\
@ -525,21 +525,26 @@ function updateFileInfo(request,file){
<td></td>\
</tr>\
</table>\
</div>\
<div class="large-6 columns">'
+ insert_permissions_table('files-tab',
</div>\
<div class="large-6 columns">' +
insert_permissions_table('files-tab',
"File",
file_info.ID,
file_info.UNAME,
file_info.GNAME,
file_info.UID,
file_info.GID) +
insert_extended_template_table(file_info.TEMPLATE,
'</div>\
</div>\
<div class="row">\
<div class="large-9 columns">'+
insert_extended_template_table(file_info.TEMPLATE,
"File",
file_info.ID,
"Configuration & Tags") +
'</div>\
</div></form>'
"Attributes") +
'</div>\
</div>\
</form>'
}
$("#div_edit_rename_link_files").die();

View File

@ -446,9 +446,9 @@ Sunstone.addInfoPanel("group_info_panel",group_info_panel);
function insert_views(){
views_checks_str = ""
var views_array = config['available_views'];
for (var i = 0; i < views_array.length; i++)
for (var i = 0; i < views_array.length; i++)
{
views_checks_str = views_checks_str +
views_checks_str = views_checks_str +
'<input type="checkbox" id="group_view_'+views_array[i]+'" value="'+views_array[i]+'"/>' +
'<label for="group_view_'+views_array[i]+'">'+views_array[i]+
'</label><br>'
@ -617,29 +617,33 @@ function updateGroupInfo(request,group){
title: tr("Info"),
icon: "fa-info-circle",
content:
'<div class="">\
<div class="large-6 columns">\
<table id="info_img_table" class="dataTable extended_table">\
<thead>\
<tr><th colspan="3">'+tr("Information")+'</th></tr>\
</thead>\
<tr>\
<td class="key_td">'+tr("ID")+'</td>\
<td class="value_td">'+info.ID+'</td>\
<td></td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Name")+'</td>\
<td class="value_td_rename">'+info.NAME+'</td>\
<td></td>\
</tr>\
</table>\
</div>\
<div class="large-6 columns">'
+ insert_extended_template_table(info.TEMPLATE,
'<div class="row">\
<div class="large-6 columns">\
<table id="info_img_table" class="dataTable extended_table">\
<thead>\
<tr><th colspan="3">'+tr("Information")+'</th></tr>\
</thead>\
<tr>\
<td class="key_td">'+tr("ID")+'</td>\
<td class="value_td">'+info.ID+'</td>\
<td></td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Name")+'</td>\
<td class="value_td_rename">'+info.NAME+'</td>\
<td></td>\
</tr>\
</table>\
</div>\
<div class="large-6 columns">' +
'</div>\
</div>\
<div class="row">\
<div class="large-9 columns">'+
insert_extended_template_table(info.TEMPLATE,
"Group",
info.ID,
"Configuration & Tags") +
"Attributes") +
'</div>\
</div>'
}

View File

@ -676,7 +676,7 @@ function updateHostInfo(request,host){
title : tr("Info"),
icon: "fa-info-circle",
content :
'<div class="">\
'<div class="row">\
<div class="large-6 columns">\
<table id="info_host_table" class="dataTable extended_table">\
<thead>\
@ -714,6 +714,15 @@ function updateHostInfo(request,host){
<td class="key_td">'+ tr("VN MAD") +'</td>\
<td class="value_td" colspan="2">'+host_info.VN_MAD+'</td>\
</tr>\
</tbody>\
</table>\
</div>\
<div class="large-6 columns">\
<table id="info_host_table" class="dataTable extended_table">\
<thead>\
<tr><th colspan="3">' + tr("Capacity") + '</th></tr>\
</thead>\
<tbody>\
<tr>\
<td class="key_td">' + tr("Total Mem") + '</td>\
<td class="value_td" colspan="2">'+humanize_size(host_info.HOST_SHARE.MAX_MEM)+'</td>\
@ -743,17 +752,18 @@ function updateHostInfo(request,host){
<td class="value_td" colspan="2">'+host_info.HOST_SHARE.RUNNING_VMS+'</td>\
</tr>\
</tbody>\
</table>\
</table>' +
insert_datastores_capacity_table(host_info.HOST_SHARE) +
'</div>\
</div>\
<div class="row">\
<div class="large-9 columns">'
+ insert_extended_template_table(host_info.TEMPLATE,
"Host",
host_info.ID,
"Attributes") +
'</div>\
</div>\
<div class="large-6 columns">'
+ insert_datastores_capacity_table(host_info.HOST_SHARE) +
'</div>\
<div class="large-6 columns">'
+ insert_extended_template_table(host_info.TEMPLATE,
"Host",
host_info.ID,
"Monitoring Attributes") +
'</div>\
</div>'
}

View File

@ -626,7 +626,7 @@ function updateImageInfo(request,img){
title : tr("Info"),
icon: "fa-info-circle",
content:
'<form class="custom"><div class="">\
'<form class="custom"><div class="row">\
<div class="large-6 columns">\
<table id="info_img_table" class="dataTable extended_table">\
<thead>\
@ -692,21 +692,26 @@ function updateImageInfo(request,img){
<td></td>\
</tr>\
</table>\
</div>\
<div class="large-6 columns">'
+ insert_permissions_table('images-tab',
"Image",
img_info.ID,
img_info.UNAME,
img_info.GNAME,
img_info.UID,
img_info.GID) +
insert_extended_template_table(img_info.TEMPLATE,
</div>\
<div class="large-6 columns">' +
insert_permissions_table('images-tab',
"Image",
img_info.ID,
img_info.UNAME,
img_info.GNAME,
img_info.UID,
img_info.GID) +
'</div>\
</div>\
<div class="row">\
<div class="large-9 columns">'+
insert_extended_template_table(img_info.TEMPLATE,
"Image",
img_info.ID,
"Configuration & Tags") +
'</div>\
</div></form>'
"Attributes") +
'</div>\
</div>\
</form>'
}
$("#div_edit_rename_link").die();
@ -776,7 +781,8 @@ function updateImageInfo(request,img){
var vms_info_tab = {
title: tr("VMs"),
icon: "fa-cloud",
content : '<div id="datatable_image_vms_info_div" class="large-12 columns">\
content : '<div id="datatable_image_vms_info_div" class="row">\
<div class="large-12 columns">\
<table id="datatable_image_vms" class="datatable twelve">\
<thead>\
<tr>\
@ -797,6 +803,7 @@ function updateImageInfo(request,img){
<tbody id="tbodyvmachines">\
</tbody>\
</table>\
</div>\
</div>'
}

View File

@ -248,7 +248,7 @@ function updateMarketInfo(request,app){
title : tr("Info"),
icon: "fa-info-circle",
content :
'<form class="custom"><div class="">\
'<form class="custom"><div class="row">\
<div class="large-6 columns">\
<table id="info_marketplace_table" class="dataTable extended_table">\
<thead>\
@ -304,6 +304,7 @@ function updateMarketInfo(request,app){
</tbody>\
</table>\
</div>\
</div>\
</form>'
};

View File

@ -1151,7 +1151,7 @@ function updateServiceInfo(request,elem){
title : tr("Info"),
icon: "fa-info-circle",
content:
'<div class="">\
'<div class="row">\
<div class="large-6 columns">\
<table id="info_template_table" class="dataTable extended_table">\
<thead>\
@ -1196,6 +1196,7 @@ function updateServiceInfo(request,elem){
title : "Roles",
icon: "fa-wrench",
content : '<form class="custom" id="roles_form" action="">\
<div class="row">\
<div id="role_actions">\
<div class="columns large-8">\
<h4>'+tr("Roles")+'</h4>\
@ -1238,6 +1239,7 @@ function updateServiceInfo(request,elem){
<div id="roles_extended_info" class="columns twelve">\
<span class="radius secondary label">'+tr("Select a role in the table for more information")+'</span>\
</div>\
</div>\
</form>'
};
@ -1246,7 +1248,7 @@ function updateServiceInfo(request,elem){
var logs = elem_info.TEMPLATE.BODY.log
var log_info = ''
if (logs) {
log_info += '<div class="large-12 columns"><div class="log-tab">'
log_info += '<div class="row"><div class="large-12 columns log-tab">'
for (var i = 0; i < logs.length; i++) {
var line = pretty_time(logs[i].timestamp)+' ['+logs[i].severity + '] ' + logs[i].message+ '<br>';
@ -1368,6 +1370,7 @@ function updateServiceInfo(request,elem){
</tr>\
</tbody>\
</table>\
<br>\
</div>";
info_str += '<fieldset>\

View File

@ -596,7 +596,7 @@ function updateServiceTemplateInfo(request,elem){
title : tr("Info"),
icon: "fa-info-circle",
content:
'<div class="">\
'<div class="row">\
<div class="large-6 columns">\
<table id="info_template_table" class="dataTable extended_table">\
<thead>\
@ -637,22 +637,24 @@ function updateServiceTemplateInfo(request,elem){
title : "Roles",
icon: "fa-wrench",
content : '<form class="custom" id="roles_form" action="">\
<div id="roles_info" class="columns twelve">\
<table id="datatable_service_template_roles" class="table twelve">\
<thead>\
<tr>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Cardinality")+'</th>\
<th>'+tr("VM Template")+'</th>\
<th>'+tr("Parents")+'</th>\
</tr>\
</thead>\
<tbody>\
</tbody>\
</table>\
</div>\
<div id="roles_extended_info" class="columns twelve">\
<span class="radius secondary label">'+tr("Select a role in the table for more information")+'</span>\
<div id="roles_info" class="row>\
<div class="large-12 columns>\
<table id="datatable_service_template_roles" class="table twelve">\
<thead>\
<tr>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Cardinality")+'</th>\
<th>'+tr("VM Template")+'</th>\
<th>'+tr("Parents")+'</th>\
</tr>\
</thead>\
<tbody>\
</tbody>\
</table>\
<div id="roles_extended_info" class="columns twelve">\
<span class="radius secondary label">'+tr("Select a role in the table for more information")+'</span>\
</div>\
</div>\
</div>\
</form>'
};

View File

@ -1727,7 +1727,7 @@ function updateTemplateInfo(request,template){
title : tr("Info"),
icon: "fa-info-circle",
content:
'<div class="">\
'<div class="row">\
<div class="large-6 columns">\
<table id="info_template_table" class="dataTable extended_table">\
<thead>\
@ -1766,10 +1766,12 @@ function updateTemplateInfo(request,template){
var template_tab = {
title: tr("Template"),
icon: "fa-file-o",
content: '<div class="large-12 columns">\
<table id="template_template_table" class="info_table transparent_table" style="width:80%">'+
content: '<div class="row">\
<div class="large-12 columns">\
<table id="template_template_table" class="info_table dataTable" style="width:80%">'+
prettyPrintJSON(template_info.TEMPLATE)+'\
</table>\
</div>\
</div>'
};

View File

@ -664,7 +664,7 @@ function updateUserInfo(request,user){
title : tr("Info"),
icon: "fa-info-circle",
content :
'<div class="">\
'<div class="row">\
<div class="large-6 columns">\
<table id="info_user_table" class="dataTable extended_table" cellpadding="0" cellspacing="0" border="0">\
<thead>\
@ -698,10 +698,14 @@ function updateUserInfo(request,user){
</table>\
</div>\
<div class="large-6 columns">' +
'</div>\
</div>\
<div class="row">\
<div class="large-9 columns">'+
insert_extended_template_table(info.TEMPLATE,
"User",
info.ID,
tr("Configuration Attributes")) +
tr("Attributes")) +
'</div>\
</div>'
};

View File

@ -730,7 +730,7 @@ var vm_actions = {
colored_log += line + "<br>";
}
$('#vm_log_tab').html('<div class="large-12 columns"><div class="log-tab">'+colored_log+'</div></div>')
$('#vm_log_tab').html('<div class=""><div class="large-12 columns log-tab">'+colored_log+'</div></div>')
},
error: function(request,error_json){
$("#vm_log pre").html('');
@ -1379,62 +1379,7 @@ function generatePlacementTable(vm){
var ds_rank_str = vm.USER_TEMPLATE.SCHED_DS_RANK ? vm.USER_TEMPLATE.SCHED_DS_RANK : "-";
var html = '<div class=""><div class="large-6 columns">\
<table id="vm_placement_table" class="extended_table dataTable">\
<thead>\
<tr>\
<th colspan="2" align="center">'+tr("Placement - Host")+'</th>\
</tr>\
</thead>\
<tbody>\
<tr>\
<td>'+ tr("Requirements")+'</td>\
<td>'+requirements_str+'</td>\
</tr>\
<tr>\
<td>'+ tr("Rank")+'</td>\
<td>'+rank_str+'</td>\
</tr>\
</tbody>\
</table>\
</div><div class="large-6 columns">\
<table id="vm_ds_placement_table" class="extended_table dataTable">\
<thead>\
<tr>\
<th colspan="2" align="center">'+tr("Placement - Datastore")+'</th>\
</tr>\
</thead>\
<tbody>\
<tr>\
<td>'+ tr("DS Requirements")+'</td>\
<td>'+ds_requirements_str+'</td>\
</tr>\
<tr>\
<td>'+ tr("DS Rank")+'</td>\
<td>'+ds_rank_str+'</td>\
</tr>\
</tbody>\
</table>\
</div></div>';
if (vm.USER_TEMPLATE.SCHED_MESSAGE) {
html += '<div class="large-12 columns">\
<table id="vm_ds_placement_table" class="extended_table dataTable">\
<thead>\
<tr>\
<th align="center">'+tr("Sched Message")+'</th>\
</tr>\
</thead>\
<tbody>\
<tr>\
<td>'+ vm.USER_TEMPLATE.SCHED_MESSAGE +'</td>\
</tr>\
</tbody>\
</table>\
</div>';
}
html += '<div class="large-12 columns">\
var html = '<div class="row"><div class="large-12 columns">\
<table id="vm_history_table" class="extended_table dataTable">\
<thead>\
<tr>\
@ -1501,6 +1446,65 @@ function generatePlacementTable(vm){
</table>\
</div>\
</div>';
if (vm.USER_TEMPLATE.SCHED_MESSAGE) {
html += '<div class="row">\
<div class="large-12 columns">\
<table id="vm_ds_placement_table" class="extended_table dataTable">\
<thead>\
<tr>\
<th align="center">'+tr("Sched Message")+'</th>\
</tr>\
</thead>\
<tbody>\
<tr>\
<td>'+ vm.USER_TEMPLATE.SCHED_MESSAGE +'</td>\
</tr>\
</tbody>\
</table>\
</div>\
</div>';
}
html += '<div class="row">\
<div class="large-9 columns">\
<table id="vm_placement_table" class="extended_table dataTable">\
<thead>\
<tr>\
<th colspan="2" align="center">'+tr("Placement - Host")+'</th>\
</tr>\
</thead>\
<tbody>\
<tr>\
<td>'+ tr("Requirements")+'</td>\
<td>'+requirements_str+'</td>\
</tr>\
<tr>\
<td>'+ tr("Rank")+'</td>\
<td>'+rank_str+'</td>\
</tr>\
</tbody>\
</table>\
<table id="vm_ds_placement_table" class="extended_table dataTable">\
<thead>\
<tr>\
<th colspan="2" align="center">'+tr("Placement - Datastore")+'</th>\
</tr>\
</thead>\
<tbody>\
<tr>\
<td>'+ tr("DS Requirements")+'</td>\
<td>'+ds_requirements_str+'</td>\
</tr>\
<tr>\
<td>'+ tr("DS Rank")+'</td>\
<td>'+ds_rank_str+'</td>\
</tr>\
</tbody>\
</table>\
</div>\
</div>';
return html;
};
@ -1534,7 +1538,7 @@ function updateVMInfo(request,vm){
title : tr("Info"),
icon: "fa-info-circle",
content:
'<div class="">\
'<div class="row">\
<div class="large-6 columns">\
<table id="info_vm_table" class="dataTable extended_table">\
<thead>\
@ -1595,14 +1599,18 @@ function updateVMInfo(request,vm){
vm_info.GNAME,
vm_info.UID,
vm_info.GID) +
insert_extended_template_table(stripped_vm_template,
"VM",
vm_info.ID,
"Tags",
unshown_values) +
'</div>\
</div>'
</div>\
<div class="row">\
<div class="large-9 columns">'+
insert_extended_template_table(stripped_vm_template,
"VM",
vm_info.ID,
"Attributes",
unshown_values) +
'</div>\
</div>'
};
var hotplugging_tab = {
@ -1633,10 +1641,12 @@ function updateVMInfo(request,vm){
title: tr("Template"),
icon: "fa-file-o",
content:
'<div class="large-9 columns">\
'<div class="row">\
<div class="large-9 columns">\
<table id="vm_template_table" class="info_table dataTable">'+
prettyPrintJSON(vm_info.TEMPLATE)+
'</table>\
</div>\
</div>'
};
@ -1718,22 +1728,24 @@ function updateVMDisksInfo(request,vm){
function printActionsTable(vm_info)
{
var str = '<div class="large-12 columns">\
<table id="scheduling_actions_table" class="info_table dataTable extended_table">\
<thead>\
<tr>\
<th>'+tr("ID")+'</th>\
<th>'+tr("ACTION")+'</th>\
<th>'+tr("TIME")+'</th>\
<th>'+tr("DONE")+'</th>\
<th>'+tr("MESSAGE")+'</th>\
<th colspan="">'+tr("Actions")+'</th>\
<th><button id="add_scheduling_action" class="button tiny success right radius" ><i class="fa fa-plus"/></button></th>\
</tr>\
</thead>' +
fromJSONtoActionsTable(
vm_info.USER_TEMPLATE.SCHED_ACTION) +
'</table>\
var str = '<div class="row">\
<div class="large-12 columns">\
<table id="scheduling_actions_table" class="info_table dataTable extended_table">\
<thead>\
<tr>\
<th>'+tr("ID")+'</th>\
<th>'+tr("ACTION")+'</th>\
<th>'+tr("TIME")+'</th>\
<th>'+tr("DONE")+'</th>\
<th>'+tr("MESSAGE")+'</th>\
<th colspan="">'+tr("Actions")+'</th>\
<th><button id="add_scheduling_action" class="button tiny success right radius" >'+tr("Add action")+'</button></th>\
</tr>\
</thead>' +
fromJSONtoActionsTable(
vm_info.USER_TEMPLATE.SCHED_ACTION) +
'</table>\
</div>\
</div>'
// Remove previous listeners
@ -1943,6 +1955,7 @@ function updateActionsInfo(request,vm){
// And a form to attach a new disk to the VM, if it is running.
function printDisks(vm_info){
var html ='<form id="hotplugging_form" vmid="'+vm_info.ID+'" >\
<div class="row">\
<div class="large-12 columns">\
<table class="info_table dataTable extended_table">\
<thead>\
@ -1959,10 +1972,10 @@ function printDisks(vm_info){
// If VM is not RUNNING, then we forget about the attach disk form.
if (vm_info.STATE == "3" && vm_info.LCM_STATE == "3"){
html += '\
<button id="attach_disk" class="button tiny success right radius" ><i class="fa fa-plus"/></button>'
<button id="attach_disk" class="button tiny success right radius" >'+tr("Attach disk")+'</button>'
} else {
html += '\
<button id="attach_disk" class="button tiny success right radius" disabled="disabled"><i class="fa fa-plus"/></button>'
<button id="attach_disk" class="button tiny success right radius" disabled="disabled">'+tr("Attach disk")+'</button>'
}
}
@ -2265,6 +2278,7 @@ function hotpluggingOps(){
function printNics(vm_info){
var html ='<form id="tab_network_form" vmid="'+vm_info.ID+'" >\
<div class="row">\
<div class="large-12 columns">\
<table class="info_table dataTable extended_table">\
<thead>\
@ -2282,10 +2296,10 @@ function printNics(vm_info){
// If VM is not RUNNING, then we forget about the attach nic form.
if (vm_info.STATE == "3" && vm_info.LCM_STATE == "3"){
html += '\
<button id="attach_nic" class="button tiny success right radius" ><i class="fa fa-plus"/></button>'
<button id="attach_nic" class="button tiny success right radius" >'+tr("Attach nic")+'</button>'
} else {
html += '\
<button id="attach_nic" class="button tiny success right radius" disabled="disabled"><i class="fa fa-plus"/></button>'
<button id="attach_nic" class="button tiny success right radius" disabled="disabled">'+tr("Attach nic")+'</button>'
}
}
@ -2351,9 +2365,10 @@ function printNics(vm_info){
</tbody>\
</table>\
</div>\
<div class="">\
</div>\
<div class="row">\
<div class="large-6 columns">\
<div class="row graph_legend">\
<div class="row text-center">\
<h3 class="subheader"><small>'+tr("NET RX")+'</small></h3>\
</div>\
<div class="row">\
@ -2366,7 +2381,7 @@ function printNics(vm_info){
</div>\
</div>\
<div class="large-6 columns">\
<div class="row graph_legend">\
<div class="row text-center">\
<h3 class="subheader"><small>'+tr("NET TX")+'</small></h3>\
</div>\
<div class="row">\
@ -2379,7 +2394,7 @@ function printNics(vm_info){
</div>\
</div>\
<div class="large-6 columns">\
<div class="row graph_legend">\
<div class="row text-center">\
<h3 class="subheader"><small>'+tr("NET DOWNLOAD SPEED")+'</small></h3>\
</div>\
<div class="row">\
@ -2392,7 +2407,7 @@ function printNics(vm_info){
</div>\
</div>\
<div class="large-6 columns">\
<div class="row graph_legend">\
<div class="row text-center">\
<h3 class="subheader"><small>'+tr("NET UPLOAD SPEED")+'</small></h3>\
</div>\
<div class="row">\
@ -2495,8 +2510,8 @@ function printCapacity(vm_info){
<form id="tab_capacity_form" vmid="'+vm_info.ID+'" >'
html += '\
<div class="">\
<div class="large-12 columns">\
<div class="row">\
<div class="large-6 columns">\
<table class="info_table dataTable extended_table">\
<thead>\
<tr>\
@ -2673,6 +2688,7 @@ function updateVMSnapshotsInfo(request,vm){
function printSnapshots(vm_info){
var html ='\
<form id="snapshot_form" vmid="'+vm_info.ID+'" >\
<div class="row">\
<div class="large-12 columns">\
<table class="info_table dataTable extended_table">\
<thead>\
@ -2687,10 +2703,10 @@ function printSnapshots(vm_info){
// If VM is not RUNNING, then we forget about the attach disk form.
if (vm_info.STATE == "3" && vm_info.LCM_STATE == "3"){
html += '\
<button id="take_snapshot" class="button tiny success right radius" ><i class="fa fa-plus"/></button>'
<button id="take_snapshot" class="button tiny success right radius" >'+tr("Take snapshot")+'</button>'
} else {
html += '\
<button id="take_snapshot" class="button tiny success right radius" disabled="disabled"><i class="fa fa-plus"/></button>'
<button id="take_snapshot" class="button tiny success right radius" disabled="disabled">'+tr("Take snapshot")+'</button>'
}
}
@ -2752,6 +2768,7 @@ function printSnapshots(vm_info){
</tbody>\
</table>\
</div>\
</div>\
</form>';
return html;

View File

@ -685,7 +685,7 @@ function updateVNetworksView(request, network_list){
function updateVNetworkInfo(request,vn){
var vn_info = vn.VNET;
var info_tab_content =
'<div class="">\
'<div class="row">\
<div class="large-6 columns">\
<table id="info_vn_table" class="dataTable extended_table">\
<thead>\
@ -709,18 +709,22 @@ function updateVNetworkInfo(request,vn){
'</tr>\
</table>\
</div>\
<div class="large-6 columns">'
+ insert_permissions_table('vnets-tab',
<div class="large-6 columns">' +
insert_permissions_table('vnets-tab',
"Network",
vn_info.ID,
vn_info.UNAME,
vn_info.GNAME,
vn_info.UID,
vn_info.GID)
+ insert_extended_template_table(vn_info.TEMPLATE,
vn_info.GID) +
'</div>\
</div>\
<div class="row">\
<div class="large-9 columns">' +
insert_extended_template_table(vn_info.TEMPLATE,
"Network",
vn_info.ID,
"Configuration Attributes") +
"Attributes") +
'</div>\
</div>';
@ -773,7 +777,7 @@ function updateVNetworkInfo(request,vn){
// It adds the "add lease", "hold lease" fields, and each lease comes with
// hold, release buttons etc. Listeners in setupLeasesOps()
function printLeases(vn_info){
var html ='<form id="leases_form" vnid="'+vn_info.ID+'"><div class="">';
var html ='<form id="leases_form" vnid="'+vn_info.ID+'"><div class="row">';
html +='';
html += '<div class="large-6 columns"><table id="vn_leases_info_table" class="dataTable extended_table">\

View File

@ -322,7 +322,7 @@ function updateZoneInfo(request,zone){
title : tr("Info"),
icon: "fa-info-circle",
content :
'<form class="custom"><div class="">\
'<form class="custom"><div class="row">\
<div class="large-6 columns">\
<table id="info_zone_table" class="dataTable extended_table">\
<thead>\
@ -344,13 +344,18 @@ function updateZoneInfo(request,zone){
</tbody>\
</table>\
</div>\
<div class="large-6 columns">'
+ insert_extended_template_table(zone_template,
"Zone",
zone_info.ID,
"Tags") +
<div class="large-6 columns">\
</div>\
</div>\
<div class="row">\
<div class="large-9 columns">'
+ insert_extended_template_table(zone_template,
"Zone",
zone_info.ID,
"Attributes") +
'</div>\
</div></form>'
</div>\
</form>'
}
$("#div_edit_rename_link").die();

View File

@ -2651,21 +2651,22 @@ function convert_template_to_string(template_json,unshown_values)
// Create the extended template table (with listeners)
function insert_extended_template_table(template_json,resource_type,resource_id,table_name,unshown_values)
{
var str = '<table id="'+resource_type.toLowerCase()+'_template_table" class="dataTable extended_table" cellpadding="0" cellspacing="0" border="0">\
var str = '<table id="'+resource_type.toLowerCase()+'_template_table" class="dataTable configuration_attrs" cellpadding="0" cellspacing="0" border="0">\
<thead>\
<tr>\
<th colspan="4">' +
<th colspan="3">' +
table_name +
'</th>\
</tr>\
</thead>\
<tr>\
<td class="key_td"><input type="text" name="new_key" id="new_key" /></td>\
<td class="value_td"><textarea rows="1" type="text" name="new_value" id="new_value"></textarea></td>\
<td colspan="2" class=""><button type="button" id="button_add_value" class="button small secondary">'+tr("Add")+'</button>\</td>\
</tr>' + fromJSONtoHTMLTable(template_json,
</thead>'+
fromJSONtoHTMLTable(template_json,
resource_type,
resource_id) +
'<tr>\
<td class="key_td"><input type="text" name="new_key" id="new_key" /></td>\
<td class="value_td"><textarea rows="1" type="text" name="new_value" id="new_value"></textarea></td>\
<td class="text-right"><button type="button" id="button_add_value" class="button small secondary">'+tr("Add")+'</button>\</td>\
</tr>' +
'</table>'
// Remove previous listeners
@ -3023,16 +3024,14 @@ function fromJSONtoHTMLRow(field,value,resource_type,resource_id, vectorial_key,
str += '<tr id="'+resource_type.toLowerCase()+'_template_table_'+field+'">\
<td class="key_td key_vectorial_td">'+tr(field)+'</td>\
<td class="value_vectorial_td"></td>\
<td>\
<div id="div_add_vectorial">\
<a id="div_add_vectorial_'+field+'" class="add_vectorial_a ocurrence_'+it+' vectorial_key_'+field+'" href="#"><i class="fa fa-plus-sign"/></a>\
</div>\
</td>\
<td>\
<div id="div_minus">\
<a id="div_minus_'+field+'" class="remove_vectorial_x ocurrence_'+it+'" href="#"><i class="fa fa-pencil-square-o"/><i class="fa fa-trash-o"/></a>\
</div>\
</td>'
<td class="text-right">\
<span id="div_add_vectorial">\
<a id="div_add_vectorial_'+field+'" class="add_vectorial_a ocurrence_'+it+' vectorial_key_'+field+'" href="#"><i class="fa fa-plus-sign"/></a>\
</span>&emsp;\
<span id="div_minus">\
<a id="div_minus_'+field+'" class="remove_vectorial_x ocurrence_'+it+'" href="#"><i class="fa fa-pencil-square-o"/><i class="fa fa-trash-o"/></a>\
</span>\
</td>'
str += fromJSONtoHTMLTable(current_value,
@ -3065,15 +3064,13 @@ function fromJSONtoHTMLRow(field,value,resource_type,resource_id, vectorial_key,
str += '<tr>\
<td class="key_td key_vectorial_td" style="text-align:center">'+tr(field)+'</td>\
<td class="value_td value_vectorial_td value_td_input_'+field+ocurrence_str+' vectorial_key_'+vectorial_key+'" id="value_td_input_'+field+'">'+value+'</td>\
<td>\
<div id="div_edit_vectorial">\
<td class="text-right">\
<span id="div_edit_vectorial">\
<a id="div_edit_'+field+'" class="edit_e'+ocurrence_str+' vectorial_key_'+vectorial_key+'" href="#"><i class="fa fa-pencil-square-o"/></a>\
</div>\
</td>\
<td>\
<div id="div_minus_vectorial">\
</span>&emsp;\
<span id="div_minus_vectorial">\
<a id="div_minus_'+field+'" class="remove_x'+ocurrence_str+' vectorial_key_'+vectorial_key+'" href="#"><i class="fa fa-trash-o"/></a>\
</div>\
</span>\
</td>\
</tr>';
}
@ -3085,16 +3082,14 @@ function fromJSONtoHTMLRow(field,value,resource_type,resource_id, vectorial_key,
str += '<tr id="'+resource_type.toLowerCase()+'_template_table_'+field+'">\
<td class="key_td key_vectorial_td">'+tr(field)+'</td>\
<td class="value_vectorial_td"></td>\
<td>\
<div id="div_add_vectorial">\
<a id="div_add_vectorial_'+field+'" class="add_vectorial_a'+ocurrence_str+' vectorial_key_'+field+'" href="#"><i class="fa fa-plus-sign"/></a>\
</div>\
</td>\
<td>\
<div id="div_minus">\
<a id="div_minus_'+field+'" class="remove_vectorial_x'+ocurrence_str+'" href="#"><i class="fa fa-trash-o"/></a>\
</div>\
</td>'
<td class="text-right">\
<span id="div_add_vectorial">\
<a id="div_add_vectorial_'+field+'" class="add_vectorial_a'+ocurrence_str+' vectorial_key_'+field+'" href="#"><i class="fa fa-plus-sign"/></a>\
</span>&emsp;\
<span id="div_minus">\
<a id="div_minus_'+field+'" class="remove_vectorial_x'+ocurrence_str+'" href="#"><i class="fa fa-trash-o"/></a>\
</span>\
</td>'
str += fromJSONtoHTMLTable(value,
resource_type,
resource_id,
@ -3106,15 +3101,13 @@ function fromJSONtoHTMLRow(field,value,resource_type,resource_id, vectorial_key,
str += '<tr>\
<td class="key_td">'+tr(field)+'</td>\
<td class="value_td" id="value_td_input_'+field+'">'+value+'</td>\
<td>\
<div id="div_edit">\
<td class="text-right">\
<span id="div_edit">\
<a id="div_edit_'+field+'" class="edit_e'+ocurrence_str+'" href="#"><i class="fa fa-pencil-square-o"/></a>\
</div>\
</td>\
<td>\
<div id="div_minus">\
</span>&emsp;\
<span id="div_minus">\
<a id="div_minus_'+field+'" class="remove_x'+ocurrence_str+'" href="#"><i class="fa fa-trash-o"/></a>\
</div>\
</span>\
</td>\
</tr>';
}

View File

@ -256,6 +256,12 @@ select {
color: #777 !important;
}
.configuration_attrs {
.key_td {
width: 30%;
}
}
.reveal-modal {
fieldset {
margin-bottom: 30px !important;