diff --git a/ui/src/dashboards/components/TemplateQueryBuilder.js b/ui/src/dashboards/components/TemplateQueryBuilder.js index af85b066c3..dce0c14889 100644 --- a/ui/src/dashboards/components/TemplateQueryBuilder.js +++ b/ui/src/dashboards/components/TemplateQueryBuilder.js @@ -15,13 +15,13 @@ const TemplateQueryBuilder = ({ }) => { switch (selectedType) { case 'csv': - return
n/a
+ return
Enter values below
case 'databases': - return
SHOW DATABASES
+ return
SHOW DATABASES
case 'measurements': return ( -
- SHOW MEASUREMENTS ON +
+ SHOW MEASUREMENTS ON - SHOW {selectedType === 'fieldKeys' ? 'FIELD' : 'TAG'} KEYS ON +
+ + SHOW {selectedType === 'fieldKeys' ? 'FIELD' : 'TAG'} KEYS ON + - FROM + FROM {selectedDatabase ? - SHOW TAG VALUES ON +
+ SHOW TAG VALUES ON - FROM + FROM {selectedDatabase ? : 'Pick a DB'} - WITH KEY = + WITH KEY = {selectedMeasurement ? ) default: - return
n/a
+ return
n/a
} } diff --git a/ui/src/dashboards/components/TemplateVariableRow.js b/ui/src/dashboards/components/TemplateVariableRow.js index 0ecdaef7cf..eb3c71dc4c 100644 --- a/ui/src/dashboards/components/TemplateVariableRow.js +++ b/ui/src/dashboards/components/TemplateVariableRow.js @@ -3,6 +3,7 @@ import {connect} from 'react-redux' import {bindActionCreators} from 'redux' import OnClickOutside from 'react-onclickoutside' +import classNames from 'classnames' import Dropdown from 'shared/components/Dropdown' import DeleteConfirmButtons from 'shared/components/DeleteConfirmButtons' @@ -42,10 +43,8 @@ const RowValues = ({ ) } return ( -
- {values.length - ? {_values} - : (No values to display)} +
+ {values.length ? _values : 'No values to display'}
) } @@ -60,24 +59,25 @@ const RowButtons = ({ }) => { if (isEditing) { return ( -
- +
+
) } return ( -
+
+ onDelete(id)} /> - onDelete(id)} />
) } @@ -112,7 +111,7 @@ const TemplateVariableRow = ({ onDelete, }) => (
- -
+
+ +
+
onStartEdit(null)} selected={TEMPLATE_TYPES.find(t => t.type === selectedType).text} - className={'template-variable--dropdown'} + className="dropdown-140" />
-
+
+
- -
+
{ return isEditing - ?
+ ?
- :
onStartEdit(name)}>{defaultValue}
+ :
onStartEdit(name)}> +
{defaultValue}
+
} class RowWrapper extends Component { diff --git a/ui/src/dashboards/components/TemplateVariableTable.js b/ui/src/dashboards/components/TemplateVariableTable.js index 3ff7ab111d..4236333eb6 100644 --- a/ui/src/dashboards/components/TemplateVariableTable.js +++ b/ui/src/dashboards/components/TemplateVariableTable.js @@ -11,19 +11,16 @@ const TemplateVariableTable = ({ onDelete, tempVarAlreadyExists, }) => ( -
+
{templates.length - ?
-
-
-
Variable
-
Type
-
Queries
-
Values
-
-
+ ?
+
+
Variable
+
Type
+
Definition / Values
+
-
+
{templates.map(t => ( * { + @include no-user-select(); + padding-left: 6px; + margin-right: $tvmp-table-gutter; + &:last-child {margin-right: 0;} + } +} + +/* Table Body */ +.template-variable-manager--table-rows { + display: flex; + flex-direction: column; + align-items: stretch; +} +.template-variable-manager--table-row { + border-radius: 4px; + display: flex; + align-items: flex-start; + padding: $tvmp-table-gutter; + transition: background-color 0.25s ease; + + &.editing { + background-color: $g3-castle; } - .template-variable-manager--body { - border-radius: 0 0 $radius $radius; - min-height: 150px; - @include gradient-v($g2-kevlar,$g0-obsidian); + > * { + margin-right: $tvmp-table-gutter; + &:last-child {margin-right: 0;} + } +} + +.tvm-input, +.form-control.tvm-input-edit { + font-weight: 600 !important; + width: 100% !important; + padding: 0 6px !important; + font-family: $code-font; + color: $c-comet !important; + height: 30px !important; + + &:focus, + &:focus:hover { + color: $c-comet !important; + } +} +.tvm-input { + font-size: 12px; + line-height: 26px; + padding: 0 8px; + border-radius: $radius; + border: 2px solid $g5-pepper; + background-color: $g2-kevlar; + transition: + border-color 0.25s ease; + + &:hover { + cursor: text; + border-color: $g6-smoke; + } +} +.tvm-values, +.tvm-values-empty { + width: 100%; + white-space: pre-wrap; + overflow: auto; + font-size: 12px; + font-weight: 600; + font-family: $code-font; + color: $c-pool; + padding: 0 $tvmp-table-gutter; + min-height: 30px; + max-height: 90px; + line-height: 30px; + border-radius: $radius; + background-color: $g5-pepper; + margin-top: 2px; + @include custom-scrollbar-round($g5-pepper, $g7-graphite); +} +.tvm-values-empty { + color: $g9-mountain; + font-style: italic; +} +.tvm-csv-instructions { + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 12px; + font-weight: 600; + font-family: $code-font; + padding: 0 $tvmp-table-gutter; + height: 30px; + line-height: 30px; + border-radius: $radius; + background-color: $g5-pepper; + margin-bottom: 2px; + color: $g9-mountain; + font-style: italic; +} + +.tvm-query-builder { + display: flex; + align-items: center; + height: 30px; + + > * {margin-right: 2px;} + > *:last-child {margin-right: 0;} + + .dropdown { + flex: 1 0 0; + + & > .dropdown-toggle {width: 100%;} + } +} +.tvm-query-builder--text { + @include no-user-select(); + background-color: $g5-pepper; + border-radius: $radius-small; + padding: 0 $tvmp-table-gutter; + white-space: nowrap; + height: 30px; + line-height: 30px; + color: $c-pool; + font-size: 12px; + font-weight: 600; + font-family: $code-font; +} +.tvm-actions { + display: flex; + align-items: center; + justify-content: flex-end; + + .btn-edit { + order: 1; + width: 30px; + text-align: center; + padding-left: 0 !important; + padding-right: 0 !important; + > span.icon {margin: 0 !important;} } - .dropdown-toggle { - width: 150px; + > .btn {margin-left: $tvmp-table-gutter;} + + /* Override confirm buttons styles */ + /* Janky, but doing this quick & dirty for now */ + .btn-danger { + order: 2; + height: 30px !important; + line-height: 30px !important; + padding: 0 9px !important; + font-size: 13px; + } + .confirm-buttons > .btn { + height: 30px !important; + width: 30px !important; + margin-left: $tvmp-table-gutter !important; + font-size: 13px; + padding: 0 !important; + } + /* Hide the edit button when confirming a delete */ + .confirm-buttons + .btn-edit { + display: none; } } \ No newline at end of file diff --git a/ui/src/style/pages/overlay-technology.scss b/ui/src/style/pages/overlay-technology.scss index 53e0b6d4dd..83b254ec83 100644 --- a/ui/src/style/pages/overlay-technology.scss +++ b/ui/src/style/pages/overlay-technology.scss @@ -64,29 +64,29 @@ $overlay-z: 100; text-transform: uppercase; @include no-user-select; } - .confirm-buttons { - margin-left: 32px; - } - .confirm-buttons .btn { - height: 30px; - line-height: 30px; - padding: 0 9px; +} +.overlay-controls .confirm-buttons { + margin-left: 32px; +} +.overlay-controls .confirm-buttons .btn { + height: 30px; + line-height: 30px; + padding: 0 9px; - & > span.icon { - font-size: 16px; + & > span.icon { + font-size: 16px; + } +} +.overlay-controls .toggle { + + .toggle-btn { + background-color: $overlay-controls-bg; + + &:hover { + background-color: $g4-onyx; } - } - .overlay-controls .toggle { - - .toggle-btn { - background-color: $overlay-controls-bg; - - &:hover { - background-color: $g4-onyx; - } - &.active { - background-color: $g5-pepper; - } + &.active { + background-color: $g5-pepper; } } }