grafana/public/sass/components/_panel_graph.scss
Johannes Schill 0412a28d2e TimePicker: New time picker dropdown & custom range UI (#16811)
* feat: Add new picker to DashNavTimeControls

* chore: noImplicitAny limit reached

* chore: noImplicityAny fix

* chore: Add momentUtc helper to avoid the isUtc conditionals

* chore: Move getRaw from Explore's time picker to grafana/ui utils and rename to getRawRange

* feat: Use helper functions to convert utc to browser time

* fix: Dont Select current value when pressing tab when using Time Picker

* fix: Add tabIndex to time range inputs so tab works smoothly and prevent mouseDown event to propagate to react-select

* fix: Add spacing to custom range labels

* fix: Updated snapshot

* fix: Re-adding getRaw() temporary to fix the build

* fix: Disable scroll event in Popper when we're using the TimePicker so the popup wont "follow" the menu

* fix: Move all "Last xxxx" quick ranges to the menu and show a "UTC" text when applicable

* fix: Add zoom functionality

* feat: Add logic to mark selected option as active

* fix: Add tooltip to zoom button

* fix: lint fix after rebase

* chore: Remove old time picker from DashNav

* TimePicker: minor design update

* chore: Move all time picker quick ranges to the menu

* fix: Remove the popover border-right, since the quick ranges are gone

* chore: Remove function not in use

* Fix: Close time picker on resize event

* Fix: Remove border bottom

* Fix: Use fa icons on prev/next arrows

* Fix: Pass ref from TimePicker to TimePickerOptionGroup so the popover will align as it should

* Fix: time picker ui adjustments to get better touch area on buttons

* Fix: Dont increase line height on large screens

* TimePicker: style updates

* Fix: Add more prominent colors for selected dates and fade out dates in previous/next month

* TimePicker: style updates2

* TimePicker: Big refactorings and style changes

* Removed use of Popper not sure we need that here?
* Made active selected item in the list have the "selected" checkmark
* Changed design of popover
* Changed design of and implementation of the Custom selection in the dropdown it did not feel like a item you
could select like the rest now the list is just a normal list

* TimePicker: Refactoring & style changes

* TimePicker: use same date format everywhere

* TimePicker: Calendar style updates

* TimePicker: fixed unit test

* fixed unit test

* TimeZone: refactoring time zone type

* TimePicker: refactoring

* TimePicker: finally to UTC to work

* TimePicker: better way to handle calendar utc dates

* TimePicker: Fixed tooltip issues

* Updated snapshot

* TimePicker: moved tooltip from DashNavControls into TimePicker
2019-06-24 14:39:59 +02:00

468 lines
7.6 KiB
SCSS

.graph-panel {
display: flex;
flex-direction: column;
height: 100%;
&--legend-right {
@include media-breakpoint-up(sm) {
flex-direction: row;
.graph-legend {
flex: 0 1 10px;
max-height: 100%;
}
.graph-legend-series {
display: block;
padding-left: 4px;
}
.graph-legend-table .graph-legend-series {
display: table-row;
}
}
}
}
.graph-panel__chart {
position: relative;
cursor: crosshair;
flex-grow: 1;
min-height: 65%;
}
.datapoints-warning {
position: absolute;
top: 50%;
left: 50%;
z-index: 10;
margin-top: -50px;
margin-left: -100px;
width: 200px;
text-align: center;
cursor: auto;
padding: 10px;
}
.graph-legend {
display: flex;
flex: 0 1 auto;
max-height: 35%;
margin: 0;
text-align: center;
padding-top: 6px;
position: relative;
.popover-content {
padding: 0;
}
}
.graph-legend-content {
position: relative;
}
.graph-legend-icon {
position: relative;
padding-right: 4px;
top: 1px;
}
.graph-legend-icon,
.graph-legend-alias,
.graph-legend-value {
display: inline;
cursor: pointer;
white-space: nowrap;
font-size: 85%;
text-align: left;
&.current::before {
content: 'Current: ';
}
&.max::before {
content: 'Max: ';
}
&.min::before {
content: 'Min: ';
}
&.total::before {
content: 'Total: ';
}
&.avg::before {
content: 'Avg: ';
}
}
.graph-legend-icon .fa {
font-size: 135%;
position: relative;
top: 1px;
}
.graph-legend-series {
float: left;
white-space: nowrap;
padding-left: 10px;
&--right-y {
float: right;
}
}
// Don't move series to the right if legend is on the right as well
.graph-panel--legend-right .graph-legend-series--right-y {
float: left;
}
.graph-legend-value {
padding-left: 6px;
}
// fix for phantomjs
.body--phantomjs {
.graph-panel {
display: -webkit-box;
}
.graph-panel--legend-right {
.graph-legend {
display: block;
max-width: min-content;
}
.graph-panel__chart {
display: flex;
}
.graph-legend-table {
display: table;
width: auto;
}
}
}
.graph-legend-table {
padding-bottom: 1px;
padding-right: 5px;
padding-left: 5px;
.graph-legend-series {
display: table-row;
float: none;
padding-left: 0;
&--right-y {
float: none;
.graph-legend-alias::after {
content: '(right-y)';
padding: 0 5px;
color: $text-color-weak;
}
}
}
td,
.graph-legend-alias,
.graph-legend-icon,
.graph-legend-value {
float: none;
display: table-cell;
white-space: nowrap;
padding: 2px 10px;
text-align: right;
}
.graph-legend-icon {
width: 5px;
padding: 0;
top: 0;
.fa {
top: 4px;
}
}
.graph-legend-value {
padding-left: 15px;
}
.graph-legend-alias {
padding-left: 7px;
text-align: left;
width: 95%;
max-width: 650px;
text-overflow: ellipsis;
overflow: hidden;
}
.graph-legend-series:nth-child(odd) {
background: $table-bg-accent;
}
.graph-legend-value {
&.current,
&.max,
&.min,
&.total,
&.avg {
&::before {
content: '';
}
}
}
th {
text-align: right;
padding: 0px 10px 1px 0;
font-weight: bold;
color: $blue;
font-size: 85%;
white-space: nowrap;
}
}
.graph-legend-series-hidden {
.graph-legend-value,
.graph-legend-alias {
color: $link-color-disabled;
}
}
.graph-legend-popover {
width: 210px;
label {
display: inline-block;
}
.btn {
padding: 1px 3px;
margin-right: 0px;
line-height: initial;
}
}
.annotation-tags {
color: $purple;
}
.graph-series-override {
input {
float: left;
margin-right: 10px;
}
.graph-series-override-option {
float: left;
padding: 2px 6px;
}
.graph-series-override-selector {
float: left;
}
}
.graph-tooltip {
white-space: nowrap;
font-size: $font-size-sm;
background-color: $graph-tooltip-bg;
color: $text-color;
.graph-tooltip-time {
text-align: center;
position: relative;
top: -3px;
padding: $space-xxs;
font-weight: bold;
color: $text-color;
}
.graph-tooltip-list-item {
display: table-row;
&--highlight {
color: $text-color-emphasis;
font-weight: bold;
}
}
.graph-tooltip-series-name {
display: table-cell;
padding: $space-xxs;
max-width: 650px;
text-overflow: ellipsis;
overflow: hidden;
}
.graph-tooltip-value {
display: table-cell;
font-weight: bold;
padding-left: 15px;
text-align: right;
}
}
.graph-annotation {
.label-tag {
margin-right: 4px;
margin-top: 8px;
}
.graph-annotation__header {
background: $popover-header-bg;
padding: 6px 10px;
display: flex;
}
.graph-annotation__title {
font-weight: $font-weight-semi-bold;
padding-right: $spacer;
overflow: hidden;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
flex-grow: 1;
}
.graph-annotation__edit-icon {
padding-left: $spacer;
}
.graph-annotation__time {
color: $text-muted;
font-style: italic;
font-weight: normal;
display: inline-block;
position: relative;
top: 1px;
}
.graph-annotation__body {
padding: $space-sm;
}
.graph-annotation__user {
img {
border-radius: 50%;
width: 16px;
height: 16px;
}
}
a[href] {
color: $blue;
text-decoration: underline;
}
}
.left-yaxis-label {
top: 50%;
left: 8px;
transform: translateX(-50%) translateY(-50%) rotate(-90deg);
// this is needed for phantomsjs 2.1
-webkit-transform: translateX(-50%) translateY(-50%) rotate(-90deg);
}
.right-yaxis-label {
top: 50%;
right: 8px;
transform: translateX(50%) translateY(-50%) rotate(90deg);
// this is needed for phantomsjs 2.1
-webkit-transform: translateX(50%) translateY(-50%) rotate(90deg);
}
.axisLabel {
display: inline-block;
color: $text-color;
font-size: $font-size-sm;
position: absolute;
text-align: center;
}
.alert-handle-wrapper {
position: absolute;
user-select: none;
.alert-handle {
z-index: 10;
position: relative;
float: right;
box-shadow: $card-shadow;
background: $card-background;
cursor: move;
width: 100px;
font-size: $font-size-sm;
border-radius: 4px;
text-align: left;
color: $text-muted;
&:hover {
background-color: $btn-inverse-bg-hl;
}
.icon-gf {
font-size: 14px;
position: relative;
top: 0px;
float: left;
border-right: 1px solid $btn-divider-left;
padding: 6px 4px 4px 6px;
}
}
.alert-handle-value {
border-left: 1px solid $btn-divider-right;
padding: $space-xs $space-sm;
padding: 7px;
line-height: 24px;
height: 24px;
.alert-handle-grip {
background: url($btn-drag-image) no-repeat 50% 50%;
background-size: 8px;
float: right;
width: 16px;
height: 24px;
margin-right: 2px;
}
}
&--T1 {
right: -222px;
width: 245px;
.alert-handle-line {
width: 145px;
}
}
&--T0 {
right: -104px;
width: 129px;
.alert-handle-line {
width: 28px;
}
}
&--no-value {
.alert-handle-line {
display: none;
}
}
.alert-handle-line {
float: left;
height: 2px;
margin-top: 13px;
z-index: 0;
position: relative;
&--critical {
background-color: rgba(237, 46, 24, 0.6);
}
&--warning {
background-color: rgba(247, 149, 32, 0.6);
}
}
}
.thresholds-form-disabled {
filter: blur(3px);
}