diff --git a/.zuul.yaml b/.zuul.yaml index 08bbff8d..b974c8cd 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -29,6 +29,7 @@ tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt' # yamllint disable-line rule:line-length tox_environment: STX_DC_CLIENT: distcloud-client + bindep_profile: pylint required-projects: - starlingx/config - starlingx/distcloud-client diff --git a/bindep.txt b/bindep.txt new file mode 100644 index 00000000..dafee19f --- /dev/null +++ b/bindep.txt @@ -0,0 +1,6 @@ +# This is a cross-platform list tracking distribution packages needed for install and tests; +# see https://docs.openstack.org/infra/bindep/ for additional information. + +libsasl2-dev [pylint platform:dpkg] +libldap2-dev [pylint platform:dpkg] +libssl-dev [pylint platform:dpkg] diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/api/dc_manager.py b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/api/dc_manager.py index 7a95e8f1..9371a24b 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/api/dc_manager.py +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/api/dc_manager.py @@ -55,7 +55,7 @@ class Subcloud(base.APIResourceWrapper): 'management_start_ip', 'management_end_ip', 'management_gateway_ip', 'systemcontroller_gateway_ip', 'created_at', 'updated_at', 'group_id', 'sync_status', - 'endpoint_sync_status', ] + 'endpoint_sync_status', 'region_name', ] def subcloud_list(request): diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/dc_admin/static/dashboard/dc_admin/cloud_overview/cloud_overview.module.js b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/dc_admin/static/dashboard/dc_admin/cloud_overview/cloud_overview.module.js index 5bc599fb..75faaa1e 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/dc_admin/static/dashboard/dc_admin/cloud_overview/cloud_overview.module.js +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/dc_admin/static/dashboard/dc_admin/cloud_overview/cloud_overview.module.js @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017 Wind River Systems, Inc. + * Copyright (c) 2017-2023 Wind River Systems, Inc. * * SPDX-License-Identifier: Apache-2.0 * @@ -18,8 +18,30 @@ */ angular .module('horizon.dashboard.dc_admin.cloud_overview', []) + .run(['$rootScope', '$cookies', '$location', run]) .config(config); + /* + Keeps the subcloud name updated in the menu, + instead of showing the region name. + */ + function run($rootScope, $cookies, $location) { + $rootScope.$on('$locationChangeSuccess', function() { + var services_region = $cookies.get('services_region'); + + //Finds the element where region name is displayed + var region_element = document.querySelector('span.context-region'); + + if (region_element) { + //Set the subcloud name only if it is a subcloud + if(services_region != 'RegionOne' && services_region != 'SystemController'){ + var subcloud_name = $cookies.get('subcloud_' + services_region); + region_element.textContent = subcloud_name; + } + } + }); + } + config.$inject = [ '$provide', '$windowProvider' diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/dc_admin/static/dashboard/dc_admin/cloud_overview/table/subcloud_table.controller.js b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/dc_admin/static/dashboard/dc_admin/cloud_overview/table/subcloud_table.controller.js index fd32059b..9519e493 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/dc_admin/static/dashboard/dc_admin/cloud_overview/table/subcloud_table.controller.js +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/dc_admin/static/dashboard/dc_admin/cloud_overview/table/subcloud_table.controller.js @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2021 Wind River Systems, Inc. + * Copyright (c) 2017-2023 Wind River Systems, Inc. * * SPDX-License-Identifier: Apache-2.0 * @@ -27,6 +27,7 @@ '$timeout', '$interval', '$window', + '$cookies', 'horizon.framework.widgets.toast.service', 'horizon.framework.util.i18n.gettext', 'horizon.framework.widgets.form.ModalFormService', @@ -42,6 +43,7 @@ $timeout, $interval, $window, + $cookies, toast, gettext, modalFormService, @@ -354,8 +356,7 @@ properties: { "name": { type: "string", - title: "Name", - readonly: true}, + title: "Name"}, "description": { type: "string", title: "Description"}, @@ -408,9 +409,10 @@ } keystone.getCurrentUserSession().success(function(session){ - session.available_services_regions.indexOf(cloud.name) - if (session.available_services_regions.indexOf(cloud.name) > -1) { - $window.location.href = "/auth/switch_services_region/"+ cloud.name + "/?next=/admin/active_alarms/"; + session.available_services_regions.indexOf(cloud.region_name) + if (session.available_services_regions.indexOf(cloud.region_name) > -1) { + $cookies.put("subcloud_" + cloud.region_name, cloud.name); + $window.location.href = "/auth/switch_services_region/"+ cloud.region_name + "/?next=/admin/active_alarms/"; } else { toast.add('error', ctrl.endpointErrorMsg); // TODO(tsmith) should we force a logout here with an reason message? @@ -435,8 +437,9 @@ } keystone.getCurrentUserSession().success(function(session){ - if (session.available_services_regions.indexOf(cloud.name) > -1) { - $window.location.href = "/auth/switch_services_region/"+ cloud.name + "/?next=/admin/"; + if (session.available_services_regions.indexOf(cloud.region_name) > -1) { + $cookies.put("subcloud_" + cloud.region_name, cloud.name); + $window.location.href = "/auth/switch_services_region/"+ cloud.region_name + "/?next=/admin/"; } else { toast.add('error', ctrl.endpointErrorMsg); }