diff --git a/src/sunstone/public/app/app.js b/src/sunstone/public/app/app.js
index 04ac35c942..c6ea115c7a 100644
--- a/src/sunstone/public/app/app.js
+++ b/src/sunstone/public/app/app.js
@@ -28,6 +28,7 @@ define(function(require) {
Foundation.Reveal.defaults.closeOnClick = false;
_setupDataTableSearch();
+ _setDataTableErrMode();
var SETTINGS_TAB_ID = require('tabs/settings-tab/tabId');
var PROVISION_TAB_ID = require('tabs/provision-tab/tabId');
@@ -279,6 +280,12 @@ define(function(require) {
return null;
}
+ function _setDataTableErrMode(){
+ $.fn.dataTable.ext.errMode = function(settings, techNote, message) {
+ console.log('data table error: '+message);
+ };
+ }
+
function _setupDataTableSearch() {
$.fn.dataTable.ext.type.order['file-size-pre'] = function ( data ) {
var matches = data.match( /^(\d+(?:\.\d+)?)\s*([a-z]+)/i );
diff --git a/src/sunstone/public/app/tabs/hosts-tab/datatable.js b/src/sunstone/public/app/tabs/hosts-tab/datatable.js
index 3197acdd1a..953e2bc6be 100644
--- a/src/sunstone/public/app/tabs/hosts-tab/datatable.js
+++ b/src/sunstone/public/app/tabs/hosts-tab/datatable.js
@@ -159,12 +159,15 @@ define(function(require) {
break;
}
- this.maxCPU += parseInt(element.HOST_SHARE.MAX_CPU);
- this.allocatedCPU += parseInt(element.HOST_SHARE.CPU_USAGE);
- this.realCPU += parseInt(element.HOST_SHARE.USED_CPU);
- this.maxMemory += parseInt(element.HOST_SHARE.MAX_MEM);
- this.allocatedMemory += parseInt(element.HOST_SHARE.MEM_USAGE);
- this.realMemory += parseInt(element.HOST_SHARE.USED_MEM);
+ this.maxCPU += parseInt((element && element.HOST_SHARE && element.HOST_SHARE.MAX_CPU)||0);
+ this.allocatedCPU += parseInt((element && element.HOST_SHARE && element.HOST_SHARE.CPU_USAGE)||0);
+ this.realCPU += parseInt((element && element.MONITORING && element.MONITORING.CAPACITY && element.MONITORING.CAPACITY.USED_CPU)||0);//
+ this.maxMemory += parseInt((element && element.HOST_SHARE && element.HOST_SHARE.MAX_MEM)||0);
+ this.allocatedMemory += parseInt((element && element.HOST_SHARE && element.HOST_SHARE.MEM_USAGE)||0);
+ this.realMemory += parseInt((element && element.MONITORING && element.MONITORING.CAPACITY && element.MONITORING.CAPACITY.USED_MEMORY)||0);//MONITORING.CAPACITY.USED_MEMORY
+
+
+ console.log("-->",element);
var state = OpenNebulaHost.simpleStateStr(element.STATE);
@@ -239,10 +242,13 @@ define(function(require) {
"1rem",
{"percentage": ratio_allocated_cpu, "str": info_str})
);
- var percentage = ratio_allocated_cpu > 100 ? 100 : ratio_allocated_cpu;
- $("#dashboard_host_allocated_cpu_meter").animate({
- value: percentage,
- }, time, "swing");
+
+ if(!isNaN(ratio_allocated_cpu)){
+ var percentage = ratio_allocated_cpu > 100 ? 100 : ratio_allocated_cpu;
+ $("#dashboard_host_allocated_cpu_meter").animate({
+ value: percentage,
+ }, time, "swing");
+ }
var ratio_real_cpu = 0;
if (this.maxCPU > 0) {
@@ -258,10 +264,13 @@ define(function(require) {
"1rem",
{"percentage": ratio_real_cpu, "str": info_str})
);
- var percentage = ratio_real_cpu > 100 ? 100 : ratio_real_cpu;
- $("#dashboard_host_real_cpu_meter").animate({
- value: percentage,
- }, time, "swing");
+
+ if(!isNaN(ratio_real_cpu)){
+ var percentage = ratio_real_cpu > 100 ? 100 : ratio_real_cpu;
+ $("#dashboard_host_real_cpu_meter").animate({
+ value: percentage,
+ }, time, "swing");
+ }
var ratio_allocated_mem = 0;
if (this.maxMemory > 0) {
@@ -277,10 +286,13 @@ define(function(require) {
"1rem",
{"percentage": ratio_allocated_mem, "str": info_str})
);
- var percentage = ratio_allocated_mem > 100 ? 100 : ratio_allocated_mem;
- $("#dashboard_host_allocated_mem_meter").animate({
- value: percentage,
- }, time, "swing");
+
+ if(!isNaN(ratio_allocated_mem)){
+ var percentage = ratio_allocated_mem > 100 ? 100 : ratio_allocated_mem;
+ $("#dashboard_host_allocated_mem_meter").animate({
+ value: percentage,
+ }, time, "swing");
+ }
var ratio_real_mem = 0;
if (this.maxMemory > 0) {
@@ -289,6 +301,7 @@ define(function(require) {
} else {
info_str = Humanize.size(this.realMemory) + " / -";
}
+
$("#dashboard_host_real_mem").html(quotaDashboard(
"dashboard_host_real_mem",
Locale.tr("Real Memory"),
@@ -296,10 +309,13 @@ define(function(require) {
"1rem",
{"percentage": ratio_real_mem, "str": info_str})
);
- var percentage = ratio_real_mem > 100 ? 100 : ratio_real_mem;
- $("#dashboard_host_real_mem_meter").animate({
- value: percentage,
- }, time, "swing");
+
+ if(!isNaN(ratio_real_mem)){
+ var percentage = ratio_real_mem > 100 ? 100 : ratio_real_mem;
+ $("#dashboard_host_real_mem_meter").animate({
+ value: percentage,
+ }, time, "swing");
+ }
}
diff --git a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js
index 6906b375a4..257b15c732 100644
--- a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js
+++ b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js
@@ -73,18 +73,6 @@ define(function(require) {
});
}
- that.imMadNameList = [];
- if (Config.onedConf.IM_MAD !== undefined) {
- $.each(Config.onedConf.IM_MAD, function(index, imMad) {
- if (imMad.SUNSTONE_NAME !== undefined) {
- that.imMadNameList.push({
- 'displayName': imMad["SUNSTONE_NAME"],
- 'driverName': imMad["NAME"]
- });
- }
- });
- }
-
BaseFormPanel.call(this);
};
@@ -106,8 +94,7 @@ define(function(require) {
return TemplateWizardHTML({
'formPanelId': this.formPanelId,
'vCenterClustersHTML': this.vCenterClusters.html(),
- 'vmMadNameList': this.vmMadNameList,
- 'imMadNameList': this.imMadNameList
+ 'vmMadNameList': this.vmMadNameList
});
}
@@ -117,6 +104,7 @@ define(function(require) {
$(".drivers", context).hide();
$("#host_type_mad", context).on("change", function() {
+ console.log("-->", this.value);
$("#vmm_mad", context).val(this.value).change();
$("#im_mad", context).val(this.value).change();
$(".vcenter_credentials", context).hide();
diff --git a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create/wizard.hbs b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create/wizard.hbs
index 70051be33f..ac2bfa3c93 100644
--- a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create/wizard.hbs
+++ b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create/wizard.hbs
@@ -65,7 +65,7 @@