diff --git a/src/sunstone/public/app/tabs/groups-tab/form-panels/create/wizard.hbs b/src/sunstone/public/app/tabs/groups-tab/form-panels/create/wizard.hbs index f0605ec1c2..41913f77cf 100644 --- a/src/sunstone/public/app/tabs/groups-tab/form-panels/create/wizard.hbs +++ b/src/sunstone/public/app/tabs/groups-tab/form-panels/create/wizard.hbs @@ -17,7 +17,7 @@
- {{tr "New Groups are automatically added to the default VDC"}} + {{tr "New Groups are automatically added to the default VDC"}}
diff --git a/src/sunstone/public/app/tabs/secgroups-tab/panels/vms.js b/src/sunstone/public/app/tabs/secgroups-tab/panels/vms.js index 2482b2a4c6..63bf861aab 100644 --- a/src/sunstone/public/app/tabs/secgroups-tab/panels/vms.js +++ b/src/sunstone/public/app/tabs/secgroups-tab/panels/vms.js @@ -72,7 +72,7 @@ define(function(require){ read_only: true, fixed_ids: ids, starred_ids: updatingIds, - starred_icon: '' + starred_icon: '' } }; diff --git a/src/sunstone/public/app/tabs/secgroups-tab/panels/vms/html.hbs b/src/sunstone/public/app/tabs/secgroups-tab/panels/vms/html.hbs index 390b38a5a7..fb1c87af4e 100644 --- a/src/sunstone/public/app/tabs/secgroups-tab/panels/vms/html.hbs +++ b/src/sunstone/public/app/tabs/secgroups-tab/panels/vms/html.hbs @@ -16,7 +16,7 @@ {{#unless allUpdated}}
-

{{{tr "VMs marked with are waiting to be updated with the latest rules:"}}} +

{{{tr "VMs marked with are waiting to be updated with the latest rules:"}}}

{{/unless}}
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/nic-tab.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/nic-tab.js index b2e4b42b48..c9efe4a410 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/nic-tab.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/nic-tab.js @@ -20,13 +20,13 @@ define(function(require) { */ var Config = require('sunstone-config'); - var Locale = require('utils/locale'); - var Tips = require('utils/tips'); + var OpenNebulaNetwork = require('opennebula/network'); var VNetsTable = require('tabs/vnets-tab/datatable'); var SecgroupsTable = require('tabs/secgroups-tab/datatable'); var WizardFields = require('utils/wizard-fields'); var UniqueId = require('utils/unique-id'); var CreateUtils = require('../utils'); + var Notifier = require('utils/notifier'); /* TEMPLATES @@ -43,6 +43,7 @@ define(function(require) { */ function NicTab(nicTabId) { + that = this; this.nicTabId = 'nicTab' + nicTabId + UniqueId.id(); this.vnetsTable = new VNetsTable(this.nicTabId + 'Table', {'select': true}); @@ -50,7 +51,12 @@ define(function(require) { var secgroupSelectOptions = { 'select': true, 'selectOptions': { - "multiple_choice": true + "multiple_choice": true, + 'unselect_callback': function(aData, options){ + if (that.secGroups && that.secGroups.includes(aData[options.id_index])){ + $("div[name='str_nic_tab_id'] table tbody tr td:contains('" + aData[options.name_index] + "')").click(); + } + } } } this.secgroupsTable = new SecgroupsTable(this.nicTabId + 'SGTable', secgroupSelectOptions); @@ -98,6 +104,18 @@ define(function(require) { 'select_callback': function(aData, options) { // If the net is selected by Id, avoid overwriting it with name+uname if ($('#NETWORK_ID', context).val() != aData[options.id_index]) { + OpenNebulaNetwork.show({ + data : { + id: aData[options.id_index] + }, + timeout: true, + success: function (request, vn){ + that.secGroups = vn["VNET"]["TEMPLATE"]["SECURITY_GROUPS"].split(","); + that.secgroupsTable.selectResourceTableSelect( + { ids : that.secGroups }); + }, + error: Notifier.onError + }); $('#NETWORK_ID', context).val(""); $('#NETWORK', context).val(aData[options.name_index]); $('#NETWORK_UNAME', context).val(aData[options.uname_index]); @@ -106,10 +124,10 @@ define(function(require) { } } }); - that.vnetsTable.refreshResourceTableSelect(); that.secgroupsTable.initialize(); that.secgroupsTable.refreshResourceTableSelect(); + that.vnetsTable.refreshResourceTableSelect(); $("input.pci-type-nic", context).on("change", function(){ var tbody = $(".pci-row tbody", context); diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/nic-tab/html.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/nic-tab/html.hbs index 807c043018..16326b23bb 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/nic-tab/html.hbs +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/network/nic-tab/html.hbs @@ -227,7 +227,10 @@
{{tr "Security Groups"}}
- {{{secgroupsTableSelectHTML}}} + {{{secgroupsTableSelectHTML}}}
+ + {{tr "Security Groups belonging to the selected Virtual Network will be applied and cannot be unselected"}} +
{{! Hidden inputs for white/black ports and icmp drop. These inputs are diff --git a/src/sunstone/public/app/tabs/vnets-tab/form-panels/create/wizard.hbs b/src/sunstone/public/app/tabs/vnets-tab/form-panels/create/wizard.hbs index be226ddda4..033317038d 100644 --- a/src/sunstone/public/app/tabs/vnets-tab/form-panels/create/wizard.hbs +++ b/src/sunstone/public/app/tabs/vnets-tab/form-panels/create/wizard.hbs @@ -257,7 +257,7 @@
- {{tr "The default Security Group 0 is automatically added to new Virtual Networks"}} + {{tr "The default Security Group 0 is automatically added to new Virtual Networks"}}
diff --git a/src/sunstone/public/app/utils/tab-datatable.js b/src/sunstone/public/app/utils/tab-datatable.js index 32742f9c02..94b2508bc4 100644 --- a/src/sunstone/public/app/utils/tab-datatable.js +++ b/src/sunstone/public/app/utils/tab-datatable.js @@ -895,7 +895,7 @@ define(function(require) { $('#selected_ids_row_' + that.dataTableId + ' span[row_id="' + row_id + '"]', section).remove(); - that.selectOptions.unselect_callback(); + that.selectOptions.unselect_callback(aData, that.selectOptions); } else { ids[row_id] = true;