mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Signed-off-by: Frederick Borges <fborges@opennebula.io>
This commit is contained in:
parent
f73392fa71
commit
c6da3ca698
@ -35,22 +35,63 @@
|
||||
</li>
|
||||
<li class="provision-bullet-item-buttons">
|
||||
<ul class="menu provision_action_icons without-link">
|
||||
<li>
|
||||
<button href"#" title="{{tr "Open a remote console in a new window"}}" class="button radius provision_vnc_button tip-top">
|
||||
<i class="fas fa-fw fa-lg fa-desktop"/></button>
|
||||
</li>
|
||||
<li>
|
||||
<button href"#" title="{{tr "Download a file with RDP connection"}}" class="button radius provision_rdp_button tip-top">
|
||||
<i class="fab fa-fw fa-lg fa-windows"/></button>
|
||||
</li>
|
||||
<li>
|
||||
<button href"#" title="{{tr "Download a file with virt-viewer connection"}}" class="button radius provision_wfile_button tip-top">
|
||||
<i class="fas fa-fw fa-lg fa-external-link-square-alt"/></button>
|
||||
</li>
|
||||
<li>
|
||||
<button title="{{tr "You have to boot the Virtual Machine first"}}" class="button radius white provision_vnc_button_disabled disabled tip-top" disabled>
|
||||
<i class="fas fa-fw fa-lg fa-desktop"/></button>
|
||||
</li>
|
||||
|
||||
<ul class="dropdown-menu-css">
|
||||
<li style="margin-bottom: 0;">
|
||||
<div>
|
||||
<button href="#" class="button radius provision_remote_button tip-top">
|
||||
<i class="fas fa-fw fa-lg fa-desktop"/>
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
<li class="menu-hide" style="margin: 0; width: max-content;">
|
||||
<ul>
|
||||
<!-- noVNC button -->
|
||||
<li class="display-list margin-tlr-1">
|
||||
<a href="#" class="provision_vnc_button">
|
||||
<div class="remote-logo-dropdown"><img src="images/remote_console/noVNC.png"/></div> VNC
|
||||
</a>
|
||||
</li>
|
||||
<!-- SPICE button -->
|
||||
<li class="display-list margin-tlr-1">
|
||||
<a href="#" class="provision_spice_button">
|
||||
<div class="remote-logo-dropdown"><img src="images/remote_console/spice.png"/></div> SPICE
|
||||
</a>
|
||||
</li>
|
||||
<!-- RDP button -->
|
||||
<li class="display-list margin-tlr-1">
|
||||
<a href="#" class="provision_rdp_button">
|
||||
<div class="remote-logo-dropdown"><img src="images/remote_console/windows.png"/></div> RDP
|
||||
</a>
|
||||
</li>
|
||||
<!-- Virt Viewer File button -->
|
||||
<li class="display-list margin-tlr-1">
|
||||
<a href="#" class="provision_wfile_button">
|
||||
<div class="remote-logo-dropdown"><img src="images/remote_console/virtviewer.png"/></div> Virt Viewer
|
||||
</a>
|
||||
</li>
|
||||
<!-- Guacamole VNC button -->
|
||||
<li class="display-list margin-tlr-1">
|
||||
<a href="#" class="provision_guac_vnc_button">
|
||||
<div class="remote-logo-dropdown"><img src="images/remote_console/guacamole-alt.png"/></div> VNC
|
||||
</a>
|
||||
</li>
|
||||
<!-- Guacamole RDP button -->
|
||||
<li class="display-list margin-tlr-1">
|
||||
<a href="#" class="provision_guac_rdp_button">
|
||||
<div class="remote-logo-dropdown"><img src="images/remote_console/guacamole-alt.png"/></div> RDP
|
||||
</a>
|
||||
</li>
|
||||
<!-- Guacamole SSH button -->
|
||||
<li class="display-list margin-tlr-1">
|
||||
<a href="#" class="provision_guac_ssh_button">
|
||||
<div class="remote-logo-dropdown"><img src="images/remote_console/guacamole-alt.png"/></div> SSH
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{{#isTabActionEnabled "provision-tab" "VM.save_as_template"}}
|
||||
<li>
|
||||
<button href"#" title="{{tr "The disks of the Virtual Machine will be saved in a new Image"}}" class="button radius success provision_save_as_template_confirm_button tip-top">
|
||||
|
@ -328,13 +328,38 @@ define(function(require) {
|
||||
$(".provision_rdp_button", context).toggle(Boolean(OpenNebulaVM.isConnectionSupported(data, 'rdp')));
|
||||
$(".provision_wfile_button", context).toggle(Boolean(OpenNebulaVM.isWFileSupported(data)));
|
||||
|
||||
if (OpenNebulaVM.isVNCSupported(data) ||
|
||||
OpenNebulaVM.isSPICESupported(data)) {
|
||||
$(".provision_vnc_button", context).show();
|
||||
$(".provision_vnc_button_disabled", context).hide();
|
||||
if (OpenNebulaVM.isVNCSupported(data) && !is_fireedge_configured) {
|
||||
$(".provision_vnc_button", context).parent().show();
|
||||
}else{
|
||||
$(".provision_vnc_button", context).hide();
|
||||
$(".provision_vnc_button_disabled", context).show();
|
||||
$(".provision_vnc_button", context).parent().hide();
|
||||
}
|
||||
|
||||
if (OpenNebulaVM.isSPICESupported(data)) {
|
||||
$(".provision_spice_button", context).parent().show();
|
||||
}else{
|
||||
$(".provision_spice_button", context).parent().hide();
|
||||
}
|
||||
|
||||
if (OpenNebulaVM.isVMRCSupported(data)) {
|
||||
$(".provision_vmrc_button", context).parent().show();
|
||||
}else{
|
||||
$(".provision_vmrc_button", context).parent().hide();
|
||||
}
|
||||
|
||||
if (OpenNebulaVM.isWFileSupported(data)) {
|
||||
$(".provision_wfile_button", context).parent().show();
|
||||
}else{
|
||||
$(".provision_wfile_button", context).parent().hide();
|
||||
}
|
||||
|
||||
if (OpenNebulaVM.isVNCSupported(data) && is_fireedge_configured) {
|
||||
$(".provision_guac_vnc_button", context).parent().show();
|
||||
$(".provision_guac_rdp_button", context).parent().show();
|
||||
$(".provision_guac_ssh_button", context).parent().show();
|
||||
}else{
|
||||
$(".provision_guac_vnc_button", context).parent().hide();
|
||||
$(".provision_guac_rdp_button", context).parent().hide();
|
||||
$(".provision_guac_ssh_button", context).parent().hide();
|
||||
}
|
||||
|
||||
$(".provision_info_vm", context).attr("vm_id", data.ID);
|
||||
@ -785,51 +810,50 @@ define(function(require) {
|
||||
});
|
||||
|
||||
context.on("click", ".provision_vnc_button", function(){
|
||||
var button = $(this);
|
||||
button.attr("disabled", "disabled");
|
||||
var vm_id = $(".provision_info_vm", context).attr("vm_id");
|
||||
var vm_data = $(".provision_info_vm", context).data("vm");
|
||||
|
||||
Sunstone.runAction("VM.startvnc_action", vm_data);
|
||||
return false;
|
||||
});
|
||||
|
||||
context.on("click", ".provision_spice_button", function(){
|
||||
var vm_id = $(".provision_info_vm", context).attr("vm_id");
|
||||
var vm_data = $(".provision_info_vm", context).data("vm");
|
||||
|
||||
OpenNebulaVM.vnc({
|
||||
data : {
|
||||
id: vm_id
|
||||
},
|
||||
success: function(request, response){
|
||||
if (OpenNebulaVM.isVNCSupported(vm_data)) {
|
||||
var link = RemoteActions.getLink(response,{
|
||||
port: Config.vncProxyPort,
|
||||
connnection_type: 'vnc',
|
||||
extra_params: [
|
||||
'port=' + Config.vncProxyPort,
|
||||
'encrypt=' + Config.vncWSS,
|
||||
!Config.requestVNCPassword && 'password=' + response.password
|
||||
]
|
||||
});
|
||||
// Open in a new tab the noVNC connection
|
||||
window.open(link);
|
||||
Sunstone.runAction("VM.startspice_action", vm_data);
|
||||
return false;
|
||||
});
|
||||
|
||||
button.removeAttr("disabled");
|
||||
} else if (OpenNebulaVM.isSPICESupported(vm_data)) {
|
||||
var link = RemoteActions.getLink(response, {
|
||||
port: Config.vncProxyPort,
|
||||
connnection_type: 'spice',
|
||||
extra_params: [
|
||||
'password=' + response.password,
|
||||
'encrypt=' + config.user_config.vnc_wss,
|
||||
]
|
||||
});
|
||||
// Open in a new tab the SPICE connection
|
||||
window.open(link);
|
||||
} else {
|
||||
Notifier.notifyError("The remote console is not enabled for this VM");
|
||||
}
|
||||
},
|
||||
error: function(request, response){
|
||||
Notifier.onError(request, response);
|
||||
button.removeAttr("disabled");
|
||||
}
|
||||
});
|
||||
context.on("click", ".provision_vmrc_button", function(){
|
||||
var vm_id = $(".provision_info_vm", context).attr("vm_id");
|
||||
var vm_data = $(".provision_info_vm", context).data("vm");
|
||||
var vm_name = OpenNebulaVM.getName(vm_data);
|
||||
Sunstone.runAction("VM.startvmrc_action", vm_data, vm_name);
|
||||
return false;
|
||||
});
|
||||
|
||||
context.on("click", ".provision_guac_vnc_button", function(){
|
||||
var vm_id = $(".provision_info_vm", context).attr("vm_id");
|
||||
var vm_data = $(".provision_info_vm", context).data("vm");
|
||||
|
||||
Sunstone.runAction("VM.startguac_action", vm_data, 'vnc');
|
||||
return false;
|
||||
});
|
||||
|
||||
context.on("click", ".provision_guac_ssh_button", function(){
|
||||
var vm_id = $(".provision_info_vm", context).attr("vm_id");
|
||||
var vm_data = $(".provision_info_vm", context).data("vm");
|
||||
|
||||
Sunstone.runAction("VM.startguac_action", vm_data, 'ssh');
|
||||
return false;
|
||||
});
|
||||
|
||||
context.on("click", ".provision_guac_rdp_button", function(){
|
||||
var vm_id = $(".provision_info_vm", context).attr("vm_id");
|
||||
var vm_data = $(".provision_info_vm", context).data("vm");
|
||||
|
||||
Sunstone.runAction("VM.startguac_action", vm_data, 'rdp');
|
||||
return false;
|
||||
});
|
||||
|
||||
|
@ -202,49 +202,49 @@ define(function(require) {
|
||||
"VM.startvnc" : {
|
||||
type: "action",
|
||||
id: "vm_vnc_action",
|
||||
text: Locale.tr("VNC"),
|
||||
text: '<div class="remote-logo-dropdown"><img src="images/remote_console/noVNC.png"/></div>' + Locale.tr("VNC"),
|
||||
layout: "vmsremote_buttons",
|
||||
custom_classes: "only-sunstone-info vnc-sunstone-info vnc-button"
|
||||
},
|
||||
"VM.startvmrc" : {
|
||||
type: "action",
|
||||
text: Locale.tr("VMRC"),
|
||||
text: '<div class="remote-logo-dropdown"><img src="images/remote_console/vmrc.png"/></div>' + Locale.tr("VMRC"),
|
||||
layout: "vmsremote_buttons",
|
||||
custom_classes: "only-sunstone-info vnc-sunstone-info vmrc-button"
|
||||
},
|
||||
"VM.startspice" : {
|
||||
type: "action",
|
||||
text: Locale.tr("SPICE"),
|
||||
text: '<div class="remote-logo-dropdown"><img src="images/remote_console/spice.png"/></div>' + Locale.tr("SPICE"),
|
||||
layout: "vmsremote_buttons",
|
||||
custom_classes: "only-sunstone-info spice-sunstone-info"
|
||||
},
|
||||
"VM.save_virt_viewer" : {
|
||||
type: "action",
|
||||
text: Locale.tr("VIRT-VIEWER FILE"),
|
||||
text: '<div class="remote-logo-dropdown"><img src="images/remote_console/virtviewer.png"/></div>' + Locale.tr("Virt Viewer"),
|
||||
layout: "vmsremote_buttons",
|
||||
custom_classes: "only-sunstone-info vv-sunstone-info"
|
||||
},
|
||||
"VM.guac_vnc" : {
|
||||
type: "action",
|
||||
text: Locale.tr("GUAC VNC"),
|
||||
text: '<div class="remote-logo-dropdown"><img src="images/remote_console/guacamole-alt.png"/></div>' + Locale.tr("VNC"),
|
||||
layout: "vmsremote_buttons",
|
||||
custom_classes: "only-sunstone-info vnc-sunstone-info guac-button"
|
||||
},
|
||||
"VM.guac_ssh" : {
|
||||
type: "action",
|
||||
text: Locale.tr("GUAC SSH"),
|
||||
text: '<div class="remote-logo-dropdown"><img src="images/remote_console/guacamole-alt.png"/></div>' + Locale.tr("SSH"),
|
||||
layout: "vmsremote_buttons",
|
||||
custom_classes: "only-sunstone-info ssh-sunstone-info guac-button"
|
||||
},
|
||||
"VM.guac_rdp" : {
|
||||
type: "action",
|
||||
text: Locale.tr("GUAC RDP"),
|
||||
text: '<div class="remote-logo-dropdown"><img src="images/remote_console/guacamole-alt.png"/></div>' + Locale.tr("RDP"),
|
||||
layout: "vmsremote_buttons",
|
||||
custom_classes: "only-sunstone-info rdp-sunstone-info guac-button"
|
||||
},
|
||||
"VM.save_rdp" : {
|
||||
type: "action",
|
||||
text: Locale.tr("RDP Client"),
|
||||
text: '<div class="remote-logo-dropdown"><img src="images/remote_console/windows.png"/></div>' + Locale.tr("RDP Client"),
|
||||
layout: "vmsremote_buttons",
|
||||
custom_classes: "only-sunstone-info rdp-sunstone-info"
|
||||
},
|
||||
|
BIN
src/sunstone/public/images/remote_console/guacamole-alt.png
Normal file
BIN
src/sunstone/public/images/remote_console/guacamole-alt.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
src/sunstone/public/images/remote_console/virtviewer.png
Normal file
BIN
src/sunstone/public/images/remote_console/virtviewer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
BIN
src/sunstone/public/images/remote_console/windows.png
Normal file
BIN
src/sunstone/public/images/remote_console/windows.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
@ -302,6 +302,16 @@ ul.dropdown-menu-css{
|
||||
& > li{
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
& > li.display-list{
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
& > li.margin-tlr-1{
|
||||
margin-top: 1em;
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -324,4 +334,24 @@ ul.dropdown-menu-css{
|
||||
td{
|
||||
word-break: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Styles for remote consoles buttons
|
||||
.remote-logo-dropdown {
|
||||
border-radius: 50%;
|
||||
padding: 0.2em;
|
||||
height: 2em;
|
||||
width: 2em;
|
||||
display: inline-block;
|
||||
margin-right: 0.5em;
|
||||
border-color: black;
|
||||
border-width: thin;
|
||||
border-style: solid;
|
||||
|
||||
img{
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user