diff --git a/CHANGELOG.md b/CHANGELOG.md index f10d6f03e..36804d2a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Release Notes +## Version 0.10.1 +**Release Date**: 27th August 2020 +### Bug Fixes +1. Querying occasionally hit a condition where the SVG rectangle does not exist before attempting to get the bounding client information (Issuse: #86) + + ## Version 0.10.0 **Release Date**: 26th August 2020 ### Features diff --git a/README.md b/README.md index c497a3899..336db2cc2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# OCI Designer Toolkit [0.10.0](CHANGELOG.md#version-0.10.0) +# OCI Designer Toolkit [0.10.1](CHANGELOG.md#version-0.10.1) OCI designer toolKIT (OKIT) is a set of tools for enabling design, deploy and visualise OCI environments through a graphical web based interface. diff --git a/documentation/Installation.md b/documentation/Installation.md index ee4e3896a..18893a037 100644 --- a/documentation/Installation.md +++ b/documentation/Installation.md @@ -22,22 +22,22 @@ python modules are installed and in addition provide a simple flask server that ## Clone Repository Before the building either the Docker or Vagrant Images the project will nee to be cloned from the Git Repository (or downloaded) and it is recommended that the latest Stable Release be cloned. The latest stable version number if shown in the README -and the associated Release tag is in the format vX.Y.Z hence for the version 0.10.0 the Release tag will be -**v0.10.0**. The command shows how this can be cloned to the local machine. +and the associated Release tag is in the format vX.Y.Z hence for the version 0.10.1 the Release tag will be +**v0.10.1**. The command shows how this can be cloned to the local machine. ```bash -git clone -b v0.10.0 --depth 1 git@github.com:oracle/oci-designer-toolkit.git +git clone -b v0.10.1 --depth 1 git@github.com:oracle/oci-designer-toolkit.git ``` or ```bash -git clone -b v0.10.0 --depth 1 https://github.com/oracle/oci-designer-toolkit.git +git clone -b v0.10.1 --depth 1 https://github.com/oracle/oci-designer-toolkit.git ``` ### Download If you do not have git installed locally the current release of OKIT can be retrieved by downloading it as a zip file from -https://github.com/oracle/oci-designer-toolkit/archive/v0.10.0.zip +https://github.com/oracle/oci-designer-toolkit/archive/v0.10.1.zip ## OCI Config File diff --git a/okitweb/static/okit/js/okit_console.js b/okitweb/static/okit/js/okit_console.js index 5e870a0e0..9ca4d9d25 100644 --- a/okitweb/static/okit/js/okit_console.js +++ b/okitweb/static/okit/js/okit_console.js @@ -4,8 +4,8 @@ */ console.info('Loaded Console Javascript'); -const okitVersion = '0.10.0'; -const okitReleaseDate = '26th August 2020'; +const okitVersion = '0.10.1'; +const okitReleaseDate = '27th August 2020'; // Validation const validate_error_colour = "#ff4d4d"; const validate_warning_colour = "#ffd633"; diff --git a/okitweb/static/okit/json/release.json b/okitweb/static/okit/json/release.json index 0fcc1f6bd..ed619cb62 100644 --- a/okitweb/static/okit/json/release.json +++ b/okitweb/static/okit/json/release.json @@ -1,4 +1,4 @@ { - "release": "0.10.0", - "tag": "v0.10.0" + "release": "0.10.1", + "tag": "v0.10.1" } \ No newline at end of file diff --git a/okitweb/static/okit/view/designer/js/artefacts/dynamic_routing_gateway.js b/okitweb/static/okit/view/designer/js/artefacts/dynamic_routing_gateway.js index 4e26e9980..06b3f6283 100644 --- a/okitweb/static/okit/view/designer/js/artefacts/dynamic_routing_gateway.js +++ b/okitweb/static/okit/view/designer/js/artefacts/dynamic_routing_gateway.js @@ -30,23 +30,25 @@ class DynamicRoutingGatewayView extends OkitDesignerArtefactView { let svg = super.draw(); // Get Inner Rect to attach Connectors let rect = svg.select("rect[id='" + safeId(this.id) + "']"); - let boundingClientRect = rect.node().getBoundingClientRect(); - // Add Connector Data - svg.attr("data-connector-start-y", boundingClientRect.y + boundingClientRect.height / 2) - .attr("data-connector-start-x", boundingClientRect.x + (boundingClientRect.width)) - .attr("data-connector-end-y", boundingClientRect.y + boundingClientRect.height / 2) - .attr("data-connector-end-x", boundingClientRect.x + (boundingClientRect.width)) - .attr("data-connector-id", this.id) - .attr("dragable", true) - .selectAll("*") - .attr("data-connector-start-y", boundingClientRect.y + boundingClientRect.height / 2) - .attr("data-connector-start-x", boundingClientRect.x + (boundingClientRect.width)) - .attr("data-connector-end-y", boundingClientRect.y + boundingClientRect.height / 2) - .attr("data-connector-end-x", boundingClientRect.x + (boundingClientRect.width)) - .attr("data-connector-id", this.id) - .attr("dragable", true); - // Draw Connectors - // this.drawConnectors(); + if (rect && rect.node()) { + let boundingClientRect = rect.node().getBoundingClientRect(); + // Add Connector Data + svg.attr("data-connector-start-y", boundingClientRect.y + boundingClientRect.height / 2) + .attr("data-connector-start-x", boundingClientRect.x + (boundingClientRect.width)) + .attr("data-connector-end-y", boundingClientRect.y + boundingClientRect.height / 2) + .attr("data-connector-end-x", boundingClientRect.x + (boundingClientRect.width)) + .attr("data-connector-id", this.id) + .attr("dragable", true) + .selectAll("*") + .attr("data-connector-start-y", boundingClientRect.y + boundingClientRect.height / 2) + .attr("data-connector-start-x", boundingClientRect.x + (boundingClientRect.width)) + .attr("data-connector-end-y", boundingClientRect.y + boundingClientRect.height / 2) + .attr("data-connector-end-x", boundingClientRect.x + (boundingClientRect.width)) + .attr("data-connector-id", this.id) + .attr("dragable", true); + // Draw Connectors + // this.drawConnectors(); + } console.groupEnd(); return svg; } diff --git a/visualiser/facades/ociConnection.py b/visualiser/facades/ociConnection.py index 94530bf22..d4b3c6f90 100644 --- a/visualiser/facades/ociConnection.py +++ b/visualiser/facades/ociConnection.py @@ -13,6 +13,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# import oci +import os import re import json @@ -44,8 +45,32 @@ def __init__(self, config=None, configfile=None, profile=None): if config is not None: self.config.update(config) logger.debug('>>>>>>>>>>>>>>>> Merged Config : {0!s:s}'.format(self.config)) + # Create Instance Security Signer + if os.getenv('OCI_CLI_AUTH', 'config') == 'instance_principal': + self.signerFromInstancePrincipal() + else: + self.signerFromConfig() + self.connect() + def signerFromInstancePrincipal(self): + try: + # Get Signer from Instance Principal + self.signer = oci.auth.signers.InstancePrincipalsSecurityTokenSigner() + self.config = {} + except Exception: + logger.warn('Instance Principal is not available') + self.signerFromConfig() + + def signerFromConfig(self): + self.signer = oci.Signer( + tenancy=self.config["tenancy"], + user=self.config["user"], + fingerprint=self.config["fingerprint"], + private_key_file_location=self.config.get("key_file"), + pass_phrase=oci.config.get_config_value_or_default(self.config, "pass_phrase") + ) + def toJson(self, data): return json.loads(str(data)) @@ -66,7 +91,7 @@ def __init__(self, config=None, configfile=None, profile=None): super(OCIBlockStorageVolumeConnection, self).__init__(config=config, configfile=configfile, profile=profile) def connect(self): - self.client = oci.core.BlockstorageClient(self.config) + self.client = oci.core.BlockstorageClient(config=self.config, signer=self.signer) return @@ -75,7 +100,7 @@ def __init__(self, config=None, configfile=None, profile=None): super(OCIComputeConnection, self).__init__(config=config, configfile=configfile, profile=profile) def connect(self): - self.client = oci.core.ComputeClient(self.config) + self.client = oci.core.ComputeClient(config=self.config, signer=self.signer) return @@ -84,7 +109,7 @@ def __init__(self, config=None, configfile=None, profile=None): super(OCIContainerConnection, self).__init__(config=config, configfile=configfile, profile=profile) def connect(self): - self.client = oci.container_engine.ContainerEngineClient(self.config) + self.client = oci.container_engine.ContainerEngineClient(config=self.config, signer=self.signer) return @@ -93,7 +118,7 @@ def __init__(self, config=None, configfile=None, profile=None): super(OCIDatabaseConnection, self).__init__(config=config, configfile=configfile, profile=profile) def connect(self): - self.client = oci.database.DatabaseClient(self.config) + self.client = oci.database.DatabaseClient(config=self.config, signer=self.signer) return @@ -102,7 +127,7 @@ def __init__(self, config=None, configfile=None, profile=None): super(OCIFileStorageSystemConnection, self).__init__(config=config, configfile=configfile, profile=profile) def connect(self): - self.client = oci.file_storage.FileStorageClient(self.config) + self.client = oci.file_storage.FileStorageClient(config=self.config, signer=self.signer) return @@ -112,7 +137,7 @@ def __init__(self, config=None, configfile=None, profile=None): super(OCIIdentityConnection, self).__init__(config=config, configfile=configfile, profile=profile) def connect(self): - self.client = oci.identity.IdentityClient(self.config) + self.client = oci.identity.IdentityClient(config=self.config, signer=self.signer) self.compartment_ocid = self.config["tenancy"] return @@ -122,7 +147,7 @@ def __init__(self, config=None, configfile=None, profile=None): super(OCILoadBalancerConnection, self).__init__(config=config, configfile=configfile, profile=profile) def connect(self): - self.client = oci.load_balancer.LoadBalancerClient(self.config) + self.client = oci.load_balancer.LoadBalancerClient(config=self.config, signer=self.signer) return @@ -131,7 +156,7 @@ def __init__(self, config=None, configfile=None, profile=None): super(OCIObjectStorageBucketConnection, self).__init__(config=config, configfile=configfile, profile=profile) def connect(self): - self.client = oci.object_storage.ObjectStorageClient(self.config) + self.client = oci.object_storage.ObjectStorageClient(config=self.config, signer=self.signer) return @@ -140,7 +165,7 @@ def __init__(self, config=None, configfile=None, profile=None): super(OCIResourceManagerConnection, self).__init__(config=config, configfile=configfile, profile=profile) def connect(self): - self.client = oci.resource_manager.ResourceManagerClient(self.config) + self.client = oci.resource_manager.ResourceManagerClient(config=self.config, signer=self.signer) return @@ -149,6 +174,6 @@ def __init__(self, config=None, configfile=None, profile=None): super(OCIVirtualNetworkConnection, self).__init__(config=config, configfile=configfile, profile=profile) def connect(self): - self.client = oci.core.VirtualNetworkClient(self.config) + self.client = oci.core.VirtualNetworkClient(config=self.config, signer=self.signer) return