+
Alias patterns
diff --git a/public/app/plugins/datasource/influxdb/partials/query_part.html b/public/app/plugins/datasource/influxdb/partials/query_part.html
index 0eb0146ec13..478edfe5c29 100644
--- a/public/app/plugins/datasource/influxdb/partials/query_part.html
+++ b/public/app/plugins/datasource/influxdb/partials/query_part.html
@@ -2,4 +2,4 @@
-
{{part.def.type}} ( )
+
{{part.def.type}} ( )
diff --git a/public/app/plugins/datasource/influxdb/query_ctrl.ts b/public/app/plugins/datasource/influxdb/query_ctrl.ts
index 041e3c8a882..8d6a03fc4a1 100644
--- a/public/app/plugins/datasource/influxdb/query_ctrl.ts
+++ b/public/app/plugins/datasource/influxdb/query_ctrl.ts
@@ -23,6 +23,7 @@ export class InfluxQueryCtrl extends QueryCtrl {
measurementSegment: any;
removeTagFilterSegment: any;
+
/** @ngInject **/
constructor($scope, $injector, private templateSrv, private $q, private uiSegmentSrv) {
super($scope, $injector);
@@ -154,7 +155,11 @@ export class InfluxQueryCtrl extends QueryCtrl {
}
toggleEditorMode() {
- this.target.query = this.queryModel.render(false);
+ try {
+ this.target.query = this.queryModel.render(false);
+ } catch (err) {
+ console.log('query render error');
+ }
this.target.rawQuery = !this.target.rawQuery;
}
@@ -316,5 +321,9 @@ export class InfluxQueryCtrl extends QueryCtrl {
return '=';
}
}
+
+ getCollapsedText() {
+ return this.queryModel.render(false);
+ }
}
diff --git a/public/app/plugins/datasource/opentsdb/partials/query.editor.html b/public/app/plugins/datasource/opentsdb/partials/query.editor.html
index def68d19bf9..4683f9c300a 100644
--- a/public/app/plugins/datasource/opentsdb/partials/query.editor.html
+++ b/public/app/plugins/datasource/opentsdb/partials/query.editor.html
@@ -1,223 +1,253 @@
-
-
- Metric
-
-
-
-
-
-
-
-
-
- Aggregator
-
-
-
-
-
-
-
-
+
+
-
+
+
diff --git a/public/app/plugins/datasource/prometheus/partials/query.editor.html b/public/app/plugins/datasource/prometheus/partials/query.editor.html
index fa04bb33b18..37c27ace58a 100644
--- a/public/app/plugins/datasource/prometheus/partials/query.editor.html
+++ b/public/app/plugins/datasource/prometheus/partials/query.editor.html
@@ -1,80 +1,54 @@
-
-
- Query
-
-
-
-
-
- Metric
-
-
-
-
-
+
+
-
+
+
-
+
diff --git a/public/sass/_grafana.scss b/public/sass/_grafana.scss
index 460adebb9da..194d7a5487c 100644
--- a/public/sass/_grafana.scss
+++ b/public/sass/_grafana.scss
@@ -70,6 +70,7 @@
@import "components/drop";
@import "components/query_editor";
@import "components/tabbed_view";
+@import "components/query_part";
// PAGES
@import "pages/login";
diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss
index 560f2d2dab1..fed3d805b82 100644
--- a/public/sass/_variables.dark.scss
+++ b/public/sass/_variables.dark.scss
@@ -67,8 +67,8 @@ $page-gradient: linear-gradient(60deg, transparent 70%, darken($page-bg, 4%) 98%
// Links
// -------------------------
-$link-color: darken($white,11%);
-$link-color-disabled: darken($link-color,30%);
+$link-color: darken($white, 11%);
+$link-color-disabled: darken($link-color, 30%);
$link-hover-color: $white;
$external-link-color: $blue;
@@ -76,7 +76,7 @@ $external-link-color: $blue;
// -------------------------
$headings-color: darken($white,11%);
$abbr-border-color: $gray-3 !default;
-$text-muted: darken($link-color,30%);
+$text-muted: $text-color-weak;
$blockquote-small-color: $gray-3 !default;
$blockquote-border-color: $gray-4 !default;
diff --git a/public/sass/_variables.light.scss b/public/sass/_variables.light.scss
index a7b5c72af2b..42775d989f7 100644
--- a/public/sass/_variables.light.scss
+++ b/public/sass/_variables.light.scss
@@ -82,7 +82,7 @@ $external-link-color: $blue;
// -------------------------
$headings-color: $text-color;
$abbr-border-color: $gray-2 !default;
-$text-muted: darken($link-color,30%);
+$text-muted: $text-color-weak;
$blockquote-small-color: $gray-2 !default;
$blockquote-border-color: $gray-3 !default;
diff --git a/public/sass/base/_type.scss b/public/sass/base/_type.scss
index 904dfa13b4e..7770be25a68 100644
--- a/public/sass/base/_type.scss
+++ b/public/sass/base/_type.scss
@@ -27,9 +27,9 @@ em { font-style: italic; color: $headings-color; }
cite { font-style: normal; }
// Utility classes
-.muted { color: $gray-2; }
+.muted { color: $text-muted; }
a.muted:hover,
-a.muted:focus { color: darken($gray-2, 10%); }
+a.muted:focus { color: darken($text-muted, 10%); }
.text-warning { color: $state-warning-text; }
a.text-warning:hover,
@@ -118,6 +118,10 @@ small,
font-weight: normal;
}
+.small-xs {
+ font-size: $font-size-xs;
+}
+
mark,
.mark {
padding: .2em;
diff --git a/public/sass/components/_drop.scss b/public/sass/components/_drop.scss
index 4045c1daa4b..570c1862ef0 100644
--- a/public/sass/components/_drop.scss
+++ b/public/sass/components/_drop.scss
@@ -1,4 +1,4 @@
-$popover-arrow-size: 1rem;
+$popover-arrow-size: 0.7rem;
$color: inherit;
$backgroundColor: $btn-secondary-bg;
$color: $text-color;
diff --git a/public/sass/components/_gf-form.scss b/public/sass/components/_gf-form.scss
index 66dab450ee1..0ae9f7ebb71 100644
--- a/public/sass/components/_gf-form.scss
+++ b/public/sass/components/_gf-form.scss
@@ -8,8 +8,22 @@ $gf-form-margin: 0.25rem;
text-align: left;
position: relative;
- .cr1 {
- margin-left: 8px;
+ &--offset-1 {
+ margin-left: $spacer;
+ }
+
+ &--grow {
+ flex-grow: 1;
+ }
+}
+
+.gf-form-disabled {
+ color: $text-color-weak;
+
+ .query-keyword,
+ a,
+ .gf-form-input {
+ color: $text-color-weak;
}
}
@@ -22,10 +36,6 @@ $gf-form-margin: 0.25rem;
flex-direction: row;
flex-wrap: wrap;
align-content: flex-start;
-
- .gf-form-flex {
- flex-grow: 1;
- }
}
.gf-form-button-row {
@@ -48,6 +58,12 @@ $gf-form-margin: 0.25rem;
border: $input-btn-border-width solid transparent;
@include border-radius($label-border-radius-sm);
+
+
+ &--grow {
+ flex-grow: 1;
+ min-height: 2.70rem;
+ }
}
.gf-form-checkbox {
@@ -107,6 +123,21 @@ $gf-form-margin: 0.25rem;
}
&.gf-size-auto { width: auto; }
+
+ &--dropdown {
+ padding-right: $input-padding-x*2;
+
+ &:after {
+ position: absolute;
+ top: 35%;
+ right: $input-padding-x/2;
+ background-color: transparent;
+ color: $input-color;
+ font: normal normal normal $font-size-sm/1 FontAwesome;
+ content: '\f0d7';
+ pointer-events: none;
+ }
+ }
}
.gf-form-select-wrapper {
@@ -152,9 +183,11 @@ $gf-form-margin: 0.25rem;
}
.gf-form-btn {
- margin-right: $gf-form-margin;
padding: $input-padding-y $input-padding-x;
+ margin-right: $gf-form-margin;
line-height: $input-line-height;
+ font-size: $font-size-sm;
+
flex-shrink: 0;
flex-grow: 0;
}
@@ -209,4 +242,3 @@ $gf-form-margin: 0.25rem;
select.gf-form-input ~ .gf-form-help-icon {
right: 10px;
}
-
diff --git a/public/sass/components/_query_editor.scss b/public/sass/components/_query_editor.scss
index fe8d3fb157c..4c807ed0e6b 100644
--- a/public/sass/components/_query_editor.scss
+++ b/public/sass/components/_query_editor.scss
@@ -4,13 +4,66 @@
}
.query-segment-key {
- border-right: none;
- padding-right: 1px;
+ //border-right: none;
+ //padding-right: 1px;
}
.query-segment-operator {
- padding-right: 1px;
- border-right: none;
+ //padding-right: 1px;
+ //border-right: none;
color: $orange;
}
+.gf-form-query {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+ align-content: flex-start;
+ align-items: flex-start;
+
+ .gf-form,
+ .gf-form-filler {
+ margin-bottom: 2px;
+ }
+
+ .gf-form-switch,
+ .gf-form-switch label,
+ .gf-form-input,
+ .gf-form-select-wrapper,
+ .gf-form-filler,
+ .gf-form-label {
+ margin-right: 2px;
+ }
+}
+
+.gf-form-query-content {
+ flex-grow: 2;
+
+ &--collapsed {
+ overflow: hidden;
+
+ .gf-form-label {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ width: 100%;
+ white-space: nowrap;
+ }
+ }
+}
+
+.gf-form-query-letter-cell {
+ .gf-form-query-letter-cell-carret {
+ display: inline-block;
+ width: 0.7rem;
+ position: relative;
+ left: -2px;
+ }
+ .gf-form-query-letter-cell-letter {
+ font-weight: bold;
+ color: $blue;
+ }
+ .gf-form-query-letter-cell-ds {
+ color: $text-color-weak;
+ }
+}
+
diff --git a/public/sass/components/_query_part.scss b/public/sass/components/_query_part.scss
new file mode 100644
index 00000000000..1e2fb9622c2
--- /dev/null
+++ b/public/sass/components/_query_part.scss
@@ -0,0 +1,11 @@
+
+.query-part {
+ background-color: $input-bg !important;
+
+ &.show-function-controls {
+ padding-top: 5px;
+ min-width: 100px;
+ text-align: center;
+ }
+}
+
diff --git a/public/sass/mixins/_drop_element.scss b/public/sass/mixins/_drop_element.scss
index d08e50e63b8..290e49f4cad 100644
--- a/public/sass/mixins/_drop_element.scss
+++ b/public/sass/mixins/_drop_element.scss
@@ -10,7 +10,7 @@
font-family: inherit;
background: $theme-bg;
color: $theme-color;
- padding: $spacer;
+ padding: 0.65rem;
font-size: $font-size-sm;
max-width: 20rem;
diff --git a/public/sass/utils/_utils.scss b/public/sass/utils/_utils.scss
index 055fe96a213..39e4edfe7ed 100644
--- a/public/sass/utils/_utils.scss
+++ b/public/sass/utils/_utils.scss
@@ -61,13 +61,14 @@ button.close {
.hide {
display: none;
}
+
.show {
display: block;
}
// Visibility
.invisible {
- visibility: hidden;
+ visibility: hidden !important;
}
// For Affix plugin
diff --git a/public/sass/utils/_widths.scss b/public/sass/utils/_widths.scss
index b4bdbdb6ccc..cf324b35c72 100644
--- a/public/sass/utils/_widths.scss
+++ b/public/sass/utils/_widths.scss
@@ -17,3 +17,9 @@
}
}
+@for $i from 1 through 30 {
+ .offset-width-#{$i} {
+ margin-left: ($spacer * $i) !important;
+ }
+}
+