Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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