├── .eslintrc ├── .gitignore ├── .gitreview ├── .zuul.yaml ├── CONTRIBUTING.rst ├── LICENSE ├── README.rst ├── babel-django.cfg ├── babel-djangojs.cfg ├── bindep.txt ├── devstack ├── plugin.sh └── settings ├── doc ├── Makefile ├── requirements.txt └── source │ ├── conf.py │ ├── configuration │ └── index.rst │ ├── contributor │ ├── api.rst │ └── index.rst │ ├── index.rst │ └── install │ └── index.rst ├── magnum_ui ├── __init__.py ├── api │ ├── __init__.py │ ├── heat.py │ ├── magnum.py │ └── rest │ │ ├── __init__.py │ │ └── magnum.py ├── content │ ├── __init__.py │ ├── cluster_templates │ │ ├── __init__.py │ │ ├── panel.py │ │ ├── tests.py │ │ └── urls.py │ ├── clusters │ │ ├── __init__.py │ │ ├── panel.py │ │ ├── tests.py │ │ └── urls.py │ └── container_infra │ │ ├── __init__.py │ │ └── quotas │ │ ├── __init__.py │ │ ├── panel.py │ │ └── urls.py ├── enabled │ ├── _1370_project_container_infra_panel_group.py │ ├── _1371_project_container_infra_clusters_panel.py │ ├── _1372_project_container_infra_cluster_templates_panel.py │ ├── _2370_admin_container_infra_panel_group.py │ ├── _2371_admin_container_infra_quotas_panel.py │ └── __init__.py ├── karma.conf.js ├── locale │ ├── cs │ │ └── LC_MESSAGES │ │ │ ├── django.po │ │ │ └── djangojs.po │ ├── de │ │ └── LC_MESSAGES │ │ │ ├── django.po │ │ │ └── djangojs.po │ ├── en_AU │ │ └── LC_MESSAGES │ │ │ └── djangojs.po │ ├── en_GB │ │ └── LC_MESSAGES │ │ │ ├── django.po │ │ │ └── djangojs.po │ ├── fr │ │ └── LC_MESSAGES │ │ │ ├── django.po │ │ │ └── djangojs.po │ ├── id │ │ └── LC_MESSAGES │ │ │ ├── django.po │ │ │ └── djangojs.po │ ├── ja │ │ └── LC_MESSAGES │ │ │ ├── django.po │ │ │ └── djangojs.po │ ├── ko_KR │ │ └── LC_MESSAGES │ │ │ ├── django.po │ │ │ └── djangojs.po │ ├── pt_BR │ │ └── LC_MESSAGES │ │ │ ├── django.po │ │ │ └── djangojs.po │ ├── ru │ │ └── LC_MESSAGES │ │ │ ├── django.po │ │ │ └── djangojs.po │ └── tr_TR │ │ └── LC_MESSAGES │ │ ├── django.po │ │ └── djangojs.po ├── static │ └── dashboard │ │ └── container-infra │ │ ├── cluster-templates │ │ ├── actions.module.js │ │ ├── actions.module.spec.js │ │ ├── cluster-templates.module.js │ │ ├── cluster-templates.module.spec.js │ │ ├── cluster-templates.service.js │ │ ├── cluster-templates.service.spec.js │ │ ├── create │ │ │ ├── create.service.js │ │ │ └── create.service.spec.js │ │ ├── delete │ │ │ ├── delete.service.js │ │ │ └── delete.service.spec.js │ │ ├── details │ │ │ ├── details.module.js │ │ │ ├── drawer.controller.js │ │ │ ├── drawer.controller.spec.js │ │ │ ├── drawer.html │ │ │ ├── overview.controller.js │ │ │ ├── overview.controller.spec.js │ │ │ └── overview.html │ │ ├── panel.html │ │ ├── update │ │ │ ├── update.service.js │ │ │ └── update.service.spec.js │ │ └── workflow │ │ │ ├── info.help.html │ │ │ ├── labels.help.html │ │ │ ├── network.help.html │ │ │ ├── spec.help.html │ │ │ ├── workflow.service.js │ │ │ └── workflow.service.spec.js │ │ ├── clusters │ │ ├── actions.module.js │ │ ├── actions.module.spec.js │ │ ├── cluster-stats.controller.js │ │ ├── cluster-stats.controller.spec.js │ │ ├── clusters.module.js │ │ ├── clusters.module.spec.js │ │ ├── clusters.scss │ │ ├── clusters.service.js │ │ ├── clusters.service.spec.js │ │ ├── clusters.utils.js │ │ ├── clusters.utils.spec.js │ │ ├── config │ │ │ ├── config.service.js │ │ │ └── config.service.spec.js │ │ ├── create │ │ │ ├── create.service.js │ │ │ └── create.service.spec.js │ │ ├── delete │ │ │ ├── delete.service.js │ │ │ └── delete.service.spec.js │ │ ├── details │ │ │ ├── details.module.js │ │ │ ├── drawer.controller.js │ │ │ ├── drawer.controller.spec.js │ │ │ ├── drawer.html │ │ │ ├── overview.controller.js │ │ │ ├── overview.controller.spec.js │ │ │ └── overview.html │ │ ├── panel.html │ │ ├── resize │ │ │ ├── resize.service.js │ │ │ └── resize.service.spec.js │ │ ├── rolling-upgrade │ │ │ ├── upgrade.service.js │ │ │ └── upgrade.service.spec.js │ │ ├── rotate-certificate │ │ │ ├── rotate-certificate.service.js │ │ │ └── rotate-certificate.service.spec.js │ │ ├── show-certificate │ │ │ ├── show-certificate.service.js │ │ │ └── show-certificate.service.spec.js │ │ ├── sign-certificate │ │ │ ├── sign-certificate-modal.controller.js │ │ │ ├── sign-certificate-modal.html │ │ │ ├── sign-certificate-model.js │ │ │ ├── sign-certificate-model.spec.js │ │ │ ├── sign-certificate.service.js │ │ │ └── sign-certificate.service.spec.js │ │ └── workflow │ │ │ ├── advanced.help.html │ │ │ ├── cluster-template.controller.js │ │ │ ├── cluster-template.controller.spec.js │ │ │ ├── cluster-template.html │ │ │ ├── details.help.html │ │ │ ├── management.help.html │ │ │ ├── network.help.html │ │ │ ├── size.help.html │ │ │ ├── workflow.service.js │ │ │ └── workflow.service.spec.js │ │ ├── container-infra.module.js │ │ ├── container-infra.module.spec.js │ │ ├── container-infra.scss │ │ ├── magnum.service.js │ │ ├── magnum.service.spec.js │ │ ├── quotas │ │ ├── actions.module.js │ │ ├── actions.module.spec.js │ │ ├── create │ │ │ ├── create.service.js │ │ │ └── create.service.spec.js │ │ ├── delete │ │ │ ├── delete.service.js │ │ │ └── delete.service.spec.js │ │ ├── panel.html │ │ ├── quotas.module.js │ │ ├── quotas.module.spec.js │ │ ├── quotas.service.js │ │ ├── quotas.service.spec.js │ │ ├── update │ │ │ ├── update.service.js │ │ │ └── update.service.spec.js │ │ └── workflow │ │ │ ├── workflow.service.js │ │ │ └── workflow.service.spec.js │ │ ├── utils.service.js │ │ └── utils.service.spec.js ├── test │ ├── __init__.py │ ├── api_tests │ │ ├── __init__.py │ │ └── test_rest_api.py │ ├── helpers.py │ ├── integration_tests │ │ └── __init__.py │ ├── settings.py │ └── test_data.py └── version.py ├── manage.py ├── package.json ├── releasenotes ├── notes │ ├── Workflow-updates-for-Create-Cluster-65e4fe510b4d1a4c.yaml │ ├── add-fedora-coreos-7882a33d801371fe.yaml │ ├── add-reno-7d46796dbf41c247.yaml │ ├── bugfix-cluster-template-hidden-arg-38909eaa92bd8d56.yaml │ ├── bugfix-set-floating_ip_enabled-default_in-cluster-template-true-ce06118f0e6064ba.yaml │ ├── improve-cluster-launch-dfc514b51cfa7f0e.yaml │ ├── lb_floating_ip-ca6039444f88a968.yaml │ ├── newton-dac21adfe6c6b8ee.yaml │ ├── ocata-b08d6b024c63296b.yaml │ ├── ocata-summary-a717111a782c7a68.yaml │ ├── pike-b1af664f1033a131.yaml │ ├── queens-f99244e9db54ccf3.yaml │ ├── resize-actions-1436a2a0dccbd13b.yaml │ ├── rocky-56165675d959b593.yaml │ ├── show-health-status-ff92b2fe2bfad5ae.yaml │ ├── stein-a6adf485dbbbbd1a.yaml │ ├── update-actions-02db7b9f8e5d36b6.yaml │ └── upgrade-actions-adf2f749ec0cc817.yaml └── source │ ├── 2023.1.rst │ ├── 2023.2.rst │ ├── 2024.1.rst │ ├── 2024.2.rst │ ├── 2025.1.rst │ ├── conf.py │ ├── index.rst │ ├── locale │ ├── de │ │ └── LC_MESSAGES │ │ │ └── releasenotes.po │ ├── en_GB │ │ └── LC_MESSAGES │ │ │ └── releasenotes.po │ ├── fr │ │ └── LC_MESSAGES │ │ │ └── releasenotes.po │ ├── id │ │ └── LC_MESSAGES │ │ │ └── releasenotes.po │ ├── ja │ │ └── LC_MESSAGES │ │ │ └── releasenotes.po │ ├── ko_KR │ │ └── LC_MESSAGES │ │ │ └── releasenotes.po │ ├── pt_BR │ │ └── LC_MESSAGES │ │ │ └── releasenotes.po │ ├── ru │ │ └── LC_MESSAGES │ │ │ └── releasenotes.po │ └── zh_CN │ │ └── LC_MESSAGES │ │ └── releasenotes.po │ ├── newton.rst │ ├── ocata.rst │ ├── pike.rst │ ├── queens.rst │ ├── rocky.rst │ ├── stein.rst │ ├── train.rst │ ├── unreleased.rst │ ├── ussuri.rst │ ├── victoria.rst │ ├── wallaby.rst │ ├── xena.rst │ ├── yoga.rst │ └── zed.rst ├── requirements.txt ├── setup.cfg ├── setup.py ├── test-requirements.txt ├── test-shim.js ├── tools ├── install_venv.py ├── install_venv_common.py └── with_venv.sh └── tox.ini /.eslintrc: -------------------------------------------------------------------------------- 1 | # Set up globals 2 | globals: 3 | angular: false 4 | 5 | extends: openstack 6 | 7 | # Most environment options are not explicitly enabled or disabled, only 8 | # included here for completeness' sake. They are commented out, because the 9 | # global updates.py script would otherwise override them during a global 10 | # requirements synchronization. 11 | # 12 | # Individual projects should choose which platforms they deploy to. 13 | 14 | env: 15 | # browser global variables. 16 | browser: true 17 | 18 | # Adds all of the Jasmine testing global variables for version 1.3 and 2.0. 19 | jasmine: true 20 | 21 | # Enable eslint-plugin-angular 22 | plugins: 23 | - angular 24 | 25 | # Below we adjust rules specific to horizon's usage of openstack's linting 26 | # rules, and its own plugin inclusions. 27 | rules: 28 | ############################################################################# 29 | # Disabled Rules from eslint-config-openstack 30 | ############################################################################# 31 | valid-jsdoc: [1, { 32 | requireParamDescription: false 33 | }] 34 | brace-style: 1 35 | block-scoped-var: 1 36 | callback-return: 1 37 | consistent-return: 1 38 | guard-for-in: 1 39 | no-extra-parens: 1 40 | no-new: 1 41 | no-redeclare: 1 42 | no-undefined: 1 43 | no-unneeded-ternary: 1 44 | no-use-before-define: 1 45 | quote-props: 0 46 | semi-spacing: 1 47 | space-in-parens: 1 48 | 49 | ############################################################################# 50 | # Angular Plugin Customization 51 | ############################################################################# 52 | 53 | angular/controller-as-vm: 54 | - 1 55 | - "ctrl" 56 | 57 | # Remove after migrating to angular 1.4 or later. 58 | angular/no-cookiestore: 59 | - 1 60 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | ChangeLog 3 | build 4 | cover 5 | doc/source/contributor/api/ 6 | magnum_ui/test/.secret_key_store 7 | node_modules 8 | npm-debug.log 9 | releasenotes/build 10 | .coverage* 11 | .idea 12 | .jshintrc 13 | .project 14 | .pydevproject 15 | .settings 16 | .tox 17 | *.egg* 18 | *.lock 19 | *.pyc 20 | *.swp 21 | *.mo 22 | *nose_results.html 23 | .DS_Store 24 | -------------------------------------------------------------------------------- /.gitreview: -------------------------------------------------------------------------------- 1 | [gerrit] 2 | host=review.opendev.org 3 | port=29418 4 | project=openstack/magnum-ui.git 5 | -------------------------------------------------------------------------------- /.zuul.yaml: -------------------------------------------------------------------------------- 1 | - project: 2 | templates: 3 | - check-requirements 4 | - horizon-non-primary-django-jobs 5 | - horizon-nodejs-jobs 6 | - openstack-python3-jobs-horizon 7 | - publish-openstack-docs-pti 8 | - release-notes-jobs-python3 9 | -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | If you would like to contribute to the development of OpenStack, 2 | you must follow the steps in this page: 3 | 4 | https://docs.openstack.org/infra/manual/developers.html 5 | 6 | Once those steps have been completed, changes to OpenStack 7 | should be submitted for review via the Gerrit tool, following 8 | the workflow documented at: 9 | 10 | https://docs.openstack.org/infra/manual/developers.html#development-workflow 11 | 12 | Pull requests submitted through GitHub will be ignored. 13 | 14 | Bugs should be filed on Storyboard, not GitHub: 15 | 16 | https://storyboard.openstack.org/#!/project/openstack/magnum-ui 17 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | Team and repository tags 3 | ======================== 4 | 5 | .. image:: https://governance.openstack.org/tc/badges/magnum-ui.svg 6 | :target: https://governance.openstack.org/tc/reference/tags/index.html 7 | 8 | .. Change things from this point on 9 | 10 | ========= 11 | Magnum UI 12 | ========= 13 | 14 | Horizon plugin for Magnum 15 | 16 | * Free software: Apache license 17 | * Source: https://opendev.org/openstack/magnum-ui 18 | * Bugs: https://bugs.launchpad.net/magnum-ui 19 | * Documentation: https://docs.openstack.org/magnum-ui/latest/ 20 | * Release notes: https://docs.openstack.org/releasenotes/magnum-ui/ 21 | 22 | Enabling in DevStack 23 | -------------------- 24 | 25 | Add this repo as an external repository into your ``local.conf`` file:: 26 | 27 | [[local|localrc]] 28 | enable_plugin magnum-ui https://github.com/openstack/magnum-ui 29 | 30 | Manual Installation 31 | ------------------- 32 | 33 | Begin by cloning the Horizon and Magnum UI repositories:: 34 | 35 | git clone https://github.com/openstack/horizon 36 | git clone https://github.com/openstack/magnum-ui 37 | 38 | Create a virtual environment and install Horizon dependencies:: 39 | 40 | cd horizon 41 | python tools/install_venv.py 42 | 43 | Set up your ``local_settings.py`` file:: 44 | 45 | cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py 46 | 47 | Open up the copied ``local_settings.py`` file in your preferred text 48 | editor. You will want to customize several settings: 49 | 50 | - ``OPENSTACK_HOST`` should be configured with the hostname of your 51 | OpenStack server. Verify that the ``OPENSTACK_KEYSTONE_URL`` and 52 | ``OPENSTACK_KEYSTONE_DEFAULT_ROLE`` settings are correct for your 53 | environment. (They should be correct unless you modified your 54 | OpenStack server to change them.) 55 | 56 | Install Magnum UI with all dependencies in your virtual environment:: 57 | 58 | tools/with_venv.sh pip install -e ../magnum-ui/ 59 | 60 | And enable it in Horizon:: 61 | 62 | cp ../magnum-ui/magnum_ui/enabled/_1370_project_container_infra_panel_group.py openstack_dashboard/local/enabled 63 | cp ../magnum-ui/magnum_ui/enabled/_1371_project_container_infra_clusters_panel.py openstack_dashboard/local/enabled 64 | cp ../magnum-ui/magnum_ui/enabled/_1372_project_container_infra_cluster_templates_panel.py openstack_dashboard/local/enabled 65 | 66 | To run horizon with the newly enabled Magnum UI plugin run:: 67 | 68 | python manage.py runserver 0.0.0.0:8080 69 | 70 | to have the application start on port 8080 and the horizon dashboard will be 71 | available in your browser at http://localhost:8080/ 72 | -------------------------------------------------------------------------------- /babel-django.cfg: -------------------------------------------------------------------------------- 1 | [python: **.py] 2 | [django: templates/**.html] 3 | -------------------------------------------------------------------------------- /babel-djangojs.cfg: -------------------------------------------------------------------------------- 1 | [javascript: **.js] 2 | [angular: **/static/**.html] 3 | -------------------------------------------------------------------------------- /bindep.txt: -------------------------------------------------------------------------------- 1 | # This is a cross-platform list tracking distribution packages needed for install and tests; 2 | # see https://docs.openstack.org/infra/bindep/ for additional information. 3 | 4 | libfontconfig1 [nodejs platform:dpkg] 5 | -------------------------------------------------------------------------------- /devstack/plugin.sh: -------------------------------------------------------------------------------- 1 | # plugin.sh - DevStack plugin.sh dispatch script magnum-ui 2 | 3 | MAGNUM_UI_DIR=$(cd $(dirname $BASH_SOURCE)/.. && pwd) 4 | 5 | function install_magnum_ui { 6 | # NOTE(shu-mutou): workaround for devstack bug: 1540328 7 | # where devstack install 'test-requirements' but should not do it 8 | # for magnum-ui project as it installs Horizon from url. 9 | # Remove following two 'mv' commands when mentioned bug is fixed. 10 | mv $MAGNUM_UI_DIR/test-requirements.txt $MAGNUM_UI_DIR/_test-requirements.txt 11 | 12 | setup_develop ${MAGNUM_UI_DIR} 13 | 14 | mv $MAGNUM_UI_DIR/_test-requirements.txt $MAGNUM_UI_DIR/test-requirements.txt 15 | } 16 | 17 | function configure_magnum_ui { 18 | cp -a ${MAGNUM_UI_DIR}/magnum_ui/enabled/* ${DEST}/horizon/openstack_dashboard/local/enabled/ 19 | # NOTE: If locale directory does not exist, compilemessages will fail, 20 | # so check for an existence of locale directory is required. 21 | if [ -d ${MAGNUM_UI_DIR}/magnum_ui/locale ]; then 22 | (cd ${MAGNUM_UI_DIR}/magnum_ui; DJANGO_SETTINGS_MODULE=openstack_dashboard.settings $PYTHON ../manage.py compilemessages) 23 | fi 24 | } 25 | 26 | # check for service enabled 27 | if is_service_enabled magnum-ui; then 28 | 29 | if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then 30 | # Set up system services 31 | # no-op 32 | : 33 | 34 | elif [[ "$1" == "stack" && "$2" == "install" ]]; then 35 | # Perform installation of service source 36 | echo_summary "Installing Magnum UI" 37 | install_magnum_ui 38 | 39 | elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then 40 | # Configure after the other layer 1 and 2 services have been configured 41 | echo_summary "Configuring Magnum UI" 42 | configure_magnum_ui 43 | 44 | elif [[ "$1" == "stack" && "$2" == "extra" ]]; then 45 | # no-op 46 | : 47 | fi 48 | 49 | if [[ "$1" == "unstack" ]]; then 50 | # no-op 51 | : 52 | fi 53 | 54 | if [[ "$1" == "clean" ]]; then 55 | # Remove state and transient data 56 | # Remember clean.sh first calls unstack.sh 57 | # no-op 58 | : 59 | fi 60 | fi 61 | -------------------------------------------------------------------------------- /devstack/settings: -------------------------------------------------------------------------------- 1 | # settings file for magnum-ui plugin 2 | enable_service magnum-ui 3 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | openstackdocstheme>=2.2.1 # Apache-2.0 2 | reno>=3.1.0 # Apache-2.0 3 | sphinx>=2.0.0,!=2.1.0 # BSD 4 | sphinxcontrib-apidoc>=0.2.0 # BSD 5 | -------------------------------------------------------------------------------- /doc/source/contributor/api.rst: -------------------------------------------------------------------------------- 1 | ===================== 2 | Source Code Reference 3 | ===================== 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | :glob: 8 | 9 | api/* 10 | 11 | -------------------------------------------------------------------------------- /doc/source/contributor/index.rst: -------------------------------------------------------------------------------- 1 | ================= 2 | Contributor Guide 3 | ================= 4 | 5 | There is no topic specific to Magnum UI now. 6 | 7 | See `Horizon Developer Documents 8 | `__ 9 | 10 | ---- 11 | 12 | .. toctree:: 13 | :glob: 14 | :maxdepth: 1 15 | 16 | api 17 | 18 | -------------------------------------------------------------------------------- /doc/source/index.rst: -------------------------------------------------------------------------------- 1 | ========= 2 | Magnum UI 3 | ========= 4 | 5 | Horizon plugin for Magnum 6 | 7 | * Free software: Apache license 8 | * Source: https://opendev.org/openstack/magnum-ui 9 | * Blueprints: https://blueprints.launchpad.net/magnum-ui 10 | * Bugs: https://bugs.launchpad.net/magnum-ui 11 | 12 | User Documentation 13 | ------------------ 14 | 15 | .. toctree:: 16 | :maxdepth: 2 17 | 18 | install/index 19 | configuration/index 20 | Release Notes 21 | 22 | Contributor Guide 23 | ----------------- 24 | 25 | .. toctree:: 26 | :glob: 27 | :maxdepth: 2 28 | 29 | contributor/index 30 | -------------------------------------------------------------------------------- /doc/source/install/index.rst: -------------------------------------------------------------------------------- 1 | ============ 2 | Installation 3 | ============ 4 | 5 | Enabling in DevStack 6 | -------------------- 7 | 8 | Add this repo as an external repository into your ``local.conf`` file:: 9 | 10 | [[local|localrc]] 11 | enable_plugin magnum-ui https://github.com/openstack/magnum-ui 12 | 13 | Manual Installation 14 | ------------------- 15 | 16 | Begin by cloning the Horizon and Magnum UI repositories:: 17 | 18 | git clone https://github.com/openstack/horizon 19 | git clone https://github.com/openstack/magnum-ui 20 | 21 | Create a virtual environment and install Horizon dependencies:: 22 | 23 | cd horizon 24 | python tools/install_venv.py 25 | 26 | Set up your ``local_settings.py`` file:: 27 | 28 | cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py 29 | 30 | Open up the copied ``local_settings.py`` file in your preferred text 31 | editor. You will want to customize several settings: 32 | 33 | - ``OPENSTACK_HOST`` should be configured with the hostname of your 34 | OpenStack server. Verify that the ``OPENSTACK_KEYSTONE_URL`` and 35 | ``OPENSTACK_KEYSTONE_DEFAULT_ROLE`` settings are correct for your 36 | environment. (They should be correct unless you modified your 37 | OpenStack server to change them.) 38 | 39 | Install Magnum UI with all dependencies in your virtual environment:: 40 | 41 | tools/with_venv.sh pip install -e ../magnum-ui/ 42 | 43 | And enable it in Horizon:: 44 | 45 | cp ../magnum-ui/magnum_ui/enabled/_1370_project_container_infra_panelgroup.py openstack_dashboard/local/enabled 46 | cp ../magnum-ui/magnum_ui/enabled/_1371_project_container_infra_clusters_panel.py openstack_dashboard/local/enabled 47 | cp ../magnum-ui/magnum_ui/enabled/_1372_project_container_infra_cluster_templates_panel.py openstack_dashboard/local/enabled 48 | 49 | To run horizon with the newly enabled Magnum UI plugin run:: 50 | 51 | python manage.py runserver 0.0.0.0:8080 52 | 53 | to have the application start on port 8080 and the horizon dashboard will be 54 | available in your browser at http://localhost:8080/ 55 | -------------------------------------------------------------------------------- /magnum_ui/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/magnum-ui/fa0768cd58af0c4409ccefccef4a045e7ae73c41/magnum_ui/__init__.py -------------------------------------------------------------------------------- /magnum_ui/api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/magnum-ui/fa0768cd58af0c4409ccefccef4a045e7ae73c41/magnum_ui/api/__init__.py -------------------------------------------------------------------------------- /magnum_ui/api/heat.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Cisco Systems. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | 16 | import logging 17 | 18 | from django.conf import settings 19 | 20 | from horizon.utils.memoized import memoized 21 | from openstack_dashboard.api import base 22 | 23 | from heatclient import client as heat_client 24 | 25 | LOG = logging.getLogger(__name__) 26 | 27 | 28 | @memoized 29 | def heatclient(request, password=None): 30 | 31 | service_type = 'orchestration' 32 | openstack_api_versions = getattr(settings, 'OPENSTACK_API_VERSIONS', {}) 33 | api_version = openstack_api_versions.get(service_type, 1) 34 | 35 | insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) 36 | cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) 37 | 38 | endpoint = base.url_for(request, 'orchestration') 39 | kwargs = { 40 | 'token': request.user.token.id, 41 | 'insecure': insecure, 42 | 'ca_file': cacert, 43 | 'username': request.user.username, 44 | 'password': password 45 | } 46 | 47 | client = heat_client.Client(api_version, endpoint, **kwargs) 48 | client.format_parameters = format_parameters 49 | return client 50 | 51 | 52 | def format_parameters(params): 53 | parameters = {} 54 | for count, p in enumerate(params, 1): 55 | parameters['Parameters.member.%d.ParameterKey' % count] = p 56 | parameters['Parameters.member.%d.ParameterValue' % count] = params[p] 57 | return parameters 58 | 59 | 60 | def stack_get(request, stack_id): 61 | return heatclient(request).stacks.get(stack_id) 62 | -------------------------------------------------------------------------------- /magnum_ui/api/rest/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016 Cisco Systems 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Import REST modules here 16 | from . import magnum # noqa: F401 17 | -------------------------------------------------------------------------------- /magnum_ui/content/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/magnum-ui/fa0768cd58af0c4409ccefccef4a045e7ae73c41/magnum_ui/content/__init__.py -------------------------------------------------------------------------------- /magnum_ui/content/cluster_templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/magnum-ui/fa0768cd58af0c4409ccefccef4a045e7ae73c41/magnum_ui/content/cluster_templates/__init__.py -------------------------------------------------------------------------------- /magnum_ui/content/cluster_templates/panel.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Cisco Systems, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | from django.utils.translation import gettext_lazy as _ 16 | import horizon 17 | 18 | 19 | class ClusterTemplates(horizon.Panel): 20 | name = _("Cluster Templates") 21 | slug = "cluster_templates" 22 | -------------------------------------------------------------------------------- /magnum_ui/content/cluster_templates/tests.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Cisco Systems 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | from openstack_dashboard.test import helpers as test 16 | 17 | 18 | class ClusterTemplateTests(test.TestCase): 19 | # Unit tests for cluster template. 20 | def test_me(self): 21 | self.assertTrue(1 + 1 == 2) 22 | -------------------------------------------------------------------------------- /magnum_ui/content/cluster_templates/urls.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Cisco Systems 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | from django.urls import re_path 16 | from django.utils.translation import gettext_lazy as _ 17 | from horizon.browsers import views 18 | from magnum_ui.content.cluster_templates import panel 19 | 20 | 21 | title = _("Container Infra - Cluster Templates") 22 | page_title = panel.ClusterTemplates.name 23 | urlpatterns = [ 24 | re_path(r'^$', 25 | views.AngularIndexView.as_view(title=title, 26 | page_title=page_title), 27 | name='index'), 28 | ] 29 | -------------------------------------------------------------------------------- /magnum_ui/content/clusters/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/magnum-ui/fa0768cd58af0c4409ccefccef4a045e7ae73c41/magnum_ui/content/clusters/__init__.py -------------------------------------------------------------------------------- /magnum_ui/content/clusters/panel.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Cisco Systems 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | from django.utils.translation import gettext_lazy as _ 16 | import horizon 17 | 18 | # DO NOT REMOVE 19 | # This needs for register url of REST API. 20 | # Dashboard plugins load REST API from here. 21 | from magnum_ui.api.rest import magnum # noqa: F401 22 | 23 | 24 | class Clusters(horizon.Panel): 25 | name = _("Clusters") 26 | slug = "clusters" 27 | -------------------------------------------------------------------------------- /magnum_ui/content/clusters/tests.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Cisco Systems 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | from openstack_dashboard.test import helpers as test 16 | 17 | 18 | class ClusterTests(test.TestCase): 19 | # Unit tests for cluster. 20 | def test_me(self): 21 | self.assertTrue(1 + 1 == 2) 22 | -------------------------------------------------------------------------------- /magnum_ui/content/clusters/urls.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Cisco Systems 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | from django.urls import re_path 16 | from django.utils.translation import gettext_lazy as _ 17 | from horizon.browsers import views 18 | from magnum_ui.content.clusters import panel 19 | 20 | 21 | title = _("Container Infra - Clusters") 22 | page_title = panel.Clusters.name 23 | urlpatterns = [ 24 | re_path(r'^$', views.AngularIndexView.as_view( 25 | title=title, page_title=page_title), 26 | name='index'), 27 | ] 28 | -------------------------------------------------------------------------------- /magnum_ui/content/container_infra/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/magnum-ui/fa0768cd58af0c4409ccefccef4a045e7ae73c41/magnum_ui/content/container_infra/__init__.py -------------------------------------------------------------------------------- /magnum_ui/content/container_infra/quotas/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/magnum-ui/fa0768cd58af0c4409ccefccef4a045e7ae73c41/magnum_ui/content/container_infra/quotas/__init__.py -------------------------------------------------------------------------------- /magnum_ui/content/container_infra/quotas/panel.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from django.utils.translation import gettext_lazy as _ 14 | 15 | import horizon 16 | 17 | 18 | class Quotas(horizon.Panel): 19 | name = _("Quotas") 20 | slug = "container_infra.quotas" 21 | -------------------------------------------------------------------------------- /magnum_ui/content/container_infra/quotas/urls.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | from django.urls import re_path 14 | from django.utils.translation import gettext_lazy as _ 15 | 16 | from horizon.browsers import views 17 | 18 | from magnum_ui.content.container_infra.quotas import panel 19 | 20 | title = _("Container Infra - Quotas") 21 | page_title = panel.Quotas.name 22 | urlpatterns = [ 23 | re_path(r'^$', views.AngularIndexView.as_view( 24 | title=title, page_title=page_title), 25 | name='index'), 26 | ] 27 | -------------------------------------------------------------------------------- /magnum_ui/enabled/_1370_project_container_infra_panel_group.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Cisco Systems. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | from django.utils.translation import gettext_lazy as _ 15 | 16 | # The slug of the panel group to be added to HORIZON_CONFIG. Required. 17 | PANEL_GROUP = 'container_infra' 18 | # The display name of the PANEL_GROUP. Required. 19 | PANEL_GROUP_NAME = _('Container Infra') 20 | # The slug of the dashboard the PANEL_GROUP associated with. Required. 21 | PANEL_GROUP_DASHBOARD = 'project' 22 | 23 | ADD_INSTALLED_APPS = ['magnum_ui'] 24 | 25 | ADD_ANGULAR_MODULES = [ 26 | 'horizon.dashboard.container-infra' 27 | ] 28 | 29 | ADD_JS_FILES = [ 30 | 'horizon/lib/angular/angular-route.js' 31 | ] 32 | 33 | ADD_SCSS_FILES = [ 34 | 'dashboard/container-infra/container-infra.scss' 35 | ] 36 | 37 | AUTO_DISCOVER_STATIC_FILES = True 38 | -------------------------------------------------------------------------------- /magnum_ui/enabled/_1371_project_container_infra_clusters_panel.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 NEC Corporation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | # The slug of the panel to be added to HORIZON_CONFIG. Required. 16 | PANEL = 'clusters' 17 | # The slug of the panel group the PANEL is associated with. 18 | PANEL_GROUP = 'container_infra' 19 | # The slug of the dashboard the PANEL associated with. Required. 20 | PANEL_DASHBOARD = 'project' 21 | 22 | # Python panel class of the PANEL to be added. 23 | ADD_PANEL = 'magnum_ui.content.clusters.panel.Clusters' 24 | -------------------------------------------------------------------------------- /magnum_ui/enabled/_1372_project_container_infra_cluster_templates_panel.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 NEC Corporation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | # The slug of the panel to be added to HORIZON_CONFIG. Required. 16 | PANEL = 'cluster_templates' 17 | # The slug of the panel group the PANEL is associated with. 18 | PANEL_GROUP = 'container_infra' 19 | # The slug of the dashboard the PANEL associated with. Required. 20 | PANEL_DASHBOARD = 'project' 21 | 22 | # Python panel class of the PANEL to be added. 23 | ADD_PANEL = 'magnum_ui.content.cluster_templates.panel.ClusterTemplates' 24 | -------------------------------------------------------------------------------- /magnum_ui/enabled/_2370_admin_container_infra_panel_group.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | from django.utils.translation import gettext_lazy as _ 13 | 14 | # The slug of the panel group to be added to HORIZON_CONFIG. Required. 15 | PANEL_GROUP = 'container_infra' 16 | # The display name of the PANEL_GROUP. Required. 17 | PANEL_GROUP_NAME = _('Container Infra') 18 | # The slug of the dashboard the PANEL_GROUP associated with. Required. 19 | PANEL_GROUP_DASHBOARD = 'admin' 20 | -------------------------------------------------------------------------------- /magnum_ui/enabled/_2371_admin_container_infra_quotas_panel.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | 13 | # The slug of the panel to be added to HORIZON_CONFIG. Required. 14 | PANEL = 'container_infra.quotas' 15 | # The slug of the panel group the PANEL is associated with. 16 | PANEL_GROUP = 'container_infra' 17 | # The slug of the dashboard the PANEL associated with. Required. 18 | PANEL_DASHBOARD = 'admin' 19 | 20 | # Python panel class of the PANEL to be added. 21 | ADD_PANEL = 'magnum_ui.content.container_infra.quotas.panel.Quotas' 22 | -------------------------------------------------------------------------------- /magnum_ui/enabled/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/magnum-ui/fa0768cd58af0c4409ccefccef4a045e7ae73c41/magnum_ui/enabled/__init__.py -------------------------------------------------------------------------------- /magnum_ui/locale/cs/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # Stanislav Ulrych , 2016. #zanata 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: magnum-ui 2.1.1.dev83\n" 5 | "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" 6 | "POT-Creation-Date: 2016-11-22 10:06+0000\n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "PO-Revision-Date: 2016-11-22 08:58+0000\n" 11 | "Last-Translator: Stanislav Ulrych \n" 12 | "Language-Team: Czech\n" 13 | "Language: cs\n" 14 | "X-Generator: Zanata 3.7.3\n" 15 | "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n" 16 | 17 | msgid "Cluster Templates" 18 | msgstr "Šablony clusterů" 19 | 20 | msgid "Clusters" 21 | msgstr "Clustery" 22 | 23 | msgid "Container Infra" 24 | msgstr "Infrastruktura kontejneru" 25 | -------------------------------------------------------------------------------- /magnum_ui/locale/de/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # Frank Kloeker , 2017. #zanata 2 | # Robert Simai , 2018. #zanata 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: magnum-ui VERSION\n" 6 | "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" 7 | "POT-Creation-Date: 2018-05-10 05:31+0000\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2018-05-11 02:25+0000\n" 12 | "Last-Translator: Robert Simai \n" 13 | "Language-Team: German\n" 14 | "Language: de\n" 15 | "X-Generator: Zanata 4.3.3\n" 16 | "Plural-Forms: nplurals=2; plural=(n != 1)\n" 17 | 18 | msgid "Cluster Templates" 19 | msgstr "Clustervorlagen" 20 | 21 | msgid "Clusters" 22 | msgstr "Cluster" 23 | 24 | msgid "Container Infra" 25 | msgstr "Container Infra" 26 | 27 | msgid "Container Infra - Cluster Templates" 28 | msgstr "Container Infra - Clustervorlagen" 29 | 30 | msgid "Container Infra - Clusters" 31 | msgstr "Container Infra - Cluster" 32 | 33 | msgid "Container Infra - Quotas" 34 | msgstr "Container Infra - Kontingente" 35 | 36 | msgid "Quotas" 37 | msgstr "Kontingente" 38 | -------------------------------------------------------------------------------- /magnum_ui/locale/en_GB/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # Andi Chandler , 2017. #zanata 2 | # Andi Chandler , 2018. #zanata 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: magnum-ui VERSION\n" 6 | "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" 7 | "POT-Creation-Date: 2018-04-17 01:53+0000\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2018-04-17 11:30+0000\n" 12 | "Last-Translator: Andi Chandler \n" 13 | "Language-Team: English (United Kingdom)\n" 14 | "Language: en_GB\n" 15 | "X-Generator: Zanata 4.3.3\n" 16 | "Plural-Forms: nplurals=2; plural=(n != 1)\n" 17 | 18 | msgid "Cluster Templates" 19 | msgstr "Cluster Templates" 20 | 21 | msgid "Clusters" 22 | msgstr "Clusters" 23 | 24 | msgid "Container Infra" 25 | msgstr "Container Infra" 26 | 27 | msgid "Container Infra - Cluster Templates" 28 | msgstr "Container Infra - Cluster Templates" 29 | 30 | msgid "Container Infra - Clusters" 31 | msgstr "Container Infra - Clusters" 32 | 33 | msgid "Container Infra - Quotas" 34 | msgstr "Container Infra - Quotas" 35 | 36 | msgid "Quotas" 37 | msgstr "Quotas" 38 | -------------------------------------------------------------------------------- /magnum_ui/locale/fr/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # Gérald LONLAS , 2016. #zanata 2 | # Mateusz Kowalski , 2017. #zanata 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: magnum-ui 2.2.1.dev79\n" 6 | "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" 7 | "POT-Creation-Date: 2017-08-01 03:14+0000\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2017-08-01 08:38+0000\n" 12 | "Last-Translator: Mateusz Kowalski \n" 13 | "Language-Team: French\n" 14 | "Language: fr\n" 15 | "X-Generator: Zanata 3.9.6\n" 16 | "Plural-Forms: nplurals=2; plural=(n > 1)\n" 17 | 18 | msgid "Cluster Templates" 19 | msgstr "Modèles de cluster" 20 | 21 | msgid "Clusters" 22 | msgstr "Clusters" 23 | 24 | msgid "Container Infra" 25 | msgstr "Infrastructure de conteneur" 26 | 27 | msgid "Container Infra - Cluster Templates" 28 | msgstr "Infrastructure de conteneur - Modèles de cluster" 29 | 30 | msgid "Container Infra - Clusters" 31 | msgstr "Infrastructure de conteneur - Clusters" 32 | -------------------------------------------------------------------------------- /magnum_ui/locale/id/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # suhartono , 2016. #zanata 2 | # suhartono , 2017. #zanata 3 | # suhartono , 2018. #zanata 4 | msgid "" 5 | msgstr "" 6 | "Project-Id-Version: magnum-ui VERSION\n" 7 | "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" 8 | "POT-Creation-Date: 2018-05-10 05:31+0000\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "PO-Revision-Date: 2018-05-09 04:29+0000\n" 13 | "Last-Translator: suhartono \n" 14 | "Language-Team: Indonesian\n" 15 | "Language: id\n" 16 | "X-Generator: Zanata 4.3.3\n" 17 | "Plural-Forms: nplurals=1; plural=0\n" 18 | 19 | msgid "Cluster Templates" 20 | msgstr "Cluster Templates (template klaster)" 21 | 22 | msgid "Clusters" 23 | msgstr "Clusters (klaster)" 24 | 25 | msgid "Container Infra" 26 | msgstr "Container Infra (infra kontainer)" 27 | 28 | msgid "Container Infra - Cluster Templates" 29 | msgstr "Container Infra - Cluster Templates" 30 | 31 | msgid "Container Infra - Clusters" 32 | msgstr "Container Infra - Clusters" 33 | 34 | msgid "Container Infra - Quotas" 35 | msgstr "Container Infra - Quotas" 36 | 37 | msgid "Quotas" 38 | msgstr "Quotas" 39 | -------------------------------------------------------------------------------- /magnum_ui/locale/ja/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # Shu Muto , 2016. #zanata 2 | # Shu Muto , 2018. #zanata 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: magnum-ui VERSION\n" 6 | "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" 7 | "POT-Creation-Date: 2018-05-16 02:29+0000\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2018-05-29 08:35+0000\n" 12 | "Last-Translator: Shu Muto \n" 13 | "Language-Team: Japanese\n" 14 | "Language: ja\n" 15 | "X-Generator: Zanata 4.3.3\n" 16 | "Plural-Forms: nplurals=1; plural=0\n" 17 | 18 | msgid "Cluster Templates" 19 | msgstr "クラスターテンプレート" 20 | 21 | msgid "Clusters" 22 | msgstr "クラスター" 23 | 24 | msgid "Container Infra" 25 | msgstr "コンテナーインフラ" 26 | 27 | msgid "Container Infra - Cluster Templates" 28 | msgstr "コンテナーインフラ - クラスターテンプレート" 29 | 30 | msgid "Container Infra - Clusters" 31 | msgstr "コンテナーインフラ - クラスター" 32 | 33 | msgid "Container Infra - Quotas" 34 | msgstr "コンテナーインフラ - クォータ" 35 | 36 | msgid "Quotas" 37 | msgstr "クォータ" 38 | -------------------------------------------------------------------------------- /magnum_ui/locale/ko_KR/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # Sungjin Kang , 2017. #zanata 2 | # ByungYeol Woo , 2018. #zanata 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: magnum-ui VERSION\n" 6 | "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" 7 | "POT-Creation-Date: 2018-04-25 10:07+0000\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2018-04-25 10:36+0000\n" 12 | "Last-Translator: ByungYeol Woo \n" 13 | "Language-Team: Korean (South Korea)\n" 14 | "Language: ko_KR\n" 15 | "X-Generator: Zanata 4.3.3\n" 16 | "Plural-Forms: nplurals=1; plural=0\n" 17 | 18 | msgid "Cluster Templates" 19 | msgstr "클러스터 템플릿" 20 | 21 | msgid "Clusters" 22 | msgstr "클러스터" 23 | 24 | msgid "Container Infra" 25 | msgstr "컨테이너 인프라" 26 | 27 | msgid "Container Infra - Cluster Templates" 28 | msgstr "컨테이너 인프라 - 클러스터 템플릿" 29 | 30 | msgid "Container Infra - Clusters" 31 | msgstr "컨테이너 인프라 - 클러스터" 32 | 33 | msgid "Container Infra - Quotas" 34 | msgstr "컨테이너 인프라 - 할당량" 35 | 36 | msgid "Quotas" 37 | msgstr "할당량" 38 | -------------------------------------------------------------------------------- /magnum_ui/locale/pt_BR/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # Fernando Pimenta , 2017. #zanata 2 | # Fernando Pimenta , 2018. #zanata 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: magnum-ui VERSION\n" 6 | "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" 7 | "POT-Creation-Date: 2018-04-20 04:21+0000\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2018-04-24 07:21+0000\n" 12 | "Last-Translator: Fernando Pimenta \n" 13 | "Language-Team: Portuguese (Brazil)\n" 14 | "Language: pt_BR\n" 15 | "X-Generator: Zanata 4.3.3\n" 16 | "Plural-Forms: nplurals=2; plural=(n != 1)\n" 17 | 18 | msgid "Cluster Templates" 19 | msgstr "Modelos de Cluster" 20 | 21 | msgid "Clusters" 22 | msgstr "Clusters" 23 | 24 | msgid "Container Infra" 25 | msgstr "Infraestrutura de Contêiner" 26 | 27 | msgid "Container Infra - Cluster Templates" 28 | msgstr "Infraestrutura de Contêiner - Modelos de Cluster" 29 | 30 | msgid "Container Infra - Clusters" 31 | msgstr "Infraestrutura de Contêiner - Clusters" 32 | 33 | msgid "Container Infra - Quotas" 34 | msgstr "Infraestrutura de Contêiner - Quotas" 35 | 36 | msgid "Quotas" 37 | msgstr "Quotas" 38 | -------------------------------------------------------------------------------- /magnum_ui/locale/ru/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # Veronika Stepurova , 2016. #zanata 2 | # Dmitriy Rabotyagov , 2020. #zanata 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: magnum-ui VERSION\n" 6 | "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" 7 | "POT-Creation-Date: 2019-12-29 09:43+0000\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2020-01-09 11:14+0000\n" 12 | "Last-Translator: Dmitriy Rabotyagov \n" 13 | "Language-Team: Russian\n" 14 | "Language: ru\n" 15 | "X-Generator: Zanata 4.3.3\n" 16 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" 17 | "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" 18 | 19 | msgid "Cluster Templates" 20 | msgstr "Шаблоны Кластера" 21 | 22 | msgid "Clusters" 23 | msgstr "Кластеры" 24 | 25 | msgid "Container Infra" 26 | msgstr "Контейнерная Инфраструктура" 27 | 28 | msgid "Container Infra - Cluster Templates" 29 | msgstr "Контейнерная Инфраструктура - Шаблоны Кластера" 30 | 31 | msgid "Container Infra - Clusters" 32 | msgstr "Контейнерная Инфраструктура - Кластеры" 33 | 34 | msgid "Container Infra - Quotas" 35 | msgstr "Контейнерная Инфраструктура - Квоты" 36 | 37 | msgid "Quotas" 38 | msgstr "Квоты" 39 | -------------------------------------------------------------------------------- /magnum_ui/locale/tr_TR/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # işbaran akçayır , 2017. #zanata 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: magnum-ui VERSION\n" 5 | "Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n" 6 | "POT-Creation-Date: 2018-02-26 11:52+0000\n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "PO-Revision-Date: 2017-05-22 09:09+0000\n" 11 | "Last-Translator: işbaran akçayır \n" 12 | "Language-Team: Turkish (Turkey)\n" 13 | "Language: tr_TR\n" 14 | "X-Generator: Zanata 4.3.3\n" 15 | "Plural-Forms: nplurals=2; plural=(n>1)\n" 16 | 17 | msgid "Cluster Templates" 18 | msgstr "Küme şablonları" 19 | 20 | msgid "Clusters" 21 | msgstr "Kümeler" 22 | 23 | msgid "Container Infra" 24 | msgstr "Kapsayıcı Altyapısı" 25 | 26 | msgid "Container Infra - Cluster Templates" 27 | msgstr "Kapsayıcı Altyapısı - Küme Şablonları" 28 | 29 | msgid "Container Infra - Clusters" 30 | msgstr "Kapsayıcı Altyapısı - Kümeler" 31 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/actions.module.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc overview 20 | * @ngname horizon.dashboard.container-infra.cluster-templates.actions 21 | * 22 | * @description 23 | * Provides all of the actions for cluster templates. 24 | */ 25 | angular.module('horizon.dashboard.container-infra.cluster-templates.actions', 26 | [ 27 | 'horizon.framework', 28 | 'horizon.dashboard.container-infra' 29 | ]) 30 | .run(registerClusterTemplateActions); 31 | 32 | registerClusterTemplateActions.$inject = [ 33 | 'horizon.framework.conf.resource-type-registry.service', 34 | 'horizon.framework.util.i18n.gettext', 35 | 'horizon.dashboard.container-infra.cluster-templates.create.service', 36 | 'horizon.dashboard.container-infra.cluster-templates.delete.service', 37 | 'horizon.dashboard.container-infra.cluster-templates.update.service', 38 | 'horizon.dashboard.container-infra.clusters.create.service', 39 | 'horizon.dashboard.container-infra.cluster-templates.resourceType' 40 | ]; 41 | 42 | function registerClusterTemplateActions( 43 | registry, 44 | gettext, 45 | createClusterTemplateService, 46 | deleteClusterTemplateService, 47 | updateClusterTemplateService, 48 | createClusterService, 49 | resourceType) { 50 | 51 | var templateResourceType = registry.getResourceType(resourceType); 52 | 53 | templateResourceType.globalActions 54 | .append({ 55 | id: 'createClusterTemplateAction', 56 | service: createClusterTemplateService, 57 | template: { 58 | type: 'create', 59 | text: gettext('Create Cluster Template') 60 | } 61 | }); 62 | 63 | templateResourceType.batchActions 64 | .append({ 65 | id: 'batchDeleteClusterTemplateAction', 66 | service: deleteClusterTemplateService, 67 | template: { 68 | type: 'delete-selected', 69 | text: gettext('Delete Cluster Templates') 70 | } 71 | }); 72 | 73 | templateResourceType.itemActions 74 | .append({ 75 | id: 'createClusterAction', 76 | service: createClusterService, 77 | template: { 78 | text: gettext('Create Cluster') 79 | } 80 | }) 81 | .append({ 82 | id: 'updateClusterTemplateAction', 83 | service: updateClusterTemplateService, 84 | template: { 85 | text: gettext('Update Cluster Template') 86 | } 87 | }) 88 | .append({ 89 | id: 'deleteClusterTemplateAction', 90 | service: deleteClusterTemplateService, 91 | template: { 92 | type: 'delete', 93 | text: gettext('Delete Cluster Template') 94 | } 95 | }); 96 | } 97 | })(); 98 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/actions.module.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * (c) Copyright 2016 NEC Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('register cluster template actions module', function() { 21 | var registry; 22 | beforeEach(module('horizon.dashboard.container-infra.cluster-templates.actions')); 23 | 24 | beforeEach(inject(function($injector) { 25 | registry = $injector.get('horizon.framework.conf.resource-type-registry.service'); 26 | })); 27 | 28 | it('registers Create ClusterTemplate as a batch action', function() { 29 | var actions = registry.getResourceType('OS::Magnum::ClusterTemplate').globalActions; 30 | expect(actionHasId(actions, 'createClusterTemplateAction')).toBe(true); 31 | }); 32 | 33 | it('registers Delete ClusterTemplate as a batch action', function() { 34 | var actions = registry.getResourceType('OS::Magnum::ClusterTemplate').batchActions; 35 | expect(actionHasId(actions, 'batchDeleteClusterTemplateAction')).toBe(true); 36 | }); 37 | 38 | it('registers Create Cluster as an item action', function() { 39 | var actions = registry.getResourceType('OS::Magnum::ClusterTemplate').itemActions; 40 | expect(actionHasId(actions, 'createClusterAction')).toBe(true); 41 | }); 42 | 43 | it('registers Delete ClusterTemplate as an item action', function() { 44 | var actions = registry.getResourceType('OS::Magnum::ClusterTemplate').itemActions; 45 | expect(actionHasId(actions, 'deleteClusterTemplateAction')).toBe(true); 46 | }); 47 | 48 | function actionHasId(list, value) { 49 | return list.filter(matchesId).length === 1; 50 | 51 | function matchesId(action) { 52 | return action.id === value; 53 | } 54 | } 55 | 56 | }); 57 | })(); 58 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.module.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 Cisco Systems, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | (function() { 17 | 'use strict'; 18 | 19 | describe('horizon.dashboard.container-infra.cluster-templates', function() { 20 | it('should exist', function() { 21 | expect(angular.module('horizon.dashboard.container-infra.cluster-templates')).toBeDefined(); 22 | }); 23 | }); 24 | 25 | })(); 26 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | "use strict"; 17 | 18 | angular.module('horizon.dashboard.container-infra.cluster-templates') 19 | .factory('horizon.dashboard.container-infra.cluster-templates.service', 20 | clusterTemplatesService); 21 | 22 | clusterTemplatesService.$inject = [ 23 | '$filter', 24 | 'horizon.app.core.detailRoute', 25 | 'horizon.app.core.openstack-service-api.magnum' 26 | ]; 27 | 28 | /* 29 | * @ngdoc factory 30 | * @name horizon.dashboard.container-infra.cluster-templates.service 31 | * 32 | * @description 33 | * This service provides functions that are used through the Cluster Templates 34 | * features. These are primarily used in the module registrations 35 | * but do not need to be restricted to such use. Each exposed function 36 | * is documented below. 37 | */ 38 | function clusterTemplatesService($filter, detailRoute, magnum) { 39 | return { 40 | getClusterTemplatesPromise: getClusterTemplatesPromise, 41 | urlFunction: urlFunction 42 | }; 43 | 44 | function getClusterTemplatesPromise(params) { 45 | return magnum.getClusterTemplates(params).then(modifyResponse); 46 | 47 | function modifyResponse(response) { 48 | return {data: {items: response.data.items.map(addTrackBy)}}; 49 | 50 | function addTrackBy(clusterTemplate) { 51 | /* eslint-disable max-len */ 52 | var timestamp = clusterTemplate.updated_at ? clusterTemplate.updated_at : clusterTemplate.created_at; 53 | clusterTemplate.trackBy = clusterTemplate.id + timestamp; 54 | return clusterTemplate; 55 | } 56 | } 57 | } 58 | 59 | function urlFunction(item) { 60 | return detailRoute + 'OS::Magnum::ClusterTemplate/' + item.id; 61 | } 62 | } 63 | })(); 64 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.service.spec.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | (function() { 16 | "use strict"; 17 | 18 | describe('cluster templates service', function() { 19 | var service, detailRoute; 20 | beforeEach(module('horizon.dashboard.container-infra.cluster-templates')); 21 | beforeEach(inject(function($injector) { 22 | service = $injector.get('horizon.dashboard.container-infra.cluster-templates.service'); 23 | detailRoute = $injector.get('horizon.app.core.detailRoute'); 24 | })); 25 | 26 | describe('getClusterTemplatesPromise', function() { 27 | it("provides a promise", inject(function($q, $injector, $timeout) { 28 | var magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 29 | var deferred = $q.defer(); 30 | spyOn(magnum, 'getClusterTemplates').and.returnValue(deferred.promise); 31 | var result = service.getClusterTemplatesPromise({}); 32 | deferred.resolve({ 33 | data:{ 34 | items: [ 35 | {id: 123, name: 'template1', updated_at: '2020-01-01'}, 36 | {id: 456, name: 'template2', created_at: '2021-12-12'}, 37 | ] 38 | } 39 | }); 40 | $timeout.flush(); 41 | expect(magnum.getClusterTemplates).toHaveBeenCalled(); 42 | expect(result.$$state.value.data.items[0].name).toBe('template1'); 43 | expect(result.$$state.value.data.items[0].trackBy).toBe('1232020-01-01'); 44 | expect(result.$$state.value.data.items[1].name).toBe('template2'); 45 | expect(result.$$state.value.data.items[1].trackBy).toBe('4562021-12-12'); 46 | })); 47 | }); 48 | 49 | describe('urlFunction', function() { 50 | it("get url", inject(function() { 51 | var result = service.urlFunction({id:"123abc"}); 52 | expect(result).toBe(detailRoute + "OS::Magnum::ClusterTemplate/123abc"); 53 | })); 54 | }); 55 | 56 | }); 57 | 58 | })(); 59 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/create/create.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 Cisco Systems, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | /** 21 | * @ngdoc overview 22 | * @name horizon.dashboard.container-infra.cluster-templates.create.service 23 | * @description Service for the container-infra cluster template create modal 24 | */ 25 | angular 26 | .module('horizon.dashboard.container-infra.cluster-templates') 27 | .factory('horizon.dashboard.container-infra.cluster-templates.create.service', createService); 28 | 29 | createService.$inject = [ 30 | 'horizon.app.core.openstack-service-api.magnum', 31 | 'horizon.app.core.openstack-service-api.policy', 32 | 'horizon.framework.util.actions.action-result.service', 33 | 'horizon.framework.util.i18n.gettext', 34 | 'horizon.framework.util.q.extensions', 35 | 'horizon.framework.widgets.form.ModalFormService', 36 | 'horizon.framework.widgets.toast.service', 37 | 'horizon.dashboard.container-infra.cluster-templates.resourceType', 38 | 'horizon.dashboard.container-infra.cluster-templates.workflow' 39 | ]; 40 | 41 | function createService( 42 | magnum, policy, actionResult, gettext, $qExtensions, modal, toast, resourceType, workflow 43 | ) { 44 | 45 | var config; 46 | var message = { 47 | success: gettext('Cluster template %s was successfully created.') 48 | }; 49 | 50 | var service = { 51 | perform: perform, 52 | allowed: allowed 53 | }; 54 | 55 | return service; 56 | 57 | ////////////// 58 | 59 | function perform() { 60 | config = workflow.init('create', gettext('Create Cluster Template')); 61 | return modal.open(config).then(submit); 62 | } 63 | 64 | function allowed() { 65 | return $qExtensions.booleanAsPromise(true); 66 | } 67 | 68 | function submit(context) { 69 | context.model = cleanNullProperties(context.model); 70 | return magnum.createClusterTemplate(context.model, true).then(success, true); 71 | } 72 | 73 | function cleanNullProperties(model) { 74 | // Initially clean fields that don't have any value. 75 | // Not only "null", blank too. 76 | for (var key in model) { 77 | if (model.hasOwnProperty(key) && model[key] === null || model[key] === "" || 78 | key === "tabs") { 79 | delete model[key]; 80 | } 81 | } 82 | return model; 83 | } 84 | 85 | function success(response) { 86 | response.data.id = response.data.uuid; 87 | toast.add('success', interpolate(message.success, [response.data.id])); 88 | return actionResult.getActionResult() 89 | .created(resourceType, response.data.id) 90 | .result; 91 | } 92 | } 93 | })(); 94 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/create/create.service.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * (c) Copyright 2016 NEC Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('horizon.dashboard.container-infra.cluster-templates.create.service', function() { 21 | 22 | var service, $scope, $q, deferred, magnum, workflow; 23 | var model = { 24 | tabs: "", 25 | keypair_id: "", 26 | coe: null 27 | }; 28 | var modal = { 29 | open: function(config) { 30 | config.model = model; 31 | deferred = $q.defer(); 32 | deferred.resolve(config); 33 | return deferred.promise; 34 | } 35 | }; 36 | 37 | /////////////////// 38 | 39 | beforeEach(module('horizon.app.core')); 40 | beforeEach(module('horizon.framework')); 41 | beforeEach(module('horizon.dashboard.container-infra.cluster-templates')); 42 | 43 | beforeEach(module(function($provide) { 44 | $provide.value('horizon.framework.widgets.form.ModalFormService', modal); 45 | })); 46 | 47 | beforeEach(inject(function($injector, _$rootScope_, _$q_) { 48 | $q = _$q_; 49 | $scope = _$rootScope_.$new(); 50 | service = $injector.get( 51 | 'horizon.dashboard.container-infra.cluster-templates.create.service'); 52 | magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 53 | workflow = $injector.get( 54 | 'horizon.dashboard.container-infra.cluster-templates.workflow'); 55 | deferred = $q.defer(); 56 | deferred.resolve({data: {uuid: 1}}); 57 | spyOn(magnum, 'createClusterTemplate').and.returnValue(deferred.promise); 58 | spyOn(modal, 'open').and.callThrough(); 59 | spyOn(workflow, 'init').and.returnValue({model: model}); 60 | })); 61 | 62 | it('should check the policy if the user is allowed to create cluster template', function() { 63 | var allowed = service.allowed(); 64 | expect(allowed).toBeTruthy(); 65 | }); 66 | 67 | it('open the modal', inject(function($timeout) { 68 | service.perform(); 69 | 70 | expect(modal.open).toHaveBeenCalled(); 71 | 72 | $timeout.flush(); 73 | $scope.$apply(); 74 | 75 | expect(magnum.createClusterTemplate).toHaveBeenCalled(); 76 | })); 77 | }); 78 | })(); 79 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/details/details.module.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc overview 20 | * @ngname horizon.dashboard.container-infra.cluster-templates.details 21 | * 22 | * @description 23 | * Provides details features for cluster templates. 24 | */ 25 | angular.module('horizon.dashboard.container-infra.cluster-templates.details', 26 | ['horizon.framework.conf', 'horizon.app.core']) 27 | .run(registerClusterTemplateDetails); 28 | 29 | registerClusterTemplateDetails.$inject = [ 30 | 'horizon.dashboard.container-infra.cluster-templates.basePath', 31 | 'horizon.dashboard.container-infra.cluster-templates.resourceType', 32 | 'horizon.app.core.openstack-service-api.magnum', 33 | 'horizon.framework.conf.resource-type-registry.service' 34 | ]; 35 | 36 | function registerClusterTemplateDetails( 37 | basePath, 38 | resourceType, 39 | magnum, 40 | registry 41 | ) { 42 | registry.getResourceType(resourceType) 43 | .setLoadFunction(loadFunction) 44 | .detailsViews.append({ 45 | id: 'templateDetailsOverview', 46 | name: gettext('Overview'), 47 | template: basePath + 'details/overview.html' 48 | }); 49 | 50 | function loadFunction(identifier) { 51 | return magnum.getClusterTemplate(identifier); 52 | } 53 | } 54 | 55 | })(); 56 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/details/drawer.controller.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc controller 20 | * @name horizon.dashboard.container-infra.cluster-templates.DrawerController 21 | * @description 22 | * This is the controller for the cluster templates drawer (summary) view. 23 | * Its primary purpose is to provide the metadata definitions to 24 | * the template via the ctrl.metadataDefs member. 25 | */ 26 | angular 27 | .module('horizon.dashboard.container-infra.cluster-templates') 28 | .controller('horizon.dashboard.container-infra.cluster-templates.DrawerController', controller); 29 | 30 | controller.$inject = [ 31 | ]; 32 | 33 | function controller() { 34 | var ctrl = this; 35 | ctrl.objLen = objLen; 36 | 37 | function objLen(obj) { 38 | var length = 0; 39 | if (obj && typeof obj === 'object') { 40 | length = Object.keys(obj).length; 41 | } 42 | return length; 43 | } 44 | } 45 | 46 | })(); 47 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/details/drawer.controller.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | describe('cluster template drawer controller', function() { 19 | 20 | var ctrl; 21 | 22 | beforeEach(module('horizon.dashboard.container-infra.cluster-templates')); 23 | 24 | beforeEach(inject(function($controller) { 25 | ctrl = $controller('horizon.dashboard.container-infra.cluster-templates.DrawerController', 26 | {}); 27 | })); 28 | 29 | it('objLen returns number of attributes of object', inject(function() { 30 | expect(ctrl.objLen()).toBe(0); 31 | expect(ctrl.objLen(null)).toBe(0); 32 | expect(ctrl.objLen({})).toBe(0); 33 | expect(ctrl.objLen({a: 0})).toBe(1); 34 | })); 35 | }); 36 | })(); 37 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/details/drawer.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
ID
6 |
{$ item.id $}
7 |
8 |
9 |
Network Driver
10 |
{$ item.network_driver $}
11 |
12 |
13 |
14 |
15 |
16 |
Image ID
17 |
{$ item.image_id $}
18 |
19 |
20 |
Registry Enabled
21 |
{$ item.registry_enabled | yesno $}
22 |
23 |
24 |
Labels
25 |
None
26 |
{$ key + '=' + value $}
27 |
28 |
29 |
30 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.controller.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the 'License'); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an 'AS IS' BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | (function() { 15 | "use strict"; 16 | 17 | angular 18 | .module('horizon.dashboard.container-infra.cluster-templates') 19 | .controller('ClusterTemplateOverviewController', ClusterTemplateOverviewController); 20 | 21 | ClusterTemplateOverviewController.$inject = [ 22 | '$scope', 23 | 'horizon.app.core.openstack-service-api.glance' 24 | ]; 25 | 26 | function ClusterTemplateOverviewController( 27 | $scope, 28 | glance 29 | ) { 30 | var ctrl = this; 31 | ctrl.cluster_template = {}; 32 | ctrl.image_uuid = ""; 33 | ctrl.objLen = objLen; 34 | 35 | $scope.context.loadPromise.then(onGetClusterTemplate); 36 | 37 | function onGetClusterTemplate(template) { 38 | ctrl.cluster_template = template.data; 39 | glance.getImages().then(onGetImages); 40 | } 41 | 42 | function onGetImages(images) { 43 | angular.forEach(images.data.items, function(image) { 44 | if (image.name === ctrl.cluster_template.image_id) { 45 | ctrl.image_uuid = image.id; 46 | } 47 | }); 48 | } 49 | 50 | function objLen(obj) { 51 | var length = 0; 52 | if (obj && typeof obj === 'object') { 53 | length = Object.keys(obj).length; 54 | } 55 | return length; 56 | } 57 | } 58 | })(); 59 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.controller.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * (c) Copyright 2016 NEC Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('cluster template overview controller', function() { 21 | 22 | var ctrl, glance, deferred; 23 | 24 | beforeEach(module('horizon.dashboard.container-infra.cluster-templates')); 25 | 26 | beforeEach(inject(function($controller, $q, $injector) { 27 | glance = $injector.get('horizon.app.core.openstack-service-api.glance'); 28 | deferred = $q.defer(); 29 | deferred.resolve({data: {image_id: 1, items: {1: {name: 1, id: 1},2: {name: 2, id: 2}}}}); 30 | spyOn(glance, 'getImages').and.returnValue(deferred.promise); 31 | ctrl = $controller('ClusterTemplateOverviewController', 32 | { 33 | '$scope' : {context : {loadPromise: deferred.promise}} 34 | } 35 | ); 36 | })); 37 | 38 | it('sets ctrl', inject(function($timeout) { 39 | $timeout.flush(); 40 | expect(ctrl.cluster_template).toBeDefined(); 41 | expect(ctrl.image_uuid).toBeDefined(); 42 | })); 43 | 44 | it('objLen returns number of attributes of object', inject(function() { 45 | expect(ctrl.objLen()).toBe(0); 46 | expect(ctrl.objLen(null)).toBe(0); 47 | expect(ctrl.objLen({})).toBe(0); 48 | expect(ctrl.objLen({a: 0})).toBe(1); 49 | })); 50 | }); 51 | })(); 52 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/panel.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/update/update.service.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 NEC Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('horizon.dashboard.container-infra.cluster-templates.update.service', function() { 21 | 22 | var service, $scope, $q, deferred, magnum; 23 | var selected = { 24 | id: 1 25 | }; 26 | var model = { 27 | id: 1, 28 | tabs: "", 29 | keypair_id: "", 30 | coe: null 31 | }; 32 | var modal = { 33 | open: function(config) { 34 | config.model = model; 35 | deferred = $q.defer(); 36 | deferred.resolve(config); 37 | return deferred.promise; 38 | } 39 | }; 40 | var workflow = { 41 | init: function (action, title) { 42 | action = title; 43 | return {model: model}; 44 | }, 45 | update: function () { 46 | } 47 | }; 48 | 49 | /////////////////// 50 | 51 | beforeEach(module('horizon.app.core')); 52 | beforeEach(module('horizon.framework')); 53 | beforeEach(module('horizon.dashboard.container-infra.cluster-templates')); 54 | 55 | beforeEach(module(function($provide) { 56 | $provide.value('horizon.dashboard.container-infra.cluster-templates.workflow', workflow); 57 | $provide.value('horizon.framework.widgets.form.ModalFormService', modal); 58 | })); 59 | 60 | beforeEach(inject(function($injector, _$rootScope_, _$q_) { 61 | $q = _$q_; 62 | $scope = _$rootScope_.$new(); 63 | service = $injector.get( 64 | 'horizon.dashboard.container-infra.cluster-templates.update.service'); 65 | magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 66 | deferred = $q.defer(); 67 | deferred.resolve({data: {uuid: 1, labels: "key1:val1,key2:val2"}}); 68 | spyOn(magnum, 'getClusterTemplate').and.returnValue(deferred.promise); 69 | spyOn(magnum, 'updateClusterTemplate').and.returnValue(deferred.promise); 70 | spyOn(workflow, 'init').and.returnValue({model: model}); 71 | spyOn(workflow, 'update').and.callThrough(); 72 | spyOn(modal, 'open').and.callThrough(); 73 | })); 74 | 75 | it('should check the policy if the user is allowed to update cluster template', function() { 76 | var allowed = service.allowed(); 77 | expect(allowed).toBeTruthy(); 78 | }); 79 | 80 | it('open the modal', inject(function($timeout) { 81 | service.perform(selected, $scope); 82 | 83 | expect(workflow.init).toHaveBeenCalled(); 84 | 85 | expect(modal.open).toHaveBeenCalledWith({model: model}); 86 | 87 | $timeout.flush(); 88 | $scope.$apply(); 89 | 90 | expect(magnum.updateClusterTemplate).toHaveBeenCalled(); 91 | })); 92 | }); 93 | })(); 94 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/workflow/info.help.html: -------------------------------------------------------------------------------- 1 |
2 |
Cluster Template Name
3 |
An arbitrary human-readable name
4 |
Container Orchestration Engine
5 |
Specify the Container Orchestration Engine to use.
6 |
Public
7 |
Make cluster template public. Default: False
8 |
Enable Registry
9 |
Enable docker registry in the cluster temlate. Default: False
10 |
Disable TLS
11 |
Disable TLS in the cluster template. Default: False
12 |
-------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/workflow/labels.help.html: -------------------------------------------------------------------------------- 1 |

Arbitrary labels in the form of key=value pairs to associate with a cluster templates. May be used multiple times.

-------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/workflow/network.help.html: -------------------------------------------------------------------------------- 1 |
2 |
Fixed Network
3 |
This should really be named fixed-network-cidr. Default: 10.0.0.0/24
4 |
DNS
5 |
Specify the nameserver to use for the cluster template. Default: 8.8.8.8
6 |
Master LB
7 |
Indicates whether created clusters should have a load balancer for master nodes or not. Default: False
8 |
Floating IP
9 |
Indicates whether created clusters should have a floating ip or not. Default: True
10 |
-------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/workflow/spec.help.html: -------------------------------------------------------------------------------- 1 |
2 |
Image
3 |
The name or UUID of the base image to customize for the cluster.
4 |
Keypair
5 |
The name or UUID of the SSH keypair to load into the cluster nodes.
6 |
Flavor
7 |
The nova flavor id to use when launching the cluster. Default: m1.small
8 |
Master Flavor
9 |
The nova flavor id to use when launching the master node of the cluster. Default: m1.small
10 |
Docker Volume Size
11 |
The size in GB for Docker Volume. Default: 25
12 |
Insecure Registry
13 |
The URL of docker registry.
14 |
-------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/cluster-templates/workflow/workflow.service.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * (c) Copyright 2016 NEC Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('horizon.dashboard.container-infra.cluster-templates.workflow', function() { 21 | 22 | var workflow, magnum, nova, glance, $q, deferred, keyDeferred; 23 | 24 | beforeEach(module('horizon.app.core')); 25 | beforeEach(module('horizon.framework')); 26 | beforeEach(module('horizon.dashboard.container-infra.cluster-templates')); 27 | 28 | beforeEach(inject(function($injector, _$q_) { 29 | $q = _$q_; 30 | workflow = $injector.get( 31 | 'horizon.dashboard.container-infra.cluster-templates.workflow'); 32 | nova = $injector.get('horizon.app.core.openstack-service-api.nova'); 33 | glance = $injector.get('horizon.app.core.openstack-service-api.glance'); 34 | magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 35 | deferred = $q.defer(); 36 | deferred.resolve({data:{items:{1:{name:1},2:{name:2}}}}); 37 | keyDeferred = $q.defer(); 38 | keyDeferred.resolve({data:{items:{1:{keypair:{name:1}},2:{keypair:{name:2}}}}}); 39 | spyOn(glance, 'getImages').and.returnValue(deferred.promise); 40 | spyOn(nova, 'getFlavors').and.returnValue(deferred.promise); 41 | spyOn(nova, 'getKeypairs').and.returnValue(keyDeferred.promise); 42 | spyOn(magnum, 'getNetworks').and.returnValue(deferred.promise); 43 | })); 44 | 45 | it('should be init', inject(function($timeout) { 46 | var config = workflow.init('create', 'Create Cluster Template'); 47 | $timeout.flush(); 48 | expect(config.title).toBeDefined(); 49 | expect(config.schema).toBeDefined(); 50 | expect(config.form).toBeDefined(); 51 | expect(config.model).toBeDefined(); 52 | 53 | config.model.coe = ''; 54 | config.form[0].tabs[0].items[0].items[1].onChange(); 55 | config.model.coe = 'swarm'; 56 | config.form[0].tabs[0].items[0].items[1].onChange(); 57 | 58 | config.model.coe = 'swarm-mode'; 59 | config.form[0].tabs[0].items[0].items[1].onChange(); 60 | expect(config.form[0].tabs[2].items[0].items[0].items[0].titleMap[0].value).toEqual('docker'); 61 | })); 62 | 63 | }); 64 | })(); 65 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/actions.module.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * (c) Copyright 2016 NEC Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('register cluster actions module', function() { 21 | var registry; 22 | beforeEach(module('horizon.dashboard.container-infra.clusters.actions')); 23 | 24 | beforeEach(inject(function($injector) { 25 | registry = $injector.get('horizon.framework.conf.resource-type-registry.service'); 26 | })); 27 | 28 | it('registers Create Cluster as a batch action', function() { 29 | var actions = registry.getResourceType('OS::Magnum::Cluster').globalActions; 30 | expect(actionHasId(actions, 'createClusterAction')).toBe(true); 31 | }); 32 | 33 | it('registers Delete Cluster as a batch action', function() { 34 | var actions = registry.getResourceType('OS::Magnum::Cluster').batchActions; 35 | expect(actionHasId(actions, 'batchDeleteClusterAction')).toBe(true); 36 | }); 37 | 38 | it('registers Show Certificate as an item action', function() { 39 | var actions = registry.getResourceType('OS::Magnum::Cluster').itemActions; 40 | expect(actionHasId(actions, 'showCertificateAction')).toBe(true); 41 | }); 42 | 43 | it('registers Sign Certificate as an item action', function() { 44 | var actions = registry.getResourceType('OS::Magnum::Cluster').itemActions; 45 | expect(actionHasId(actions, 'signCertificateAction')).toBe(true); 46 | }); 47 | 48 | it('registers Rotate Certificate as an item action', function() { 49 | var actions = registry.getResourceType('OS::Magnum::Cluster').itemActions; 50 | expect(actionHasId(actions, 'rotateCertificateAction')).toBe(true); 51 | }); 52 | 53 | it('registers Resize Cluster as an item action', function() { 54 | var actions = registry.getResourceType('OS::Magnum::Cluster').itemActions; 55 | expect(actionHasId(actions, 'resizeClusterAction')).toBe(true); 56 | }); 57 | 58 | it('registers Delete Cluster as an item action', function() { 59 | var actions = registry.getResourceType('OS::Magnum::Cluster').itemActions; 60 | expect(actionHasId(actions, 'deleteClusterAction')).toBe(true); 61 | }); 62 | 63 | it('registers Get Cluster Config as an item action', function() { 64 | var actions = registry.getResourceType('OS::Magnum::Cluster').itemActions; 65 | expect(actionHasId(actions, 'getClusterConfigAction')).toBe(true); 66 | }); 67 | 68 | function actionHasId(list, value) { 69 | return list.filter(matchesId).length === 1; 70 | 71 | function matchesId(action) { 72 | return action.id === value; 73 | } 74 | } 75 | 76 | }); 77 | })(); 78 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/cluster-stats.controller.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc controller 20 | * @name clusterStatsController 21 | * @ngController 22 | * 23 | * @description 24 | * Controller to show stats and quota charts for cluster in cluster table view 25 | */ 26 | angular 27 | .module('horizon.dashboard.container-infra.clusters') 28 | .controller( 29 | 'horizon.dashboard.container-infra.clusters.clusterStatsController', 30 | clusterStatsController); 31 | 32 | clusterStatsController.$inject = [ 33 | '$q', 34 | '$scope', 35 | 'horizon.app.core.openstack-service-api.magnum', 36 | 'horizon.app.core.openstack-service-api.userSession' 37 | ]; 38 | 39 | function clusterStatsController($q, $scope, magnum, userSession) { 40 | var ctrl = this; 41 | ctrl.chartSettings = { 42 | innerRadius: 24, 43 | outerRadius: 48, 44 | titleClass: "pie-chart-title-medium", 45 | showTitle: false, 46 | showLabel: true, 47 | showLegend: false, 48 | tooltipIcon: 'fa-square' 49 | }; 50 | // Chart data is watched by pie-chart directive. 51 | // So to refresh chart after retrieving data, update whole of 'data' array. 52 | ctrl.chartDataClusters = { 53 | maxLimit: 20, 54 | data: [] 55 | }; 56 | // container for temporal chart data 57 | var dataClusters = []; 58 | userSession.get().then(onGetUserSession); 59 | 60 | function onGetUserSession(session) { 61 | ctrl.projectId = session.project_id; 62 | magnum.getStats().then(onGetStats); 63 | } 64 | 65 | function onGetStats(response) { 66 | ctrl.stats = response.data.stats; 67 | dataClusters = [ 68 | {label: gettext("Exists"), value: response.data.stats.clusters, colorClass: "exists"}, 69 | {label: gettext("Margin"), value: 20 - response.data.stats.clusters, colorClass: "margin"} 70 | ]; 71 | magnum.getQuota(ctrl.projectId, "Cluster", true).then(onGetQuotaCluster, onGetQuotaCluster); 72 | } 73 | 74 | function onGetQuotaCluster(response) { 75 | // set data for clusters chart 76 | var sum = dataClusters[0].value; 77 | var max = dataClusters[1].value; 78 | max = response.data.hard_limit; 79 | dataClusters[1].value = max - sum; 80 | var percent = Math.round(sum / max * 100); 81 | // shows 100% used if max = 0 82 | if (max === 0) { 83 | percent = 100; 84 | } 85 | var overMax = percent > 100; 86 | ctrl.chartDataClusters = { 87 | title: gettext("Clusters"), 88 | label: percent + '%', 89 | maxLimit: max, 90 | overMax: overMax, 91 | data: dataClusters 92 | }; 93 | ctrl.quota = {clusters: max}; 94 | } 95 | } 96 | })(); 97 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/cluster-stats.controller.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | describe('horizon.dashboard.container-infra.clusters', function() { 18 | var magnum, userSession, controller, $scope, $q, deferredSession, deferred, deferredQuota; 19 | 20 | beforeEach(module('horizon.framework')); 21 | beforeEach(module('horizon.app.core.openstack-service-api')); 22 | beforeEach(module('horizon.dashboard.container-infra.clusters')); 23 | 24 | beforeEach(inject(function ($injector, _$rootScope_, _$q_) { 25 | $q = _$q_; 26 | $scope = _$rootScope_.$new(); 27 | magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 28 | userSession = $injector.get('horizon.app.core.openstack-service-api.userSession'); 29 | controller = $injector.get('$controller'); 30 | deferredSession = $q.defer(); 31 | deferredSession.resolve({project_id: "1"}); 32 | spyOn(userSession, 'get').and.returnValue(deferredSession.promise); 33 | deferred = $q.defer(); 34 | deferred.resolve({data: {stats: {clusters: 1}}}); 35 | spyOn(magnum, 'getStats').and.returnValue(deferred.promise); 36 | createController($scope); 37 | })); 38 | 39 | function createController($scoped) { 40 | return controller( 41 | 'horizon.dashboard.container-infra.clusters.clusterStatsController', 42 | { 43 | $q: $q, 44 | $scope: $scoped, 45 | magnum: magnum, 46 | userSession: userSession 47 | }); 48 | } 49 | 50 | it('should load user session', function() { 51 | expect(userSession.get).toHaveBeenCalled(); 52 | }); 53 | 54 | it('should load stats and quotas', function() { 55 | deferredQuota = $q.defer(); 56 | deferredQuota.resolve({data: {hard_limit: 20}}); 57 | spyOn(magnum, 'getQuota').and.returnValue(deferredQuota.promise); 58 | 59 | $scope.$apply(); 60 | expect(magnum.getStats).toHaveBeenCalled(); 61 | expect(magnum.getQuota).toHaveBeenCalled(); 62 | }); 63 | 64 | it('should load stats and zero quota', function() { 65 | deferredQuota = $q.defer(); 66 | deferredQuota.resolve({data: {hard_limit: 0}}); 67 | spyOn(magnum, 'getQuota').and.returnValue(deferredQuota.promise); 68 | 69 | $scope.$apply(); 70 | expect(magnum.getStats).toHaveBeenCalled(); 71 | expect(magnum.getQuota).toHaveBeenCalled(); 72 | }); 73 | }); 74 | })(); 75 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/clusters.module.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 Cisco Systems, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | (function() { 17 | 'use strict'; 18 | 19 | describe('horizon.dashboard.container-infra.clusters', function() { 20 | it('should exist', function() { 21 | expect(angular.module('horizon.dashboard.container-infra.clusters')).toBeDefined(); 22 | }); 23 | }); 24 | 25 | })(); 26 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/clusters.scss: -------------------------------------------------------------------------------- 1 | .pie-chart { 2 | display: block; 3 | .svg-pie-chart { 4 | .slice { 5 | &.exists { 6 | fill: lighten(blue, 20%); 7 | } 8 | &.margin { 9 | fill: $gray-lighter; 10 | } 11 | } 12 | } 13 | .pie-chart-legend { 14 | display: inline-block; 15 | margin-left: 20px; 16 | .slice-legend { 17 | .slice-key { 18 | &.exists { 19 | background-color: lighten(blue, 20%); 20 | } 21 | &.margin { 22 | background-color: $gray-lighter; 23 | } 24 | } 25 | .chartless { 26 | &.exists { 27 | color: lighten(blue, 20%); 28 | } 29 | &.margin { 30 | color: $gray-lighter; 31 | } 32 | } 33 | } 34 | } 35 | } 36 | .chart-tooltip { 37 | span.fa { 38 | &.exists { 39 | color: lighten(blue, 20%); 40 | } 41 | &.margin { 42 | color: $gray-lighter; 43 | } 44 | } 45 | } 46 | 47 | .dropdown-menu > li.disabled { 48 | cursor: not-allowed; 49 | } 50 | 51 | // prevents click propagation to ng-click 52 | .split-button.disabled, 53 | .dropdown-menu > li.disabled > a { 54 | pointer-events: none; 55 | } -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/clusters.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | "use strict"; 17 | 18 | angular.module('horizon.dashboard.container-infra.clusters') 19 | .factory('horizon.dashboard.container-infra.clusters.service', 20 | clustersService); 21 | 22 | clustersService.$inject = [ 23 | '$filter', 24 | 'horizon.app.core.detailRoute', 25 | 'horizon.app.core.openstack-service-api.magnum' 26 | ]; 27 | 28 | /* 29 | * @ngdoc factory 30 | * @name horizon.dashboard.container-infra.clusters.service 31 | * 32 | * @description 33 | * This service provides functions that are used through the Clusters 34 | * features. These are primarily used in the module registrations 35 | * but do not need to be restricted to such use. Each exposed function 36 | * is documented below. 37 | */ 38 | function clustersService($filter, detailRoute, magnum) { 39 | return { 40 | getClustersPromise: getClustersPromise, 41 | urlFunction: urlFunction 42 | }; 43 | 44 | function getClustersPromise(params) { 45 | return magnum.getClusters(params).then(modifyResponse); 46 | 47 | function modifyResponse(response) { 48 | return {data: {items: response.data.items.map(addTrackBy)}}; 49 | 50 | function addTrackBy(cluster) { 51 | var timestamp = cluster.updated_at ? cluster.updated_at : cluster.created_at; 52 | cluster.trackBy = cluster.id + timestamp; 53 | return cluster; 54 | } 55 | } 56 | } 57 | 58 | function urlFunction(item) { 59 | return detailRoute + 'OS::Magnum::Cluster/' + item.id; 60 | } 61 | } 62 | })(); 63 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/clusters.service.spec.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | (function() { 16 | "use strict"; 17 | 18 | describe('cluster templates service', function() { 19 | var service, detailRoute, magnum; 20 | beforeEach(module('horizon.dashboard.container-infra.cluster-templates')); 21 | beforeEach(inject(function($injector) { 22 | service = $injector.get('horizon.dashboard.container-infra.clusters.service'); 23 | detailRoute = $injector.get('horizon.app.core.detailRoute'); 24 | magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 25 | })); 26 | 27 | describe('getClustersPromise', function() { 28 | it("provides a promise", inject(function($q, $injector, $timeout) { 29 | var deferred = $q.defer(); 30 | spyOn(magnum, 'getClusters').and.returnValue(deferred.promise); 31 | var result = service.getClustersPromise({}); 32 | deferred.resolve({ 33 | data:{ 34 | items: [{id: 123, name: 'cluster1'}] 35 | } 36 | }); 37 | $timeout.flush(); 38 | expect(magnum.getClusters).toHaveBeenCalled(); 39 | expect(result.$$state.value.data.items[0].name).toBe('cluster1'); 40 | })); 41 | 42 | it("provides a promise with updated_at", inject(function($q, $injector, $timeout) { 43 | var deferred = $q.defer(); 44 | spyOn(magnum, 'getClusters').and.returnValue(deferred.promise); 45 | var result = service.getClustersPromise({}); 46 | deferred.resolve({ 47 | data:{ 48 | items: [{id: 123, name: 'cluster1', updated_at: '2017-01-16'}] 49 | } 50 | }); 51 | $timeout.flush(); 52 | expect(magnum.getClusters).toHaveBeenCalled(); 53 | expect(result.$$state.value.data.items[0].name).toBe('cluster1'); 54 | })); 55 | }); 56 | 57 | describe('urlFunction', function() { 58 | it("get url", inject(function() { 59 | var result = service.urlFunction({id:"123abc"}); 60 | expect(result).toBe(detailRoute + "OS::Magnum::Cluster/123abc"); 61 | })); 62 | }); 63 | }); 64 | })(); 65 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/clusters.utils.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 NEC Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('horizon.dashboard.container-infra.clusters.utils', function() { 21 | 22 | var service, $scope, mockDirective, actionsDirectiveLinkFn, attrs; 23 | 24 | /////////////////// 25 | 26 | beforeEach(module('horizon.app.core')); 27 | beforeEach(module('horizon.framework')); 28 | beforeEach(module('horizon.dashboard.container-infra.clusters')); 29 | 30 | beforeEach(inject(function($injector, _$rootScope_) { 31 | $scope = _$rootScope_.$new(); 32 | service = $injector.get( 33 | 'horizon.dashboard.container-infra.clusters.utils'); 34 | 35 | mockDirective = {link:{apply:function() {}}}; 36 | actionsDirectiveLinkFn = service.getActionsDirectiveLinkFn(mockDirective); 37 | attrs = { 38 | type: 'row', 39 | item: 'item', 40 | allowed: 'allowed' 41 | }; 42 | })); 43 | 44 | it('should not amend the directive because the action type is ' + 45 | 'not \'row\'', function() { 46 | attrs.type = 'main'; 47 | actionsDirectiveLinkFn($scope, angular.element(""), attrs); 48 | }); 49 | 50 | it('should attempt to amend the directive without critical failure', function() { 51 | $scope.allowed = []; 52 | actionsDirectiveLinkFn($scope, angular.element(""), attrs); 53 | }); 54 | 55 | }); 56 | })(); 57 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/config/config.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc overview 20 | * @name horizon.dashboard.container-infra.clusters.config.service 21 | * @description Service for the container-infra cluster get config modal 22 | */ 23 | angular 24 | .module('horizon.dashboard.container-infra.clusters') 25 | .factory( 26 | 'horizon.dashboard.container-infra.clusters.config.service', 27 | getClusterConfigService); 28 | 29 | getClusterConfigService.$inject = [ 30 | 'horizon.app.core.openstack-service-api.magnum', 31 | 'horizon.dashboard.container-infra.clusters.resourceType', 32 | 'horizon.framework.util.actions.action-result.service', 33 | 'horizon.framework.util.file.text-download', 34 | 'horizon.framework.util.q.extensions' 35 | ]; 36 | 37 | function getClusterConfigService( 38 | magnum, resourceType, actionResult, textDownload, $qExtensions 39 | ) { 40 | 41 | var service = { 42 | initAction: initAction, 43 | perform: perform, 44 | allowed: allowed 45 | }; 46 | 47 | return service; 48 | 49 | ////////////// 50 | 51 | function initAction() { 52 | } 53 | 54 | function perform(selected) { 55 | // get config 56 | return magnum.getClusterConfig(selected.id).then(function(response) { 57 | if (typeof response.data.key !== "undefined") { 58 | textDownload.downloadTextFile(response.data.key, selected.name + "_key.pem"); 59 | textDownload.downloadTextFile(response.data.ca, selected.name + "_ca.pem"); 60 | textDownload.downloadTextFile(response.data.cert, selected.name + "_cert.pem"); 61 | } 62 | textDownload.downloadTextFile(response.data.cluster_config, selected.name + "_config"); 63 | var result = actionResult.getActionResult() 64 | .created(resourceType, selected.id); 65 | return result.result; 66 | }); 67 | } 68 | 69 | function allowed() { 70 | return $qExtensions.booleanAsPromise(true); 71 | } 72 | } 73 | })(); 74 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/config/config.service.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * (c) Copyright 2016 NEC Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('horizon.dashboard.container-infra.clusters.config.service', function() { 21 | 22 | var $scope, service, selected, magnum, textDownload; 23 | 24 | beforeEach(module('horizon.app.core')); 25 | beforeEach(module('horizon.framework')); 26 | beforeEach(module('horizon.dashboard.container-infra.clusters')); 27 | 28 | beforeEach(inject(function($injector) { 29 | service = $injector.get( 30 | 'horizon.dashboard.container-infra.clusters.config.service'); 31 | magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 32 | textDownload = $injector.get('horizon.framework.util.file.text-download'); 33 | spyOn(textDownload, 'downloadTextFile').and.returnValue(Promise.resolve(true)); 34 | $scope = $injector.get('$rootScope'); 35 | selected = {id: '1'}; 36 | })); 37 | 38 | it('should check the policy', function() { 39 | var allowed = service.allowed(); 40 | expect(allowed).toBeTruthy(); 41 | }); 42 | 43 | it('should get magnum.getClusterConfig', function() { 44 | var returnValue = {data: {cluster_config: "config1"}}; 45 | spyOn(magnum, 'getClusterConfig').and.returnValue(Promise.resolve(returnValue)); 46 | 47 | service.initAction(); 48 | var promise = service.perform(selected); 49 | promise.then(verifyContents); 50 | $scope.$apply(); 51 | expect(magnum.getClusterConfig).toHaveBeenCalled(); 52 | function verifyContents (contents) { 53 | expect(contents.created).toBeDefined(); 54 | expect(contents.failed).toEqual([]); 55 | expect(textDownload.downloadTextFile.calls.count()).toBe(1); 56 | } 57 | }); 58 | 59 | it('should download', inject(function() { 60 | var returnValue = {data: {key: "key1", cluster_config: "config1", ca: "ca1", cert: "cert1"}}; 61 | spyOn(magnum, 'getClusterConfig').and.returnValue(Promise.resolve(returnValue)); 62 | service.initAction(); 63 | var promise = service.perform(selected); 64 | promise.then(verifyContents); 65 | $scope.$apply(); 66 | expect(magnum.getClusterConfig).toHaveBeenCalled(); 67 | function verifyContents (contents) { 68 | expect(contents.created).toBeDefined(); 69 | expect(contents.failed).toEqual([]); 70 | expect(textDownload.downloadTextFile.calls.count()).toBe(4); 71 | } 72 | })); 73 | 74 | }); 75 | })(); 76 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/details/details.module.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc overview 20 | * @ngname horizon.dashboard.container-infra.clusters.details 21 | * 22 | * @description 23 | * Provides details features for clusters. 24 | */ 25 | angular.module('horizon.dashboard.container-infra.clusters.details', 26 | ['horizon.framework.conf', 'horizon.app.core']) 27 | .run(registerClusterDetails); 28 | 29 | registerClusterDetails.$inject = [ 30 | 'horizon.dashboard.container-infra.clusters.basePath', 31 | 'horizon.dashboard.container-infra.clusters.resourceType', 32 | 'horizon.app.core.openstack-service-api.magnum', 33 | 'horizon.framework.conf.resource-type-registry.service' 34 | ]; 35 | 36 | function registerClusterDetails( 37 | basePath, 38 | resourceType, 39 | magnum, 40 | registry 41 | ) { 42 | registry.getResourceType(resourceType) 43 | .setLoadFunction(loadFunction) 44 | .detailsViews.append({ 45 | id: 'clusterDetailsOverview', 46 | name: gettext('Overview'), 47 | template: basePath + 'details/overview.html' 48 | }); 49 | 50 | function loadFunction(identifier) { 51 | return magnum.getCluster(identifier); 52 | } 53 | } 54 | 55 | })(); 56 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc controller 20 | * @name horizon.dashboard.container-infra.clusters.DrawerController 21 | * @description 22 | * This is the controller for the cluster drawer (summary) view. 23 | * Its primary purpose is to provide the metadata definitions to 24 | * the template via the ctrl.metadataDefs member. 25 | */ 26 | angular 27 | .module('horizon.dashboard.container-infra.clusters') 28 | .controller('horizon.dashboard.container-infra.clusters.DrawerController', controller); 29 | 30 | controller.$inject = [ 31 | ]; 32 | 33 | function controller() { 34 | var ctrl = this; 35 | ctrl.objLen = objLen; 36 | 37 | function objLen(obj) { 38 | var length = 0; 39 | if (obj && typeof obj === 'object') { 40 | length = Object.keys(obj).length; 41 | } 42 | return length; 43 | } 44 | } 45 | })(); 46 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | describe('cluster drawer controller', function() { 19 | 20 | var ctrl; 21 | 22 | beforeEach(module('horizon.dashboard.container-infra.clusters')); 23 | 24 | beforeEach(inject(function($controller) { 25 | ctrl = $controller('horizon.dashboard.container-infra.clusters.DrawerController', {}); 26 | })); 27 | 28 | it('objLen returns number of attributes of object', inject(function() { 29 | expect(ctrl.objLen()).toBe(0); 30 | expect(ctrl.objLen(null)).toBe(0); 31 | expect(ctrl.objLen({})).toBe(0); 32 | expect(ctrl.objLen({a: 0})).toBe(1); 33 | })); 34 | }); 35 | })(); 36 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/details/drawer.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
ID
6 |
{$ item.id $}
7 |
8 |
9 |
Master Count
10 |
{$ item.master_count $}
11 |
12 |
13 |
Node Count
14 |
{$ item.node_count $}
15 |
16 |
17 |
Keypair
18 |
{$ item.keypair $}
19 |
20 |
21 |
22 |
23 |
24 |
Cluster Template
25 |
{$ item.cluster_template_id $}
26 |
27 |
28 |
Kubernetes API Address
29 |
{$ item.api_address $}
30 |
31 |
32 |
33 |
34 |
Control Plane Addresses
35 |
None
36 |
{$ addr $}
37 |
38 |
39 |
Node Addresses
40 |
None
41 |
{$ addr $}
42 |
43 |
44 |
45 |
46 |
Health Status Reason
47 |
{$ item.health_status_reason | json $}
48 |
49 |
50 |
Status Reason
51 |
{$ item.status_reason $}
52 |
53 |
54 |
55 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the 'License'); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an 'AS IS' BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | (function() { 15 | "use strict"; 16 | 17 | angular 18 | .module('horizon.dashboard.container-infra.clusters') 19 | .controller('ClusterOverviewController', ClusterOverviewController); 20 | 21 | ClusterOverviewController.$inject = [ 22 | '$scope', 23 | 'horizon.app.core.openstack-service-api.magnum' 24 | ]; 25 | 26 | function ClusterOverviewController( 27 | $scope, 28 | magnum 29 | ) { 30 | var ctrl = this; 31 | ctrl.cluster = {}; 32 | ctrl.cluster_template = {}; 33 | ctrl.objLen = objLen; 34 | 35 | $scope.context.loadPromise.then(onGetCluster); 36 | 37 | function onGetCluster(cluster) { 38 | ctrl.cluster = cluster.data; 39 | magnum.getClusterTemplate(ctrl.cluster.cluster_template_id).then(onGetClusterTemplate); 40 | } 41 | 42 | function onGetClusterTemplate(clusterTemplate) { 43 | ctrl.cluster_template = clusterTemplate.data; 44 | } 45 | 46 | function objLen(obj) { 47 | var length = 0; 48 | if (obj && typeof obj === 'object') { 49 | length = Object.keys(obj).length; 50 | } 51 | return length; 52 | } 53 | } 54 | })(); 55 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * (c) Copyright 2016 NEC Corporation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('cluster overview controller', function() { 21 | 22 | var ctrl, magnum, deferred; 23 | 24 | beforeEach(module('horizon.dashboard.container-infra.clusters')); 25 | 26 | beforeEach(inject(function($controller, $q, $injector) { 27 | magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 28 | deferred = $q.defer(); 29 | deferred.resolve({data: {image_id: 1},items:{1:{name:1,id:1},2:{name:2,id:2}}}); 30 | spyOn(magnum, 'getClusterTemplate').and.returnValue(deferred.promise); 31 | ctrl = $controller('ClusterOverviewController', 32 | { 33 | '$scope' : {context : {loadPromise: deferred.promise}} 34 | } 35 | ); 36 | })); 37 | 38 | it('sets ctrl', inject(function($timeout) { 39 | $timeout.flush(); 40 | expect(ctrl.cluster_template).toBeDefined(); 41 | expect(ctrl.cluster).toBeDefined(); 42 | })); 43 | 44 | it('objLen returns number of attributes of object', inject(function() { 45 | expect(ctrl.objLen()).toBe(0); 46 | expect(ctrl.objLen(null)).toBe(0); 47 | expect(ctrl.objLen({})).toBe(0); 48 | expect(ctrl.objLen({a: 0})).toBe(1); 49 | })); 50 | }); 51 | })(); 52 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/panel.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |
6 |
7 | 9 |
10 |
11 |

Stats

12 |
13 |
14 |
Clusters
15 |
Used {$ ctrl.stats.clusters $} of {$ ctrl.quota.clusters $}
16 |
Nodes
17 |
{$ ctrl.stats.nodes $}
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | 27 |
28 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/rotate-certificate/rotate-certificate.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc overview 20 | * @name horizon.dashboard.container-infra.clusters.rotate-certificate.service 21 | * @description Service for the container-infra cluster rotate certificate 22 | */ 23 | angular 24 | .module('horizon.dashboard.container-infra.clusters') 25 | .factory( 26 | 'horizon.dashboard.container-infra.clusters.rotate-certificate.service', 27 | rotateCertificateService); 28 | 29 | rotateCertificateService.$inject = [ 30 | 'horizon.app.core.openstack-service-api.magnum', 31 | 'horizon.dashboard.container-infra.clusters.resourceType', 32 | 'horizon.framework.util.actions.action-result.service', 33 | 'horizon.framework.util.i18n.gettext', 34 | 'horizon.framework.util.q.extensions', 35 | 'horizon.framework.widgets.toast.service' 36 | ]; 37 | 38 | function rotateCertificateService( 39 | magnum, resourceType, actionResult, gettext, $qExtensions, toast 40 | ) { 41 | 42 | var message = { 43 | success: gettext('Certificate %s was successfully rotated.') 44 | }; 45 | 46 | var service = { 47 | initAction: initAction, 48 | perform: perform, 49 | allowed: allowed 50 | }; 51 | 52 | return service; 53 | 54 | ////////////// 55 | 56 | function initAction() { 57 | } 58 | 59 | function perform(selected) { 60 | // rotate certificate 61 | return magnum.rotateCertificate(selected.id).then(success); 62 | } 63 | 64 | function success(response) { 65 | response.data.id = response.data.uuid; 66 | toast.add('success', interpolate(message.success, [response.data.id])); 67 | var result = actionResult.getActionResult() 68 | .deleted(resourceType, response.data.id); 69 | return result.result; 70 | } 71 | 72 | function allowed() { 73 | // NOTE(flwang): So far, Magnum doesn't support rotate certificate, so 74 | // let's disable it now until we can support it. 75 | return $qExtensions.booleanAsPromise(false); 76 | } 77 | } 78 | })(); 79 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/rotate-certificate/rotate-certificate.service.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | describe('horizon.dashboard.container-infra.clusters.rotate-certificate.service', function() { 19 | 20 | var $q, service, selected, magnum, deferred; 21 | 22 | beforeEach(module('horizon.app.core')); 23 | beforeEach(module('horizon.framework')); 24 | beforeEach(module('horizon.dashboard.container-infra.clusters')); 25 | 26 | beforeEach(inject(function($injector, _$q_) { 27 | $q = _$q_; 28 | service = $injector.get( 29 | 'horizon.dashboard.container-infra.clusters.rotate-certificate.service'); 30 | magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 31 | deferred = $q.defer(); 32 | deferred.resolve({}); 33 | spyOn(magnum, 'rotateCertificate').and.returnValue(deferred.promise); 34 | })); 35 | 36 | it('should check the policy', function() { 37 | var allowed = service.allowed(); 38 | expect(allowed).toBeTruthy(); 39 | }); 40 | 41 | it('should get magnum.rotatecertificate', function() { 42 | selected = { 43 | id: '1' 44 | }; 45 | service.initAction(); 46 | service.perform(selected); 47 | expect(magnum.rotateCertificate).toHaveBeenCalled(); 48 | }); 49 | }); 50 | })(); 51 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/show-certificate/show-certificate.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc overview 20 | * @name horizon.dashboard.container-infra.clusters.show-certificate.service 21 | * @description Service for the container-infra cluster show certificate modal 22 | */ 23 | angular 24 | .module('horizon.dashboard.container-infra.clusters') 25 | .factory( 26 | 'horizon.dashboard.container-infra.clusters.show-certificate.service', 27 | showCertificateService); 28 | 29 | showCertificateService.$inject = [ 30 | 'horizon.app.core.openstack-service-api.magnum', 31 | 'horizon.dashboard.container-infra.clusters.resourceType', 32 | 'horizon.framework.util.actions.action-result.service', 33 | 'horizon.framework.util.file.text-download', 34 | 'horizon.framework.util.q.extensions' 35 | ]; 36 | 37 | function showCertificateService( 38 | magnum, resourceType, actionResult, textDownload, $qExtensions 39 | ) { 40 | 41 | var service = { 42 | initAction: initAction, 43 | perform: perform, 44 | allowed: allowed 45 | }; 46 | 47 | return service; 48 | 49 | ////////////// 50 | 51 | function initAction() { 52 | } 53 | 54 | function perform(selected) { 55 | // get certificate 56 | return magnum.showCertificate(selected.id).then(function(response) { 57 | textDownload.downloadTextFile(response.data.pem, selected.name + "_ca.pem"); 58 | 59 | response.data.id = response.data.uuid; 60 | var result = actionResult.getActionResult() 61 | .created(resourceType, response.data.id); 62 | return result.result; 63 | }); 64 | } 65 | 66 | function allowed() { 67 | return $qExtensions.booleanAsPromise(true); 68 | } 69 | } 70 | })(); 71 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/show-certificate/show-certificate.service.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * (c) Copyright 2016 NEC Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('horizon.dashboard.container-infra.clusters.show-certificate.service', function() { 21 | 22 | var $q, service, selected, magnum, deferred; 23 | 24 | beforeEach(module('horizon.app.core')); 25 | beforeEach(module('horizon.framework')); 26 | beforeEach(module('horizon.dashboard.container-infra.clusters')); 27 | 28 | beforeEach(inject(function($injector, _$q_) { 29 | $q = _$q_; 30 | service = $injector.get( 31 | 'horizon.dashboard.container-infra.clusters.show-certificate.service'); 32 | magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 33 | deferred = $q.defer(); 34 | deferred.resolve({}); 35 | spyOn(magnum, 'showCertificate').and.returnValue(deferred.promise); 36 | })); 37 | 38 | it('should check the policy', function() { 39 | var allowed = service.allowed(); 40 | expect(allowed).toBeTruthy(); 41 | }); 42 | 43 | it('should get magnum.showcertificate', function() { 44 | selected = { 45 | id: '1' 46 | }; 47 | service.initAction(); 48 | service.perform(selected); 49 | expect(magnum.showCertificate).toHaveBeenCalled(); 50 | }); 51 | }); 52 | })(); 53 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/sign-certificate/sign-certificate-modal.controller.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc controller 20 | * @name horizon.dashboard.container-infra.clusters.signCertificateController 21 | * @ngController 22 | * 23 | * @description 24 | * Controller for the container-infra cluster in sign certificate modal 25 | */ 26 | angular 27 | .module('horizon.dashboard.container-infra.clusters') 28 | .controller( 29 | 'horizon.dashboard.container-infra.clusters.signCertificateController', 30 | signCertificateController); 31 | 32 | signCertificateController.$inject = [ 33 | 'horizon.app.core.openstack-service-api.magnum', 34 | 'horizon.dashboard.container-infra.clusters.sign-certificate-model' 35 | ]; 36 | 37 | function signCertificateController(magnum, model) { 38 | var ctrl = this; 39 | ctrl.model = model; 40 | ctrl.form = null; 41 | ctrl.title = gettext("CSR"); 42 | magnum.getCluster(model.newCertificateSpec.cluster_uuid).then(onGetCluster); 43 | 44 | function onGetCluster(response) { 45 | ctrl.model.cluster_name = response.name; 46 | } 47 | } 48 | })(); 49 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/sign-certificate/sign-certificate-modal.html: -------------------------------------------------------------------------------- 1 | 9 | 10 |
11 | 23 | 24 | 35 |
-------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/sign-certificate/sign-certificate-model.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | angular 19 | .module('horizon.dashboard.container-infra.clusters') 20 | .factory('horizon.dashboard.container-infra.clusters.sign-certificate-model', CertificateModel); 21 | 22 | CertificateModel.$inject = [ 23 | 'horizon.app.core.openstack-service-api.magnum' 24 | ]; 25 | 26 | function CertificateModel(magnum) { 27 | var model = { 28 | newCertificateSpec: {}, 29 | cluster_name: "", 30 | 31 | // API methods 32 | init: init, 33 | signCertificate: signCertificate 34 | }; 35 | 36 | function init(clusterId) { 37 | // Reset the new Certificate spec 38 | model.newCertificateSpec = { 39 | cluster_uuid: clusterId, 40 | csr: "" 41 | }; 42 | model.cluster_name = ""; 43 | } 44 | 45 | function signCertificate() { 46 | var finalSpec = angular.copy(model.newCertificateSpec); 47 | 48 | cleanNullProperties(finalSpec); 49 | 50 | return magnum.signCertificate(finalSpec); 51 | } 52 | 53 | function cleanNullProperties(finalSpec) { 54 | // Initially clean fields that don't have any value. 55 | for (var key in finalSpec) { 56 | if (finalSpec.hasOwnProperty(key) && finalSpec[key] === null) { 57 | delete finalSpec[key]; 58 | } 59 | } 60 | } 61 | 62 | return model; 63 | } 64 | })(); 65 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/sign-certificate/sign-certificate-model.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * (c) Copyright 2016 NEC Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('horizon.dashboard.container-infra.cluster-templates.model', function() { 21 | var certificate; 22 | 23 | beforeEach(module('horizon.dashboard.container-infra.clusters')); 24 | beforeEach(inject(function($injector) { 25 | certificate = $injector.get( 26 | 'horizon.dashboard.container-infra.clusters.sign-certificate-model'); 27 | })); 28 | 29 | it('should be init CertificateModel', function() { 30 | var clusterId = 1; 31 | certificate.init(clusterId); 32 | expect(certificate.newCertificateSpec.cluster_uuid).toEqual(clusterId); 33 | }); 34 | 35 | it('signCertificate', inject(function($q, $injector) { 36 | var magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 37 | var deferred = $q.defer(); 38 | spyOn(magnum, 'signCertificate').and.returnValue(deferred.promise); 39 | 40 | certificate.init(null); 41 | certificate.signCertificate(); 42 | expect(magnum.signCertificate).toHaveBeenCalled(); 43 | })); 44 | 45 | }); 46 | })(); 47 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/sign-certificate/sign-certificate.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc overview 20 | * @name horizon.dashboard.container-infra.clusters.sign-certificate.service 21 | * @description Service for the container-infra cluster sign certificate modal 22 | */ 23 | angular 24 | .module('horizon.dashboard.container-infra.clusters') 25 | .factory( 26 | 'horizon.dashboard.container-infra.clusters.sign-certificate.service', 27 | signCertificateService); 28 | 29 | signCertificateService.$inject = [ 30 | '$uibModal', 31 | 'horizon.app.core.openstack-service-api.magnum', 32 | 'horizon.dashboard.container-infra.clusters.basePath', 33 | 'horizon.dashboard.container-infra.clusters.resourceType', 34 | 'horizon.dashboard.container-infra.clusters.sign-certificate-model', 35 | 'horizon.framework.util.actions.action-result.service', 36 | 'horizon.framework.util.file.text-download', 37 | 'horizon.framework.util.i18n.gettext', 38 | 'horizon.framework.util.q.extensions', 39 | 'horizon.framework.widgets.toast.service' 40 | ]; 41 | 42 | function signCertificateService( 43 | $uibModal, magnum, basePath, resourceType, model, actionResult, textDownload, 44 | gettext, $qExtensions, toast 45 | ) { 46 | 47 | var message = { 48 | success: gettext('Certificate %s was successfully signed.') 49 | }; 50 | 51 | var service = { 52 | initAction: initAction, 53 | perform: perform, 54 | allowed: allowed 55 | }; 56 | 57 | return service; 58 | 59 | ////////////// 60 | 61 | function initAction() { 62 | } 63 | 64 | function signCertificateModal() { 65 | var localSpec = { 66 | backdrop: 'static', 67 | controller: 'horizon.dashboard.container-infra.clusters.signCertificateController as ctrl', 68 | templateUrl: basePath + 'sign-certificate/sign-certificate-modal.html' 69 | }; 70 | return $uibModal.open(localSpec).result; 71 | } 72 | 73 | function perform(selected) { 74 | model.init(selected.id); 75 | return signCertificateModal().then(submit); 76 | } 77 | 78 | function allowed() { 79 | return $qExtensions.booleanAsPromise(true); 80 | } 81 | 82 | function submit() { 83 | return model.signCertificate().then(success); 84 | } 85 | 86 | function success(response) { 87 | textDownload.downloadTextFile(response.data.pem, model.cluster_name + "_cert.pem"); 88 | 89 | response.data.id = response.data.uuid; 90 | toast.add('success', interpolate(message.success, [response.data.id])); 91 | var result = actionResult.getActionResult() 92 | .created(resourceType, response.data.id); 93 | return result.result; 94 | } 95 | } 96 | })(); 97 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/sign-certificate/sign-certificate.service.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * (c) Copyright 2016 NEC Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('horizon.dashboard.container-infra.clusters.sign-certificate.service', 21 | function() { 22 | 23 | var $q, service, textDownload, deferred, fakeDeferred, model; 24 | 25 | var fakeModal = { 26 | result: { 27 | then: function(callback) { 28 | callback('test'); 29 | } 30 | } 31 | }; 32 | 33 | var fakesignCertificate = { 34 | data:{ 35 | pem: "" 36 | } 37 | }; 38 | 39 | beforeEach(module('horizon.app.core')); 40 | beforeEach(module('horizon.framework')); 41 | beforeEach(module('horizon.dashboard.container-infra.clusters')); 42 | 43 | beforeEach(inject(function($injector, _$rootScope_, _$q_, $uibModal) { 44 | $q = _$q_; 45 | service = $injector.get( 46 | 'horizon.dashboard.container-infra.clusters.sign-certificate.service'); 47 | textDownload = $injector.get('horizon.framework.util.file.text-download'); 48 | deferred = $q.defer(); 49 | deferred.resolve({data: {uuid: 1}}); 50 | spyOn(textDownload, 'downloadTextFile').and.returnValue(deferred.promise); 51 | 52 | model = $injector.get('horizon.dashboard.container-infra.clusters.sign-certificate-model'); 53 | fakeDeferred = $q.defer(); 54 | fakeDeferred.resolve(fakesignCertificate); 55 | spyOn(model, 'signCertificate').and.returnValue(fakeDeferred.promise); 56 | 57 | spyOn($uibModal, 'open').and.returnValue(fakeModal); 58 | })); 59 | 60 | it('should pass allow()', function() { 61 | var allowed = service.allowed(); 62 | expect(allowed).toBeTruthy(); 63 | }); 64 | 65 | it('should pass submit() and success()', inject(function($timeout) { 66 | 67 | var selected = {id : 1}; 68 | service.initAction(); 69 | service.perform(selected); 70 | $timeout.flush(); 71 | 72 | expect(model.signCertificate).toHaveBeenCalled(); 73 | expect(textDownload.downloadTextFile).toHaveBeenCalled(); 74 | 75 | })); 76 | 77 | }); 78 | })(); 79 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/workflow/advanced.help.html: -------------------------------------------------------------------------------- 1 |

Additional Labels

2 | 3 |

Specify additional labels to apply to the cluster or override labels set by the cluster template. Overriding labels set by the cluster template may result in your cluster being misconfigured, unstable or unable to be created.

4 | 5 |

The key=value pair string is case insensitive and will be converted to lower case.

6 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/workflow/cluster-template.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Cluster Template Detail 4 |
5 |
Name
6 |
7 | {$ ctrl.clusterTemplate.name|noName $} 8 |
9 |
ID
10 |
{$ ctrl.clusterTemplate.id $}
11 |
COE
12 |
{$ ctrl.clusterTemplate.coe $}
13 |
Image ID
14 |
{$ ctrl.clusterTemplate.image_id $}
15 |
Keypair
16 |
{$ ctrl.clusterTemplate.keypair_id|noValue $}
17 |
Docker Volume Size
18 |
{$ ctrl.clusterTemplate.docker_volume_size|gb|noValue $}
19 |
Public
20 |
{$ ctrl.clusterTemplate.public $}
21 |
Registry Enabled
22 |
{$ ctrl.clusterTemplate.registry_enabled $}
23 |
TLS Disabled
24 |
{$ ctrl.clusterTemplate.tls_disabled $}
25 |
API Server Port
26 |
{$ ctrl.clusterTemplate.apiserver_port|noValue $}
27 |
28 |
29 |
30 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/workflow/details.help.html: -------------------------------------------------------------------------------- 1 |

Addon software

2 |

Any addon software selected will be installed at the latest supported version when the cluster is deployed, but will not be upgraded automatically by rolling upgrades.

-------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/workflow/management.help.html: -------------------------------------------------------------------------------- 1 |

Security Updates

2 |

Please note that updates may cause application downtime if workloads deployed to Kubernetes are not following the best practices outlined in the documentation (for example, not using multiple replicas).

-------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/workflow/network.help.html: -------------------------------------------------------------------------------- 1 |

Network

2 | 3 |

You can choose to create a new network for this cluster, or use an existing network. If you use an existing, it needs to have a subnet and router with a gateway on the external network. You may also need to take care not to conflict with CIDRs in use by the Kubernetes pod and service network.

4 | 5 | 6 |

API Loadbalancer: Floating IP

7 | 8 |

Making the Kubernetes API accessible from your private network only is the most secure option (the default), but access will be limited to compute instances on the same private network or a VPN to that network.

9 |

Making the Kubernetes API accessible from the public internet with a floating IP is convenient, but may represent a security risk. When selecting this option, it is recommended to set Allowed CIDRs to limit access to a trusted IP address range.

10 | 11 | 12 |

API Loadbalancer: Allowed CIDRs

13 |

If this field is left empty, the API Loadbalancer will accept connections from any address. When set to one or more CIDR then only those, plus the internal network, are permitted access to the Kubernetes API Loadbalancer.

14 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/clusters/workflow/size.help.html: -------------------------------------------------------------------------------- 1 |

Control Plane size

2 | 3 |

Only uneven number of control plane nodes are supported. This provides the best balance of fault tolerance and cost for etcd.

4 | 5 | 6 |

Auto Scaling

7 | 8 |

If enabled, the minimum and maximum number of worker nodes must be specified.

9 |

Auto scaling requires the use of CPU and memory limits on the resource definition of Pods.

10 |

If Kubernetes is unable to schedule a Pod due to insufficient CPU or memory in the cluster, a worker node will be added, as long as the maximum number of worker nodes has not been reached.

11 |

If the aggregate resource limits of all existing Pods is lower than 50% of the cluster capacity, a worker node will be removed, as long as the minimum number of worker nodes has not been reached.

12 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/container-infra.module.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 Cisco Systems, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | /** 21 | * @ngdoc overview 22 | * @name horizon.dashboard.container-infra 23 | * 24 | * @description 25 | * Dashboard module to host various container-infra panels. 26 | */ 27 | angular 28 | .module('horizon.dashboard.container-infra', [ 29 | 'horizon.dashboard.container-infra.clusters', 30 | 'horizon.dashboard.container-infra.cluster-templates', 31 | 'horizon.dashboard.container-infra.quotas', 32 | 'ngRoute' 33 | ]) 34 | .config(config); 35 | 36 | config.$inject = ['$provide', '$windowProvider']; 37 | 38 | function config($provide, $windowProvider) { 39 | var path = $windowProvider.$get().STATIC_URL + 'dashboard/container-infra/'; 40 | $provide.constant('horizon.dashboard.container-infra.basePath', path); 41 | } 42 | })(); 43 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/container-infra.module.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 Cisco Systems, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | (function() { 17 | 'use strict'; 18 | 19 | describe('horizon.dashboard.container-infra', function() { 20 | it('should exist', function() { 21 | expect(angular.module('horizon.dashboard.container-infra')).toBeDefined(); 22 | }); 23 | }); 24 | 25 | })(); 26 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/container-infra.scss: -------------------------------------------------------------------------------- 1 | @import "clusters/clusters"; 2 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/quotas/actions.module.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc overview 20 | * @ngname horizon.dashboard.container-infra.quotas.actions 21 | * 22 | * @description 23 | * Provides all of the actions for quotas. 24 | */ 25 | angular.module('horizon.dashboard.container-infra.quotas.actions', 26 | [ 27 | 'horizon.framework', 28 | 'horizon.dashboard.container-infra' 29 | ]) 30 | .run(registerQuotaActions); 31 | 32 | registerQuotaActions.$inject = [ 33 | 'horizon.framework.conf.resource-type-registry.service', 34 | 'horizon.framework.util.i18n.gettext', 35 | 'horizon.dashboard.container-infra.quotas.create.service', 36 | 'horizon.dashboard.container-infra.quotas.update.service', 37 | 'horizon.dashboard.container-infra.quotas.delete.service', 38 | 'horizon.dashboard.container-infra.quotas.resourceType' 39 | ]; 40 | 41 | function registerQuotaActions ( 42 | registry, 43 | gettext, 44 | createQuotaService, 45 | updateQuotaService, 46 | deleteQuotaService, 47 | resourceType) { 48 | 49 | var quotaResourceType = registry.getResourceType(resourceType); 50 | quotaResourceType.globalActions 51 | .append({ 52 | id: 'createQuotaAction', 53 | service: createQuotaService, 54 | template: { 55 | type: 'create', 56 | text: gettext('Create Quota') 57 | } 58 | }); 59 | 60 | quotaResourceType.batchActions 61 | .append({ 62 | id: 'batchDeleteQuotaService', 63 | service: deleteQuotaService, 64 | template: { 65 | type: 'delete-selected', 66 | text: gettext('Delete Quotas') 67 | } 68 | }); 69 | 70 | quotaResourceType.itemActions 71 | .append({ 72 | id: 'updateQuotaService', 73 | service: updateQuotaService, 74 | template: { 75 | text: gettext('Update Quota') 76 | } 77 | }) 78 | .append({ 79 | id: 'deleteQuotaService', 80 | service: deleteQuotaService, 81 | template: { 82 | type: 'delete', 83 | text: gettext('Delete Quota') 84 | } 85 | }); 86 | } 87 | 88 | })(); 89 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/quotas/actions.module.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | describe('register quota actions module', function() { 19 | var registry; 20 | beforeEach(module('horizon.dashboard.container-infra.quotas.actions')); 21 | 22 | beforeEach(inject(function($injector) { 23 | registry = $injector.get('horizon.framework.conf.resource-type-registry.service'); 24 | })); 25 | 26 | it('registers Create Quota as a batch action', function() { 27 | var actions = registry.getResourceType('OS::Magnum::Quota').globalActions; 28 | expect(actionHasId(actions, 'createQuotaAction')).toBe(true); 29 | }); 30 | 31 | function actionHasId(list, value) { 32 | return list.filter(matchesId).length === 1; 33 | 34 | function matchesId(action) { 35 | return action.id === value; 36 | } 37 | } 38 | }); 39 | })(); 40 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/quotas/create/create.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | /** 19 | * @ngdoc overview 20 | * @name horizon.dashboard.container-infra.quotas.create.service 21 | * @description Service for the container-infra quota create modal 22 | */ 23 | angular 24 | .module('horizon.dashboard.container-infra.quotas') 25 | .factory('horizon.dashboard.container-infra.quotas.create.service', createService); 26 | 27 | createService.$inject = [ 28 | '$location', 29 | 'horizon.app.core.openstack-service-api.magnum', 30 | 'horizon.app.core.openstack-service-api.policy', 31 | 'horizon.framework.util.actions.action-result.service', 32 | 'horizon.framework.util.i18n.gettext', 33 | 'horizon.framework.util.q.extensions', 34 | 'horizon.framework.widgets.form.ModalFormService', 35 | 'horizon.framework.widgets.toast.service', 36 | 'horizon.dashboard.container-infra.quotas.resourceType', 37 | 'horizon.dashboard.container-infra.quotas.workflow' 38 | ]; 39 | 40 | function createService( 41 | $location, magnum, policy, actionResult, gettext, $qExtensions, modal, toast, 42 | resourceType, workflow 43 | ) { 44 | 45 | var config; 46 | var message = { 47 | success: gettext('Quota %s was successfully created.') 48 | }; 49 | 50 | var service = { 51 | perform: perform, 52 | allowed: allowed 53 | }; 54 | 55 | return service; 56 | 57 | ////////////// 58 | 59 | function perform(selected, $scope) { 60 | config = workflow.init('create', gettext('Create'), $scope); 61 | if (typeof selected !== 'undefined') { 62 | config.model.id = selected.id; 63 | } 64 | return modal.open(config).then(submit); 65 | } 66 | 67 | function allowed() { 68 | return $qExtensions.booleanAsPromise(true); 69 | } 70 | 71 | function submit(context) { 72 | context.model = cleanNullProperties(context.model); 73 | return magnum.createQuota(context.model).then(success, true); 74 | } 75 | 76 | function cleanNullProperties(model) { 77 | // Initially clean fields that don't have any value. 78 | // Not only "null", blank too. 79 | for (var key in model) { 80 | if (model.hasOwnProperty(key) && model[key] === null || model[key] === "") { 81 | delete model[key]; 82 | } 83 | } 84 | return model; 85 | } 86 | 87 | function success(response) { 88 | response.data.id = response.data.uuid; 89 | toast.add('success', interpolate(message.success, [response.data.id])); 90 | var result = actionResult.getActionResult() 91 | .created(resourceType, response.data.id); 92 | return result.result; 93 | } 94 | } 95 | })(); 96 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/quotas/create/create.service.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | describe('horizon.dashboard.container-infra.quotas.create.service', function() { 19 | 20 | var service, $scope, $q, deferred, magnum, workflow; 21 | var model = { 22 | id: 1 23 | }; 24 | var modal = { 25 | open: function(config) { 26 | config.model = model; 27 | deferred = $q.defer(); 28 | deferred.resolve(config); 29 | return deferred.promise; 30 | } 31 | }; 32 | 33 | /////////////////// 34 | 35 | beforeEach(module('horizon.app.core')); 36 | beforeEach(module('horizon.framework')); 37 | beforeEach(module('horizon.dashboard.container-infra.quotas')); 38 | 39 | beforeEach(module(function($provide) { 40 | $provide.value('horizon.framework.widgets.form.ModalFormService', modal); 41 | })); 42 | 43 | beforeEach(inject(function($injector, _$rootScope_, _$q_) { 44 | $q = _$q_; 45 | $scope = _$rootScope_.$new(); 46 | service = $injector.get('horizon.dashboard.container-infra.quotas.create.service'); 47 | magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 48 | workflow = $injector.get('horizon.dashboard.container-infra.quotas.workflow'); 49 | deferred = $q.defer(); 50 | deferred.resolve({data: {id: 1}}); 51 | spyOn(magnum, 'createQuota').and.returnValue(deferred.promise); 52 | spyOn(modal, 'open').and.callThrough(); 53 | spyOn(workflow, 'init').and.returnValue({model: model}); 54 | })); 55 | 56 | it('should check the policy if the user is allowed to create quota', function() { 57 | var allowed = service.allowed(); 58 | expect(allowed).toBeTruthy(); 59 | }); 60 | 61 | it('open the modal', inject(function($timeout) { 62 | service.perform(model, $scope); 63 | 64 | expect(modal.open).toHaveBeenCalled(); 65 | 66 | $timeout.flush(); 67 | $scope.$apply(); 68 | 69 | expect(magnum.createQuota).toHaveBeenCalled(); 70 | })); 71 | }); 72 | })(); 73 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/quotas/panel.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/quotas/quotas.module.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | (function() { 15 | 'use strict'; 16 | 17 | describe('horizon.dashboard.container-infra.quotas', function() { 18 | it('should exist', function() { 19 | expect(angular.module('horizon.dashboard.container-infra.quotas')).toBeDefined(); 20 | }); 21 | }); 22 | 23 | })(); 24 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/quotas/quotas.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | "use strict"; 17 | 18 | angular.module('horizon.dashboard.container-infra.quotas') 19 | .factory('horizon.dashboard.container-infra.quotas.service', 20 | quotasService); 21 | 22 | quotasService.$inject = [ 23 | '$filter', 24 | 'horizon.app.core.openstack-service-api.magnum' 25 | ]; 26 | 27 | /* 28 | * @ngdoc factory 29 | * @name horizon.dashboard.container-infra.quotas.service 30 | * 31 | * @description 32 | * This service provides functions that are used through the Quotas 33 | * features. These are primarily used in the module registrations 34 | * but do not need to be restricted to such use. Each exposed function 35 | * is documented below. 36 | */ 37 | function quotasService($filter, magnum) { 38 | return { 39 | getQuotasPromise: getQuotasPromise 40 | }; 41 | 42 | function getQuotasPromise(params) { 43 | return magnum.getQuotas(params).then(modifyResponse); 44 | 45 | function modifyResponse(response) { 46 | return {data: {items: response.data.items.map(addTrackBy)}}; 47 | 48 | function addTrackBy(quota) { 49 | quota.trackBy = quota.id + quota.resource; 50 | return quota; 51 | } 52 | } 53 | } 54 | } 55 | })(); 56 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/quotas/quotas.service.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | (function() { 15 | "use strict"; 16 | 17 | describe('quotas service', function() { 18 | var magnum, service; 19 | beforeEach(module('horizon.framework')); 20 | beforeEach(module('horizon.app.core.openstack-service-api')); 21 | beforeEach(module('horizon.dashboard.container-infra.quotas')); 22 | beforeEach(inject(function($injector) { 23 | magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 24 | service = $injector.get('horizon.dashboard.container-infra.quotas.service'); 25 | })); 26 | 27 | describe('getQuotasPromise', function() { 28 | it("provides a promise", inject(function($q, $timeout) { 29 | var deferred = $q.defer(); 30 | spyOn(magnum, 'getQuotas').and.returnValue(deferred.promise); 31 | var result = service.getQuotasPromise({}); 32 | deferred.resolve({ 33 | data:{ 34 | items: [{id: '123', resource: 'Cluster', hard_limit: 5}] 35 | } 36 | }); 37 | $timeout.flush(); 38 | expect(magnum.getQuotas).toHaveBeenCalled(); 39 | expect(result.$$state.value.data.items[0].id).toBe('123'); 40 | })); 41 | }); 42 | }); 43 | })(); 44 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/quotas/update/update.service.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | describe('horizon.dashboard.container-infra.quotas.update.service', function() { 19 | 20 | var service, $scope, $q, deferred, magnum; 21 | var selected = { 22 | id: 1 23 | }; 24 | var model = { 25 | id: 1, 26 | project_id: "p1", 27 | resource: "Cluster", 28 | hard_limit: 1 29 | }; 30 | var modal = { 31 | open: function(config) { 32 | config.model = model; 33 | deferred = $q.defer(); 34 | deferred.resolve(config); 35 | return deferred.promise; 36 | } 37 | }; 38 | var workflow = { 39 | init: function (action, title) { 40 | action = title; 41 | return {model: model}; 42 | } 43 | }; 44 | 45 | /////////////////// 46 | 47 | beforeEach(module('horizon.app.core')); 48 | beforeEach(module('horizon.framework')); 49 | beforeEach(module('horizon.dashboard.container-infra.quotas')); 50 | 51 | beforeEach(module(function($provide) { 52 | $provide.value('horizon.dashboard.container-infra.quotas.workflow', workflow); 53 | $provide.value('horizon.framework.widgets.form.ModalFormService', modal); 54 | })); 55 | 56 | beforeEach(inject(function($injector, _$rootScope_, _$q_) { 57 | $q = _$q_; 58 | $scope = _$rootScope_.$new(); 59 | service = $injector.get( 60 | 'horizon.dashboard.container-infra.quotas.update.service'); 61 | magnum = $injector.get('horizon.app.core.openstack-service-api.magnum'); 62 | deferred = $q.defer(); 63 | deferred.resolve({data: {id: 1, project_id: "p1", resource: "Cluster", hard_limit: 1}}); 64 | spyOn(magnum, 'getQuota').and.returnValue(deferred.promise); 65 | spyOn(magnum, 'updateQuota').and.returnValue(deferred.promise); 66 | spyOn(workflow, 'init').and.returnValue({model: model}); 67 | spyOn(modal, 'open').and.callThrough(); 68 | })); 69 | 70 | it('should check the policy if the user is allowed to update quota', function() { 71 | var allowed = service.allowed(); 72 | expect(allowed).toBeTruthy(); 73 | }); 74 | 75 | it('open the modal', inject(function($timeout) { 76 | service.perform(selected, $scope); 77 | 78 | expect(workflow.init).toHaveBeenCalled(); 79 | 80 | expect(modal.open).toHaveBeenCalledWith({model: model}); 81 | 82 | $timeout.flush(); 83 | $scope.$apply(); 84 | 85 | expect(magnum.updateQuota).toHaveBeenCalled(); 86 | })); 87 | }); 88 | })(); 89 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/quotas/workflow/workflow.service.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | 'use strict'; 17 | 18 | describe('horizon.dashboard.container-infra.quotas.workflow', function() { 19 | 20 | var workflow, $scope, $q, keystone, deferred; 21 | 22 | beforeEach(module('horizon.app.core')); 23 | beforeEach(module('horizon.framework')); 24 | beforeEach(module('horizon.dashboard.container-infra.quotas')); 25 | 26 | beforeEach(inject(function($injector, _$rootScope_, _$q_) { 27 | $q = _$q_; 28 | $scope = _$rootScope_.$new(); 29 | workflow = $injector.get('horizon.dashboard.container-infra.quotas.workflow'); 30 | keystone = $injector.get('horizon.app.core.openstack-service-api.keystone'); 31 | deferred = $q.defer(); 32 | deferred.resolve({data:{items:{1:{name:1},2:{name:2}}}}); 33 | spyOn(keystone, 'getProjects').and.returnValue(deferred.promise); 34 | })); 35 | 36 | it('should be init', inject(function($timeout) { 37 | var config = workflow.init('create', 'Create Quota', $scope); 38 | $timeout.flush(); 39 | expect(config.title).toBeDefined(); 40 | expect(config.schema).toBeDefined(); 41 | expect(config.form).toBeDefined(); 42 | expect(config.model).toBeDefined(); 43 | })); 44 | }); 45 | })(); 46 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/utils.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 3 | * not use this file except in compliance with the License. You may obtain 4 | * a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations 12 | * under the License. 13 | */ 14 | 15 | (function() { 16 | "use strict"; 17 | 18 | angular.module('horizon.dashboard.container-infra') 19 | .factory('horizon.dashboard.container-infra.utils.service', 20 | utilsService); 21 | 22 | /* 23 | * @ngdoc factory 24 | * @name horizon.dashboard.container-infra.utils.service 25 | * 26 | * @description 27 | * A utility service providing helpers for the Magnum UI frontend. 28 | */ 29 | function utilsService() { 30 | return { 31 | versionCompare: versionCompare 32 | }; 33 | 34 | function versionCompare(v1, v2, options) { 35 | var lexicographical = options && options.lexicographical; 36 | var zeroExtend = options && options.zeroExtend; 37 | var v1parts = v1.split('.'); 38 | var v2parts = v2.split('.'); 39 | 40 | // Step 1: Validation 41 | function isValidPart(x) { 42 | return (lexicographical ? /^\d+[A-Za-z]*$/ : /^\d+$/).test(x); 43 | } 44 | if (!v1parts.every(isValidPart) || !v2parts.every(isValidPart)) { 45 | return NaN; 46 | } 47 | 48 | // Step 2: Normalise 49 | function normaliseParts(parts) { 50 | if (zeroExtend) { 51 | while (parts.length < parts.length) { parts.push("0"); } 52 | } 53 | if (!lexicographical) { 54 | parts = parts.map(Number); 55 | } 56 | return parts; 57 | } 58 | v1parts = normaliseParts(v1parts); 59 | v2parts = normaliseParts(v2parts); 60 | 61 | // Step 3: Comparison 62 | for (var i = 0; i < v1parts.length; ++i) { 63 | if (v2parts.length === i) { return 1; } 64 | 65 | if (v1parts[i] === v2parts[i]) { 66 | continue; 67 | } 68 | if (v1parts[i] > v2parts[i]) { 69 | return 1; 70 | } 71 | return -1; 72 | } 73 | if (v1parts.length !== v2parts.length) { return -1; } 74 | 75 | return 0; 76 | } 77 | } 78 | })(); 79 | -------------------------------------------------------------------------------- /magnum_ui/static/dashboard/container-infra/utils.service.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 NEC Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | (function() { 18 | 'use strict'; 19 | 20 | describe('horizon.dashboard.container-infra.utils.service', function() { 21 | 22 | var service; 23 | 24 | /////////////////// 25 | 26 | beforeEach(module('horizon.dashboard.container-infra')); 27 | beforeEach(inject(function($injector) { 28 | service = $injector.get( 29 | 'horizon.dashboard.container-infra.utils.service'); 30 | })); 31 | 32 | it('should compare two semver-based versions strings', function() { 33 | expect(service.versionCompare('1.2.2','1.2.2')).toBe(0); 34 | expect(service.versionCompare('1.2.3','1.2.2')).toBe(1); 35 | expect(service.versionCompare('1.2.2','1.2.3')).toBe(-1); 36 | 37 | expect(service.versionCompare('1.12.2','1.2.2')).toBe(1); 38 | expect(service.versionCompare('12.1.2','1.3.2')).toBe(1); 39 | expect(service.versionCompare('1.3.2','1.3.11')).toBe(-1); 40 | }); 41 | }); 42 | })(); 43 | -------------------------------------------------------------------------------- /magnum_ui/test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/magnum-ui/fa0768cd58af0c4409ccefccef4a045e7ae73c41/magnum_ui/test/__init__.py -------------------------------------------------------------------------------- /magnum_ui/test/api_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/magnum-ui/fa0768cd58af0c4409ccefccef4a045e7ae73c41/magnum_ui/test/api_tests/__init__.py -------------------------------------------------------------------------------- /magnum_ui/test/helpers.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Cisco Systems, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | from unittest import mock 16 | 17 | from magnum_ui import api 18 | from magnum_ui.test import test_data 19 | from magnumclient.v1 import client as magnum_client 20 | from openstack_dashboard.test import helpers 21 | 22 | 23 | class APITestCase(helpers.APITestCase): 24 | """Extends the base Horizon APITestCase for magnumclient""" 25 | 26 | def setUp(self): 27 | super(APITestCase, self).setUp() 28 | self._original_magnumclient = api.magnum.magnumclient 29 | api.magnum.magnumclient = lambda request: self.stub_magnumclient() 30 | 31 | def _setup_test_data(self): 32 | super(APITestCase, self)._setup_test_data() 33 | test_data.data(self) 34 | 35 | def tearDown(self): 36 | super(APITestCase, self).tearDown() 37 | api.magnum.magnumclient = self._original_magnumclient 38 | 39 | def stub_magnumclient(self): 40 | if not hasattr(self, "magnumclient"): 41 | magnum_client.Client = mock.Mock() 42 | self.magnumclient = magnum_client.Client 43 | return self.magnumclient 44 | -------------------------------------------------------------------------------- /magnum_ui/test/integration_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/magnum-ui/fa0768cd58af0c4409ccefccef4a045e7ae73c41/magnum_ui/test/integration_tests/__init__.py -------------------------------------------------------------------------------- /magnum_ui/test/settings.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016 Cisco Systems, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | # Default to Horizons test settings to avoid any missing keys 16 | from horizon.test.settings import * # noqa: F403,H303 17 | from openstack_dashboard.test.settings import * # noqa: F403,H303 18 | 19 | # Update the dashboards with magnum_ui 20 | import magnum_ui.enabled 21 | import openstack_dashboard.enabled 22 | from openstack_dashboard.utils import settings 23 | 24 | # pop these keys to avoid log warnings about deprecation 25 | # update_dashboards will populate them anyway 26 | HORIZON_CONFIG.pop('dashboards', None) 27 | HORIZON_CONFIG.pop('default_dashboard', None) 28 | 29 | settings.update_dashboards( 30 | [ 31 | magnum_ui.enabled, 32 | openstack_dashboard.enabled, 33 | ], 34 | HORIZON_CONFIG, 35 | INSTALLED_APPS 36 | ) 37 | 38 | # Ensure any duplicate apps are removed after the update_dashboards call 39 | INSTALLED_APPS = list(set(INSTALLED_APPS)) 40 | -------------------------------------------------------------------------------- /magnum_ui/test/test_data.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Cisco Systems, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | from openstack_dashboard.test.test_data import utils 16 | 17 | 18 | def data(TEST): 19 | # Test Data Container in Horizon 20 | TEST.cluster_templates = utils.TestDataContainer() 21 | TEST.clusters = utils.TestDataContainer() 22 | TEST.certificates = utils.TestDataContainer() 23 | TEST.certificate_res_list = utils.TestDataContainer() 24 | 25 | # Cluster Templates 26 | cluster_template_dict_1 = {"uuid": 1, 27 | "name": "kindofabigdeal", 28 | "image-id": "", 29 | "keypair-id": "", 30 | "external-network-id": "", 31 | "coe": "", 32 | "fixed-network": "", 33 | "dns-nameserver": "", 34 | "flavor-id": "", 35 | "master-flavor-id": "", 36 | "docker-volume-size": "", 37 | "http-proxy": "", 38 | "https-proxy": "", 39 | "no-proxy": "", 40 | "labels": "", 41 | "tls-disabled": "", 42 | "public": "", 43 | "docker_storage_driver": "", 44 | "fixed_subnet": "", 45 | "floating_ip_enabled": "", 46 | "master_lb_enabled": "", 47 | "insecure_registry": ""} 48 | 49 | TEST.cluster_templates.add(cluster_template_dict_1) 50 | 51 | # Clusters 52 | cluster_dict_1 = {"uuid": 1, 53 | "name": "peopleknowme", 54 | "cluster_template_id": cluster_template_dict_1["uuid"], 55 | "node_count": "", 56 | "master_count": "", 57 | "discovery_url": "", 58 | "create_timeout": 0} 59 | 60 | TEST.clusters.add(cluster_dict_1) 61 | 62 | # Certificates 63 | certificate_1 = {"cluster_uuid": 1, 64 | "csr": "kore-ya-kono\n" 65 | "yuku-mo-kaheru-mo\n" 66 | "wakarete-ha\n" 67 | "shiru-mo-shiranu-mo\n" 68 | "afusaka-no-seki"} 69 | 70 | TEST.certificates.add(certificate_1) 71 | 72 | certificate_res = {"cluster_uuid": 1, 73 | "pem": "wata-no-hara\n" 74 | "yasoshima-kakete\n" 75 | "kogi-idenu-to\n" 76 | "hito-niwa-tsugeyo\n" 77 | "ama-no-tsuri-fune"} 78 | 79 | TEST.certificate_res_list.add(certificate_res) 80 | -------------------------------------------------------------------------------- /magnum_ui/version.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 2 | # not use this file except in compliance with the License. You may obtain 3 | # a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | import pbr.version 13 | 14 | version_info = pbr.version.VersionInfo('magnum-ui') 15 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | # not use this file except in compliance with the License. You may obtain 5 | # a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | 15 | import os 16 | import sys 17 | 18 | from django.core.management import execute_from_command_line 19 | 20 | if __name__ == "__main__": 21 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", 22 | "magnum_ui.test.settings") 23 | execute_from_command_line(sys.argv) 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magnum-ui", 3 | "description": "Magnum UI JavaScript tests", 4 | "repository": { 5 | "type": "git", 6 | "url": "https://opendev.org/openstack/magnum-ui" 7 | }, 8 | "version": "0.0.0", 9 | "private": true, 10 | "license": "Apache 2.0", 11 | "author": "Openstack ", 12 | "devDependencies": { 13 | "eslint": "^3.19.0", 14 | "eslint-config-openstack": "^4.0.1", 15 | "eslint-plugin-angular": "3.1.x", 16 | "jasmine-core": "2.8.x", 17 | "karma": "1.7.x", 18 | "karma-cli": "1.0.x", 19 | "karma-coverage": "1.1.x", 20 | "karma-firefox-launcher": "2.1.0", 21 | "karma-jasmine": "1.1.x", 22 | "karma-ng-html2js-preprocessor": "1.0.x", 23 | "karma-threshold-reporter": "0.1.x" 24 | }, 25 | "dependencies": {}, 26 | "scripts": { 27 | "postinstall": "if [ ! -d .tox ] || [ ! -d .tox/karma ]; then tox -ekarma --notest; fi", 28 | "lint": "eslint --no-color magnum_ui/static", 29 | "lintq": "eslint --quiet magnum_ui/static", 30 | "test": "karma start magnum_ui/karma.conf.js --single-run" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /releasenotes/notes/Workflow-updates-for-Create-Cluster-65e4fe510b4d1a4c.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The Cluster Create workflow has been improved to provide better input 5 | validation. 6 | - | 7 | "Master" has been renamed to "Control Plane" in user facing locations 8 | in line with Kubernetes teminology. The Magnum API still uses old terms. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/add-fedora-coreos-7882a33d801371fe.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Add fedora-coreos image support. User can choose an image with property 5 | 'os_distro=fedora-coreos' on horizon UI when creating a k8s cluster template. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/add-reno-7d46796dbf41c247.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - Switch to reno for managing release notes. 4 | 5 | -------------------------------------------------------------------------------- /releasenotes/notes/bugfix-cluster-template-hidden-arg-38909eaa92bd8d56.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | Fix an issue where a user was unable to create or update a cluster template 5 | on Horizon due to missing hidden option expected by the API. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/bugfix-set-floating_ip_enabled-default_in-cluster-template-true-ce06118f0e6064ba.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | Setting the `floating_ip_enabled` check box in the cluster_template 5 | creation form to true by default, so as to match with the default in the 6 | backend. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/improve-cluster-launch-dfc514b51cfa7f0e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - > 4 | Improve cluster launch workflow form. 5 | - > 6 | Add configuration for specifying ingress controllers and addon software 7 | supported / available for use with clusters. 8 | - > 9 | Adds REST endpoints for retrieving configured ingress controllers and addon 10 | software. 11 | -------------------------------------------------------------------------------- /releasenotes/notes/lb_floating_ip-ca6039444f88a968.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The Create Cluster workflow option `floating_ip_enabled` has been replaced 5 | with `master_lb_floating_ip_enabled` label as the former added floating 6 | IP's to all nodes, whereas the replacement only adds a floating IP to the 7 | K8s API loadbalancer itself. The field `floating_ip_enabled` has not 8 | changed behaviour and can still be used via the CLI. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/newton-dac21adfe6c6b8ee.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | Magnum changes its service scope as Container 4 | Infrastructure Management service. Also Magnum-UI 5 | change rename service 'container' to 6 | 'container-infra', and container management functions 7 | removed. 8 | Magnum uses terms 'cluster' and 'cluster template' 9 | instead of 'bay' and 'baymodel', because the use of 10 | new Magnum term of 'bay' has caused confusion with 11 | users. 12 | features: 13 | - > 14 | Support 'ca-show'. The function of downloading CA from 15 | cluster is added. 16 | - > 17 | Support 'ca-sign'. The function of signing of 18 | certificates to cluster is added. 19 | - | 20 | Add following options to cluster template creation 21 | and views. 22 | 23 | * 'docker_storage_driver' 24 | * 'fixed_subnet' 25 | * 'floating_ip_enabled' 26 | * 'master_lb_enabled' 27 | upgrade: 28 | - > 29 | Service is renamed from 'container' to 30 | 'container-infra'. Renaming targets are URLs, Angular 31 | module name, slugs for panel, etc. 32 | - > 33 | 'bay' and 'baymodel' are changed to 'cluster' and 34 | 'cluster template'. 35 | deprecations: 36 | - > 37 | Container panel is removed. According to decision of 38 | Magnum that changes service scope, container 39 | management functions are removed. 40 | fixes: 41 | - > 42 | Fixes issue that there is no way to specify for 43 | insecure magnumclient as a result api throws 500 and 44 | SSL cert verify errors. 'insecure' and 'ca-cert' 45 | options are added for magnumclient. 46 | other: 47 | - > 48 | Support for Horizon's Angular registry service, 49 | generic table and detail view, action service. 50 | -------------------------------------------------------------------------------- /releasenotes/notes/ocata-b08d6b024c63296b.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | Magnum UI keeps on following changes for Horizon's 4 | AngularJS-based framework. So we can use recent 5 | Horizon's feature. And hundreds of JavaScript tests 6 | are added. This ensures quality of Magnum UI. 7 | features: 8 | - > 9 | Allow to create cluster template without keypair. 10 | Also, allow change or set keypair in cluster creation. 11 | Following change in Magnum, also Magnum UI allows this 12 | feature. 13 | - > 14 | Change creation actions to global actions. Cluster 15 | Template creation and Cluster creation actions are 16 | changed from batchAction to globalAction. This means 17 | these actions are callable from other panels. 18 | - > 19 | Use initAction() instead initScope(). initScope() is 20 | deprecated from Horizon in Ocata and will be removed 21 | in Queens. 22 | - > 23 | Use horizon's common "views" module for Angular. This 24 | proceeds independence against Django framework for 25 | plugins. 26 | - Reasonable name is set to browser title bar. 27 | -------------------------------------------------------------------------------- /releasenotes/notes/ocata-summary-a717111a782c7a68.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | Ocata release summary. 4 | features: 5 | - | 6 | https://review.opendev.org/424984 Added an update action for clusters. 7 | https://review.opendev.org/422477 Added update action for cluster templ. 8 | https://review.opendev.org/424536 Action for json schema adjusted. 9 | https://review.opendev.org/421693 Python 3.5 classifier and venv added. 10 | https://review.opendev.org/415321 Improved tracebacks for exceptions. 11 | https://review.opendev.org/414810 Adopted horizon views for Angular 12 | https://review.opendev.org/408039 Replace mox with mock 13 | Added numerous unit tests. 14 | fixes: 15 | - | 16 | https://launchpad.net/bugs/1651054 $model is deprecated 17 | https://launchpad.net/bugs/1647921 initScope is deprecated 18 | https://launchpad.net/bugs/1645754 allow keypair in cluster creation 19 | Fixed numerous typos 20 | other: 21 | - | 22 | We removed the Xstatic packages from requirements, as those are not needed 23 | anymore. Horizon includes what it needs. 24 | -------------------------------------------------------------------------------- /releasenotes/notes/pike-b1af664f1033a131.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - > 4 | [`blueprint stats-list `_] 5 | REST API and Angular service for stats list are added. 6 | This allows to implement usage views for cluster and 7 | nodes. 8 | - > 9 | [`blueprint add-ca-rotate `_] 10 | Support rotate certificates. This adds 11 | "Rotate Certificate" action for cluster as item action. 12 | - > 13 | [`blueprint add-rollback-option `_] 14 | Support rollback option in cluster update. This adds 15 | checkbox into cluster update dialog for rollback on 16 | failure in update. 17 | - > 18 | [`blueprint add-docker-volume-size-option `_] 19 | Support docker volume size option in cluster creation. 20 | - > 21 | [`bug/1570668 `_] 22 | To be convenient to input netwok settings, this changes 23 | input forms for External Network, Fixed Network and 24 | Fixed Subnet in Cluster Template create/update dialogs 25 | to pulldowns. 26 | fixes: 27 | - > 28 | [`bug/1694634 `_] 29 | When selected Cluster Template doesn't have Keypair 30 | setting, Keypair doesn't be set properly on Create 31 | Cluster dialog. This fixes the issue. 32 | upgrade: 33 | - > 34 | Support python 3.5. 35 | - > 36 | Use only tox for test and remove run_tests.sh that is 37 | no longer used. 38 | - > 39 | Switch theme for documentation from oslosphinx to 40 | openstackdocstheme. 41 | - > 42 | Use pbr autodoc feature rather than custom logic. 43 | 44 | -------------------------------------------------------------------------------- /releasenotes/notes/queens-f99244e9db54ccf3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - > 4 | Used text-download service on horizon. The text-download service have 5 | been ported from Magnum UI to Horizon, so we use it. 6 | - > 7 | Added API service for Quotas. APIs for CLI, REST API for Ajax 8 | and REST service for Angular are added. Also stats and quota 9 | information are added into cluster table view. 10 | - > 11 | insecure_registry for cluster template creation is added. 12 | This parameter is also shown in update dialog and details view. 13 | - > 14 | Filled up empty values with '-' on table view and details view 15 | using noValue filters. Also show 'None' for empty objects. 16 | - > 17 | flavor_id and master_flavor_id parameters for cluster creation 18 | are added. These parameters are originally set by cluster template, 19 | but we can customize them when cluster create now. 20 | - > 21 | Added some attributes for cluster to show. 22 | Keypair, API address and Master Addresses are added into 23 | drawer on table view. 24 | Docker Volume Size, Stack Faults, Master Flavor ID, Node Flavor ID, 25 | COE Version, Container Version, Labels and Status Reason are 26 | added into details view. 27 | - > 28 | The load-edit directive is used. The CSR field on Sign Certificate 29 | dialog use load-edit directive newly added into Horizon. 30 | issues: 31 | - > 32 | [`bug/1638863 `_] 33 | Magnum has issue for updating labels of cluster template and cluster. 34 | - > 35 | Removed link to Stack. Panel for Stack, i.e. Heat Dashboard, 36 | was separated to independent UI Plugin. 37 | So we removed link to Stack panel on details view for Cluster. 38 | We might restore the link if we can find the installed plugins 39 | and paths to link. 40 | fixes: 41 | - > 42 | [`bug/1742599 `_] 43 | Fixed issue the deleted item is selected again with batch delete. 44 | Items recently deleted with batch action had been shown in deletion 45 | confirmation dialog when execute the batch delete action again. 46 | And this had caused the conflict error due to trying to delete 47 | unexisting item. 48 | 49 | -------------------------------------------------------------------------------- /releasenotes/notes/resize-actions-1436a2a0dccbd13b.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - > 4 | REST Api and Angular service for resizing clusters is addedd. Angular view 5 | supports resizing number of worker nodes only. 6 | other: 7 | - > 8 | Bump python-magnumclient lowerconstraint to >= 2.15.0 9 | - > 10 | Adds python-heatclient >= 1.18.0 dependency 11 | -------------------------------------------------------------------------------- /releasenotes/notes/rocky-56165675d959b593.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - > 4 | [`blueprint add-quotas-panel `_] 5 | Added quotas panel for admin. This panel has CRUD operations for quotas. 6 | For now, admin user can limit only the number of clusters for each project. 7 | To enable quotas panel, copy 8 | `magnum_ui/enabled/_2370_admin_container_infra_panel_group.py` and 9 | `magnum_ui/enabled/_2371_admin_container_infra_quotas_panel.py` into 10 | horizon's `enabled` directory. 11 | fixes: 12 | - > 13 | [`bug/1777545 `_] 14 | Fixed issue the deleted item is selected again with batch delete. 15 | Item selections on table view for batch actions does not be cleared 16 | after execution of actions. To ensure to clear item selections, 17 | `hzTable:clearSelection` event is emitted. 18 | - > 19 | [`bug/1638863 `_] 20 | Fixed failure updating labels for cluster template. 21 | - > 22 | [`bug/1746706 `_] 23 | Reproduced navigations when refreshing details view. Previously the fix 24 | for [`bug/1681627 `_] 25 | allowed us to reload or directly open Angular-based detail page (ngdetail), 26 | but the navigation menu was not reproduced correctly. 27 | -------------------------------------------------------------------------------- /releasenotes/notes/show-health-status-ff92b2fe2bfad5ae.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Show health status on cluster list table and show health status 5 | and health status reason on the cluster details page. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/stein-a6adf485dbbbbd1a.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added attributes for cluster to show. Following cluster attributes 5 | were added. 6 | 7 | In drawer on table view: 8 | 9 | - Keypair 10 | - API address 11 | - Master Addresses 12 | 13 | In details view 14 | 15 | - Docker Volume Size 16 | - Stack Faults 17 | - Master Flavor ID 18 | - COE Version 19 | - Container Version 20 | - Labels 21 | - Status Reason 22 | 23 | Also, reconstructed layouts for drawer and details views. 24 | - | 25 | Added flavor_id, master_flavor_id and labels for cluster creation 26 | as flavor, master flavor and labels. 27 | - | 28 | Supported Calico as network driver for kubernetes. 29 | - | 30 | Limit cluster update properties 31 | - | 32 | [`story 2003865 `_] 33 | Added master_flavor_id and flavor_id to show in cluster update dialog. 34 | fixes: 35 | - | 36 | [`story 2003614 `_] 37 | Added image filtering for magnum. When open a image selector for cluster 38 | creation dialog, many invalid images were shown. If a project has a lot 39 | of images, options can be quite long, and cause wrong selection by mistake. 40 | Now, images that has "os_distro" property and its value is one of 41 | "fedora-atomic", "coreos" and "ubuntu" would be shown. 42 | - | 43 | Disabled action for rotate certificate, due to Magnum API has not 44 | support rotate certificate yet. This action will be enabled in the future. 45 | - | 46 | [`story 2003865 `_] 47 | Magnum only allows the node count in cluster update now. 48 | Properties for cluster update filtered in favor of Magnum API. 49 | - | 50 | Supported api-version for client. Magnum API is using micro versions 51 | and to get the correct fuctions support, user or client have to 52 | initialize the correct client with parameter 'api_version'. 53 | Magnum UI also follow the same way as other OpenStack services 54 | to read the version from OPENSTACK_API_VERSIONS of Horizon 55 | local_settings.py. 56 | -------------------------------------------------------------------------------- /releasenotes/notes/update-actions-02db7b9f8e5d36b6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | Update actions are added for cluster template and 4 | cluster. Also, the form maintainability is proceeded by 5 | angular-json-schema. 6 | features: 7 | - > 8 | Update actions are added for cluster template and 9 | cluster. 10 | - > 11 | angular-json-schema library is used for create and 12 | update dialog, their forms are integrated into one 13 | workflow service. It proceeds maintainability for 14 | forms. 15 | -------------------------------------------------------------------------------- /releasenotes/notes/upgrade-actions-adf2f749ec0cc817.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Adds REST api and Angular service for rolling upgrade action on cluster. 5 | -------------------------------------------------------------------------------- /releasenotes/source/2023.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2023.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/2023.1 7 | :ignore-notes: 8 | queens-f99244e9db54ccf3.yaml 9 | -------------------------------------------------------------------------------- /releasenotes/source/2023.2.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2023.2 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2023.2 7 | -------------------------------------------------------------------------------- /releasenotes/source/2024.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2024.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2024.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/2024.2.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2024.2 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2024.2 7 | -------------------------------------------------------------------------------- /releasenotes/source/2025.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2025.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2025.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/index.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Magnum UI Release Notes 3 | ========================= 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | 8 | unreleased 9 | 2025.1 10 | 2024.2 11 | 2024.1 12 | 2023.2 13 | 2023.1 14 | zed 15 | yoga 16 | xena 17 | wallaby 18 | victoria 19 | ussuri 20 | train 21 | stein 22 | rocky 23 | queens 24 | pike 25 | ocata 26 | newton 27 | -------------------------------------------------------------------------------- /releasenotes/source/locale/fr/LC_MESSAGES/releasenotes.po: -------------------------------------------------------------------------------- 1 | # Gérald LONLAS , 2016. #zanata 2 | # JF Taltavull , 2017. #zanata 3 | # Mateusz Kowalski , 2017. #zanata 4 | msgid "" 5 | msgstr "" 6 | "Project-Id-Version: Magnum UI Release Notes\n" 7 | "Report-Msgid-Bugs-To: \n" 8 | "POT-Creation-Date: 2024-06-06 07:30+0000\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "PO-Revision-Date: 2017-08-01 08:40+0000\n" 13 | "Last-Translator: Mateusz Kowalski \n" 14 | "Language-Team: French\n" 15 | "Language: fr\n" 16 | "X-Generator: Zanata 4.3.3\n" 17 | "Plural-Forms: nplurals=2; plural=(n > 1)\n" 18 | 19 | msgid "'bay' and 'baymodel' are changed to 'cluster' and 'cluster template'." 20 | msgstr "" 21 | "'bay' et 'baymodel' ont été changés pour 'cluster' et 'cluster template'." 22 | 23 | msgid "'docker_storage_driver'" 24 | msgstr "'docker_storage_driver'" 25 | 26 | msgid "'fixed_subnet'" 27 | msgstr "'fixed_subnet'" 28 | 29 | msgid "'floating_ip_enabled'" 30 | msgstr "'floating_ip_enabled'" 31 | 32 | msgid "'master_lb_enabled'" 33 | msgstr "'master_lb_enabled'" 34 | 35 | msgid "2.1.1" 36 | msgstr "2.1.1" 37 | 38 | msgid "2.2.0" 39 | msgstr "2.2.0" 40 | 41 | msgid "Bug Fixes" 42 | msgstr "Corrections de bugs" 43 | 44 | msgid "Current Series Release Notes" 45 | msgstr "Note de la release actuelle" 46 | 47 | msgid "Deprecation Notes" 48 | msgstr "Notes d'obsolescence" 49 | 50 | msgid "Magnum UI Release Notes" 51 | msgstr "Note de release pour Magnum UI" 52 | 53 | msgid "New Features" 54 | msgstr "Nouvelles fonctionnalités" 55 | 56 | msgid "Newton Series Release Notes" 57 | msgstr "Note de release pour Newton" 58 | 59 | msgid "Ocata release summary." 60 | msgstr "Note de release pour Ocata" 61 | 62 | msgid "Other Notes" 63 | msgstr "Autres notes" 64 | 65 | msgid "Switch to reno for managing release notes." 66 | msgstr "Commence à utiliser reno pour la gestion des notes de release" 67 | 68 | msgid "Upgrade Notes" 69 | msgstr "Notes de mises à jours" 70 | -------------------------------------------------------------------------------- /releasenotes/source/locale/ru/LC_MESSAGES/releasenotes.po: -------------------------------------------------------------------------------- 1 | # Artem , 2017. #zanata 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Magnum UI Release Notes\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2024-06-06 07:30+0000\n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "PO-Revision-Date: 2017-02-09 06:57+0000\n" 11 | "Last-Translator: Artem \n" 12 | "Language-Team: Russian\n" 13 | "Language: ru\n" 14 | "X-Generator: Zanata 4.3.3\n" 15 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" 16 | "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" 17 | 18 | msgid "'bay' and 'baymodel' are changed to 'cluster' and 'cluster template'." 19 | msgstr "'bay' и 'baymodel' изменены на 'cluster' и 'cluster template'." 20 | 21 | msgid "'docker_storage_driver'" 22 | msgstr "'docker_storage_driver'" 23 | 24 | msgid "'fixed_subnet'" 25 | msgstr "'fixed_subnet'" 26 | 27 | msgid "'floating_ip_enabled'" 28 | msgstr "'floating_ip_enabled'" 29 | 30 | msgid "'master_lb_enabled'" 31 | msgstr "'master_lb_enabled'" 32 | 33 | msgid "2.1.1" 34 | msgstr "2.1.1" 35 | 36 | msgid "Bug Fixes" 37 | msgstr "Исправленные ошибки" 38 | 39 | msgid "Current Series Release Notes" 40 | msgstr "Примечания к текущему релизу" 41 | 42 | msgid "Magnum UI Release Notes" 43 | msgstr "Примечания к выпуску Magnum UI" 44 | 45 | msgid "New Features" 46 | msgstr "Новые особенности" 47 | 48 | msgid "Newton Series Release Notes" 49 | msgstr "Примечания к релизу Newton" 50 | 51 | msgid "Other Notes" 52 | msgstr "Прочие изменения" 53 | -------------------------------------------------------------------------------- /releasenotes/source/newton.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Newton Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: origin/stable/newton 7 | -------------------------------------------------------------------------------- /releasenotes/source/ocata.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Ocata Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: origin/stable/ocata 7 | -------------------------------------------------------------------------------- /releasenotes/source/pike.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Pike Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/pike 7 | -------------------------------------------------------------------------------- /releasenotes/source/queens.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Queens Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/queens 7 | -------------------------------------------------------------------------------- /releasenotes/source/rocky.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Rocky Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/rocky 7 | -------------------------------------------------------------------------------- /releasenotes/source/stein.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Stein Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/stein 7 | -------------------------------------------------------------------------------- /releasenotes/source/train.rst: -------------------------------------------------------------------------------- 1 | ========================== 2 | Train Series Release Notes 3 | ========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/train 7 | -------------------------------------------------------------------------------- /releasenotes/source/unreleased.rst: -------------------------------------------------------------------------------- 1 | ============================== 2 | Current Series Release Notes 3 | ============================== 4 | 5 | .. release-notes:: 6 | -------------------------------------------------------------------------------- /releasenotes/source/ussuri.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | Ussuri Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/ussuri 7 | -------------------------------------------------------------------------------- /releasenotes/source/victoria.rst: -------------------------------------------------------------------------------- 1 | ============================= 2 | Victoria Series Release Notes 3 | ============================= 4 | 5 | .. release-notes:: 6 | :branch: stable/victoria 7 | -------------------------------------------------------------------------------- /releasenotes/source/wallaby.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | Wallaby Series Release Notes 3 | ============================ 4 | 5 | .. release-notes:: 6 | :branch: stable/wallaby 7 | -------------------------------------------------------------------------------- /releasenotes/source/xena.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Xena Series Release Notes 3 | ========================= 4 | 5 | .. release-notes:: 6 | :branch: stable/xena 7 | -------------------------------------------------------------------------------- /releasenotes/source/yoga.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Yoga Series Release Notes 3 | ========================= 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/yoga 7 | -------------------------------------------------------------------------------- /releasenotes/source/zed.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | Zed Series Release Notes 3 | ======================== 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/zed 7 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # Requirements lower bounds listed here are our best effort to keep them up to 2 | # date but we do not test them so no guarantee of having them all correct. If 3 | # you find any incorrect lower bounds, let us know or propose a fix. 4 | pbr!=2.1.0,>=2.0.0 # Apache-2.0 5 | python-magnumclient>=4.2.0 # Apache-2.0 6 | python-heatclient>=1.18.0 7 | 8 | horizon>=17.1.0 # Apache-2.0 9 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = magnum-ui 3 | summary = Magnum User Interface 4 | description_file = 5 | README.rst 6 | author = OpenStack 7 | author_email = openstack-discuss@lists.openstack.org 8 | home_page = https://docs.openstack.org/developer/magnum-ui/ 9 | classifier = 10 | Environment :: OpenStack 11 | Intended Audience :: Information Technology 12 | Intended Audience :: System Administrators 13 | License :: OSI Approved :: Apache Software License 14 | Operating System :: POSIX :: Linux 15 | Programming Language :: Python 16 | Programming Language :: Python :: 3 17 | Programming Language :: Python :: 3.6 18 | Programming Language :: Python :: 3.7 19 | Programming Language :: Python :: 3.8 20 | Programming Language :: Python :: 3.9 21 | Programming Language :: Python :: 3.10 22 | Programming Language :: Python :: 3.11 23 | 24 | [files] 25 | packages = 26 | magnum_ui 27 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | # implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | import setuptools 17 | 18 | setuptools.setup( 19 | setup_requires=['pbr>=2.0.0'], 20 | pbr=True) 21 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | hacking>=7.0.0,<7.1.0 # Apache-2.0 2 | 3 | coverage!=4.4,>=4.0 # Apache-2.0 4 | nodeenv>=0.9.4 # BSD 5 | pytest>=5.3.5 # MIT 6 | selenium>=2.50.1 # Apache-2.0 7 | # This also needs xvfb library installed on your OS 8 | xvfbwrapper>=0.1.3 #license: MIT 9 | -------------------------------------------------------------------------------- /test-shim.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Shim for Javascript unit tests; supplying expected global features. 3 | * This should be removed from the codebase once i18n services are provided. 4 | * Taken from default i18n file provided by Django. 5 | */ 6 | 7 | var horizonPlugInModules = []; 8 | 9 | 10 | (function (globals) { 11 | 12 | var django = globals.django || (globals.django = {}); 13 | 14 | 15 | django.pluralidx = function (count) { return (count == 1) ? 0 : 1; }; 16 | 17 | /* gettext identity library */ 18 | 19 | django.gettext = function (msgid) { return msgid; }; 20 | django.ngettext = function (singular, plural, count) { return (count == 1) ? singular : plural; }; 21 | django.gettext_noop = function (msgid) { return msgid; }; 22 | django.pgettext = function (context, msgid) { return msgid; }; 23 | django.npgettext = function (context, singular, plural, count) { return (count == 1) ? singular : plural; }; 24 | 25 | 26 | django.interpolate = function (fmt, obj, named) { 27 | if (named) { 28 | return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])}); 29 | } else { 30 | return fmt.replace(/%s/g, function(match){return String(obj.shift())}); 31 | } 32 | }; 33 | 34 | 35 | /* formatting library */ 36 | 37 | django.formats = { 38 | "DATETIME_FORMAT": "N j, Y, P", 39 | "DATETIME_INPUT_FORMATS": [ 40 | "%Y-%m-%d %H:%M:%S", 41 | "%Y-%m-%d %H:%M:%S.%f", 42 | "%Y-%m-%d %H:%M", 43 | "%Y-%m-%d", 44 | "%m/%d/%Y %H:%M:%S", 45 | "%m/%d/%Y %H:%M:%S.%f", 46 | "%m/%d/%Y %H:%M", 47 | "%m/%d/%Y", 48 | "%m/%d/%y %H:%M:%S", 49 | "%m/%d/%y %H:%M:%S.%f", 50 | "%m/%d/%y %H:%M", 51 | "%m/%d/%y" 52 | ], 53 | "DATE_FORMAT": "N j, Y", 54 | "DATE_INPUT_FORMATS": [ 55 | "%Y-%m-%d", 56 | "%m/%d/%Y", 57 | "%m/%d/%y" 58 | ], 59 | "DECIMAL_SEPARATOR": ".", 60 | "FIRST_DAY_OF_WEEK": "0", 61 | "MONTH_DAY_FORMAT": "F j", 62 | "NUMBER_GROUPING": "3", 63 | "SHORT_DATETIME_FORMAT": "m/d/Y P", 64 | "SHORT_DATE_FORMAT": "m/d/Y", 65 | "THOUSAND_SEPARATOR": ",", 66 | "TIME_FORMAT": "P", 67 | "TIME_INPUT_FORMATS": [ 68 | "%H:%M:%S", 69 | "%H:%M:%S.%f", 70 | "%H:%M" 71 | ], 72 | "YEAR_MONTH_FORMAT": "F Y" 73 | }; 74 | 75 | django.get_format = function (format_type) { 76 | var value = django.formats[format_type]; 77 | if (typeof(value) == 'undefined') { 78 | return format_type; 79 | } else { 80 | return value; 81 | } 82 | }; 83 | 84 | /* add to global namespace */ 85 | globals.pluralidx = django.pluralidx; 86 | globals.gettext = django.gettext; 87 | globals.ngettext = django.ngettext; 88 | globals.gettext_noop = django.gettext_noop; 89 | globals.pgettext = django.pgettext; 90 | globals.npgettext = django.npgettext; 91 | globals.interpolate = django.interpolate; 92 | globals.get_format = django.get_format; 93 | globals.STATIC_URL = '/static/'; 94 | globals.WEBROOT = '/'; 95 | 96 | }(this)); 97 | -------------------------------------------------------------------------------- /tools/install_venv.py: -------------------------------------------------------------------------------- 1 | # Copyright 2010 United States Government as represented by the 2 | # Administrator of the National Aeronautics and Space Administration. 3 | # All Rights Reserved. 4 | # 5 | # Copyright 2010 OpenStack Foundation 6 | # Copyright 2013 IBM Corp. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | 20 | import os 21 | import sys 22 | 23 | import install_venv_common as install_venv 24 | 25 | 26 | def print_help(venv, root): 27 | help = """ 28 | OpenStack development environment setup is complete. 29 | 30 | OpenStack development uses virtualenv to track and manage Python 31 | dependencies while in development and testing. 32 | 33 | To activate the OpenStack virtualenv for the extent of your current shell 34 | session you can run: 35 | 36 | $ source %s/bin/activate 37 | 38 | Or, if you prefer, you can run commands in the virtualenv on a case by case 39 | basis by running: 40 | 41 | $ %s/tools/with_venv.sh 42 | 43 | Also, make test will automatically use the virtualenv. 44 | """ 45 | print(help % (venv, root)) 46 | 47 | 48 | def main(argv): 49 | root = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) 50 | 51 | if os.environ.get('tools_path'): 52 | root = os.environ['tools_path'] 53 | venv = os.path.join(root, '.venv') 54 | if os.environ.get('venv'): 55 | venv = os.environ['venv'] 56 | 57 | pip_requires = os.path.join(root, 'requirements.txt') 58 | test_requires = os.path.join(root, 'test-requirements.txt') 59 | py_version = "python%s.%s" % (sys.version_info[0], sys.version_info[1]) 60 | project = 'OpenStack' 61 | install = install_venv.InstallVenv(root, venv, pip_requires, test_requires, 62 | py_version, project) 63 | options = install.parse_args(argv) 64 | install.check_dependencies() 65 | install.create_virtualenv(no_site_packages=options.no_site_packages) 66 | install.install_dependencies() 67 | print_help(venv, root) 68 | 69 | 70 | if __name__ == '__main__': 71 | sys.exit(main(sys.argv)) 72 | -------------------------------------------------------------------------------- /tools/with_venv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | TOOLS_PATH=${TOOLS_PATH:-$(dirname $0)} 3 | VENV_PATH=${VENV_PATH:-${TOOLS_PATH}} 4 | VENV_DIR=${VENV_NAME:-/../.venv} 5 | TOOLS=${TOOLS_PATH} 6 | VENV=${VENV:-${VENV_PATH}/${VENV_DIR}} 7 | source ${VENV}/bin/activate && "$@" 8 | --------------------------------------------------------------------------------