Skip to content

Commit

Permalink
M #~: Fix conditions to start vms remote connections
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Betanzos committed Jun 3, 2020
1 parent a4d7beb commit 9319a0a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"));
Expand All @@ -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 {
Expand All @@ -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"));

Expand Down
14 changes: 7 additions & 7 deletions src/sunstone/public/app/tabs/vms-tab/datatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -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"));

Expand All @@ -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"));
}
Expand All @@ -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"))
}
Expand Down

1 comment on commit 9319a0a

@GitCop
Copy link

@GitCop GitCop commented on 9319a0a Jun 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were the following issues with your Pull Request

  • Subject must be equal or less than 50

Guidelines are available at https://github.com/OpenNebula/one/blob/master/share/doc/dev/COMMIT_MESSAGES.md


This message was auto-generated by https://gitcop.com

Please sign in to comment.