Skip to content

Commit

Permalink
B #3213 Adjust Sunstone banner (#3285)
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Lobo <jlobo@opennebula.systems>
(cherry picked from commit 67816c0)
  • Loading branch information
jloboescalona2 authored and tinova committed Apr 29, 2019
1 parent b1b1501 commit 373eca9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 42 deletions.
83 changes: 42 additions & 41 deletions src/sunstone/public/app/opennebula/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
/* -------------------------------------------------------------------------- */

define(function(require) {
var OpenNebulaAction = require('./action'),
OpenNebulaHelper = require('./helper'),
OpenNebulaError = require('./error');
Locale = require('utils/locale'),
Navigation = require('utils/navigation');
var OpenNebulaAction = require("./action"),
OpenNebulaHelper = require("./helper"),
OpenNebulaError = require("./error");
Locale = require("utils/locale"),
Navigation = require("utils/navigation");

var OpenNebulaCluster = require('./cluster');
var OpenNebulaCluster = require("./cluster");

var RESOURCE = "VM";

Expand Down Expand Up @@ -279,13 +279,13 @@ define(function(require) {
];

var EXTERNAL_IP_ATTRS = [
'GUEST_IP',
'GUEST_IP_ADDRESSES',
'AWS_IP_ADDRESS',
'AWS_PUBLIC_IP_ADDRESS',
'AWS_PRIVATE_IP_ADDRESS',
'AZ_IPADDRESS',
'SL_PRIMARYIPADDRESS'
"GUEST_IP",
"GUEST_IP_ADDRESSES",
"AWS_IP_ADDRESS",
"AWS_PUBLIC_IP_ADDRESS",
"AWS_PRIVATE_IP_ADDRESS",
"AZ_IPADDRESS",
"SL_PRIMARYIPADDRESS"
];

var NIC_IP_ATTRS = [
Expand All @@ -309,17 +309,17 @@ define(function(require) {
];

var EXTERNAL_NETWORK_ATTRIBUTES = [
'GUEST_IP',
'GUEST_IP_ADDRESSES',
'AWS_IP_ADDRESS',
'AWS_DNS_NAME',
'AWS_PUBLIC_IP_ADDRESS',
'AWS_PUBLIC_DNS_NAME',
'AWS_PRIVATE_IP_ADDRESS',
'AWS_PRIVATE_DNS_NAME',
'AWS_SECURITY_GROUPS',
'AZ_IPADDRESS',
'SL_PRIMARYIPADDRESS'
"GUEST_IP",
"GUEST_IP_ADDRESSES",
"AWS_IP_ADDRESS",
"AWS_DNS_NAME",
"AWS_PUBLIC_IP_ADDRESS",
"AWS_PUBLIC_DNS_NAME",
"AWS_PRIVATE_IP_ADDRESS",
"AWS_PRIVATE_DNS_NAME",
"AWS_SECURITY_GROUPS",
"AZ_IPADDRESS",
"SL_PRIMARYIPADDRESS"
];

var MIGRATE_ACTION_STR = [
Expand Down Expand Up @@ -628,7 +628,7 @@ define(function(require) {
var state = element.STATE;
var hostname = "--";
if (state == STATES.ACTIVE || state == STATES.SUSPENDED || state == STATES.POWEROFF) {
var history = retrieveLastHistoryRecord(element)
var history = retrieveLastHistoryRecord(element);
if (history) {
hostname = history.HOSTNAME;
};
Expand All @@ -640,7 +640,7 @@ define(function(require) {
var state = element.STATE;
var hostname = "--";
if (state == STATES.ACTIVE || state == STATES.SUSPENDED || state == STATES.POWEROFF) {
var history = retrieveLastHistoryRecord(element)
var history = retrieveLastHistoryRecord(element);
if (history) {
hostname = Navigation.link(history.HOSTNAME, "hosts-tab", history.HID);
};
Expand All @@ -652,7 +652,7 @@ define(function(require) {
var state = element.STATE;
var cluster = "--";
if (state == STATES.ACTIVE || state == STATES.SUSPENDED || state == STATES.POWEROFF) {
var history = retrieveLastHistoryRecord(element)
var history = retrieveLastHistoryRecord(element);
if (history) {
cluster = history.CID;
};
Expand All @@ -675,7 +675,7 @@ define(function(require) {
"getName": function(id){
return OpenNebulaAction.getName(id, RESOURCE);
}
}
};

function retrieveLastHistoryRecord(element) {
if (element.HISTORY_RECORDS && element.HISTORY_RECORDS.HISTORY) {
Expand All @@ -692,27 +692,27 @@ define(function(require) {

// Return true if the VM has a hybrid section
function isNICGraphsSupported(element) {
var history = retrieveLastHistoryRecord(element)
var history = retrieveLastHistoryRecord(element);
if (history) {
return $.inArray(history.VM_MAD, ['az']) == -1;
return $.inArray(history.VM_MAD, ["az"]) == -1;
} else {
return false;
}
}

function isDiskGraphsSupported(element) {
var history = retrieveLastHistoryRecord(element)
var history = retrieveLastHistoryRecord(element);
if (history) {
return $.inArray(history.VM_MAD, ['ec2','az']) == -1;
return $.inArray(history.VM_MAD, ["ec2","az"]) == -1;
} else {
return false;
}
}

function isNICAttachSupported(element) {
var history = retrieveLastHistoryRecord(element)
var history = retrieveLastHistoryRecord(element);
if (history) {
return $.inArray(history.VM_MAD, ['ec2', 'az']) == -1;
return $.inArray(history.VM_MAD, ["ec2", "az"]) == -1;
} else {
return false;
}
Expand Down Expand Up @@ -752,7 +752,7 @@ define(function(require) {

// Return the IP or several IPs of a VM
function ipsStr(element, divider) {
var divider = divider || "<br>"
var divider = divider || "<br>";
var nic = element.TEMPLATE.NIC;
var pci = element.TEMPLATE.PCI;
var ips = [];
Expand All @@ -764,15 +764,15 @@ define(function(require) {
externalIP = monitoring[IPAttr];

if (externalIP) {
var splitArr = externalIP.split(',');
var splitArr = externalIP.split(",");

$.each(splitArr, function(i,ip){
if (ip && ($.inArray(ip, ips) == -1)) {
ips.push(ip);
}
});
}
})
});
}

if (nic == undefined){
Expand Down Expand Up @@ -809,13 +809,13 @@ define(function(require) {
if (ips.length > 0) {
return ips.join(divider);
} else {
return '--';
return "--";
}
};

// Return the Alias or several Aliases of a VM
function aliasStr(element, divider) {
var divider = divider || "<br>"
var divider = divider || "<br>";
var nic_alias = element.TEMPLATE.NIC_ALIAS;
var ips = [];

Expand All @@ -841,12 +841,13 @@ define(function(require) {
if (ips.length > 0) {
return ips.join(divider);
} else {
return '--';
return "--";
}
};

// returns true if the vnc button should be enabled
function isVNCSupported(element) {
console.log("inVNCSupport_function -> ",element);
var graphics = element.TEMPLATE.GRAPHICS;
var state = parseInt(element.LCM_STATE);

Expand All @@ -867,4 +868,4 @@ define(function(require) {
}

return VM;
})
});
2 changes: 1 addition & 1 deletion src/sunstone/public/app/tabs/support-tab/title.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</button>
</div>

<div class="support_not_connected">
<div class="support_not_connected" style="display: none;">
<button class="button small alert radius">
{{tr "Not officially supported"}}
</button>
Expand Down

0 comments on commit 373eca9

Please sign in to comment.