diff --git a/CHANGELOG.md b/CHANGELOG.md index 259196fb6..0c1768e3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,21 @@ # Release Notes +## Version 0.28.0 +**Release Date**: 20th October 2021 +### Features +1. User / Groups View added + 1. Allow the creation / definition of local Users + 2. Allow the creation / definition of OCI Groups +2. Bastion as a Service functionality added to main design canvas. +3. Update cache functionality to store based on Configuration & Region. +4. Add "OKIT Reference" Tag to all resources created via OKIT to allow for future expansion / reference. +### Bug Fixes +1. Add missing policy documentation to export to markdown. +2. Fix Save As Template to add .json if not specified. +3. Resolve issue where the default dhcp option would generate terraform with an empty search_domain_names if the server type was changed and then changed back. + + ## Version 0.27.1 **Release Date**: 1st October 2021 ### Bug Fixes diff --git a/Dockerfile b/Dockerfile index b8e3e3e88..5ee5a4768 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,10 +5,10 @@ FROM oraclelinux:7-slim LABEL "provider"="Oracle" \ "issues"="https://github.com/oracle/oci-designer-toolkit/issues" \ - "version"="0.27.1" \ + "version"="0.28.0" \ "description"="OKIT Web Server Container." \ "copyright"="Copyright (c) 2020, 2021, Oracle and/or its affiliates." -SHELL ["/bin/bash", "-c"] +# SHELL ["/bin/bash", "-c"] ENV PYTHONIOENCODING=utf8 \ PYTHONPATH=":/okit/visualiser:/okit/okitweb:/okit" \ FLASK_APP=okitweb \ diff --git a/README.md b/README.md index 7e1019510..c29ef49f1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Oracle Cloud Infrastructure Designer and Visualisation Toolkit [0.27.1](CHANGELOG.md#version-0.27.1) +# Oracle Cloud Infrastructure Designer and Visualisation Toolkit [0.28.0](CHANGELOG.md#version-0.28.0) OCI designer and visualisation toolKIT (OKIT) is a browser based tool that allows the user to [design](https://www.ateam-oracle.com/introduction-to-okit-the-oci-designer-toolkit), [deploy](https://www.ateam-oracle.com/introduction-to-okit-the-oci-designer-toolkit) and visualise ([introspect/query](https://www.ateam-oracle.com/the-oci-designer-toolkit-query-feature)) @@ -33,7 +33,7 @@ OCI environments through a graphical web based interface. ## Changes -[Changes for the current release (0.27.1) are documented here.](CHANGELOG.md#version-0.27.1) +[Changes for the current release (0.28.0) are documented here.](CHANGELOG.md#version-0.28.0) ## Releases @@ -141,7 +141,7 @@ docker run -d --rm -p 80:80 --volume /.oci:/root/.oci --volume /.oci:/root/.oci --volume /.ssh:/root/.ssh --volume :/okit/instance/user --volume :/okit/instance/git --volume :/okit/instance/local --name okit okit +docker run -d --rm -p 80:80 --volume /.oci:/root/.oci --volume /.ssh:/root/.ssh --volume :/okit/instance/templates/user --volume :/okit/instance/git --volume :/okit/instance/local --name okit okit ``` Once started the Designer BUI can be accessed on [http://localhost/okit/designer](http://localhost/okit/designer) diff --git a/containers/docker/8-slim/Dockerfile b/containers/docker/8-slim/Dockerfile index 528f04cb7..b2ba73db3 100644 --- a/containers/docker/8-slim/Dockerfile +++ b/containers/docker/8-slim/Dockerfile @@ -8,7 +8,7 @@ LABEL "provider"="Oracle" \ "version"="0.20.0" \ "description"="OKIT Web Server Container." \ "copyright"="Copyright (c) 2020, 2021, Oracle and/or its affiliates." -SHELL ["/bin/bash", "-c"] +# SHELL ["/bin/bash", "-c"] ENV PYTHONIOENCODING=utf8 \ PYTHONPATH=":/okit/visualiser:/okit/okitweb:/okit" \ FLASK_APP=okitweb \ diff --git a/containers/docker/Dockerfile b/containers/docker/Dockerfile index 584982154..a80425a83 100644 --- a/containers/docker/Dockerfile +++ b/containers/docker/Dockerfile @@ -5,10 +5,10 @@ FROM oraclelinux:7-slim LABEL "provider"="Oracle" \ "issues"="https://github.com/oracle/oci-designer-toolkit/issues" \ - "version"="0.27.1" \ + "version"="0.28.0" \ "description"="OKIT Web Server Container." \ "copyright"="Copyright (c) 2020, 2021, Oracle and/or its affiliates." -SHELL ["/bin/bash", "-c"] +# SHELL ["/bin/bash", "-c"] ENV PYTHONIOENCODING=utf8 \ PYTHONPATH=":/okit/visualiser:/okit/okitweb:/okit" \ FLASK_APP=okitweb \ diff --git a/okitweb/okitOci.py b/okitweb/okitOci.py index 4b69ce755..bbffd711d 100644 --- a/okitweb/okitOci.py +++ b/okitweb/okitOci.py @@ -426,11 +426,11 @@ def resourceTypes(profile): return 'Unknown Method', 500 -@bp.route('/dropdown/', methods=(['GET'])) -def dropdownQuery(profile): +@bp.route('/dropdown//', methods=(['GET'])) +def dropdownQuery(profile, region): if request.method == 'GET': dropdown_query = OCIDropdownQuery(profile=profile) - dropdown_json = dropdown_query.executeQuery() + dropdown_json = dropdown_query.executeQuery([region]) return dropdown_json else: return 'Unknown Method', 500 diff --git a/okitweb/okitWebDesigner.py b/okitweb/okitWebDesigner.py index ee2b9ff6a..9c8d945f0 100644 --- a/okitweb/okitWebDesigner.py +++ b/okitweb/okitWebDesigner.py @@ -379,10 +379,12 @@ def template_save(): instance_path = current_app.instance_path root_dir = request.json["root_dir"].strip('/') template_filename = request.json["template_file"].strip('/') + if not template_filename.endswith('.json'): + template_filename = f'{template_filename}.json' okit_json = request.json["okit_json"] git = request.json.get('git', False) git_commit_msg = request.json.get('git_commit_msg', '') - logger.info(f'Save Template : {root_dir}') + logger.info(f'Save Template : {root_dir} {template_filename}') template_dir = os.path.dirname(template_filename) full_dir = os.path.join(instance_path, root_dir, template_dir) @@ -577,13 +579,13 @@ def saveas(savetype): return str(e), 500 -@bp.route('/dropdown/data/', methods=(['GET', 'POST'])) -def dropdownData(profile): +@bp.route('/dropdown/data//', methods=(['GET', 'POST'])) +def dropdownData(profile, region): dropdown_dir = os.path.abspath(os.path.join(bp.static_folder, 'json', 'dropdown')) shipped_dropdown_file = os.path.abspath(os.path.join(dropdown_dir, 'dropdown.json')) # shipped_dropdown_file = os.path.abspath(os.path.join(bp.static_folder, 'json', 'dropdown', 'dropdown.json')) profile_dropdown_dir = os.path.abspath(os.path.join(dropdown_dir, 'profiles')) - profile_dropdown_file = os.path.abspath(os.path.join(profile_dropdown_dir, f'{profile}.json')) + profile_dropdown_file = os.path.abspath(os.path.join(profile_dropdown_dir, profile, f'{region}.json')) # Check if profile specific dropdown file exists if not use the default if request.method == 'GET': if os.path.exists(profile_dropdown_file): diff --git a/okitweb/package.json b/okitweb/package.json index 9ebcf759e..1c1299ea0 100644 --- a/okitweb/package.json +++ b/okitweb/package.json @@ -1,6 +1,6 @@ { "name": "okitweb", - "version": "0.27.1", + "version": "0.28.0", "description": "OKIT Web application", "scripts": {}, "author": "Oracle", diff --git a/okitweb/static/okit/css/okit_console.css b/okitweb/static/okit/css/okit_console.css index 6d20c8021..9e1b36fe4 100644 --- a/okitweb/static/okit/css/okit_console.css +++ b/okitweb/static/okit/css/okit_console.css @@ -108,9 +108,11 @@ summary:focus { } .hidden { - visibility: hidden; + position: absolute; display: none; + visibility: hidden; max-height: 0; + max-width: 0; } .okit-pointer-cursor { @@ -137,7 +139,19 @@ summary:focus { background-position: center; background-repeat: no-repeat; background-size: 1em; - width: 2em; + width: 1em; + height: 1em; +} + +.action-button-column { + min-width: 2em; +} + +.cancel-overlay { + position: absolute; + right: 2px; + top: 2px; + z-index: 10; } /* @@ -458,7 +472,7 @@ summary:focus { */ .context-menu { - z-index:102; + z-index: 102; position: absolute; border: 1px rgba(37, 49, 65, 0.1) solid; padding: 2px; @@ -607,7 +621,7 @@ li a.parent-item:hover { overflow: auto; } -.okit-table .td > input[type="text"] { +.okit-table .td > input[type="text"], input[type="email"], input[type="password"] { width: 100%; } @@ -706,7 +720,7 @@ li a.parent-item:hover { right: 0; bottom: 0; left: 0; - z-index: 100; + z-index: 1000; padding: 15px 15px; background: rgba(0, 0, 0, 0.6); width: 100%; @@ -716,7 +730,7 @@ li a.parent-item:hover { .okit-modal-dialog { display: flex; flex-direction: column; - z-index:1000; + z-index: 1000; position: absolute; left: 30%; top: 20%; @@ -936,12 +950,12 @@ li a.parent-item:hover { } .okit-slide-hide-right { - /* padding: 0 !important; + padding: 0 !important; margin: 0 !important;; overflow: hidden !important; width: 0 !important; min-width: 0 !important; - max-width: 0!important; */ + max-width: 0!important; transition: transform 0.25s; transform: translateX(100%); } diff --git a/okitweb/static/okit/js/okit.js b/okitweb/static/okit/js/okit.js index 6734aa5b5..04dac675d 100644 --- a/okitweb/static/okit/js/okit.js +++ b/okitweb/static/okit/js/okit.js @@ -75,65 +75,71 @@ class OkitGITConfig { class OkitOCIData { key = "OkitDropdownCache"; day_milliseconds = 86400000; - constructor(profile) { + constructor(profile, region='uk-london-1') { this.compartments = []; this.dropdown_data = {} - this.load(profile); + this.load(profile, region); } clearLocalStorage() {localStorage.removeItem(this.key)} - storeLocal(profile) { + getCache() { + const local_data = localStorage.getItem(this.key) + return local_data ? JSON.parse(local_data) : {} + } + + storeLocal(profile, region='') { console.info(`Storing Local Dropdown data for ${profile}`); const local_data = localStorage.getItem(this.key) let cache = {} if (local_data) cache = JSON.parse(local_data) - if (profile) cache[profile] = this.dropdown_data + if (profile && !cache.hasOwnProperty(profile)) cache[profile] = {} + if (profile) cache[profile][region] = this.dropdown_data localStorage.setItem(this.key, JSON.stringify(cache)) } - loadLocal(profile) { + loadLocal(profile, region='') { const local_data = localStorage.getItem(this.key) console.info(`Loading Local Dropdown data for ${profile}`); let cache = {} if (local_data) cache = JSON.parse(local_data) - if (profile && cache[profile]) { + if (profile && region && cache[profile] && cache[profile][region]) { // Add test for stale cache && cache[profile].cache_date && ((Date.now() - cache[profile].cache_date) / this.day_milliseconds) <= 7 - console.info(`Found Local Dropdown Data for ${profile}`); - this.dropdown_data = cache[profile] + console.info(`Found Local Dropdown Data for ${profile} ${region}`); + this.dropdown_data = cache[profile][region] return true; } else { return false; } } - load(profile) { + load(profile, region='') { console.info('Loading Dropdown data for', profile); this.compartments = []; const self = this; - if (!this.loadLocal(profile)) { + if (!this.loadLocal(profile, region)) { const start = new Date().getTime() - $.getJSON(`dropdown/data/${String(profile)}`, (resp) => { + $.getJSON(`dropdown/data/${String(profile)}/${String(region)}`, (resp) => { const end = new Date().getTime() console.info('Load Dropdown Data took', end - start, 'ms') // $.extend(true, self, resp); self.dropdown_data = resp; - self.storeLocal(profile); + self.storeLocal(profile, region); if (resp.shipped && profile !== undefined) { - self.refresh(profile); + self.refresh(profile, region); } }); } } - refresh(profile) { + refresh(profile, region='') { console.info('Refreshing Dropdown data for', profile); - this.query(profile, false) + this.query(profile, false, region) } - save(profile) { + save(profile, region='') { console.info('Saving Dropdown data for', profile); - this.storeLocal(profile); + this.storeLocal(profile, region); $.ajax({ type: 'post', url: `dropdown/data/${String(profile)}`, @@ -148,17 +154,17 @@ class OkitOCIData { }); } - cloneForSave(profile) { + cloneForSave(profile, region='') { let clone = JSON.clone(this); clone.compartments = []; return clone; } - query(profile, save=false) { - console.info('Querying Dropdown data for', profile); + query(profile, save=false, region='') { + console.info('Querying Dropdown data for', profile, region); const self = this; const start = new Date().getTime() - $.getJSON(`oci/dropdown/${profile}`, (resp) => { + $.getJSON(`oci/dropdown/${profile}/${region}`, (resp) => { // Merge with base dropdown overwriting where appropriate with new data self.dropdown_data = {...self.dropdown_data, ...resp}; delete self.dropdown_data.default @@ -166,8 +172,8 @@ class OkitOCIData { self.dropdown_data.cache_date = Date.now() const end = new Date().getTime() console.info('Queried Dropdown Data for', profile, 'took', end - start, 'ms') - if (save) this.save(profile) - else this.storeLocal(profile) + if (save) this.save(profile, region) + else this.storeLocal(profile, region) }); } @@ -394,7 +400,7 @@ class OkitSettings { this.is_vcn_defaults = true; this.is_timestamp_files = false; this.profile = 'DEFAULT'; - this.region = '' + this.region = 'uk-london-1' this.is_always_free = false; this.is_optional_expanded = true; this.is_display_grid = false; @@ -406,7 +412,7 @@ class OkitSettings { this.highlight_association = true; this.show_label = 'none'; this.tooltip_type = 'simple'; - this.name_prefix = 'okit-'; + this.name_prefix = 'okit'; this.auto_save = false; this.show_ocids = false; this.validate_markdown = true; diff --git a/okitweb/static/okit/js/okit_console.js b/okitweb/static/okit/js/okit_console.js index 3a0e34913..b911c9d37 100644 --- a/okitweb/static/okit/js/okit_console.js +++ b/okitweb/static/okit/js/okit_console.js @@ -4,8 +4,10 @@ */ console.info('Loaded Console Javascript'); -const okitVersion = '0.27.1'; -const okitReleaseDate = '1st October 2021'; + +const okitVersion = '0.28.0'; +const okitReleaseDate = '20th October 2021'; + // Validation const validate_error_colour = "#ff4d4d"; const validate_warning_colour = "#ffd633"; @@ -115,7 +117,8 @@ function handleConfigChanged(event) { console_header_region_select.empty() console_header_region_select.append($('