aboutsummaryrefslogtreecommitdiffstats
path: root/ui/imports/ui/components
diff options
context:
space:
mode:
Diffstat (limited to 'ui/imports/ui/components')
-rw-r--r--ui/imports/ui/components/env-amqp-credentials-info/env-amqp-credentials-info.html4
-rw-r--r--ui/imports/ui/components/env-open-stack-db-credentials-info/env-open-stack-db-credentials-info.html4
-rw-r--r--ui/imports/ui/components/mt-input/mt-input.js8
-rw-r--r--ui/imports/ui/components/mt-radios/mt-radios.js8
-rw-r--r--ui/imports/ui/components/mt-select/mt-select.js8
-rw-r--r--ui/imports/ui/components/network-graph-manager/network-graph-manager.js29
-rw-r--r--ui/imports/ui/components/network-graph/network-graph.js89
-rw-r--r--ui/imports/ui/components/network-graph/network-graph.styl17
-rw-r--r--ui/imports/ui/components/new-scanning/new-scanning.js8
-rw-r--r--ui/imports/ui/components/scheduled-scan/scheduled-scan.js8
-rw-r--r--ui/imports/ui/components/scheduled-scans-list/scheduled-scans-list.js8
-rw-r--r--ui/imports/ui/components/selectable-ordered-input/selectable-ordered-input.js8
12 files changed, 90 insertions, 109 deletions
diff --git a/ui/imports/ui/components/env-amqp-credentials-info/env-amqp-credentials-info.html b/ui/imports/ui/components/env-amqp-credentials-info/env-amqp-credentials-info.html
index b6187e6..02b923d 100644
--- a/ui/imports/ui/components/env-amqp-credentials-info/env-amqp-credentials-info.html
+++ b/ui/imports/ui/components/env-amqp-credentials-info/env-amqp-credentials-info.html
@@ -79,8 +79,8 @@
<div class="col-sm-3">
{{> InputModel(createInputArgs
- value=model.password
- key="password"
+ value=model.pwd
+ key="pwd"
type="password"
disabled=disabled
placeholder="Password")
diff --git a/ui/imports/ui/components/env-open-stack-db-credentials-info/env-open-stack-db-credentials-info.html b/ui/imports/ui/components/env-open-stack-db-credentials-info/env-open-stack-db-credentials-info.html
index 11421a0..13967d5 100644
--- a/ui/imports/ui/components/env-open-stack-db-credentials-info/env-open-stack-db-credentials-info.html
+++ b/ui/imports/ui/components/env-open-stack-db-credentials-info/env-open-stack-db-credentials-info.html
@@ -79,8 +79,8 @@
<div class="col-sm-3">
{{> InputModel(createInputArgs
- value=model.password
- key="password"
+ value=model.pwd
+ key="pwd"
type="password"
disabled=disabled
placeholder="Password")
diff --git a/ui/imports/ui/components/mt-input/mt-input.js b/ui/imports/ui/components/mt-input/mt-input.js
index f8192ef..729adb9 100644
--- a/ui/imports/ui/components/mt-input/mt-input.js
+++ b/ui/imports/ui/components/mt-input/mt-input.js
@@ -1,11 +1,3 @@
-/////////////////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others /
-// /
-// All rights reserved. This program and the accompanying materials /
-// are made available under the terms of the Apache License, Version 2.0 /
-// which accompanies this distribution, and is available at /
-// http://www.apache.org/licenses/LICENSE-2.0 /
-/////////////////////////////////////////////////////////////////////////////////////////
/*
* Template Component: MtInput
*/
diff --git a/ui/imports/ui/components/mt-radios/mt-radios.js b/ui/imports/ui/components/mt-radios/mt-radios.js
index e2c3169..a8f7f7c 100644
--- a/ui/imports/ui/components/mt-radios/mt-radios.js
+++ b/ui/imports/ui/components/mt-radios/mt-radios.js
@@ -1,11 +1,3 @@
-/////////////////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others /
-// /
-// All rights reserved. This program and the accompanying materials /
-// are made available under the terms of the Apache License, Version 2.0 /
-// which accompanies this distribution, and is available at /
-// http://www.apache.org/licenses/LICENSE-2.0 /
-/////////////////////////////////////////////////////////////////////////////////////////
/*
* Template Component: MtRadios
*/
diff --git a/ui/imports/ui/components/mt-select/mt-select.js b/ui/imports/ui/components/mt-select/mt-select.js
index 48a2141..95190e2 100644
--- a/ui/imports/ui/components/mt-select/mt-select.js
+++ b/ui/imports/ui/components/mt-select/mt-select.js
@@ -1,11 +1,3 @@
-/////////////////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others /
-// /
-// All rights reserved. This program and the accompanying materials /
-// are made available under the terms of the Apache License, Version 2.0 /
-// which accompanies this distribution, and is available at /
-// http://www.apache.org/licenses/LICENSE-2.0 /
-/////////////////////////////////////////////////////////////////////////////////////////
/*
* Template Component: MtSelect
*/
diff --git a/ui/imports/ui/components/network-graph-manager/network-graph-manager.js b/ui/imports/ui/components/network-graph-manager/network-graph-manager.js
index 7022bcc..16637ea 100644
--- a/ui/imports/ui/components/network-graph-manager/network-graph-manager.js
+++ b/ui/imports/ui/components/network-graph-manager/network-graph-manager.js
@@ -1,11 +1,3 @@
-/////////////////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others /
-// /
-// All rights reserved. This program and the accompanying materials /
-// are made available under the terms of the Apache License, Version 2.0 /
-// which accompanies this distribution, and is available at /
-// http://www.apache.org/licenses/LICENSE-2.0 /
-/////////////////////////////////////////////////////////////////////////////////////////
/*
* Template Component: NetworkGraphManager
*/
@@ -229,10 +221,14 @@ function addNodeToGraph(node, graphData) {
name: node._id._str,
};
- newNode = R.ifElse(R.isNil,
- R.always(newNode),
- R.assocPath(['_osmeta', 'host'], R.__, newNode)
- )(node.host);
+ let groupMarkers = ['host', 'switch'];
+ let groupKey = R.find((key) => {
+ if (R.isNil(R.path([key], node))) { return false; }
+ return true;
+ })(groupMarkers);
+ if (groupKey) {
+ newNode = R.assocPath(['_osmeta', 'groupId'], node[groupKey], newNode);
+ }
let nodes = R.unionWith(R.eqBy(R.prop('_osid')), graphData.nodes, [newNode]);
let links = expandLinks(graphData.links, nodes);
@@ -253,18 +249,19 @@ function calcIsReady(graphData) {
function calcGroups(nodes) {
return R.reduce((accGroups, node) => {
- let host = R.path(['_osmeta', 'host'], node);
- if (R.isNil(host)) {
+ let groupId = R.path(['_osmeta', 'groupId'], node);
+ if (R.isNil(groupId)) {
return accGroups;
}
- let groupIndex = R.findIndex(R.propEq('_osid', host), accGroups);
+ let groupIndex = R.findIndex(R.propEq('_osid', groupId), accGroups);
let group = null;
if (groupIndex < 0) {
let group = {
- _osid: host,
+ _osid: groupId,
leaves: [node],
isExpanded: true,
+ name: groupId,
};
accGroups = R.append(group, accGroups);
diff --git a/ui/imports/ui/components/network-graph/network-graph.js b/ui/imports/ui/components/network-graph/network-graph.js
index 49e41a8..04a33b0 100644
--- a/ui/imports/ui/components/network-graph/network-graph.js
+++ b/ui/imports/ui/components/network-graph/network-graph.js
@@ -1,11 +1,3 @@
-/////////////////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others /
-// /
-// All rights reserved. This program and the accompanying materials /
-// are made available under the terms of the Apache License, Version 2.0 /
-// which accompanies this distribution, and is available at /
-// http://www.apache.org/licenses/LICENSE-2.0 /
-/////////////////////////////////////////////////////////////////////////////////////////
/*
* Template Component: NetworkGraph
*/
@@ -389,12 +381,22 @@ function renderView(force,
function tickFn() {
let svgGroups = mainEl.selectAll('.group');
svgGroups
+ .attr('transform', function (d) {
+ let x = R.path(['bounds', 'x'], d);
+ let y = R.path(['bounds', 'y'], d);
+ return `translate(${x},${y})`;
+ })
+ ;
+ /*
.attr('x', function (d) {
return R.path(['bounds', 'x'], d);
})
.attr('y', function (d) {
return R.path(['bounds', 'y'], d);
})
+ */
+
+ svgGroups.selectAll('.group-shape')
.attr('width', function (d) {
if (d.bounds) { return d.bounds.width(); }
})
@@ -402,6 +404,15 @@ function renderView(force,
if (d.bounds) { return d.bounds.height(); }
});
+ svgGroups.selectAll('.group-name')
+ .attr('x', function(d) {
+ return (d.bounds.width() / 2);
+ })
+ .attr('y', function(_d) {
+ return 30;
+ })
+ ;
+
let svgNodes = mainEl.selectAll('.node');
svgNodes.attr('transform', function(d) {
return 'translate(' + d.x + ',' + d.y + ')';
@@ -470,20 +481,44 @@ function genSvgGroups(g, groups, drag, onRenderViewReq) {
let svgGroups = g.selectAll('.group')
.data(groups, (d) => d._osid);
- //let rects =
- svgGroups.enter()
+ let enterGroups = svgGroups.enter();
+
+ let groupsContainers =
+ enterGroups
+ .append('g')
+ .attr('class', 'group')
+ .attr('data-group-id', (d) => d._osid)
+ .call(drag)
+ .on('click', function (d) {
+ console.log('click', d);
+ d.isExpanded = !d.isExpanded;
+ onRenderViewReq();
+ });
+
+ groupsContainers
.append('rect')
+ .attr('class', 'group-shape')
.attr('rx', 8)
.attr('ry', 8)
- .attr('class', 'group')
- .attr('data-group-id', (d) => d._osid)
.style('fill', function (_d, _i) { return 'lightblue'; })
- .call(drag)
- .on('click', function (d) {
- console.log('click', d);
- d.isExpanded = !d.isExpanded;
- onRenderViewReq();
- });
+ ;
+
+ groupsContainers
+ .append('text')
+ .text(function(d) {
+ return d.name;
+ })
+ .attr('class', 'group-name')
+ .attr('x', function(d) {
+ return (d.bounds.width() / 2);
+ })
+ .attr('y', function(_d) {
+ return 30;
+ })
+ .attr('dy', '.25em')
+ .attr('text-anchor', 'middle')
+ .attr('font-size', 20)
+ ;
svgGroups.exit()
.remove();
@@ -552,10 +587,10 @@ function calcClosedGroupsNodes(rejectedGroups, prevViewNodes) {
function calcNodesAndRejectedNodes(originalNodes, originalGroups) {
let rejectedNodes = [];
let nodes = R.reject((node) => {
- let host = R.path(['_osmeta', 'host'], node);
- if (R.isNil(host)) { return false; }
+ let groupId = R.path(['_osmeta', 'groupId'], node);
+ if (R.isNil(groupId)) { return false; }
- let group = R.find(R.propEq('_osid', host), originalGroups);
+ let group = R.find(R.propEq('_osid', groupId), originalGroups);
if (R.isNil(group)) { return false; }
if (group.isExpanded) { return false; }
@@ -596,8 +631,8 @@ function calcLinksAndRejectedLinks(originalLinks, rejectedNodes) {
function calcNewLinksForRejectedSource(rejectedSourceLinks, nodes, prevLinks) {
let newLinksForRejectedSource = R.reduce((acc, link) => {
- let host = R.path(['_osmeta', 'host'], link.source);
- let groupNodeId = `${host}-group-node`;
+ let groupId = R.path(['_osmeta', 'groupId'], link.source);
+ let groupNodeId = `${groupId}-group-node`;
let newSource = R.find(R.propEq('_osid', groupNodeId), nodes);
if (R.isNil(newSource)) {
throw 'error in new links for rejected source function';
@@ -628,8 +663,8 @@ function calcNewLinksForRejectedSource(rejectedSourceLinks, nodes, prevLinks) {
function calcNewLinksForRejectedTarget(rejectedLinks, nodes, prevLinks) {
let newLinks = R.reduce((acc, link) => {
- let host = R.path(['_osmeta', 'host'], link.target);
- let groupNodeId = `${host}-group-node`;
+ let groupId = R.path(['_osmeta', 'groupId'], link.target);
+ let groupNodeId = `${groupId}-group-node`;
let newTarget = R.find(R.propEq('_osid', groupNodeId), nodes);
if (R.isNil(newTarget)) {
throw 'error in new links for rejected target function';
@@ -660,8 +695,8 @@ function calcNewLinksForRejectedTarget(rejectedLinks, nodes, prevLinks) {
function calcNewLinksForRejectedBoth(rejectedLinks, nodes, prevLinks) {
let newLinks = R.reduce((acc, link) => {
- let targetHost = R.path(['_osmeta', 'host'], link.target);
- let sourceHost = R.path(['_osmeta', 'host'], link.source);
+ let targetHost = R.path(['_osmeta', 'groupId'], link.target);
+ let sourceHost = R.path(['_osmeta', 'groupId'], link.source);
let groupSourceNodeId = `${sourceHost}-group-node`;
let groupTargetNodeId = `${targetHost}-group-node`;
diff --git a/ui/imports/ui/components/network-graph/network-graph.styl b/ui/imports/ui/components/network-graph/network-graph.styl
index 114cc96..d5f7ce2 100644
--- a/ui/imports/ui/components/network-graph/network-graph.styl
+++ b/ui/imports/ui/components/network-graph/network-graph.styl
@@ -6,13 +6,18 @@
width: 100%;
height: 100%;
- .group {
- stroke: #fff;
- stroke-width: 1.5px;
- cursor: move;
- opacity: 0.7;
- }
+ .group
+ .group-shape
+ stroke: #fff;
+ stroke-width: 1.5px;
+ cursor: move;
+ opacity: 0.7;
+ .group-name
+ fill: rgba(133, 133, 133, 0.52);
+ font-weight: 400;
+ line-height: 20px;
+ font-family: 'Helvetica', 'Arial', sans-serif;
.link-group
text
diff --git a/ui/imports/ui/components/new-scanning/new-scanning.js b/ui/imports/ui/components/new-scanning/new-scanning.js
index 1995ded..891d2b3 100644
--- a/ui/imports/ui/components/new-scanning/new-scanning.js
+++ b/ui/imports/ui/components/new-scanning/new-scanning.js
@@ -1,11 +1,3 @@
-/////////////////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others /
-// /
-// All rights reserved. This program and the accompanying materials /
-// are made available under the terms of the Apache License, Version 2.0 /
-// which accompanies this distribution, and is available at /
-// http://www.apache.org/licenses/LICENSE-2.0 /
-/////////////////////////////////////////////////////////////////////////////////////////
/*
* Template Component: NewScanning
*/
diff --git a/ui/imports/ui/components/scheduled-scan/scheduled-scan.js b/ui/imports/ui/components/scheduled-scan/scheduled-scan.js
index 3bcc591..4092d00 100644
--- a/ui/imports/ui/components/scheduled-scan/scheduled-scan.js
+++ b/ui/imports/ui/components/scheduled-scan/scheduled-scan.js
@@ -1,11 +1,3 @@
-/////////////////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others /
-// /
-// All rights reserved. This program and the accompanying materials /
-// are made available under the terms of the Apache License, Version 2.0 /
-// which accompanies this distribution, and is available at /
-// http://www.apache.org/licenses/LICENSE-2.0 /
-/////////////////////////////////////////////////////////////////////////////////////////
/*
* Template Component: ScheduledScan
*/
diff --git a/ui/imports/ui/components/scheduled-scans-list/scheduled-scans-list.js b/ui/imports/ui/components/scheduled-scans-list/scheduled-scans-list.js
index 7aa76e9..bd85afd 100644
--- a/ui/imports/ui/components/scheduled-scans-list/scheduled-scans-list.js
+++ b/ui/imports/ui/components/scheduled-scans-list/scheduled-scans-list.js
@@ -1,11 +1,3 @@
-/////////////////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others /
-// /
-// All rights reserved. This program and the accompanying materials /
-// are made available under the terms of the Apache License, Version 2.0 /
-// which accompanies this distribution, and is available at /
-// http://www.apache.org/licenses/LICENSE-2.0 /
-/////////////////////////////////////////////////////////////////////////////////////////
/*
* Template Component: ScheduledScansList
*/
diff --git a/ui/imports/ui/components/selectable-ordered-input/selectable-ordered-input.js b/ui/imports/ui/components/selectable-ordered-input/selectable-ordered-input.js
index 30b740f..15c46fe 100644
--- a/ui/imports/ui/components/selectable-ordered-input/selectable-ordered-input.js
+++ b/ui/imports/ui/components/selectable-ordered-input/selectable-ordered-input.js
@@ -1,11 +1,3 @@
-/////////////////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others /
-// /
-// All rights reserved. This program and the accompanying materials /
-// are made available under the terms of the Apache License, Version 2.0 /
-// which accompanies this distribution, and is available at /
-// http://www.apache.org/licenses/LICENSE-2.0 /
-/////////////////////////////////////////////////////////////////////////////////////////
/*
* Template Component: SelectableOrderedInput
*/