Skip to content

Commit

Permalink
Merge pull request #88 from oracle/sprint-9
Browse files Browse the repository at this point in the history
Patch for #86
  • Loading branch information
toxophilist authored Aug 27, 2020
2 parents 233635f + d9802c9 commit 18d628d
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 37 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 5 additions & 5 deletions documentation/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]:oracle/oci-designer-toolkit.git
git clone -b v0.10.1 --depth 1 [email protected]: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
Expand Down
4 changes: 2 additions & 2 deletions okitweb/static/okit/js/okit_console.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions okitweb/static/okit/json/release.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"release": "0.10.0",
"tag": "v0.10.0"
"release": "0.10.1",
"tag": "v0.10.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
45 changes: 35 additions & 10 deletions visualiser/facades/ociConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

import oci
import os
import re

import json
Expand Down Expand Up @@ -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))

Expand All @@ -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


Expand All @@ -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


Expand All @@ -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


Expand All @@ -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


Expand All @@ -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


Expand All @@ -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

Expand All @@ -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


Expand All @@ -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


Expand All @@ -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


Expand All @@ -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

0 comments on commit 18d628d

Please sign in to comment.