open-nomad/ui/app/styles/components/sidebar.scss
Phil Renaud 76bed82192
[ui] Show task events in the sidebar (#15733)
* Add task events to task logs sidebar

* Max-heighting inner table when present for nice looking borders
2023-01-10 17:02:21 -05:00

150 lines
2.9 KiB
SCSS

$topNavOffset: 112px;
$subNavOffset: 49px;
.sidebar {
position: fixed;
background: #ffffff;
width: 750px;
padding: 24px;
right: 0%;
overflow: visible;
bottom: 0;
top: $topNavOffset;
transform: translateX(100%);
transition-duration: 150ms;
transition-timing-function: ease;
z-index: $z-modal;
&.open {
transform: translateX(0%);
box-shadow: 6px 6px rgba(0, 0, 0, 0.06), 0px 12px 16px rgba(0, 0, 0, 0.2);
}
&.has-subnav {
top: calc($topNavOffset + $subNavOffset);
}
&.wide {
width: calc(100vw - $gutter-width - 1rem);
}
.button.widener {
position: absolute;
left: 0;
top: calc(50% - 16px);
width: 32px;
height: 32px;
left: -16px;
box-shadow: -5px 0 10px -5px rgb(0 0 0 / 20%);
border-radius: 16px;
}
}
.sidebar-content {
position: relative;
display: inline-flex;
}
.error-header {
display: flex;
justify-content: flex-end;
}
.detail-header {
display: flex;
justify-content: space-between;
}
.related-evaluations {
overflow-x: scroll;
overflow-y: hidden;
}
.evaluation-actors {
display: flex;
flex-direction: column;
justify-content: space-evenly;
flex-basis: 100%;
}
.actor {
margin: 24px;
outline: 1px solid #d9dee6;
padding: 10px;
width: 100px;
}
.task-context-sidebar {
header {
display: grid;
justify-content: left;
grid-template-columns: 1fr auto auto;
gap: 2rem;
border-bottom: 1px solid $grey-blue;
padding-bottom: 1rem;
margin-bottom: 24px;
height: 50px;
.title {
margin-bottom: unset;
}
.link {
align-self: center;
}
.state {
font-size: 1rem;
font-weight: normal;
margin-left: 1rem;
text-transform: capitalize;
&:before {
content: '';
display: inline-block;
height: 1rem;
width: 1rem;
margin-right: 5px;
border-radius: 4px;
position: relative;
top: 2px;
}
&.running:before {
background-color: $green;
}
&.dead:before {
background-color: $red;
}
&.pending:before {
background-color: $grey-lighter;
}
}
}
.task-events .boxed-section-body {
height: 250px;
overflow: auto;
table {
height: 100%;
}
}
// Instead of trying to calculate on the fly with JS, let's use vh and offset nav and headers above.
// We can make this a LOT more streamlined when CSS Container Queries are available.
$sidebarTopOffset: 161px;
$sidebarInnerPadding: 48px;
$sidebarHeaderOffset: 74px;
$cliHeaderOffset: 54.5px;
$offsetWithoutEvents: $sidebarTopOffset + $sidebarInnerPadding +
$sidebarHeaderOffset + $cliHeaderOffset;
$sidebarEventsHeight: 250px + 44px + 44px; // table + table header + horizontal rule
.cli-window {
height: calc(100vh - $offsetWithoutEvents);
}
&.has-events {
.cli-window {
height: calc(100vh - $offsetWithoutEvents - $sidebarEventsHeight);
}
}
}