Skip to content

Commit

Permalink
Merge pull request #97 from oracle/toxophilist/sprint-9/OKIT-104
Browse files Browse the repository at this point in the history
Toxophilist/sprint 9/okit 104
  • Loading branch information
toxophilist authored Sep 9, 2020
2 parents ad8aebc + 590d4fa commit 2e6aeec
Show file tree
Hide file tree
Showing 31 changed files with 656 additions and 146 deletions.
4 changes: 3 additions & 1 deletion containers/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ RUN yum install -y \
oci==2.6.0 \
pyyaml==5.2 \
# Create Workspace
&& mkdir -p /okit/{config,log,visualiser,okitweb,workspace}
&& mkdir -p /okit/{config,log,visualiser,okitweb,workspace,templates} \
&& mkdir -p /okit/okitweb/static/okit/templates \
&& ln -s /okit/templates /okit/okitweb/static/okit/templates/user
# Copy source code
COPY okitweb /okit/okitweb
COPY visualiser /okit/visualiser
Expand Down
2 changes: 2 additions & 0 deletions containers/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ services:
ports:
- 443:443/tcp
- 80:80/tcp
volumes:
- "~/okit/user/templates:/okit/templates"
...
2 changes: 2 additions & 0 deletions containers/vagrant/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Disable Audio to prevent CPU spikes
v.customize ["modifyvm", :id, "--audio", "none"]
end
# This will expose the local OKIT Template folder within the VM
config.vm.synced_folder "~/okit/user/templates", "/okit/templates"

# VM hostname
config.vm.hostname = NAME
Expand Down
1 change: 1 addition & 0 deletions documentation/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ cd oci-designer-toolkit
docker run -d --rm -p 443:443 -p 80:80 \
--name okit \
--hostname okit \
--volume ~/okit/user/templates:/okit/templates \
okit
```

Expand Down
1 change: 1 addition & 0 deletions documentation/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ cd oci-designer-toolkit
docker run -d --rm -p 443:443 -p 80:80 \
--name okit \
--hostname okit \
--volume ~/okit/user/templates:/okit/templates \
okit
```
The __<OKIT_ROOT_DIR>/containers/scripts__ contains helper scripts for Linux/Mac and Windows PowerShell.
Expand Down
5 changes: 5 additions & 0 deletions okitweb/okitOci.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from facades.ociFileStorageSystems import OCIFileStorageSystems
from facades.ociImage import OCIImages
from facades.ociInstance import OCIInstances
from facades.ociInstancePool import OCIInstancePools
from facades.ociInternetGateway import OCIInternetGateways
from facades.ociLoadBalancer import OCILoadBalancers
from facades.ociLocalPeeringGateway import OCILocalPeeringGateways
Expand Down Expand Up @@ -229,6 +230,10 @@ def ociArtifacts(artifact):
logger.info('---- Processing Instances')
oci_instances = OCIInstances(config=config, profile=config_profile, compartment_id=query_json['compartment_id'])
response_json = oci_instances.list(filter=query_json.get('instance_filter', None))
elif artifact == 'InstancePool':
logger.info('---- Processing Instance Pools')
oci_instance_pools = OCIInstancePools(config=config, profile=config_profile, compartment_id=query_json['compartment_id'])
response_json = oci_instance_pools.list(filter=query_json.get('instance_filter', None))
elif artifact == 'InternetGateway':
logger.info('---- Processing Internet Gateways')
oci_internet_gateways = OCIInternetGateways(config=config, profile=config_profile, compartment_id=query_json['compartment_id'], vcn_id=query_json['vcn_id'])
Expand Down
2 changes: 1 addition & 1 deletion okitweb/static/okit/fragments/json/bastion_server.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
],
"source_details": {
"os": "Oracle Linux",
"version": "7.7",
"version": "",
"boot_volume_size_in_gbs": "50",
"source_type": "image"
},
Expand Down
8 changes: 4 additions & 4 deletions okitweb/static/okit/fragments/json/load_balanced_nginx.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
],
"source_details": {
"os": "Oracle Linux",
"version": "7.7",
"version": "",
"boot_volume_size_in_gbs": "50",
"source_type": "image"
},
Expand Down Expand Up @@ -93,7 +93,7 @@
],
"source_details": {
"os": "Oracle Linux",
"version": "7.7",
"version": "",
"boot_volume_size_in_gbs": "50",
"source_type": "image"
},
Expand Down Expand Up @@ -142,7 +142,7 @@
],
"source_details": {
"os": "Oracle Linux",
"version": "7.7",
"version": "",
"boot_volume_size_in_gbs": "50",
"source_type": "image"
},
Expand Down Expand Up @@ -191,7 +191,7 @@
],
"source_details": {
"os": "Oracle Linux",
"version": "7.7",
"version": "",
"boot_volume_size_in_gbs": "50",
"source_type": "image"
},
Expand Down
9 changes: 8 additions & 1 deletion okitweb/static/okit/js/okit_designer.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,27 +194,33 @@ function handleSaveAs(evt) {
.attr('id', 'save_as_template_table')
.attr('class', 'table okit-table okit-modal-dialog-table');
let tbody = table.append('div').attr('class', 'tbody');
// Title
let tr = tbody.append('div').attr('class', 'tr');
tr.append('div').attr('class', 'td').text('Title');
tr.append('div').attr('class', 'td').append('input')
.attr('class', 'okit-input')
.attr('id', 'template_title')
.attr('name', 'template_title')
.attr('type', 'text');
// Description
tr = tbody.append('div').attr('class', 'tr');
tr.append('div').attr('class', 'td').text('Description');
tr.append('div').attr('class', 'td').append('input')
.attr('class', 'okit-input')
.attr('id', 'template_description')
.attr('name', 'template_description')
.attr('type', 'text');
// Type
/* TODO: Reinstate when sub template types are implemented
tr = tbody.append('div').attr('class', 'tr');
tr.append('div').attr('class', 'td').text('Type');
tr.append('div').attr('class', 'td').append('input')
.attr('class', 'okit-input')
.attr('id', 'template_type')
.attr('name', 'template_type')
.attr('type', 'text');
*/
// Save
let save_button = d3.select(d3Id('modal_dialog_footer')).append('div').append('button')
.attr('id', 'save_as_button')
.attr('type', 'button')
Expand All @@ -225,7 +231,8 @@ function handleSaveAs(evt) {
function handleSaveAsTemplate(e) {
okitJsonModel.title = $(jqId('template_title')).val();
okitJsonModel.description = $(jqId('template_description')).val();
okitJsonModel.template_type = $(jqId('template_type')).val();
//okitJsonModel.template_type = $(jqId('template_type')).val();
okitJsonModel.template_type = 'User';
$.ajax({
type: 'post',
url: 'saveas/template',
Expand Down
1 change: 1 addition & 0 deletions okitweb/static/okit/js/okit_designer_properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function loadPropertiesSheet(json_element) {
$(jqId(key)).find("input:checkbox").each(function() {
if ($(this).prop('checked')) {json_element[key].push($(this).val());}
});
redrawSVGCanvas();
});
if (val.includes($(this).val())) {$(this).prop("checked", true);}
});
Expand Down
Loading

0 comments on commit 2e6aeec

Please sign in to comment.