Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETOBSERV-637 UI Consistency: Topology styling #224

Merged
merged 3 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion web/locales/en/plugin__netobserv-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@
"Edge": "Edge",
"Unknown": "Unknown",
"Unable to get topology": "Unable to get topology",
"Kind": "Kind",
"Step into this {{name}}": "Step into this {{name}}",
"Add {{name}} filter": "Add {{name}} filter",
"Unpin this element": "Unpin this element",
"Pin this element": "Pin this element",
"Query is slow": "Query is slow",
"Overview": "Overview",
"Traffic flows": "Traffic flows",
Expand Down Expand Up @@ -232,6 +235,7 @@
"Kubernetes Objects": "Kubernetes Objects",
"Owner Kubernetes Objects": "Owner Kubernetes Objects",
"IPs & Ports": "IPs & Ports",
"Kind": "Kind",
"Owner Kind": "Owner Kind",
"Port": "Port",
"Kubernetes Object": "Kubernetes Object",
Expand Down
102 changes: 67 additions & 35 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@patternfly/react-charts": "6.92.0",
"@patternfly/react-core": "4.239.0",
"@patternfly/react-table": "4.108.0",
"@patternfly/react-topology": "4.86.0",
"@patternfly/react-topology": "4.90.11",
"history": "^5.1.0",
"i18next": "^19.8.3",
"i18next-http-backend": "^1.0.21",
Expand Down
8 changes: 7 additions & 1 deletion web/src/components/netflow-topology/components/edge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ type BaseEdgeProps = {
endTerminalStatus?: NodeStatus;
endTerminalSize?: number;
shadowed?: boolean;
filtered?: boolean;
highlighted?: boolean;
isDark?: boolean;
tag?: string;
tagClass?: string;
tagStatus?: NodeStatus;
Expand Down Expand Up @@ -68,7 +70,9 @@ const BaseEdge: React.FC<BaseEdgeProps> = ({
endTerminalStatus,
endTerminalSize = 14,
shadowed,
filtered,
highlighted,
isDark,
tag,
tagClass,
tagStatus,
Expand Down Expand Up @@ -103,7 +107,9 @@ const BaseEdge: React.FC<BaseEdgeProps> = ({
selected && 'pf-m-selected',
'topology',
shadowed && 'shadowed',
highlighted && 'edge-highlighted'
filtered && 'edge-filtered',
highlighted && 'edge-highlighted',
isDark && 'dark'
);

const edgeAnimationDuration = animationDuration ?? getEdgeAnimationDuration(element.getEdgeAnimationSpeed());
Expand Down
13 changes: 11 additions & 2 deletions web/src/components/netflow-topology/components/node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ type BaseNodeProps = {
dropTarget?: boolean;
scaleNode?: boolean; // Whether or not to scale the node, best on hover of node at lowest scale level
shadowed?: boolean;
filtered?: boolean;
highlighted?: boolean;
isDark?: boolean;
label?: string; // Defaults to element.getLabel()
secondaryLabel?: string;
showLabel?: boolean; // Defaults to true
Expand Down Expand Up @@ -112,7 +114,9 @@ const BaseNode: React.FunctionComponent<BaseNodeProps> = ({
showLabel = true,
label,
shadowed,
filtered,
highlighted,
isDark,
secondaryLabel,
labelClassName,
labelPosition,
Expand Down Expand Up @@ -216,7 +220,9 @@ const BaseNode: React.FunctionComponent<BaseNodeProps> = ({
StatusModifier[status],
'topology',
shadowed && 'shadowed',
highlighted && 'node-highlighted'
filtered && 'node-filtered',
highlighted && 'node-highlighted',
isDark && 'dark'
);

const backgroundClassName = css(
Expand Down Expand Up @@ -342,7 +348,10 @@ const BaseNode: React.FunctionComponent<BaseNodeProps> = ({
{children}
</g>
{statusDecorator}
{isHover && attachments}
{
//isHover &&
attachments
}
</g>
);
};
Expand Down
55 changes: 49 additions & 6 deletions web/src/components/netflow-topology/netflow-topology.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,58 @@ g.netobserv.topology.shadowed {
opacity: 0.5;
}

g.netobserv.topology.node-highlighted>g>ellipse {
g.netobserv.topology.pf-topology__edge>.pf-topology__edge__background {
stroke-width: 6px;
}

g.netobserv.topology.pf-topology__edge.dark>.pf-topology__edge__tag>.pf-topology__edge__tag__background{
fill: #E0E0E0;
}

g.netobserv.topology.pf-topology__edge>.pf-topology__edge__link,
g.netobserv.topology.pf-topology__edge>.pf-topology-connector-arrow {
stroke: #6A6E73;
fill: #E0E0E0;
}

g.netobserv.topology.pf-topology__edge.dark>.pf-topology__edge__link,
g.netobserv.topology.pf-topology__edge.dark>.pf-topology-connector-arrow {
stroke: #E0E0E0;
fill: #6A6E73;
}

g.netobserv.topology.node-filtered>g>.pf-topology__node__background {
stroke: #EF9234;
stroke-width: 2px;
}

g.netobserv.topology.pf-topology__edge.edge-filtered>.pf-topology__edge__link,
g.netobserv.topology.pf-topology__edge.edge-filtered>.pf-topology-connector-arrow,
g.netobserv.topology.pf-topology__edge.edge-filtered.dark>.pf-topology__edge__link,
g.netobserv.topology.pf-topology__edge.edge-filtered.dark>.pf-topology-connector-arrow {
stroke: #EF9234;
fill: #773D00;
}

g.netobserv.topology>g>.pf-topology__node__background {
fill: #FFFFFF;
}

g.netobserv.topology.dark>g>.pf-topology__node__background {
fill: #26292D;
}

g.netobserv.topology.node-highlighted>g>.pf-topology__node__background {
stroke: #0066CC;
stroke-width: 3px;
--pf-topology__node__background--Fill: white;
stroke-width: 2px;
}

g.netobserv.topology.edge-highlighted>.pf-topology__edge__link,
g.netobserv.topology.edge-highlighted>.pf-topology-connector-arrow {
g.netobserv.topology.pf-topology__edge.edge-highlighted>.pf-topology__edge__link,
g.netobserv.topology.pf-topology__edge.edge-highlighted>.pf-topology-connector-arrow,
g.netobserv.topology.pf-topology__edge.edge-highlighted.dark>.pf-topology__edge__link,
g.netobserv.topology.pf-topology__edge.edge-highlighted.dark>.pf-topology-connector-arrow {
stroke: #0066CC;
fill: #002952;
}

g.netobserv.pf-topology__group>.pf-topology__group__background {
Expand All @@ -54,6 +97,6 @@ g.netobserv.pf-topology__group.pf-m-selected>.pf-topology__group__background {
border: none;
}

.topology-icon > text {
.topology-icon>text {
fill: white;
}
Loading