diff --git a/src/sunstone/etc/sunstone-views/kvm/admin.yaml b/src/sunstone/etc/sunstone-views/kvm/admin.yaml index 65c044322c..0e0835aa98 100644 --- a/src/sunstone/etc/sunstone-views/kvm/admin.yaml +++ b/src/sunstone/etc/sunstone-views/kvm/admin.yaml @@ -533,6 +533,7 @@ tabs: host_esx_tab: true host_pci_tab: true host_numa_tab: true + host_nsx_tab: true table_columns: - 0 # Checkbox - 1 # ID diff --git a/src/sunstone/etc/sunstone-views/kvm/groupadmin.yaml b/src/sunstone/etc/sunstone-views/kvm/groupadmin.yaml index d703f048de..f88af85df4 100644 --- a/src/sunstone/etc/sunstone-views/kvm/groupadmin.yaml +++ b/src/sunstone/etc/sunstone-views/kvm/groupadmin.yaml @@ -534,6 +534,7 @@ tabs: host_esx_tab: true host_pci_tab: true host_numa_tab: true + host_nsx_tab: true table_columns: - 0 # Checkbox - 1 # ID diff --git a/src/sunstone/etc/sunstone-views/kvm/user.yaml b/src/sunstone/etc/sunstone-views/kvm/user.yaml index 76d0dd3936..e240849566 100644 --- a/src/sunstone/etc/sunstone-views/kvm/user.yaml +++ b/src/sunstone/etc/sunstone-views/kvm/user.yaml @@ -527,6 +527,7 @@ tabs: host_esx_tab: true host_pci_tab: true host_numa_tab: true + host_nsx_tab: true table_columns: - 0 # Checkbox - 1 # ID diff --git a/src/sunstone/etc/sunstone-views/mixed/admin.yaml b/src/sunstone/etc/sunstone-views/mixed/admin.yaml index cb273a041a..2a3194dbf5 100644 --- a/src/sunstone/etc/sunstone-views/mixed/admin.yaml +++ b/src/sunstone/etc/sunstone-views/mixed/admin.yaml @@ -535,6 +535,7 @@ tabs: host_esx_tab: true host_pci_tab: true host_numa_tab: true + host_nsx_tab: true table_columns: - 0 # Checkbox - 1 # ID diff --git a/src/sunstone/etc/sunstone-views/mixed/groupadmin.yaml b/src/sunstone/etc/sunstone-views/mixed/groupadmin.yaml index d703f048de..f88af85df4 100644 --- a/src/sunstone/etc/sunstone-views/mixed/groupadmin.yaml +++ b/src/sunstone/etc/sunstone-views/mixed/groupadmin.yaml @@ -534,6 +534,7 @@ tabs: host_esx_tab: true host_pci_tab: true host_numa_tab: true + host_nsx_tab: true table_columns: - 0 # Checkbox - 1 # ID diff --git a/src/sunstone/etc/sunstone-views/mixed/user.yaml b/src/sunstone/etc/sunstone-views/mixed/user.yaml index 76d0dd3936..e240849566 100644 --- a/src/sunstone/etc/sunstone-views/mixed/user.yaml +++ b/src/sunstone/etc/sunstone-views/mixed/user.yaml @@ -527,6 +527,7 @@ tabs: host_esx_tab: true host_pci_tab: true host_numa_tab: true + host_nsx_tab: true table_columns: - 0 # Checkbox - 1 # ID diff --git a/src/sunstone/etc/sunstone-views/vcenter/admin.yaml b/src/sunstone/etc/sunstone-views/vcenter/admin.yaml index 39367f2e8c..cfded6a7c2 100644 --- a/src/sunstone/etc/sunstone-views/vcenter/admin.yaml +++ b/src/sunstone/etc/sunstone-views/vcenter/admin.yaml @@ -533,6 +533,7 @@ tabs: host_esx_tab: true host_pci_tab: true host_numa_tab: true + host_nsx_tab: true table_columns: - 0 # Checkbox - 1 # ID diff --git a/src/sunstone/etc/sunstone-views/vcenter/groupadmin.yaml b/src/sunstone/etc/sunstone-views/vcenter/groupadmin.yaml index 67cd202f92..2482ac8485 100644 --- a/src/sunstone/etc/sunstone-views/vcenter/groupadmin.yaml +++ b/src/sunstone/etc/sunstone-views/vcenter/groupadmin.yaml @@ -534,6 +534,7 @@ tabs: host_esx_tab: true host_pci_tab: true host_numa_tab: true + host_nsx_tab: true table_columns: - 0 # Checkbox - 1 # ID diff --git a/src/sunstone/etc/sunstone-views/vcenter/user.yaml b/src/sunstone/etc/sunstone-views/vcenter/user.yaml index 76d0dd3936..e240849566 100644 --- a/src/sunstone/etc/sunstone-views/vcenter/user.yaml +++ b/src/sunstone/etc/sunstone-views/vcenter/user.yaml @@ -527,6 +527,7 @@ tabs: host_esx_tab: true host_pci_tab: true host_numa_tab: true + host_nsx_tab: true table_columns: - 0 # Checkbox - 1 # ID diff --git a/src/sunstone/public/app/console/vnc.js b/src/sunstone/public/app/console/vnc.js index c40278913f..5fd613c52f 100644 --- a/src/sunstone/public/app/console/vnc.js +++ b/src/sunstone/public/app/console/vnc.js @@ -98,7 +98,7 @@ define(function(require) { } return(false); } - + console.log("JORGE"); token = window.token; var URL = ""; var proxy_host = window.location.hostname; diff --git a/src/sunstone/public/app/tabs/hosts-tab.js b/src/sunstone/public/app/tabs/hosts-tab.js index 3bcffce70b..4e96840192 100644 --- a/src/sunstone/public/app/tabs/hosts-tab.js +++ b/src/sunstone/public/app/tabs/hosts-tab.js @@ -36,9 +36,9 @@ define(function(require) { require('./hosts-tab/panels/zombies'), require('./hosts-tab/panels/esx'), require('./hosts-tab/panels/pci'), - require('./hosts-tab/panels/numa') + require('./hosts-tab/panels/numa'), + require('./hosts-tab/panels/nsx') ]; - var _panelsHooks = [ require('../utils/hooks/header') ]; diff --git a/src/sunstone/public/app/tabs/hosts-tab/panels/nsx.js b/src/sunstone/public/app/tabs/hosts-tab/panels/nsx.js new file mode 100644 index 0000000000..1b7ce792bb --- /dev/null +++ b/src/sunstone/public/app/tabs/hosts-tab/panels/nsx.js @@ -0,0 +1,140 @@ +/* -------------------------------------------------------------------------- */ +/* Copyright 2002-2019, OpenNebula Project, OpenNebula Systems */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ +/* not use this file except in compliance with the License. You may obtain */ +/* a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ +/* See the License for the specific language governing permissions and */ +/* limitations under the License. */ +/* -------------------------------------------------------------------------- */ + +define(function(require) { + /* + DEPENDENCIES + */ + var Sunstone = require('sunstone'); + var TemplateUtils = require('utils/template-utils'); + var Tips = require('utils/tips'); + + /* + TEMPLATES + */ + + var TemplateNsx = require('hbs!./nsx/html'); + + /* + CONSTANTS + */ + + var PANEL_ID = require('./nsx/panelId'); + var RESOURCE = "Host"; + var NSX = 'NSX'; + var tabID = '#hosts-tab-panelsTabs'; + var user = "NSX_USER"; + var pass = "NSX_PASSWORD"; + var submit = "nsx_submit"; + var showForm = true; + var template = {}; + + /* + CONSTRUCTOR + */ + + function Panel(info) { + this.title = Locale.tr("NSX"); + this.icon = "fa-desktop"; + this.element = info[RESOURCE.toUpperCase()]; + return this; + }; + + Panel.PANEL_ID = PANEL_ID; + Panel.prototype.html = _html; + Panel.prototype.setup = _setup; + Panel.prototype.onShow = _onShow; + + return Panel; + + /* + FUNCTION DEFINITIONS + */ + + function _html() { + showForm = true; + if(this && this.element && this.element.TEMPLATE && this.element.TEMPLATE.NSX_STATUS && this.element.TEMPLATE.NSX_STATUS.trim() === 'OK'){ + showForm=false; + } + return TemplateNsx(); + } + + function _onShow(context){ + var that = this; + } + + function displayTab(status){ + $(tabID).find('li').each(function(i, li){ + var element = $(li); + if(element.text().trim() === NSX){ + if(status){ + element.show(); + }else{ + element.hide(); + } + } + }); + } + + function _setup(context) { + var that = this; + var title = $("

").text("NSX Credentials"); + var full = $("
",{"class": "small-12 columns"}); + var middle = $("
",{"class": "small-6 columns"}); + var label = $("