diff --git a/CHANGELOG.md b/CHANGELOG.md index d738efd940..7a73d37a3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ 1.[#2015](https://github.com/influxdata/chronograf/pull/2015): Chronograf shows real status for windows hosts when metrics are saved in non-default db - thank you, @ar7z1! 1.[#2019](https://github.com/influxdata/chronograf/pull/2006): Fix false error warning for duplicate kapacitor name 1.[#2018](https://github.com/influxdata/chronograf/pull/2018): Fix unresponsive display options and query builder in dashboards +1.[#1996](https://github.com/influxdata/chronograf/pull/1996): Able to switch InfluxDB sources on a per graph basis ### Features 1. [#1885](https://github.com/influxdata/chronograf/pull/1885): Add `fill` options to data explorer and dashboard queries @@ -18,8 +19,11 @@ 1. [#2002](https://github.com/influxdata/chronograf/pull/2002): Improve usability of dashboard cell context menus 1. [#2002](https://github.com/influxdata/chronograf/pull/2002): Move dashboard cell renaming UI into Cell Editor Overlay 1. [#2040](https://github.com/influxdata/chronograf/pull/2040): Prevent the legend from overlapping graphs at the bottom of the screen +1. [#2054](https://github.com/influxdata/chronograf/pull/2054): Add a "Plus" icon to every button with an Add or Create action for clarity and consistency 1. [#2052](https://github.com/influxdata/chronograf/pull/2052): Make hovering over series smoother 1. [#2072](https://github.com/influxdata/chronograf/pull/2072): Remove tabs from Data Explorer +1. [#2057](https://github.com/influxdata/chronograf/pull/2057): Improve appearance of placeholder text in inputs +1. [#2057](https://github.com/influxdata/chronograf/pull/2057): Add ability to use "Default" values in Source Connection form ## v1.3.8.1 [unreleased] ### Bug Fixes diff --git a/bolt/internal/internal.go b/bolt/internal/internal.go index ca6df1827f..8d79dde745 100644 --- a/bolt/internal/internal.go +++ b/bolt/internal/internal.go @@ -195,6 +195,7 @@ func MarshalDashboard(d chronograf.Dashboard) ([]byte, error) { Command: q.Command, Label: q.Label, Range: r, + Source: q.Source, } } @@ -274,6 +275,7 @@ func UnmarshalDashboard(data []byte, d *chronograf.Dashboard) error { queries[j] = chronograf.DashboardQuery{ Command: q.Command, Label: q.Label, + Source: q.Source, } if q.Range.Upper != q.Range.Lower { queries[j].Range = &chronograf.Range{ diff --git a/bolt/internal/internal.pb.go b/bolt/internal/internal.pb.go index 4af4f8fd04..02d757fdc9 100644 --- a/bolt/internal/internal.pb.go +++ b/bolt/internal/internal.pb.go @@ -261,6 +261,7 @@ type Query struct { Wheres []string `protobuf:"bytes,5,rep,name=Wheres" json:"Wheres,omitempty"` Label string `protobuf:"bytes,6,opt,name=Label,proto3" json:"Label,omitempty"` Range *Range `protobuf:"bytes,7,opt,name=Range" json:"Range,omitempty"` + Source string `protobuf:"bytes,8,opt,name=Source,proto3" json:"Source,omitempty"` } func (m *Query) Reset() { *m = Query{} } @@ -327,67 +328,70 @@ func init() { func init() { proto.RegisterFile("internal.proto", fileDescriptorInternal) } var fileDescriptorInternal = []byte{ - // 985 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x56, 0xcd, 0x6e, 0x23, 0x45, - 0x10, 0x56, 0xcf, 0x8f, 0xed, 0x29, 0x67, 0x03, 0x6a, 0xad, 0xd8, 0x61, 0xb9, 0x98, 0x11, 0x48, - 0x06, 0x41, 0x40, 0xbb, 0x42, 0x42, 0xdc, 0x9c, 0x18, 0xad, 0x42, 0xb2, 0x4b, 0x68, 0x27, 0x81, - 0x0b, 0x5a, 0xb5, 0xc7, 0x95, 0x64, 0xb4, 0x63, 0xcf, 0xd0, 0x33, 0x13, 0x7b, 0xde, 0x82, 0x27, - 0x40, 0x42, 0xe2, 0xc4, 0x81, 0x03, 0x2f, 0xc0, 0x9d, 0xa7, 0x42, 0xd5, 0xdd, 0x33, 0x1e, 0xb3, - 0x59, 0xb4, 0x17, 0xf6, 0xd6, 0x5f, 0x55, 0xbb, 0xba, 0xe6, 0xab, 0xfa, 0x3e, 0x19, 0xf6, 0x93, - 0x55, 0x89, 0x6a, 0x25, 0xd3, 0x83, 0x5c, 0x65, 0x65,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0xc1, 0x1c, 0xed, 0x0a, 0xe6, 0x68, 0x2b, 0x98, 0xe9, 0x61, 0x23, 0x98, 0xe9, 0x21, 0x61, - 0x71, 0xd6, 0x08, 0x46, 0x9c, 0xd1, 0xb0, 0x9e, 0xa8, 0xac, 0xca, 0x0f, 0x6b, 0x33, 0xd5, 0x40, - 0xb4, 0x98, 0xb6, 0xec, 0xfb, 0x1b, 0x54, 0x96, 0xea, 0x40, 0x58, 0x44, 0x3b, 0x79, 0xaa, 0xcd, - 0xc4, 0x90, 0x6b, 0x00, 0xff, 0x10, 0x7c, 0x41, 0xe4, 0x69, 0x86, 0x77, 0xe6, 0xa2, 0xc3, 0xc2, - 0x64, 0xa3, 0xc7, 0xf6, 0x1a, 0x55, 0xb9, 0xc8, 0x73, 0x54, 0x56, 0x4a, 0x06, 0xe8, 0xda, 0xd9, - 0x1a, 0x8d, 0x0b, 0xba, 0xc2, 0x80, 0xe8, 0x47, 0x08, 0x26, 0x29, 0xaa, 0x52, 0x54, 0xe9, 0xcb, - 0xde, 0xc9, 0xc1, 0xfb, 0x66, 0xf6, 0xed, 0xb3, 0x46, 0x80, 0x74, 0xde, 0xca, 0xc6, 0xfd, 0x97, - 0x6c, 0x4e, 0x64, 0x2e, 0x8f, 0xa7, 0x7a, 0x9f, 0x5c, 0x61, 0x51, 0xf4, 0x31, 0x78, 0x24, 0xcf, - 0x4e, 0x65, 0xef, 0x55, 0xd2, 0x9e, 0xf7, 0xf4, 0x5f, 0xa4, 0xc7, 0xff, 0x04, 0x00, 0x00, 0xff, - 0xff, 0x5a, 0xf0, 0x92, 0xd4, 0x34, 0x09, 0x00, 0x00, + // 1028 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0xd7, 0xf8, 0x4f, 0x12, 0xbf, 0x74, 0x0b, 0x1a, 0xad, 0x58, 0xb3,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, 0x27, 0x16, 0x45, 0x4f, 0xec, 0xe7, 0x54, + 0xfd, 0x22, 0xcf, 0x51, 0x59, 0x89, 0x19, 0xa0, 0xcf, 0xcc, 0x6e, 0xd1, 0xb8, 0xa3, 0x2b, 0x0c, + 0x88, 0x7e, 0x84, 0x60, 0x92, 0xa2, 0x2a, 0x45, 0x95, 0xbe, 0xee, 0xa9, 0x1c, 0xbc, 0x6f, 0x67, + 0xdf, 0x3d, 0x6f, 0x84, 0x49, 0xeb, 0xad, 0x9c, 0xdc, 0x7f, 0xc8, 0xe9, 0x44, 0xe6, 0xf2, 0x78, + 0xaa, 0xe7, 0xcc, 0x15, 0x16, 0x45, 0x9f, 0x82, 0x47, 0xb2, 0xed, 0x54, 0xf6, 0xde, 0x24, 0xf9, + 0x79, 0x4f, 0xff, 0x2b, 0x7b, 0xf2, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x59, 0x2e, 0xc0, + 0xa7, 0x09, 0x00, 0x00, } diff --git a/bolt/internal/internal.proto b/bolt/internal/internal.proto index aa4fe470b2..9cd762d39d 100644 --- a/bolt/internal/internal.proto +++ b/bolt/internal/internal.proto @@ -108,6 +108,7 @@ message Query { repeated string Wheres = 5; // Wheres define the restrictions on the query string Label = 6; // Label is the name of the Y-Axis Range Range = 7; // Range is the upper and lower bound of the Y-Axis + string Source = 8; // Source is the optional URI to the data source } message Range { diff --git a/bolt/internal/internal_test.go b/bolt/internal/internal_test.go index 937a192d4f..244dd471cb 100644 --- a/bolt/internal/internal_test.go +++ b/bolt/internal/internal_test.go @@ -162,6 +162,7 @@ func Test_MarshalDashboard(t *testing.T) { Range: &chronograf.Range{ Upper: int64(100), }, + Source: "/chronograf/v1/sources/1", }, }, Axes: map[string]chronograf.Axis{ diff --git a/chronograf.go b/chronograf.go index 070862ed5f..d2d5c2bfa1 100644 --- a/chronograf.go +++ b/chronograf.go @@ -395,6 +395,7 @@ type DashboardQuery struct { Label string `json:"label,omitempty"` // Label is the Y-Axis label for the data Range *Range `json:"range,omitempty"` // Range is the default Y-Axis range for the data QueryConfig QueryConfig `json:"queryConfig,omitempty"` // QueryConfig represents the query state that is understood by the data explorer + Source string `json:"source"` // Source is the optional URI to the data source for this queryConfig } // TemplateQuery is used to retrieve choices for template replacement diff --git a/etc/scripts/chronograf.service b/etc/scripts/chronograf.service index 422f6cd925..dd84b1f2b4 100644 --- a/etc/scripts/chronograf.service +++ b/etc/scripts/chronograf.service @@ -8,6 +8,7 @@ After=network-online.target [Service] User=chronograf Group=chronograf +EnvironmentFile=-/etc/default/chronograf ExecStart=/usr/bin/chronograf --host 0.0.0.0 --port 8888 -b /var/lib/chronograf/chronograf-v1.db -c /usr/share/chronograf/canned KillMode=control-group Restart=on-failure diff --git a/server/dashboards_test.go b/server/dashboards_test.go index ff740ba001..30ee0d0629 100644 --- a/server/dashboards_test.go +++ b/server/dashboards_test.go @@ -217,6 +217,7 @@ func Test_newDashboardResponse(t *testing.T) { H: 0, Queries: []chronograf.DashboardQuery{ { + Source: "/chronograf/v1/sources/1", Command: "SELECT donors from hill_valley_preservation_society where time > '1985-10-25 08:00:00'", }, }, @@ -236,6 +237,7 @@ func Test_newDashboardResponse(t *testing.T) { H: 0, Queries: []chronograf.DashboardQuery{ { + Source: "/chronograf/v1/sources/2", Command: "SELECT winning_horses from grays_sports_alamanc where time > now() - 15m", }, }, @@ -256,6 +258,7 @@ func Test_newDashboardResponse(t *testing.T) { Queries: []chronograf.DashboardQuery{ { Command: "SELECT donors from hill_valley_preservation_society where time > '1985-10-25 08:00:00'", + Source: "/chronograf/v1/sources/1", QueryConfig: chronograf.QueryConfig{ RawText: &[]string{"SELECT donors from hill_valley_preservation_society where time > '1985-10-25 08:00:00'"}[0], Fields: []chronograf.Field{}, @@ -303,6 +306,7 @@ func Test_newDashboardResponse(t *testing.T) { Queries: []chronograf.DashboardQuery{ { Command: "SELECT winning_horses from grays_sports_alamanc where time > now() - 15m", + Source: "/chronograf/v1/sources/2", QueryConfig: chronograf.QueryConfig{ Measurement: "grays_sports_alamanc", Fields: []chronograf.Field{ diff --git a/server/swagger.json b/server/swagger.json index baed5e911f..82e402fc4c 100644 --- a/server/swagger.json +++ b/server/swagger.json @@ -3766,6 +3766,11 @@ "query": { "type": "string" }, + "source": { + "type": "string", + "format": "url", + "description": "Optional URI for data source for this query" + }, "queryConfig": { "$ref": "#/definitions/QueryConfig" } diff --git a/ui/src/admin/components/DatabaseManager.js b/ui/src/admin/components/DatabaseManager.js index 2d3484fc9a..48dd5a89e0 100644 --- a/ui/src/admin/components/DatabaseManager.js +++ b/ui/src/admin/components/DatabaseManager.js @@ -37,7 +37,7 @@ const DatabaseManager = ({ disabled={isAddDBDisabled} onClick={addDatabase} > - Create Database + Create Database
diff --git a/ui/src/admin/components/DatabaseTableHeader.js b/ui/src/admin/components/DatabaseTableHeader.js index 792afcfd06..f7d6a65b9a 100644 --- a/ui/src/admin/components/DatabaseTableHeader.js +++ b/ui/src/admin/components/DatabaseTableHeader.js @@ -59,7 +59,7 @@ const Header = ({ disabled={isAddRPDisabled} onClick={onAddRetentionPolicy(database)} > - Add Retention Policy + Add Retention Policy {database.name === '_internal' ? null diff --git a/ui/src/admin/components/FilterBar.js b/ui/src/admin/components/FilterBar.js index 7f7a786a76..daac025246 100644 --- a/ui/src/admin/components/FilterBar.js +++ b/ui/src/admin/components/FilterBar.js @@ -44,7 +44,8 @@ class FilterBar extends Component { disabled={isEditing} onClick={onClickCreate(type)} > - Create {placeholderText.substring(0, placeholderText.length - 1)} + Create{' '} + {placeholderText.substring(0, placeholderText.length - 1)}
) diff --git a/ui/src/admin/containers/AdminPage.js b/ui/src/admin/containers/AdminPage.js index de4e936b96..65e448d469 100644 --- a/ui/src/admin/containers/AdminPage.js +++ b/ui/src/admin/containers/AdminPage.js @@ -154,7 +154,7 @@ class AdminPage extends Component {

Admin

- +
diff --git a/ui/src/alerts/containers/AlertsApp.js b/ui/src/alerts/containers/AlertsApp.js index 34140b11f4..16330dbabb 100644 --- a/ui/src/alerts/containers/AlertsApp.js +++ b/ui/src/alerts/containers/AlertsApp.js @@ -156,7 +156,7 @@ class AlertsApp extends Component {

Alert History

- + +
Y Axis Controls
diff --git a/ui/src/dashboards/components/CellEditorOverlay.js b/ui/src/dashboards/components/CellEditorOverlay.js index 12e877dcb6..1d5963ff7f 100644 --- a/ui/src/dashboards/components/CellEditorOverlay.js +++ b/ui/src/dashboards/components/CellEditorOverlay.js @@ -23,10 +23,17 @@ class CellEditorOverlay extends Component { constructor(props) { super(props) - const {cell: {name, type, queries, axes}} = props + const {cell: {name, type, queries, axes}, sources} = props + + let source = _.get(queries, ['0', 'source'], null) + source = sources.find(s => s.links.self === source) || props.source const queriesWorkingDraft = _.cloneDeep( - queries.map(({queryConfig}) => ({...queryConfig, id: uuid.v4()})) + queries.map(({queryConfig}) => ({ + ...queryConfig, + id: uuid.v4(), + source, + })) ) this.state = { @@ -141,6 +148,7 @@ class CellEditorOverlay extends Component { return { queryConfig: q, query, + source: _.get(q, ['source', 'links', 'self'], null), } }) @@ -197,6 +205,15 @@ class CellEditorOverlay extends Component { }) } + handleSetQuerySource = source => { + const queriesWorkingDraft = this.state.queriesWorkingDraft.map(q => ({ + ..._.cloneDeep(q), + source, + })) + + this.setState({queriesWorkingDraft}) + } + getActiveQuery = () => { const {queriesWorkingDraft, activeQueryIndex} = this.state const activeQuery = queriesWorkingDraft[activeQueryIndex] @@ -221,9 +238,39 @@ class CellEditorOverlay extends Component { } } + formatSources = this.props.sources.map(s => ({ + ...s, + text: `${s.name} @ ${s.url}`, + })) + + findSelectedSource = () => { + const {source} = this.props + const sources = this.formatSources + const query = _.get(this.state.queriesWorkingDraft, 0, false) + + if (!query || !query.source) { + const defaultSource = sources.find(s => s.id === source.id) + return (defaultSource && defaultSource.text) || 'No sources' + } + + const selected = sources.find(s => s.id === query.source.id) + return (selected && selected.text) || 'No sources' + } + + getSource = () => { + const {source, sources} = this.props + const query = _.get(this.state.queriesWorkingDraft, 0, false) + + if (!query || !query.source) { + return source + } + + const querySource = sources.find(s => s.id === query.source.id) + return querySource || source + } + render() { const { - source, onCancel, templates, timeRange, @@ -232,12 +279,12 @@ class CellEditorOverlay extends Component { } = this.props const { + axes, activeQueryIndex, cellWorkingName, cellWorkingType, isDisplayOptionsTabActive, queriesWorkingDraft, - axes, } = this.state const queryActions = { @@ -271,11 +318,14 @@ class CellEditorOverlay extends Component { /> {isDisplayOptionsTabActive ? : { const cells = dashboard.cells.map(cell => { const dashboardCell = {...cell} - dashboardCell.queries = dashboardCell.queries.map( - ({label, query, queryConfig, db}) => ({ - label, - query, - queryConfig, - db, - database: db, - text: query, - }) - ) + dashboardCell.queries = dashboardCell.queries.map(q => ({ + ...q, + database: q.db, + text: q.query, + })) return dashboardCell }) @@ -54,17 +50,18 @@ const Dashboard = ({ />} {cells.length ? :

This Dashboard has no Cells

@@ -112,6 +109,7 @@ Dashboard.propTypes = { proxy: string, }).isRequired, }).isRequired, + sources: arrayOf(shape({})).isRequired, autoRefresh: number.isRequired, timeRange: shape({}).isRequired, onOpenTemplateManager: func.isRequired, diff --git a/ui/src/dashboards/components/DashboardHeader.js b/ui/src/dashboards/components/DashboardHeader.js index a7bd5436a7..ff670787fd 100644 --- a/ui/src/dashboards/components/DashboardHeader.js +++ b/ui/src/dashboards/components/DashboardHeader.js @@ -18,7 +18,6 @@ const DashboardHeader = ({ handleChooseTimeRange, handleChooseAutoRefresh, handleClickPresentationButton, - source, onAddCell, onEditDashboard, onToggleTempVarControls, @@ -49,7 +48,7 @@ const DashboardHeader = ({
- + {dashboard ?
diff --git a/ui/src/dashboards/components/DashboardsTable.js b/ui/src/dashboards/components/DashboardsTable.js index 4dcb6c7da5..fc72d49a0d 100644 --- a/ui/src/dashboards/components/DashboardsTable.js +++ b/ui/src/dashboards/components/DashboardsTable.js @@ -54,7 +54,7 @@ const DashboardsTable = ({ onClick={onCreateDashboard} style={{marginBottom: '90px'}} > - Create Dashboard + Create Dashboard
} diff --git a/ui/src/dashboards/components/OverlayControls.js b/ui/src/dashboards/components/OverlayControls.js index ba4ac6fda4..54299b551c 100644 --- a/ui/src/dashboards/components/OverlayControls.js +++ b/ui/src/dashboards/components/OverlayControls.js @@ -2,16 +2,24 @@ import React, {PropTypes} from 'react' import classnames from 'classnames' import ConfirmButtons from 'shared/components/ConfirmButtons' +import SourceSelector from 'src/dashboards/components/SourceSelector' const OverlayControls = ({ - onCancel, onSave, + sources, + selected, + onCancel, + isSavable, + onSetQuerySource, isDisplayOptionsTabActive, onClickDisplayOptions, - isSavable, }) =>
-

Cell Editor

+
  • - Display Options + Options
@@ -41,7 +49,7 @@ const OverlayControls = ({
-const {func, bool} = PropTypes +const {arrayOf, bool, func, shape, string} = PropTypes OverlayControls.propTypes = { onCancel: func.isRequired, @@ -49,6 +57,9 @@ OverlayControls.propTypes = { isDisplayOptionsTabActive: bool.isRequired, onClickDisplayOptions: func.isRequired, isSavable: bool, + sources: arrayOf(shape()), + onSetQuerySource: func, + selected: string, } export default OverlayControls diff --git a/ui/src/dashboards/components/QueryMaker.js b/ui/src/dashboards/components/QueryMaker.js index 23376948d7..3a8c1e56c8 100644 --- a/ui/src/dashboards/components/QueryMaker.js +++ b/ui/src/dashboards/components/QueryMaker.js @@ -13,7 +13,7 @@ const buildText = q => q.rawText || buildInfluxQLQuery(q.range || TEMPLATE_RANGE, q) || '' const QueryMaker = ({ - source: {links}, + source, actions, queries, timeRange, @@ -39,7 +39,7 @@ const QueryMaker = ({ query={buildText(activeQuery)} config={activeQuery} onUpdate={rawTextBinder( - links, + source.links, activeQuery.id, actions.editRawTextAsync )} @@ -49,6 +49,7 @@ const QueryMaker = ({ query={activeQuery} actions={actions} onAddQuery={onAddQuery} + source={source} />
: } diff --git a/ui/src/dashboards/components/SourceSelector.js b/ui/src/dashboards/components/SourceSelector.js new file mode 100644 index 0000000000..a9c1953bd2 --- /dev/null +++ b/ui/src/dashboards/components/SourceSelector.js @@ -0,0 +1,28 @@ +import React, {PropTypes} from 'react' +import Dropdown from 'shared/components/Dropdown' + +const SourceSelector = ({sources = [], selected, onSetQuerySource}) => + sources.length > 1 + ?
+

Source:

+ +
+ : null + +const {arrayOf, func, shape, string} = PropTypes + +SourceSelector.propTypes = { + sources: arrayOf(shape()).isRequired, + onSetQuerySource: func.isRequired, + selected: string, +} + +export default SourceSelector diff --git a/ui/src/dashboards/containers/DashboardPage.js b/ui/src/dashboards/containers/DashboardPage.js index 18b9a2c447..60f6e8168c 100644 --- a/ui/src/dashboards/containers/DashboardPage.js +++ b/ui/src/dashboards/containers/DashboardPage.js @@ -190,6 +190,7 @@ class DashboardPage extends Component { const { source, + sources, timeRange, timeRange: {lower, upper}, showTemplateControlBar, @@ -277,6 +278,7 @@ class DashboardPage extends Component { {selectedCell ? { persisted: {autoRefresh, showTemplateControlBar}, }, dashboardUI: {dashboards, timeRange, cellQueryStatus}, + sources, } = state return { @@ -424,6 +429,7 @@ const mapStateToProps = state => { showTemplateControlBar, inPresentationMode, cellQueryStatus, + sources, } } diff --git a/ui/src/data_explorer/components/VisHeader.js b/ui/src/data_explorer/components/VisHeader.js index 855cf6b1eb..0457460fe7 100644 --- a/ui/src/data_explorer/components/VisHeader.js +++ b/ui/src/data_explorer/components/VisHeader.js @@ -33,13 +33,15 @@ const VisHeader = ({views, view, onToggleView, name, query, errorThrown}) => )} -
- - .csv -
+ {query + ?
+ + .csv +
+ : null}
: null}
@@ -54,7 +56,7 @@ VisHeader.propTypes = { view: string.isRequired, onToggleView: func.isRequired, name: string.isRequired, - query: shape().isRequired, + query: shape(), errorThrown: func.isRequired, } diff --git a/ui/src/data_explorer/components/VisView.js b/ui/src/data_explorer/components/VisView.js index c6c9714a89..59865c0211 100644 --- a/ui/src/data_explorer/components/VisView.js +++ b/ui/src/data_explorer/components/VisView.js @@ -51,7 +51,7 @@ const {arrayOf, func, number, shape, string} = PropTypes VisView.propTypes = { view: string.isRequired, axes: shape(), - query: shape().isRequired, + query: shape(), queries: arrayOf(shape()).isRequired, cellType: string, templates: arrayOf(shape()), diff --git a/ui/src/data_explorer/containers/Header.js b/ui/src/data_explorer/containers/Header.js index 32cd0e0bff..cbf79fc4f1 100644 --- a/ui/src/data_explorer/containers/Header.js +++ b/ui/src/data_explorer/containers/Header.js @@ -22,12 +22,6 @@ const Header = React.createClass({ }).isRequired, }, - contextTypes: { - source: shape({ - name: string, - }), - }, - handleChooseTimeRange(bounds) { this.props.actions.setTimeRange(bounds) }, @@ -48,7 +42,7 @@ const Header = React.createClass({
- +
Host List
- +
diff --git a/ui/src/kapacitor/components/KapacitorRules.js b/ui/src/kapacitor/components/KapacitorRules.js index 611c36e0f1..d5a7773a16 100644 --- a/ui/src/kapacitor/components/KapacitorRules.js +++ b/ui/src/kapacitor/components/KapacitorRules.js @@ -59,7 +59,7 @@ const KapacitorRules = ({ className="btn btn-sm btn-primary" style={{marginRight: '4px'}} > - Build Rule + Build Rule @@ -99,7 +99,7 @@ const KapacitorRules = ({ ) } -const PageContents = ({children, source}) => +const PageContents = ({children}) =>
@@ -109,7 +109,7 @@ const PageContents = ({children, source}) =>
- +
@@ -139,7 +139,6 @@ KapacitorRules.propTypes = { PageContents.propTypes = { children: node, - source: shape(), onCloseTickscript: func, } diff --git a/ui/src/kapacitor/components/RuleHeaderSave.js b/ui/src/kapacitor/components/RuleHeaderSave.js index 5d368133fe..be2c441373 100644 --- a/ui/src/kapacitor/components/RuleHeaderSave.js +++ b/ui/src/kapacitor/components/RuleHeaderSave.js @@ -4,14 +4,13 @@ import TimeRangeDropdown from 'shared/components/TimeRangeDropdown' import SourceIndicator from 'shared/components/SourceIndicator' const RuleHeaderSave = ({ - source, onSave, timeRange, validationError, onChooseTimeRange, }) =>
- + list.map(l => ({...l, name: `${l.db}.${l.rp}`})) const TickscriptHeader = ({ task: {id, type, dbrps}, task, - source: {name}, onSave, onChangeType, onChangeID, @@ -26,7 +25,7 @@ const TickscriptHeader = ({ : }
- + { return true } - return data.every(datum => { - return datum.response.results.every(result => { + return data.every(({response}) => { + return _.get(response, 'results', []).every(result => { return ( Object.keys(result).filter(k => k !== 'statement_id').length === 0 ) diff --git a/ui/src/shared/components/CustomTimeIndicator.js b/ui/src/shared/components/CustomTimeIndicator.js index baad870a6f..16fd558364 100644 --- a/ui/src/shared/components/CustomTimeIndicator.js +++ b/ui/src/shared/components/CustomTimeIndicator.js @@ -15,7 +15,7 @@ const CustomTimeIndicator = ({queries}) => { : customLower return ( - + {customTimeRange} ) diff --git a/ui/src/shared/components/DatabaseList.js b/ui/src/shared/components/DatabaseList.js index 2c84392bfb..076cbdfdc6 100644 --- a/ui/src/shared/components/DatabaseList.js +++ b/ui/src/shared/components/DatabaseList.js @@ -14,6 +14,17 @@ const DatabaseList = React.createClass({ propTypes: { query: shape({}).isRequired, onChooseNamespace: func.isRequired, + querySource: shape({ + links: shape({ + proxy: string.isRequired, + }).isRequired, + }), + }, + + getDefaultProps() { + return { + source: null, + } }, contextTypes: { @@ -31,8 +42,23 @@ const DatabaseList = React.createClass({ }, componentDidMount() { + this.getDbRp() + }, + + componentDidUpdate(prevProps) { + if (_.isEqual(prevProps.querySource, this.props.querySource)) { + return + } + + this.getDbRp() + }, + + getDbRp() { const {source} = this.context - const proxy = source.links.proxy + const {querySource} = this.props + const proxy = + _.get(querySource, ['links', 'proxy'], null) || source.links.proxy + showDatabases(proxy).then(resp => { const {errors, databases} = showDatabasesParser(resp.data) if (errors.length) { diff --git a/ui/src/shared/components/Dropdown.js b/ui/src/shared/components/Dropdown.js index 605bc62733..92efa21028 100644 --- a/ui/src/shared/components/Dropdown.js +++ b/ui/src/shared/components/Dropdown.js @@ -206,6 +206,7 @@ class Dropdown extends Component { iconName, buttonSize, buttonColor, + toggleStyle, useAutoComplete, } = this.props const {isOpen, searchTerm, filteredItems} = this.state @@ -222,6 +223,7 @@ class Dropdown extends Component { {useAutoComplete && isOpen ?
- :
+ :
{iconName ? : null} @@ -291,6 +296,7 @@ Dropdown.propTypes = { menuLabel: string, menuClass: string, useAutoComplete: bool, + toggleStyle: shape(), } export default OnClickOutside(Dropdown) diff --git a/ui/src/shared/components/EmptyQuery.js b/ui/src/shared/components/EmptyQuery.js index e37b9cf72b..e42cca09d9 100644 --- a/ui/src/shared/components/EmptyQuery.js +++ b/ui/src/shared/components/EmptyQuery.js @@ -5,7 +5,7 @@ const EmptyQueryState = ({onAddQuery}) =>
This Graph has no Queries

- Add a Query + Add a Query
diff --git a/ui/src/shared/components/FieldList.js b/ui/src/shared/components/FieldList.js index 79607635c7..918cdf994d 100644 --- a/ui/src/shared/components/FieldList.js +++ b/ui/src/shared/components/FieldList.js @@ -1,4 +1,5 @@ import React, {PropTypes, Component} from 'react' +import _ from 'lodash' import FieldListItem from 'src/data_explorer/components/FieldListItem' import GroupByTimeDropdown from 'src/data_explorer/components/GroupByTimeDropdown' @@ -26,7 +27,8 @@ class FieldList extends Component { } componentDidUpdate(prevProps) { - const {database, measurement, retentionPolicy} = this.props.query + const {querySource, query} = this.props + const {database, measurement, retentionPolicy} = query const { database: prevDB, measurement: prevMeas, @@ -39,7 +41,8 @@ class FieldList extends Component { if ( database === prevDB && measurement === prevMeas && - retentionPolicy === prevRP + retentionPolicy === prevRP && + _.isEqual(prevProps.querySource, querySource) ) { return } @@ -58,14 +61,12 @@ class FieldList extends Component { _getFields = () => { const {database, measurement, retentionPolicy} = this.props.query const {source} = this.context - const proxySource = source.links.proxy + const {querySource} = this.props - showFieldKeys( - proxySource, - database, - measurement, - retentionPolicy - ).then(resp => { + const proxy = + _.get(querySource, ['links', 'proxy'], null) || source.links.proxy + + showFieldKeys(proxy, database, measurement, retentionPolicy).then(resp => { const {errors, fieldSets} = showFieldKeysParser(resp.data) if (errors.length) { console.error('Error parsing fields keys: ', errors) @@ -171,6 +172,11 @@ FieldList.propTypes = { applyFuncsToField: func.isRequired, isKapacitorRule: bool, isInDataExplorer: bool, + querySource: shape({ + links: shape({ + proxy: string.isRequired, + }).isRequired, + }), } export default FieldList diff --git a/ui/src/shared/components/GraphTips.js b/ui/src/shared/components/GraphTips.js index 5ff4d3e638..edf0193b78 100644 --- a/ui/src/shared/components/GraphTips.js +++ b/ui/src/shared/components/GraphTips.js @@ -4,7 +4,7 @@ import ReactTooltip from 'react-tooltip' const GraphTips = React.createClass({ render() { const graphTipsText = - '

Graph Tips:

Click + Drag Zoom in (X or Y)

Shift + Click Pan Graph Window

Double Click Reset Graph Window

' + '

Graph Tips:

Click + Drag Zoom in (X or Y)

Shift + Click Pan Graph Window

Double Click Reset Graph Window

' return (
+import _ from 'lodash' + +const getSource = (cell, source, sources, defaultSource) => { + const s = _.get(cell, ['queries', '0', 'source'], null) + if (!s) { + return source + } + + return sources.find(src => src.links.self === s) || defaultSource +} + +const Layout = ( + { + host, + cell, + cell: {h, axes, type}, + source, + sources, + onZoom, + templates, + timeRange, + isEditable, + onEditCell, + autoRefresh, + onDeleteCell, + synchronizer, + resizeCoords, + onCancelEditCell, + onSummonOverlayTechnologies, + }, + {source: defaultSource} +) => {cell.isWidget ? @@ -36,17 +51,27 @@ const Layout = ({ type={type} cellHeight={h} onZoom={onZoom} + sources={sources} timeRange={timeRange} templates={templates} autoRefresh={autoRefresh} synchronizer={synchronizer} resizeCoords={resizeCoords} - queries={buildQueriesForLayouts(cell, source, timeRange, host)} + queries={buildQueriesForLayouts( + cell, + getSource(cell, source, sources, defaultSource), + timeRange, + host + )} />} const {arrayOf, bool, func, number, shape, string} = PropTypes +Layout.contextTypes = { + source: shape(), +} + Layout.propTypes = { autoRefresh: number.isRequired, timeRange: shape({ @@ -87,6 +112,7 @@ Layout.propTypes = { onCancelEditCell: func, resizeCoords: shape(), onZoom: func, + sources: arrayOf(shape()), } export default Layout diff --git a/ui/src/shared/components/LayoutCell.js b/ui/src/shared/components/LayoutCell.js index 8b75c16058..088fcfbe65 100644 --- a/ui/src/shared/components/LayoutCell.js +++ b/ui/src/shared/components/LayoutCell.js @@ -40,16 +40,16 @@ class LayoutCell extends Component {
@@ -60,7 +60,7 @@ class LayoutCell extends Component { className="no-query--button btn btn-md btn-primary" onClick={this.handleSummonOverlay(cell)} > - Add Graph + Add Graph
}
@@ -69,7 +69,7 @@ class LayoutCell extends Component { } } -const {array, bool, func, node, number, shape, string} = PropTypes +const {arrayOf, bool, func, node, number, shape, string} = PropTypes LayoutCell.propTypes = { cell: shape({ @@ -77,7 +77,7 @@ LayoutCell.propTypes = { isEditing: bool, x: number.isRequired, y: number.isRequired, - queries: array, + queries: arrayOf(shape()), }).isRequired, children: node.isRequired, onDeleteCell: func, diff --git a/ui/src/shared/components/LayoutCellHeader.js b/ui/src/shared/components/LayoutCellHeader.js index 9b33401776..01300cc77a 100644 --- a/ui/src/shared/components/LayoutCellHeader.js +++ b/ui/src/shared/components/LayoutCellHeader.js @@ -1,5 +1,4 @@ import React, {PropTypes} from 'react' -import classnames from 'classnames' import CustomTimeIndicator from 'shared/components/CustomTimeIndicator' @@ -8,12 +7,12 @@ import {NEW_DEFAULT_DASHBOARD_CELL} from 'src/dashboards/constants/index' const LayoutCellHeader = ({queries, isEditable, cellName}) => { const cellNameIsDefault = cellName === NEW_DEFAULT_DASHBOARD_CELL.name + const headingClass = `dash-graph--heading ${isEditable + ? 'dash-graph--heading-draggable' + : ''}` + return ( -
+
{ } > {cellName} - {queries && queries.length - ? - : null} +
+ {queries && queries.length + ? + : null} +
) } -const {array, bool, string} = PropTypes +const {arrayOf, bool, shape, string} = PropTypes LayoutCellHeader.propTypes = { - queries: array, + queries: arrayOf(shape()), isEditable: bool, cellName: string, } diff --git a/ui/src/shared/components/LayoutRenderer.js b/ui/src/shared/components/LayoutRenderer.js index cfd76c2eb1..7ab90c4dd1 100644 --- a/ui/src/shared/components/LayoutRenderer.js +++ b/ui/src/shared/components/LayoutRenderer.js @@ -1,6 +1,7 @@ import React, {Component, PropTypes} from 'react' import ReactGridLayout, {WidthProvider} from 'react-grid-layout' import Resizeable from 'react-component-resizable' + import _ from 'lodash' import Layout from 'src/shared/components/Layout' @@ -26,11 +27,6 @@ class LayoutRenderer extends Component { } } - // idea adopted from https://stackoverflow.com/questions/36862334/get-viewport-window-height-in-reactjs - updateWindowDimensions = () => { - this.setState({rowHeight: this.calculateRowHeight()}) - } - handleLayoutChange = layout => { if (!this.props.onPositionChange) { return @@ -72,6 +68,7 @@ class LayoutRenderer extends Component { host, cells, source, + sources, onZoom, templates, timeRange, @@ -88,7 +85,7 @@ class LayoutRenderer extends Component { const isDashboard = !!this.props.onPositionChange return ( - + { const {errors, measurementSets} = showMeasurementsParser(resp.data) if (errors.length) { diff --git a/ui/src/shared/components/SchemaExplorer.js b/ui/src/shared/components/SchemaExplorer.js index 2572952e61..ebf5cfac33 100644 --- a/ui/src/shared/components/SchemaExplorer.js +++ b/ui/src/shared/components/SchemaExplorer.js @@ -9,6 +9,7 @@ const actionBinder = (id, action) => item => action(id, item) const SchemaExplorer = ({ query, query: {id}, + source, actions: { chooseTag, groupByTag, @@ -24,17 +25,22 @@ const SchemaExplorer = ({
{ + const sourceName = _.get(sourceOverride, 'name', null) + ? sourceOverride.name + : name + const sourceUrl = _.get(sourceOverride, 'url', null) + ? sourceOverride.url + : url - render() { - const {sourceName} = this.props - if (!sourceName) { - return null - } - const sourceNameTooltip = `Connected to ${sourceName}` - return ( -
- - -
- ) - }, -}) + if (!sourceName) { + return null + } + const sourceNameTooltip = `

Connected to Source:

${sourceName} @ ${sourceUrl}

` + const uuidTooltip = uuid.v4() + + return ( +
+ + +
+ ) +} + +const {shape, string} = PropTypes + +SourceIndicator.propTypes = { + sourceOverride: shape({ + name: string, + url: string, + }), +} + +SourceIndicator.contextTypes = { + source: shape({ + name: string, + url: string, + }), +} export default SourceIndicator diff --git a/ui/src/shared/copy/cell.js b/ui/src/shared/copy/cell.js index 071e2ec8f2..a17b594ef6 100644 --- a/ui/src/shared/copy/cell.js +++ b/ui/src/shared/copy/cell.js @@ -2,9 +2,9 @@ import _ from 'lodash' const emptyFunny = [ 'Looks like you don’t have any queries. Be a lot cooler if you did.', - 'Create a query below. Go on, I dare ya!', - 'Create a query below. Have fun!', - '1) Create a query below\n2) Profit', + 'Create a query. Go on, I dare ya!', + 'Create a query. Have fun!', + '1) Create a query \n2) Profit', ] export const emptyGraphCopy = _.sample(emptyFunny) diff --git a/ui/src/sources/components/InfluxTable.js b/ui/src/sources/components/InfluxTable.js index d690c3597d..f3aaaee651 100644 --- a/ui/src/sources/components/InfluxTable.js +++ b/ui/src/sources/components/InfluxTable.js @@ -17,7 +17,7 @@ const kapacitorDropdown = ( to={`/sources/${source.id}/kapacitors/new`} className="btn btn-xs btn-default" > - Add Config + Add Config ) } @@ -89,7 +89,7 @@ const InfluxTable = ({ to={`/sources/${source.id}/manage-sources/new`} className="btn btn-sm btn-primary" > - Add Source + Add Source
diff --git a/ui/src/sources/components/SourceForm.js b/ui/src/sources/components/SourceForm.js index 3a7bd7ea0d..020b295a35 100644 --- a/ui/src/sources/components/SourceForm.js +++ b/ui/src/sources/components/SourceForm.js @@ -1,20 +1,14 @@ -import React, {PropTypes} from 'react' +import React, {PropTypes, Component} from 'react' import classnames from 'classnames' import {insecureSkipVerifyText} from 'shared/copy/tooltipText' import _ from 'lodash' -const {bool, func, shape} = PropTypes +class SourceForm extends Component { + constructor(props) { + super(props) + } -export const SourceForm = React.createClass({ - propTypes: { - source: shape({}).isRequired, - editMode: bool.isRequired, - onInputChange: func.isRequired, - onSubmit: func.isRequired, - onBlurSourceURL: func.isRequired, - }, - - handleSubmitForm(e) { + handleSubmitForm = e => { e.preventDefault() const newSource = { ...this.props.source, @@ -31,9 +25,14 @@ export const SourceForm = React.createClass({ } this.props.onSubmit(newSource) - }, + } - handleBlurSourceURL() { + handleUseDefaultValues = () => { + this.sourceURL.value = 'http://localhost:8086' + this.sourceName.value = 'My InfluxDB' + } + + handleBlurSourceURL = () => { const url = this.sourceURL.value.trim() if (!url) { @@ -46,7 +45,7 @@ export const SourceForm = React.createClass({ } this.props.onBlurSourceURL(newSource) - }, + } render() { const {source, editMode, onInputChange} = this.props @@ -58,14 +57,14 @@ export const SourceForm = React.createClass({
- + (this.sourceURL = r)} className="form-control" id="connect-string" - placeholder="http://localhost:8086" + placeholder="Address of InfluxDB" onChange={onInputChange} value={source.url || ''} onBlur={this.handleBlurSourceURL} @@ -80,7 +79,7 @@ export const SourceForm = React.createClass({ ref={r => (this.sourceName = r)} className="form-control" id="name" - placeholder="Influx 1" + placeholder="Name this source" onChange={onInputChange} value={source.name || ''} required={true} @@ -166,7 +165,7 @@ export const SourceForm = React.createClass({
: null} -
+
+
+ + Use Default Values +
) - }, -}) + } +} + +const {bool, func, shape} = PropTypes + +SourceForm.propTypes = { + source: shape({}).isRequired, + editMode: bool.isRequired, + onInputChange: func.isRequired, + onSubmit: func.isRequired, + onBlurSourceURL: func.isRequired, +} export default SourceForm diff --git a/ui/src/sources/containers/ManageSources.js b/ui/src/sources/containers/ManageSources.js index b1f400fd3a..3c27fe8825 100644 --- a/ui/src/sources/containers/ManageSources.js +++ b/ui/src/sources/containers/ManageSources.js @@ -62,7 +62,7 @@ class ManageSources extends Component {

Configuration

- +
diff --git a/ui/src/sources/containers/SourcePage.js b/ui/src/sources/containers/SourcePage.js index 0cf5d1cf68..d407203812 100644 --- a/ui/src/sources/containers/SourcePage.js +++ b/ui/src/sources/containers/SourcePage.js @@ -125,7 +125,7 @@ export const SourcePage = React.createClass({
- +
diff --git a/ui/src/status/containers/StatusPage.js b/ui/src/status/containers/StatusPage.js index 5e07241d4c..50974161de 100644 --- a/ui/src/status/containers/StatusPage.js +++ b/ui/src/status/containers/StatusPage.js @@ -56,7 +56,7 @@ class StatusPage extends Component {

Status

- +
diff --git a/ui/src/style/chronograf.scss b/ui/src/style/chronograf.scss index d7ec2232fc..2be5b0290f 100644 --- a/ui/src/style/chronograf.scss +++ b/ui/src/style/chronograf.scss @@ -50,6 +50,7 @@ @import 'components/resizer'; @import 'components/search-widget'; @import 'components/source-indicator'; +@import 'components/source-selector'; @import 'components/tables'; // Pages diff --git a/ui/src/style/components/ceo-display-options.scss b/ui/src/style/components/ceo-display-options.scss index 94c707337f..44d77270d5 100644 --- a/ui/src/style/components/ceo-display-options.scss +++ b/ui/src/style/components/ceo-display-options.scss @@ -17,8 +17,6 @@ padding: 30px; flex: 1 0 0; margin-right: 8px; - - &:last-child { margin-right: 0; } } .display-options--cellx2 { flex: 2 0 0; @@ -29,8 +27,6 @@ color: $g11-sidewalk; @include no-user-select(); } - - .viz-type-selector { display: flex; flex-wrap: wrap; diff --git a/ui/src/style/components/react-tooltips.scss b/ui/src/style/components/react-tooltips.scss index df2227227b..bc75724235 100644 --- a/ui/src/style/components/react-tooltips.scss +++ b/ui/src/style/components/react-tooltips.scss @@ -33,6 +33,15 @@ $tooltip-code-color: $c-potassium; text-transform: none !important; cursor: default; + h1 { + font-size: 14px; + font-weight: 600; + margin: 0 0 6px 0; + line-height: 1.125em; + letter-spacing: 0; + font-family: $default-font; + } + p { margin: 0; width: 100%; @@ -70,7 +79,6 @@ $tooltip-code-color: $c-potassium; border-color: transparent transparent $tooltip-accent transparent !important; } - /* Kapacitor Style Tooltip */ &.kapacitor-tooltip { border-color: $c-rainforest !important; @@ -90,14 +98,13 @@ $tooltip-code-color: $c-potassium; .influx-tooltip__hover { @extend .influx-tooltip; - pointer-events: auto!important; + pointer-events: auto !important; &:hover { - visibility: visible!important; - opacity: 1!important; + visibility: visible !important; + opacity: 1 !important; } } - /* Question Mark Tooltip ---------------------------------------------- @@ -121,8 +128,7 @@ $qmark-tooltip-size: 15px; background-color: $g10-wolf; color: $g0-obsidian; margin: 0 5px; - transition: - background-color 0.25s ease; + transition: background-color 0.25s ease; } .question-mark-tooltip:hover { cursor: default; diff --git a/ui/src/style/components/source-indicator.scss b/ui/src/style/components/source-indicator.scss index a4e04c78df..60099d3b3a 100644 --- a/ui/src/style/components/source-indicator.scss +++ b/ui/src/style/components/source-indicator.scss @@ -18,4 +18,4 @@ font-size: 16px; margin: 0 4px; } -} \ No newline at end of file +} diff --git a/ui/src/style/components/source-selector.scss b/ui/src/style/components/source-selector.scss new file mode 100644 index 0000000000..13fcc48cd3 --- /dev/null +++ b/ui/src/style/components/source-selector.scss @@ -0,0 +1,18 @@ +/* + Source Selector component styles + ---------------------------------------------------------------- +*/ + +.source-selector { + display: flex; + align-items: center; + flex-wrap: nowrap; + flex: 1 0 0; + + h3 { + margin: 0 4px 0 0; + font-size: 17px; + color: $g13-mist; + @include no-user-select(); + } +} diff --git a/ui/src/style/pages/dashboards.scss b/ui/src/style/pages/dashboards.scss index b3761ec046..f0b07700c0 100644 --- a/ui/src/style/pages/dashboards.scss +++ b/ui/src/style/pages/dashboards.scss @@ -11,22 +11,49 @@ $dash-graph-options-arrow: 8px; ------------------------------------------------------ */ @keyframes refreshingSpinnerA { - 0% { transform: translate(-50%,-50%) scale(1.75); background-color: $g7-graphite; } - 33% { transform: translate(-50%,-50%) scale(1,1); } - 66% { transform: translate(-50%,-50%) scale(1,1); } - 100% { transform: translate(-50%,-50%) scale(1,1); } + 0% { + transform: translate(-50%, -50%) scale(1.75); + background-color: $g7-graphite; + } + 33% { + transform: translate(-50%, -50%) scale(1, 1); + } + 66% { + transform: translate(-50%, -50%) scale(1, 1); + } + 100% { + transform: translate(-50%, -50%) scale(1, 1); + } } @keyframes refreshingSpinnerB { - 0% { transform: translate(-50%,-50%) scale(1,1); } - 33% { transform: translate(-50%,-50%) scale(1.75); background-color: $g7-graphite; } - 66% { transform: translate(-50%,-50%) scale(1,1); } - 100% { transform: translate(-50%,-50%) scale(1,1); } + 0% { + transform: translate(-50%, -50%) scale(1, 1); + } + 33% { + transform: translate(-50%, -50%) scale(1.75); + background-color: $g7-graphite; + } + 66% { + transform: translate(-50%, -50%) scale(1, 1); + } + 100% { + transform: translate(-50%, -50%) scale(1, 1); + } } @keyframes refreshingSpinnerC { - 0% { transform: translate(-50%,-50%) scale(1,1); } - 33% { transform: translate(-50%,-50%) scale(1,1); } - 66% { transform: translate(-50%,-50%) scale(1.75); background-color: $g7-graphite; } - 100% { transform: translate(-50%,-50%) scale(1,1); } + 0% { + transform: translate(-50%, -50%) scale(1, 1); + } + 33% { + transform: translate(-50%, -50%) scale(1, 1); + } + 66% { + transform: translate(-50%, -50%) scale(1.75); + background-color: $g7-graphite; + } + 100% { + transform: translate(-50%, -50%) scale(1, 1); + } } /* @@ -93,7 +120,6 @@ $dash-graph-options-arrow: 8px; top: 0; width: 100%; height: 100%; - } .dygraph .dygraph-child { position: absolute; @@ -124,9 +150,7 @@ $dash-graph-options-arrow: 8px; font-weight: 600; font-size: 13px; color: $g14-chromium; - transition: - color 0.25s ease, - background-color 0.25s ease; + transition: color 0.25s ease, background-color 0.25s ease; &.dash-graph--heading-draggable:hover { cursor: move; background-color: $g5-pepper; @@ -146,30 +170,41 @@ $dash-graph-options-arrow: 8px; line-height: $dash-graph-heading; width: calc(100% - 53px); padding-left: 10px; - transition: - color 0.25s ease, - background-color 0.25s ease, + transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease; } .dash-graph--name.dash-graph--name__default { font-style: italic; } - -.dash-graph--custom-time { - font-style: normal; - font-family: $code-font; - color: $c-pool; - background-color: $g2-kevlar; +.dash-graph--custom-indicators { height: 24px; - font-size: 10px; - line-height: 24px; border-radius: 3px; - padding: 0 7px; position: absolute; top: 3px; - right: 2px; -} + right: 0; + display: flex; + > .custom-indicator, + > .source-indicator { + font-size: 10px; + line-height: 24px; + padding: 0 7px; + font-style: normal; + font-family: $code-font; + color: $c-pool; + background-color: $g2-kevlar; + margin-right: 2px; + border-radius: 3px; + } + > .source-indicator { + height: 24px; + + > .icon { + font-size: 12px; + margin: 0; + } + } +} .dash-graph-context { z-index: 2; position: absolute; @@ -187,9 +222,7 @@ $dash-graph-options-arrow: 8px; font-size: 12px; position: relative; color: $g11-sidewalk; - transition: - color 0.25s ease, - background-color 0.25s ease; + transition: color 0.25s ease, background-color 0.25s ease; &:hover, &.active { @@ -197,13 +230,15 @@ $dash-graph-options-arrow: 8px; color: $g20-white; background-color: $g5-pepper; } - &:first-child {margin-right: 2px;} + &:first-child { + margin-right: 2px; + } > .icon { position: absolute; top: 50%; left: 50%; - transform: translate(-50%,-50%); + transform: translate(-50%, -50%); } } .dash-graph-context--confirm { @@ -230,7 +265,7 @@ $dash-graph-options-arrow: 8px; border-bottom-color: $c-curacao; left: 50%; top: 0; - transform: translate(-50%,-100%); + transform: translate(-50%, -100%); transition: border-color 0.25s ease; } @@ -241,7 +276,6 @@ $dash-graph-options-arrow: 8px; &:hover:before { border-bottom-color: $c-dreamsicle; } - } /* Presentation Mode */ @@ -257,7 +291,7 @@ $dash-graph-options-arrow: 8px; .graph-panel__refreshing { position: absolute; top: -18px !important; - transform: translate(0,0); + transform: translate(0, 0); right: 50%; transform: translateX(50%); width: 16px; @@ -270,12 +304,24 @@ $dash-graph-options-arrow: 8px; border-radius: 50%; position: absolute; top: 50%; - transform: translate(-50%,-50%); + transform: translate(-50%, -50%); } - div:nth-child(1) {left: 0; animation: refreshingSpinnerA 0.8s cubic-bezier(0.645, 0.045, 0.355, 1) infinite; } - div:nth-child(2) {left: 50%; animation: refreshingSpinnerB 0.8s cubic-bezier(0.645, 0.045, 0.355, 1) infinite; } - div:nth-child(3) {left: 100%; animation: refreshingSpinnerC 0.8s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;} + div:nth-child(1) { + left: 0; + animation: refreshingSpinnerA 0.8s cubic-bezier(0.645, 0.045, 0.355, 1) + infinite; + } + div:nth-child(2) { + left: 50%; + animation: refreshingSpinnerB 0.8s cubic-bezier(0.645, 0.045, 0.355, 1) + infinite; + } + div:nth-child(3) { + left: 100%; + animation: refreshingSpinnerC 0.8s cubic-bezier(0.645, 0.045, 0.355, 1) + infinite; + } } /* @@ -291,7 +337,7 @@ $dash-graph-options-arrow: 8px; } .react-grid-item { &.resizing { - background-color: fade-out($g3-castle,0.09); + background-color: fade-out($g3-castle, 0.09); border-color: $c-pool; border-image-slice: 3%; border-image-repeat: initial; @@ -301,13 +347,14 @@ $dash-graph-options-arrow: 8px; z-index: 3; & > .react-resizable-handle { - &:before, &:after { + &:before, + &:after { background-color: $c-comet; } } } &.react-draggable-dragging { - background-color: fade-out($g3-castle,0.09); + background-color: fade-out($g3-castle, 0.09); border-color: $c-pool; border-image-slice: 3%; border-image-repeat: initial; @@ -341,14 +388,15 @@ $dash-graph-options-arrow: 8px; } &:before { width: 20px; - transform: translate(-50%,-50%) rotate(-45deg); + transform: translate(-50%, -50%) rotate(-45deg); } &:after { width: 12px; - transform: translate(-3px,2px) rotate(-45deg); + transform: translate(-3px, 2px) rotate(-45deg); } &:hover { - &:before, &:after { + &:before, + &:after { background-color: $c-comet; } } diff --git a/ui/src/style/pages/overlay-technology.scss b/ui/src/style/pages/overlay-technology.scss index 74c7fa6e6a..8cc608ac2d 100644 --- a/ui/src/style/pages/overlay-technology.scss +++ b/ui/src/style/pages/overlay-technology.scss @@ -44,10 +44,21 @@ $overlay-z: 100; border: 0; background-color: $g2-kevlar; } + .overlay-controls .nav-tablist { + width: 200px; + + li { + white-space: nowrap; + justify-content: center; + flex: 1 0 50%; + } + } .overlay-controls--right { display: flex; align-items: center; flex-wrap: nowrap; + justify-content: flex-end; + flex: 1 0 0; .toggle { margin: 0 0 0 5px; diff --git a/ui/src/style/theme/bootstrap-theme.scss b/ui/src/style/theme/bootstrap-theme.scss index dc9e8897fd..a78dfc0179 100755 --- a/ui/src/style/theme/bootstrap-theme.scss +++ b/ui/src/style/theme/bootstrap-theme.scss @@ -1293,7 +1293,7 @@ div.btn > .icon, button.btn > .icon, input.btn > .icon { position: relative; - top: -.5px; + top: -1px; margin: 0 4px 0 0; font-size: 1em; } @@ -3727,9 +3727,10 @@ fieldset[disabled] button.btn-link-alert:after { } .label { display: inline-block; - padding: .2em .6em; - font-size: .75em; - line-height: 1.2em; + padding: .3em .5em; + margin: 0 3px; + font-size: .9em; + line-height: 1.1em; vertical-align: middle; user-select: none; } @@ -3887,7 +3888,7 @@ p .label { text-overflow: ellipsis; white-space: nowrap; - flex: 1 0 0%; + flex: 1 0 0; } .dropdown-toggle.btn-xs .caret { right: 7px; @@ -4010,14 +4011,10 @@ p .label { } .dropdown-menu li.dropdown-item { position: relative; - display: flex; width: 100%; padding: 0; margin: 0; user-select: none; - - align-items: center; - justify-content: space-between; } .dropdown-menu li.dropdown-item, .dropdown-menu li.dropdown-item:hover { @@ -4034,14 +4031,14 @@ p .label { } .dropdown-menu li.dropdown-item > a { padding: 7px 9px; + overflow: hidden; font-size: 13px; font-weight: 500; line-height: 13px; color: #f0fcff; + text-overflow: ellipsis; outline: none; transition: color .25s ease; - - flex: 1 0 0%; } .dropdown-menu li.dropdown-item > a, .dropdown-menu li.dropdown-item > a:hover, @@ -4073,6 +4070,21 @@ p .label { background: linear-gradient(to right, #326bba 0%, #22adf6 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@color1', endColorstr='@color2', GradientType=1); } +.dropdown-menu .dropdown-sub-item { + display: inline-block; + margin-top: 4px; + font-size: 12px; + line-height: 12px; + white-space: pre-wrap; + opacity: .66; +} +.dropdown-menu .dropdown-sub-item.dropdown-sub-item--success { + color: #a5f3b4; + opacity: 1; +} +.dropdown-menu .dropdown-sub-item span.icon { + margin-right: 3px; +} .dropdown .dropdown-menu .dropdown-actions { position: absolute; top: 50%; @@ -5005,6 +5017,7 @@ p .label { padding: 0; margin: 0; overflow: hidden; + background-color: #383846; border: 2px solid #383846; border-radius: 4px; @@ -5013,7 +5026,7 @@ p .label { .nav-tablist > li { display: flex; padding: 0 14px; - margin: 0; + margin: 0 2px 0 0; font-size: 15px; font-weight: 600; color: #999dab; @@ -5045,6 +5058,9 @@ p .label { cursor: not-allowed; background-color: #202028; } +.nav-tablist > li:last-child { + margin-right: 0; +} /* Size Modifiers */ .nav-tablist.nav-tablist-lg { height: 46px; @@ -5336,24 +5352,28 @@ pre[data-lang="js"]:before { .form-control::-webkit-input-placeholder, textarea::-webkit-input-placeholder, input::-webkit-input-placeholder { + font-style: italic; font-weight: 500 !important; color: #757888; } .form-control::-moz-placeholder, textarea::-moz-placeholder, input::-moz-placeholder { + font-style: italic; font-weight: 500 !important; color: #757888; } .form-control:-ms-input-placeholder, textarea:-ms-input-placeholder, input:-ms-input-placeholder { + font-style: italic; font-weight: 500 !important; color: #757888; } .form-control:-moz-placeholder, textarea:-moz-placeholder, input:-moz-placeholder { + font-style: italic; font-weight: 500 !important; color: #757888; } diff --git a/ui/src/utils/buildQueriesForGraphs.js b/ui/src/utils/buildQueriesForGraphs.js index 39ff302e5f..7b2a1691fa 100644 --- a/ui/src/utils/buildQueriesForGraphs.js +++ b/ui/src/utils/buildQueriesForGraphs.js @@ -8,7 +8,17 @@ const buildQueries = (proxy, queryConfigs, timeRange) => { }) const queries = statements.filter(s => s.text !== null).map(s => { - return {host: [proxy], text: s.text, id: s.id, queryConfig: s.queryConfig} + let queryProxy = '' + if (s.queryConfig.source) { + queryProxy = `${s.queryConfig.source.links.proxy}` + } + + return { + host: [queryProxy || proxy], + text: s.text, + id: s.id, + queryConfig: s.queryConfig, + } }) return queries