From 41e9d62993917fb458c6e9e92c05014ab79dde30 Mon Sep 17 00:00:00 2001 From: David Lyle Date: Fri, 6 May 2016 16:06:52 -0600 Subject: [PATCH] Remove embedded CSS As follow on work to restoring the old network topology, this patch separates embedded CSS in one of the html files into a separate SCSS file. This change is not intended to make topology themable. There is still much work that needs to be done and will follow up soon. Change-Id: I46b7152a24fc1f7a26a1752ba22d80e31ff1ffdb --- .../network_topology/_svg_element.html | 120 -------------- .../components/_network_topology_svg.scss | 148 ++++++++++++++++++ .../static/dashboard/scss/horizon.scss | 1 + 3 files changed, 149 insertions(+), 120 deletions(-) create mode 100644 openstack_dashboard/static/dashboard/scss/components/_network_topology_svg.scss diff --git a/openstack_dashboard/dashboards/project/network_topology/templates/network_topology/_svg_element.html b/openstack_dashboard/dashboards/project/network_topology/templates/network_topology/_svg_element.html index f1c021010b..2a38b20630 100644 --- a/openstack_dashboard/dashboards/project/network_topology/templates/network_topology/_svg_element.html +++ b/openstack_dashboard/dashboards/project/network_topology/templates/network_topology/_svg_element.html @@ -1,124 +1,4 @@ {% load i18n %} - diff --git a/openstack_dashboard/static/dashboard/scss/components/_network_topology_svg.scss b/openstack_dashboard/static/dashboard/scss/components/_network_topology_svg.scss new file mode 100644 index 0000000000..cdde4c3256 --- /dev/null +++ b/openstack_dashboard/static/dashboard/scss/components/_network_topology_svg.scss @@ -0,0 +1,148 @@ +#topology_canvas { + font-family: sans-serif; + + .network-rect { + cursor: pointer; + + &.nourl { + cursor: auto; + } + } + + .network-name { + font-weight: $badge-font-weight; + font-size: $font-size-base; + fill: $component-active-color; + text-anchor: middle; + } + + .network-cidr { + font-size: $font-size-small; + text-anchor: end; + } + + text.network-type { + font-family: FontAwesome; + text-anchor: end; + } + + .port_text { + font-size: $font-size-small; + fill: $gray; + + &.left { + text-anchor: end; + } + } + + .base_bg_normal { + fill: $gray-dark; + } + + .loading_bg_normal { + fill: $gray; + } + + .base_bg_small, + .loading_bg_small { + fill: $body-bg; + } + + .active { + fill: $brand-success; + } + + .icon polygon { + fill: $gray-dark; + } + + .instance_small, + .router_small { + .frame { + fill: url(#device_small_bg); + stroke: $gray-dark; + stroke-width: 3; + } + + .port_text { + display: none; + } + } + + .router_normal, + .instance_normal { + .frame { + fill: #fff; + stroke: $gray-dark; + stroke-width: 4; + } + + .icon_bg { + fill: #fff; + stroke: $gray-dark; + stroke-width: 4; + } + + .texts_bg { + fill: url('#device_normal_bg'); + } + + .texts { + .name { + text-anchor: middle; + fill: $gray-dark; + font-size: $font-size-base; + } + + .type { + text-anchor: middle; + fill: #fff; + font-size: $font-size-base; + } + } + + .instance_bg { + fill: $gray-dark; + } + } + + g.loading { + .active { + fill: $gray; + } + + .icon polygon { + fill: $gray; + } + + .instance_bg { + fill: $gray; + } + + .instance_small, + .router_small { + .frame { + stroke: $gray; + fill: url(#device_small_bg_loading); + } + } + + .instance_normal { + .frame { + stroke: $gray; + } + + .name { + fill: $gray-light; + } + + .texts_bg { + fill: url(#device_normal_bg_loading); + } + + .icon_bg { + stroke: $gray; + } + } + } +} diff --git a/openstack_dashboard/static/dashboard/scss/horizon.scss b/openstack_dashboard/static/dashboard/scss/horizon.scss index 93a5423a58..25c3123390 100644 --- a/openstack_dashboard/static/dashboard/scss/horizon.scss +++ b/openstack_dashboard/static/dashboard/scss/horizon.scss @@ -32,6 +32,7 @@ @import "components/modals"; @import "components/navbar"; @import "components/network_topology"; +@import "components/network_topology_svg"; @import "components/pie_charts"; @import "components/progress_bars"; @import "components/quota";