mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Merge branch 'master' of git.opennebula.org:one
This commit is contained in:
commit
72892faa1f
src
acct
cloud/occi
sunstone/public/js/plugins
@ -154,7 +154,7 @@ module OneWatchClient
|
||||
if filter[:uid]
|
||||
filter[:uid]==0 ? (hosts = pool) : (return nil)
|
||||
elsif filter[:gid]
|
||||
filter[:uid]==0 ? (hosts = pool) : (return nil)
|
||||
filter[:gid]==0 ? (hosts = pool) : (return nil)
|
||||
else
|
||||
hosts = pool
|
||||
end
|
||||
|
@ -54,7 +54,7 @@ setup()
|
||||
|
||||
start()
|
||||
{
|
||||
if [ ! -x "$OCCI_SERVER" ]; then
|
||||
if [ ! -f "$OCCI_SERVER" ]; then
|
||||
echo "Cannot find $OCCI_SERVER."
|
||||
exit 1
|
||||
fi
|
||||
|
@ -63,6 +63,7 @@ var vms_tab_content =
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
|
||||
<th>'+tr("ID")+'</th>\
|
||||
<th>'+tr("Name")+' / '+tr("State")+'</th>\
|
||||
<th>'+tr("IP")+'</th>\
|
||||
</tr>\
|
||||
</thead>\
|
||||
<tbody id="tbodyvmachines">\
|
||||
@ -397,6 +398,20 @@ function str_start_time(vm){
|
||||
return pretty_time(vm.STIME);
|
||||
}
|
||||
|
||||
function ip_str(vm){
|
||||
var nic = vm.NIC;
|
||||
var ip = '--';
|
||||
if ($.isArray(nic)) {
|
||||
ip = '';
|
||||
$.each(nic, function(index,value){
|
||||
ip += value.IP+'<br />';
|
||||
});
|
||||
} else if (nic && nic.IP) {
|
||||
ip = nic.IP;
|
||||
};
|
||||
return ip;
|
||||
};
|
||||
|
||||
// Returns an array formed by the information contained in the vm_json
|
||||
// and ready to be introduced in a dataTable
|
||||
function vMachineElementArray(vm_json){
|
||||
@ -416,7 +431,8 @@ function vMachineElementArray(vm_json){
|
||||
return [
|
||||
'<input class="check_item" type="checkbox" id="vm_'+id+'" name="selected_items" value="'+id+'"/>',
|
||||
id,
|
||||
VMStateBulletStr(vm_json) + name
|
||||
VMStateBulletStr(vm_json) + name,
|
||||
ip_str(vm)
|
||||
];
|
||||
}
|
||||
|
||||
@ -454,7 +470,7 @@ function addVMachineElement(request,vm_json){
|
||||
var id = vm_json.COMPUTE.ID;
|
||||
var element = vMachineElementArray(vm_json);
|
||||
addElement(element,dataTable_vMachines);
|
||||
Sunstone.runAction("VM.showstate",id);
|
||||
Sunstone.runAction("VM.show",id);
|
||||
}
|
||||
|
||||
|
||||
@ -997,6 +1013,7 @@ function setupVNC(){
|
||||
modal:true,
|
||||
height:500,
|
||||
resizable:true,
|
||||
closeOnEscape: false
|
||||
});
|
||||
|
||||
$('#sendCtrlAltDelButton',dialog).click(function(){
|
||||
@ -1097,6 +1114,7 @@ $(document).ready(function(){
|
||||
{ "bSortable": false, "aTargets": ["check"] },
|
||||
{ "sWidth": "60px", "aTargets": [0] },
|
||||
{ "sWidth": "35px", "aTargets": [1] },
|
||||
{ "sWidth": "110px", "aTargets": [3] },
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
@ -1107,7 +1125,7 @@ $(document).ready(function(){
|
||||
dataTable_vMachines.fnClearTable();
|
||||
addElement([
|
||||
spinner,
|
||||
'',''],dataTable_vMachines);
|
||||
'','',''],dataTable_vMachines);
|
||||
Sunstone.runAction("VM.list");
|
||||
|
||||
//setupCreateVMDialog();
|
||||
|
@ -36,6 +36,7 @@ var images_tab_content = '\
|
||||
<th>'+tr("Persistent")+'</th>\
|
||||
<th>'+tr("Status")+'</th>\
|
||||
<th>'+tr("#VMS")+'</th>\
|
||||
<th>'+tr("Target")+'</th>\
|
||||
</tr>\
|
||||
</thead>\
|
||||
<tbody id="tbodyimages">\
|
||||
@ -108,6 +109,11 @@ var create_image_tmpl =
|
||||
<input type="text" name="img_driver" id="img_driver" />\
|
||||
<div class="tip">'+tr("Specific image mapping driver. KVM: raw, qcow2. XEN: tap:aio, file:")+'</div>\
|
||||
</div>\
|
||||
<div class="img_param">\
|
||||
<label for="img_target">'+tr("Target")+':</label>\
|
||||
<input type="text" name="img_target" id="img_target" />\
|
||||
<div class="tip">'+tr("Target on which the image will be mounted at. For example: hda, sdb...")+'</div>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="" id="src_path_select">\
|
||||
@ -544,7 +550,8 @@ function imageElementArray(image_json){
|
||||
parseInt(image.PERSISTENT) ? '<input class="action_cb" id="cb_persistent_image" type="checkbox" elem_id="'+image.ID+'" checked="checked"/>'
|
||||
: '<input class="action_cb" id="cb_persistent_image" type="checkbox" elem_id="'+image.ID+'"/>',
|
||||
OpenNebula.Helper.resource_state("image",image.STATE),
|
||||
image.RUNNING_VMS
|
||||
image.RUNNING_VMS,
|
||||
image.TEMPLATE.TARGET ? image.TEMPLATE.TARGET : '--'
|
||||
];
|
||||
}
|
||||
|
||||
@ -899,6 +906,10 @@ function setupCreateImageDialog(){
|
||||
if (driver.length)
|
||||
img_json["DRIVER"] = driver;
|
||||
|
||||
var target = $('#img_target',this).val();
|
||||
if (target)
|
||||
img_json["TARGET"] = target;
|
||||
|
||||
switch ($('#src_path_select input:checked',this).val()){
|
||||
case "path":
|
||||
path = $('#img_path',this).val();
|
||||
@ -1144,10 +1155,10 @@ $(document).ready(function(){
|
||||
"aoColumnDefs": [
|
||||
{ "bSortable": false, "aTargets": ["check"] },
|
||||
{ "sWidth": "60px", "aTargets": [0,2,3,9,10] },
|
||||
{ "sWidth": "35px", "aTargets": [1,6,11] },
|
||||
{ "sWidth": "35px", "aTargets": [1,6,11,12] },
|
||||
{ "sWidth": "100px", "aTargets": [5,7] },
|
||||
{ "sWidth": "150px", "aTargets": [8] },
|
||||
{ "bVisible": false, "aTargets": [6,8]}
|
||||
{ "bVisible": false, "aTargets": [6,8,12]}
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
@ -1158,7 +1169,7 @@ $(document).ready(function(){
|
||||
dataTable_images.fnClearTable();
|
||||
addElement([
|
||||
spinner,
|
||||
'','','','','','','','','','',''],dataTable_images);
|
||||
'','','','','','','','','','','',''],dataTable_images);
|
||||
Sunstone.runAction("Image.list");
|
||||
|
||||
setupCreateImageDialog();
|
||||
|
@ -208,7 +208,7 @@ var create_template_tmpl = '<div id="template_create_tabs">\
|
||||
</select>\
|
||||
<div class="tip">'+tr("Type of disk device to emulate: ide, scsi")+'</div>\
|
||||
</div>\
|
||||
<div class="vm_param kvm_opt xen_opt vmware">\
|
||||
<div class="vm_param kvm xen vmware">\
|
||||
<label for="TARGET">'+tr("Target")+':</label>\
|
||||
<input type="text" id="TARGET" name="target" />\
|
||||
<div class="tip">'+tr("Device to map image disk. If set, it will overwrite the default device mapping")+'</div>\
|
||||
@ -1405,6 +1405,11 @@ function setupCreateTemplateDialog(){
|
||||
$('#IMAGE', section_disks).change(function(){
|
||||
var uname = getValue($(this).val(),4,2,dataTable_images);
|
||||
$('input#IMAGE_UNAME',section_disks).val(uname);
|
||||
var target = getValue($(this).val(),4,12,dataTable_images);
|
||||
if (target && target != "--")
|
||||
$('input#TARGET',section_disks).val(target);
|
||||
else
|
||||
$('input#TARGET',section_disks).val('');
|
||||
});
|
||||
|
||||
//Depending on adding a disk or a image we need to show/hide
|
||||
@ -1420,16 +1425,12 @@ function setupCreateTemplateDialog(){
|
||||
$('.add_image',section_disks).attr('disabled','disabled');
|
||||
$('.add_disk',section_disks).show();
|
||||
$('.add_disk',section_disks).removeAttr('disabled');
|
||||
$('#TARGET',section_disks).parent().removeClass(opt_class);
|
||||
$('#TARGET',section_disks).parent().addClass(man_class);
|
||||
break;
|
||||
case "image":
|
||||
$('.add_disk',section_disks).hide();
|
||||
$('.add_disk',section_disks).attr('disabled','disabled');
|
||||
$('.add_image',section_disks).show();
|
||||
$('.add_image',section_disks).removeAttr('disabled');
|
||||
$('#TARGET',section_disks).parent().removeClass(man_class);
|
||||
$('#TARGET',section_disks).parent().addClass(opt_class);
|
||||
break;
|
||||
}
|
||||
$('#SIZE',section_disks).parent().hide();
|
||||
|
@ -1300,6 +1300,7 @@ function setupVNC(){
|
||||
modal:true,
|
||||
height:500,
|
||||
resizable:true,
|
||||
closeOnEscape: false
|
||||
});
|
||||
|
||||
$('#sendCtrlAltDelButton',dialog).click(function(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user