1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00

M #~: Fix conditions to start vms remote connections (#4872)

This commit is contained in:
Sergio Betanzos 2020-06-03 10:33:42 +02:00 committed by GitHub
parent 4f0b6fda33
commit 0e9d195e97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -319,7 +319,7 @@ define(function(require) {
$(".spice", context).on("click", function() {
var data = $(this).data();
if (!Spice.lockStatus() && data.id) {
if (!Spice.lockStatus() && data.hasOwnProperty("id")) {
Spice.lock();
Sunstone.runAction("VM.startspice_action", String(data.id));
} else {
@ -333,10 +333,10 @@ define(function(require) {
$(".w_file", context).on("click", function() {
var data = $(this).data();
(data.id && data.hostname && data.type && data.port)
(data.hasOwnProperty("id") && data.hasOwnProperty("hostname") && data.hasOwnProperty("type") && data.hasOwnProperty("port"))
? Sunstone.runAction(
"VM.save_virt_viewer_action",
data.id,
String(data.id),
{ hostname: data.hostname, type: data.type, port: data.port }
)
: Notifier.notifyError(Locale.tr("Data for virt-viewer file isn't correct"));
@ -348,7 +348,7 @@ define(function(require) {
$(".vnc", context).on("click", function() {
var data = $(this).data();
if (!Vnc.lockStatus() && data.id) {
if (!Vnc.lockStatus() && data.hasOwnProperty("id")) {
Vnc.lock();
Sunstone.runAction("VM.startvnc_action", String(data.id));
} else {
@ -362,7 +362,7 @@ define(function(require) {
$(".rdp", context).on("click", function() {
var data = $(this).data();
(data.ip && data.name)
(data.hasOwnProperty("ip") && data.hasOwnProperty("name"))
? Sunstone.runAction("VM.save_rdp", data)
: Notifier.notifyError(Locale.tr("This VM needs a nic with rdp active"));

View File

@ -178,10 +178,10 @@ define(function(require) {
$('#' + this.dataTableId).on("click", '.w_file', function(){
var data = $(this).data();
(data.id && data.hostname && data.type && data.port)
(data.hasOwnProperty("id") && data.hasOwnProperty("hostname") && data.hasOwnProperty("type") && data.hasOwnProperty("port"))
? Sunstone.runAction(
"VM.save_virt_viewer_action",
data.id,
String(data.id),
{ hostname: data.hostname, type: data.type, port: data.port }
)
: Notifier.notifyError(Locale.tr("Data for virt-viewer file isn't correct"));
@ -193,7 +193,7 @@ define(function(require) {
$('#' + this.dataTableId).on("click", '.rdp', function() {
var data = $(this).data();
(data.ip && data.name)
(data.hasOwnProperty("ip") && data.hasOwnProperty("name"))
? Sunstone.runAction("VM.save_rdp", data)
: Notifier.notifyError(Locale.tr("This VM needs a nic with rdp active"));
@ -203,9 +203,9 @@ define(function(require) {
$('#' + this.dataTableId).on("click", '.vnc', function() {
var data = $(this).data();
if (!Vnc.lockStatus()) {
if (!Vnc.lockStatus() && data.hasOwnProperty("id")) {
Vnc.lock();
Sunstone.runAction("VM.startvnc_action", data.id);
Sunstone.runAction("VM.startvnc_action", String(data.id));
} else {
Notifier.notifyError(Locale.tr("VNC Connection in progress"));
}
@ -216,9 +216,9 @@ define(function(require) {
$('#' + this.dataTableId).on("click", '.spice', function() {
var data = $(this).data();
if (!Spice.lockStatus() && data.id) {
if (!Spice.lockStatus() && data.hasOwnProperty("id")) {
Spice.lock();
Sunstone.runAction("VM.startspice_action", data.id);
Sunstone.runAction("VM.startspice_action", String(data.id));
} else {
Notifier.notifyError(Locale.tr("SPICE Connection in progress"))
}