open-consul/ui/packages/consul-ui/app/components/consul/discovery-chain/layout.scss

160 lines
3.0 KiB
SCSS
Raw Normal View History

ui: Discovery Chain (#6746) * Add data layer for discovery chain (model/adapter/serializer/repo) * Add routing plus template for routing tab * Add extra deps - consul-api-double upgrade plus ngraph for graphing * Add discovery-chain and related components and helpers: 1. discovery-chain to orchestrate/view controller 2. route-card, splitter-card, resolver card to represent the 3 different node types. 3. route-match helper for easy formatting of route rules 4. dom-position to figure out where things are in order to draw lines 5. svg-curve, simple wrapper around svg's <path d=""> attribute format. 6. data-structs service. This isn't super required but we are using other data-structures provided by other third party npm modules in other yet to be merged PRs. All of these types of things will live here for easy access/injection/changability 7. Some additions to our css-var 'polyfill' for a couple of extra needed rules * Related CSS for discovery chain 1. We add a %card base component here, eventually this will go into our base folder and %stats-card will also use it for a base component. 2. New icon for failovers * ui: Discovery Chain Continued (#6939) 1. Add in the things we use for the animations 2 Use IntersectionObserver so we know when the tab is visible, otherwise the dom-position helper won't work as the dom elements don't have any display. 3. Add some base work for animations and use them a little 4. Try to detect if a resolver is a redirect. Right now this works for datacenters and namespaces, but it can't work for services and subsets - we are awaiting backend support for doing this properly. 5. Add a fake 'this service has no routes' route that says 'Default' 6. redirect icon 7. Add CSS.escape polyfill for Edge
2019-12-17 19:27:28 +00:00
%discovery-chain .resolvers,
%discovery-chain .splitters,
%discovery-chain .routes {
@extend %chain-group;
}
%discovery-chain .route-card {
@extend %route-card;
@extend %with-chain-outlet;
}
%discovery-chain .splitter-card {
@extend %splitter-card;
@extend %with-chain-outlet;
}
%discovery-chain .resolver-card {
@extend %resolver-card;
}
%discovery-chain path {
@extend %discovery-chain-edge, %discovery-chain-edge-inactive;
}
%discovery-chain-edge:hover,
%discovery-chain-edge:focus {
@extend %discovery-chain-edge-active;
}
%discovery-chain [id*=':']:not(path):hover {
@extend %chain-node-active;
}
%discovery-chain {
position: relative;
display: flex;
justify-content: space-between;
}
%discovery-chain svg {
position: absolute;
}
%chain-group {
padding: 10px 1% 10px 1%;
width: 32%;
}
2020-11-30 16:52:13 +00:00
%chain-group > header {
height: 18px;
}
ui: Discovery Chain (#6746) * Add data layer for discovery chain (model/adapter/serializer/repo) * Add routing plus template for routing tab * Add extra deps - consul-api-double upgrade plus ngraph for graphing * Add discovery-chain and related components and helpers: 1. discovery-chain to orchestrate/view controller 2. route-card, splitter-card, resolver card to represent the 3 different node types. 3. route-match helper for easy formatting of route rules 4. dom-position to figure out where things are in order to draw lines 5. svg-curve, simple wrapper around svg's <path d=""> attribute format. 6. data-structs service. This isn't super required but we are using other data-structures provided by other third party npm modules in other yet to be merged PRs. All of these types of things will live here for easy access/injection/changability 7. Some additions to our css-var 'polyfill' for a couple of extra needed rules * Related CSS for discovery chain 1. We add a %card base component here, eventually this will go into our base folder and %stats-card will also use it for a base component. 2. New icon for failovers * ui: Discovery Chain Continued (#6939) 1. Add in the things we use for the animations 2 Use IntersectionObserver so we know when the tab is visible, otherwise the dom-position helper won't work as the dom elements don't have any display. 3. Add some base work for animations and use them a little 4. Try to detect if a resolver is a redirect. Right now this works for datacenters and namespaces, but it can't work for services and subsets - we are awaiting backend support for doing this properly. 5. Add a fake 'this service has no routes' route that says 'Default' 6. redirect icon 7. Add CSS.escape polyfill for Edge
2019-12-17 19:27:28 +00:00
%chain-group > header span {
position: relative;
z-index: 1;
margin-left: 2px;
}
%chain-group [role='group'] {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
justify-content: space-around;
height: 100%;
}
/* TODO: resets - these probably should be changed to be specific */
/* to certain layouts rather than globally */
%chain-node {
margin-top: 0 !important;
}
%chain-node dl {
margin: 0;
float: none;
}
/**/
%route-card,
%splitter-card,
%resolver-card {
@extend %card;
@extend %chain-node;
margin-bottom: 20px;
}
/* route */
%route-card header.short dl {
display: flex;
}
%route-card header.short dt::after {
content: ' ';
display: inline-block;
}
%route-card > header ul {
float: right;
margin-top: -2px;
}
%route-card > header ul li {
margin-left: 5px;
}
%route-card section {
display: flex;
}
%route-card section header {
display: block;
2020-11-30 16:52:13 +00:00
width: 19px;
margin-right: 14px
ui: Discovery Chain (#6746) * Add data layer for discovery chain (model/adapter/serializer/repo) * Add routing plus template for routing tab * Add extra deps - consul-api-double upgrade plus ngraph for graphing * Add discovery-chain and related components and helpers: 1. discovery-chain to orchestrate/view controller 2. route-card, splitter-card, resolver card to represent the 3 different node types. 3. route-match helper for easy formatting of route rules 4. dom-position to figure out where things are in order to draw lines 5. svg-curve, simple wrapper around svg's <path d=""> attribute format. 6. data-structs service. This isn't super required but we are using other data-structures provided by other third party npm modules in other yet to be merged PRs. All of these types of things will live here for easy access/injection/changability 7. Some additions to our css-var 'polyfill' for a couple of extra needed rules * Related CSS for discovery chain 1. We add a %card base component here, eventually this will go into our base folder and %stats-card will also use it for a base component. 2. New icon for failovers * ui: Discovery Chain Continued (#6939) 1. Add in the things we use for the animations 2 Use IntersectionObserver so we know when the tab is visible, otherwise the dom-position helper won't work as the dom elements don't have any display. 3. Add some base work for animations and use them a little 4. Try to detect if a resolver is a redirect. Right now this works for datacenters and namespaces, but it can't work for services and subsets - we are awaiting backend support for doing this properly. 5. Add a fake 'this service has no routes' route that says 'Default' 6. redirect icon 7. Add CSS.escape polyfill for Edge
2019-12-17 19:27:28 +00:00
}
/**/
/* resolver */
%resolver-card a {
display: block;
}
%resolver-card dl {
display: flex;
flex-wrap: wrap;
margin-top: 5px;
}
%resolver-card dt {
margin-right: 6px;
margin-top: 1px;
width: 23px;
height: 20px;
}
%resolver-card ol {
display: flex;
flex-wrap: wrap;
list-style-type: none;
}
%resolver-card ol li:not(:last-child)::after {
display: inline-block;
content: ',';
margin-right: 0.2em;
margin-left: -0.3em;
}
/**/
%with-chain-outlet {
position: relative;
}
%with-chain-outlet::before {
position: absolute;
z-index: 1;
right: -5px;
top: 50%;
margin-top: -5px;
width: 10px;
height: 10px;
}
%discovery-chain-joints {
width: 10px;
height: 100%;
z-index: 1;
}
%discovery-chain .splitter-inlets,
%discovery-chain .resolver-inlets {
@extend %discovery-chain-joints;
}
/* there are 3 columns, or %chain-groups the calculation here */
/* depends on the width of those */
%discovery-chain .splitter-inlets {
left: 50%;
/* keep the extra calculations here for doc purposes */
margin-left: calc(calc(-32% / 2) + 1% - 3px);
}
%discovery-chain .resolver-inlets {
/* keep the extra calculations here for doc purposes */
right: calc(32% - 1% - 7px);
}