Commit Graph

206 Commits (b1f16adc7b1409858719d3fd439cf367acd86b43)

Author SHA1 Message Date
Michael de Sa 66eab84b40 Set ID on retrieved user from boltdb
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 19:32:35 -04:00
Michael de Sa f712d2204b Add roles to boltdb UsersStore
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 19:31:44 -04:00
Jared Scheib aedaafe426 Update bolt UsersStore for updated chronograf User
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 19:31:26 -04:00
Michael Desa fd50f2fc7e Refactor bolt.RolesStore to use bolt.UsersStore
Add definitions for user roles and permissions in chronograf package

Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-12 19:31:15 -04:00
Michael de Sa 3e3ca4d1a2 Remove old bolt implementation of RoleStore
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 19:31:06 -04:00
Jared Scheib 4db4ae5bcf Refactor Roles & Protobuf to be part of User msg
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-12 19:30:50 -04:00
Michael Desa 4be172d988 WIP: Add BoltDB implementation of RolesStore
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 19:30:34 -04:00
Jared Scheib b7c78f4c56 Add Role and Permission messages to protobuf
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-12 19:30:09 -04:00
Jared Scheib 2d88f15fdf Use string IDs in JSON res and req for Users
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-10 12:27:55 -07:00
Jared Scheib eb6c212023 Implement CRUD routes & operations for Chronograf User
Move source Users code into source_users and source_users_test files.
Use the UsersStore for both InfluxDB and Chronograf users.

Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-09 14:16:24 -07:00
Chris Goller 0e6a06d663 Update dashboard cells to have optional data source URI. 2017-10-02 12:50:42 -07:00
Andrew Watkins fac768c142 Update tests for scale to default to linear 2017-08-24 09:23:22 -07:00
Andrew Watkins 04f25f6915 Default scale to 'linear' 2017-08-23 21:08:17 -07:00
Tim Raymond c6bcdcb884 Add Axes to Cells on Layouts
This allows a creator of a layout to specify the visible extents of
graphs for individual cells. For example, a cell displaying a
percentage could be limited to values between 0 and 100.

Existing canned layouts need to updated as a separate step. However,
this adds support for Axes to appear in them as well.
2017-08-23 16:08:32 -07:00
Tim Raymond 715cdc9364 Add Scale attribute to Cell Axis
This allows clients to specify the magnitude of numbers found on a
particular axis.
2017-08-23 15:58:28 -07:00
Tim Raymond f6e029557b Add Prefix, Suffix, and Base to Axes
We would like to add additional user-configurable options to the display
of axes on Dashboards. This adds three fields to expand settings that
the frontend can persist through the API.

One field of interest here is the "Base" field which controls when and
how axes transition the display of values such as bytes, kilobytes,
megabytes, etc. By default, it's returned from the API as "10" to
indicate decimal, but can be set to anything the frontend wishes--the
immediate differing value will be "2" for the aforementioned use case.
2017-08-23 15:58:28 -07:00
Tim Raymond 4c2bb63553 Add Label to Layout Cells' Axes
We added a Label to DashboardCells' Axes. This brings Layout Cells into
parity with them.
2017-08-10 13:53:00 -07:00
Tim Raymond a3c0ae82f9 Update Bounds to follow string format
We updated DashboardCell to use string bounds rather than the [2]int64{}
we were using before. This brings the Layout cells to parity with that
2017-08-10 13:52:51 -07:00
Tim Raymond f6e1be290c Add Axes to Cells on Layouts
This allows a creator of a layout to specify the visible extents of
graphs for individual cells. For example, a cell displaying a
percentage could be limited to values between 0 and 100.

Existing canned layouts need to updated as a separate step. However,
this adds support for Axes to appear in them as well.
2017-08-10 13:52:43 -07:00
Tim Raymond 532a6a8c48 Merge branch 'master' into feature/1602-graph-bounds-setting
Also removed LegacyBounds marshaling since it was no longer necessary

Conflicts resolved:
	bolt/internal/internal.go
	bolt/internal/internal.pb.go
	bolt/internal/internal.proto
	bolt/internal/internal_test.go
	chronograf.go
	server/cells_test.go
	server/dashboards_test.go
	server/swagger.json
2017-08-02 11:29:29 -04:00
Tim Raymond e545f91d8f Add Label to DashboardCell Axis
It's useful for the frontend to be able to specify a label on a
particular axis. This adds a property to Axis to facilitate that.
2017-08-02 11:12:47 -04:00
Tim Raymond 803906e25a Return nothing from previously set bounds
Previously, if bounds were not set, the default value that would be
returned was ["0", "0"], which is incorrect. This now returns [] when
there was nothing set for a particular axis.
2017-08-02 10:58:01 -04:00
Tim Raymond 2ff3e27e1f Convert Axis Bounds to []string
Due to various limitations with the previous implementation of Bounds as
a [2]int64{}, we've decided to change this to a []string{}. This will
allow clients to store arbitrary data specifying a bound and interpret
it as they wish.
2017-07-31 16:35:53 -04:00
Tim Raymond 543b8703b3 Add tests for Dashboard protobuf & misc renaming
There were previously no tests around Dashboard serialization to
protobuf, so this patch adds coverage for that. Also, the `go-cmp`
package has been introduced to replace our usage of `reflect.DeepEqual`
going forward because it has better comparison features that make it
more stable across Go versions and produces nice diffs in tests when
they fail, reducing the need for debug lines and manual inspection.
2017-07-24 14:04:23 -04:00
Tim Raymond a5bdc5ff61 s/DashboardRange/Axis, format protobufs, 64-bit
"Axis" is a more consistent and appropriate name. Also, the formatting
the protobufs was all over the place, so this has been made consistent
using a first-column \t. Furthermore, a vim modeline was added to the
bottom to make it easier for editors to autoconfigure themselves to the
right format, since protobufs are not something that we edit everyday.

Also, 32-bit values have been substituted for 64-bit values in Protobuf
definitions.
2017-07-24 14:03:48 -04:00
Tim Raymond cbbfd312ca Add Axes to Dashboard Cells
The frontend would like to store viewport information for each cell so
that visualizations are zoomed to the proper extents upon rendering.
This adds a property to cells called "axes" which takes the following
shape:

```
{
   "axes" : {
      "y" : {
         "bounds" : [
            0,
            2
         ]
      },
      "y2" : {
         "bounds" : [
            1,
            3
         ]
      }
   }
}
```

Bounds specify the visible range for the axis, and are a 2-tuple of the
form [lower, upper]. Bounds are not implicitly inclusive or
exclusive--that determination is left for clients to make. Also, there
are no restrictions on the naming of axes.
2017-07-24 13:45:28 -04:00
Tim Raymond d1443b1dbd Add tests for Dashboard protobuf & misc renaming
There were previously no tests around Dashboard serialization to
protobuf, so this patch adds coverage for that. Also, the `go-cmp`
package has been introduced to replace our usage of `reflect.DeepEqual`
going forward because it has better comparison features that make it
more stable across Go versions and produces nice diffs in tests when
they fail, reducing the need for debug lines and manual inspection.
2017-07-21 11:11:30 -04:00
Tim Raymond 617fc38b14 s/DashboardRange/Axis, format protobufs, 64-bit
"Axis" is a more consistent and appropriate name. Also, the formatting
the protobufs was all over the place, so this has been made consistent
using a first-column \t. Furthermore, a vim modeline was added to the
bottom to make it easier for editors to autoconfigure themselves to the
right format, since protobufs are not something that we edit everyday.

Also, 32-bit values have been substituted for 64-bit values in Protobuf
definitions.
2017-07-20 14:42:51 -04:00
Tim Raymond f05c1d0774 Add Axes to Dashboard Cells
The frontend would like to store viewport information for each cell so
that visualizations are zoomed to the proper extents upon rendering.
This adds a property to cells called "axes" which takes the following
shape:

```
{
   "axes" : {
      "y" : {
         "bounds" : [
            0,
            2
         ]
      },
      "y2" : {
         "bounds" : [
            1,
            3
         ]
      }
   }
}
```

Bounds specify the visible range for the axis, and are a 2-tuple of the
form [lower, upper]. Bounds are not implicitly inclusive or
exclusive--that determination is left for clients to make. Also, there
are no restrictions on the naming of axes.
2017-07-19 10:46:32 -04:00
Chris Goller 8dc08278bd Add JWT shared secret influxdb auth
Refactor --new-sources to simplify adding shared secrets
2017-07-19 01:39:06 -05:00
Tim Raymond fd5036ed20 Add support for :autoGroupBy: template variable
This adds support for dynamic template variables that compute something
about themselves given some additional context.
2017-06-13 14:59:56 -04:00
Andrew Watkins 92bd5d10b4 Resolve conflicts
Conflicts:
	ui/src/utils/influxql.js
2017-05-05 10:01:26 -07:00
Hunter Trujillo 2373725cb8 Fix Go compiled file. 2017-04-26 15:29:20 -06:00
Hunter Trujillo 116c2e3c23 Merge branch 'master' into feature/template-variables
# Conflicts:
#	bolt/internal/internal.pb.go
#	ui/src/CheckSources.js
#	ui/src/dashboards/actions/index.js
#	ui/src/dashboards/containers/DashboardPage.js
#	ui/src/data_explorer/components/Visualization.js
#	ui/src/shared/components/AutoRefresh.js
#	ui/src/shared/components/Dropdown.js
2017-04-25 17:08:55 -06:00
Jade McGough 744f733a87 DRY bolt/servers.go code 2017-04-21 13:07:32 -07:00
Jade McGough cbdf067a56 persist the currently active kapacitor in boltdb 2017-04-21 12:42:35 -07:00
Chris Goller 5c64a24760 Fix whitespace in proto 2017-04-20 14:35:59 -05:00
Chris Goller fc40e344c8 Add template variables to bolt storage 2017-04-20 14:31:29 -05:00
Chris Goller 46f4f43692 Update kapacitors rule's to use AST and kapacitor directly 2017-04-05 20:04:42 -05:00
Jared Scheib b90ff76670 Introduce ability to edit a dashboard cell
* Correct documentation for dashboards

* Exclude .git and use 'make run-dev' in 'make continuous'

* Fix dashboard deletion bug where id serialization was wrong

* Commence creation of overlay technology, add autoRefresh props to DashboardPage

* Enhance overlay magnitude of overlay technology

* Add confirm buttons to overlay technology

* Refactor ResizeContainer to accommodate arbitrary containers

* Refactor ResizeContainer to require explicit ResizeTop and ResizeBottom for clarity

* Add markup and styles for OverlayControls

* CellEditorOverlay needs a larger minimum bottom height to accommodate more things

* Revert Visualization to not use ResizeTop or flex-box

* Remove TODO and move to issue

* Refactor CellEditorOverlay to allow selection of graph type

* Style Overlay controls, move confirm buttons to own stylesheet

* Fix toggle buttons in overlay so active is actually active

* Block user-select on a few UI items

* Update cell query shape to support Visualization and LayoutRenderer

* Code cleanup

* Repair fixture schema; update props for affected components

* Wired up selectedGraphType and activeQueryID in CellEditorOverlay

* Wire up chooseMeasurements in QueryBuilder

Pass queryActions into QueryBuilder so that DataExplorer can provide
actionCreators and CellEditorOverlay can provide functions that
modify its component state

* semicolon cleanup

* Bind all queryModifier actions to component state with a stateReducer

* Overlay Technologies™ can add and delete a query from a cell

* Semicolon cleanup

* Add conversion of InfluxQL to QueryConfig for dashboards

* Update go deps to add influxdb at af72d9b0e4

* Updated docs for dashboard query config

* Update CHANGELOG to mention InfluxQL to QueryConfig

* Make reducer’s name more specific for clarity

* Remove 'table' as graphType

* Make graph renaming prettier

* Remove duplicate DashboardQuery in swagger.json

* Fix swagger to include name and links for Cell

* Refactor CellEditorOverlay to enable graph type selection

* Add link.self to all Dashboard cells; add bolt migrations

* Make dash graph names only hover on contents

* Consolidate timeRange format patterns, clean up

* Add cell endpoints to dashboards

* Include Line + Stat in Visualization Type list

* Add cell link to dashboards

* Enable step plot and stacked graph in Visualization

* Overlay Technologies are summonable and dismissable

* OverlayTechnologies saves changes to a cell

* Convert NameableGraph to createClass for state

This was converted from a pure function to encapsulate the state of the
buttons. An attempt was made previously to store this state in Redux,
but it proved too convoluted with the current state of the reducers for
cells and dashboards. Another effort must take place to separate a cell
reducer to manage the state of an individual cell in Redux in order for
this state to be sanely kept in Redux as well.

For the time being, this state is being kept in the component for the
sake of expeditiousness, since this is needed for Dashboards to be
released. A refactor of this will occur later.

* Cells should contain a links key in server response

* Clean up console logs

* Use live data instead of a cellQuery fixture

* Update docs for dashboard creation

* DB and RP are already present in the Command field

* Fix LayoutRenderer’s understanding of query schema

* Return a new object, rather that mutate in place

* Visualization doesn’t use activeQueryID

* Selected is an object, not a string

* QueryBuilder refactored to use query index instead of query id

* CellEditorOverlay refactored to use query index instead of query id

* ConfirmButtons doesn’t need to act on an item

* Rename functions to follow convention

* Queries are no longer guaranteed to have ids

* Omit WHERE and GROUP BY clauses when saving query

* Select new query on add in OverlayTechnologies

* Add click outside to dash graph menu, style menu also

* Change context menu from ... to a caret

More consistent with the rest of the UI, better affordance

* Hide graph context menu in presentation mode

Don’t want people editing a dashboard from presentation mode

* Move graph refreshing spinner so it does not overlap with context menu

* Wire up Cell Menu to Overlay Technologies

* Correct empty dashboard type

* Refactor dashboard spec fixtures

* Test syncDashboardCell reducer

* Remove Delete button from graph dropdown menu (for now)

* Update changelog
2017-03-23 17:12:33 -07:00
Chris Goller 9ac300cf19 Update to fix go linter issues 2017-03-06 10:11:52 -06:00
Chris Goller 1f9be2e4aa Merge branch 'master' into feature/#54-tr-enterprise-client
Conflicts:
	bolt/internal/internal.pb.go
2017-02-24 13:02:32 -06:00
Chris Goller 1e2de1d475 Add tests for bolt user store 2017-02-21 22:15:22 -06:00
Chris Goller 2444890a40 Fix bolt sources go vet 2017-02-21 22:15:07 -06:00
Chris Goller 7a42a6611a Update user bolt bucket to be different b/c schema change 2017-02-21 18:48:25 -06:00
Chris Goller b304ac256e Add get of all users for a data source 2017-02-17 15:13:51 -06:00
Chris Goller 2a2e188560 Refactor users and add client usersstore 2017-02-17 13:37:00 -06:00
Jade McGough a7742fb9c1 add metaURL to source 2017-02-09 23:14:04 -06:00
Chris Goller a4aa900bf8 Merge pull request #852 from influxdata/feature/kapacitor-detail-field
Update kapacitor alert rule to have detail field
2017-02-08 20:50:48 -06:00
Chris Goller 7d0b7781d4 Update kapacitor alert rule to have detail field 2017-02-07 17:09:14 -06:00
Chris Goller 75cd6cebff Remove explorations from backend server 2017-02-01 15:09:02 -06:00
Jade McGough 626ee4081e fix bugs 2017-01-27 04:51:31 -08:00
Jade McGough e460f32dbc augment boltdb to store dashboard query objects 2017-01-27 04:29:38 -08:00
Jade McGough 1140179a4b fix dashboard unmarshalling 2017-01-27 01:23:19 -08:00
Chris Goller 8e0376cec4 Add insecureSkipVerify option to source to accept all influxdb certs
The insecureSkipVerify defaults to false, but when true, instructs
the server to accept any certificate coming from the InfluxDB server.
2017-01-04 19:35:07 -06:00
Jade McGough 7a8d0ba4a5 clean up pointer usage 2016-12-15 13:37:11 -08:00
Jade McGough f42f7166f9 fix bugs 2016-12-15 11:27:06 -08:00
Jade McGough 417e923fe6 dashboard, not dashboards 2016-12-15 00:50:38 -08:00
Jade McGough 899fcbce86 be sure to create dashboardsbucket in bolt 2016-12-15 00:49:43 -08:00
Jade McGough bdf65400f2 formatting 2016-12-14 12:12:20 -08:00
Jade McGough 77cab972a6 add update func to dashboards 2016-12-14 00:12:36 -08:00
Jade McGough de0efa0b27 omg it compiled 2016-12-13 23:56:26 -08:00
Jade McGough 16327a87d7 wow did it actually just compile? 2016-12-13 23:22:54 -08:00
Jade McGough 582bde4657 fix errors 2016-12-13 22:57:52 -08:00
Jade McGough 282394c01d fix issues in dashboards internal 2016-12-13 16:19:42 -08:00
Jade McGough 2bdedc0683 update internal.pb.go 2016-12-13 03:07:24 -08:00
Jade McGough 39ba29b893 add and get methods for dashboard 2016-12-13 02:44:19 -08:00
Jade McGough 76fb9a95c4 add marshal/unmarshal for dashboards 2016-12-13 02:25:26 -08:00
Jade McGough 9ba8820c42 WIP 2016-12-08 19:28:40 -08:00
Jade McGough dc95ca2b6e add type to cell interface 2016-12-06 02:48:12 -08:00
Jade McGough f0767d4505 add type to marshal/unmarshal 2016-12-05 21:46:30 -08:00
Jade McGough 5088c76a12 add type to Cell 2016-12-05 21:27:47 -08:00
Chris Goller 38394152d6 Update layout ylabel and yrange to be properties of the query. 2016-11-30 14:13:15 -08:00
Chris Goller 761ec9d66d Add ylabels and yranges to layouts 2016-11-30 14:04:32 -08:00
Tim Raymond 4ba7e10931 Fix template layout ordering
This divides templates into two classes: autoflow and static. This is
controlled by a boolean "autoflow" property on templates. Any autoflow
templates that will be rendered for a host, have their cells arranged in
a left-to-right, top-to-bottom fashion.

Static templates, are assumed to have precise positioning information
for their graphs. The only adjustment made to them will be a translation
of their Y coords so they do not overlap other layouts.

The autoflow templates, after processing, become a static layout as
defined above and are positioned accordingly.
2016-11-29 17:41:19 -05:00
Will Piers c749203b11 Dont render routes if user is not authenticated 2016-11-21 14:20:33 -07:00
Will Piers fe14fd74e3 Add users endpoints/storage plus me endpoint 2016-11-21 14:19:57 -07:00
Chris Goller 8f890378e2 Fix tab spacing in protobuf and swagger 2016-11-18 16:07:53 -06:00
Chris Goller 6067d5aaa8 Update sources endpoint to take optional telegraf database name. 2016-11-18 16:07:53 -06:00
Chris Goller 50044a8e89 Fix problems found by https://github.com/dominikh/go-staticcheck 2016-11-14 11:04:32 -06:00
Chris Goller 6484509b56 Merge pull request #403 from influxdata/bugfix/tr-singular-default-source
Make API guarantee one default source at all times
2016-11-08 11:57:13 -06:00
Tim Raymond b0860ca903 Make argument order of setRandomDefault consistent
Most of the other private CRUD methods have a consistent argument order
of a context, a source, then a transaction. setRandomDefault had two of
these args transposed, so this swaps them to be consistent with the rest
of the methods.
2016-11-08 12:29:29 -05:00
Tim Raymond d4f2434399 Make context.Context the first argument
This is the convention.
2016-11-08 12:14:06 -05:00
Tim Raymond b8e335fbee Prevent deadlocks with source default enforcement
Previously, the logic to enforce on default source relied on the
public-facing CRUD methods already provided by SourcesStore. This was
prone to deadlocks due to the possibility of acquiring a transaction
within a transaction.  This extracts the logic that was performed within
the transactions of each CRUD action and makes the private methods that
receive a *bolt.Tx.  This allows the convenience methods that enforce
default source to use this private API and provide the transaction from
its caller. This ensures that there is only ever one transaction
acquired by each expored
CRUD method.
2016-11-08 12:09:35 -05:00
Chris Goller 8d97980aad Add wheres to layouts 2016-11-07 20:35:46 -06:00
Tim Raymond 493befbdc7 Enforce default constraints on first/last source
Whenver sources are present, there should be exactly one default source.
Prior to this commit, it was possible to add the first source as a
non-default source and circumvent this invariant. This unfortunately
requires a bit of special-casing logic in s.Add and requires a query to
fetch the number of sources currently persisted.

Tests have been added to cover this as well as deleting the final
source, to ensure that there aren't any odd indexing panics that might
result from trying to find another candidate default source when
deleting.
2016-11-07 18:13:23 -05:00
Tim Raymond d03d47b9ad Extract Default source enforcement logic
Enforcing the constraint that there be exactly one default source
whenever there are sources present isn't really a concern of the
traditional CRUD methods that are provided by SourcesStore. This makes
this separation a little more explicit and provides a place to glue some
documentation onto what would otherwise be a confusing bit of business
logic in the write path of SourcesStore.
2016-11-07 18:13:23 -05:00
Tim Raymond 193765ead2 Auto-set default source on Add and Delete
Previously, when adding a new default source, it was possible to create
more than one default source, since the previous default would not be unset.

Implementing this revealed another issue where deleting the default
source would leave no default set. If the default source is deleted now,
another source is chosen to be the new default.
2016-11-07 18:13:23 -05:00
Tim Raymond 4a02ad7525 Enforce single default source on update
This ensures that there will only be on default source upon setting a
new default by unsetting the default flag on all other sources. This
only happens when the source to be updated has Default set to true to
avoid a performance hit when updating other attributes.
2016-11-07 18:13:23 -05:00
Chris Goller b274363149 Add groupby options to layouts 2016-11-07 16:31:48 -06:00
Chris Goller 73cbc4abc6 Fix bolt scoping and minor kapacitor tickscript updates 2016-11-03 22:25:41 -05:00
Chris Goller a95c998300 Update to store alert information in boltdb 2016-11-03 19:52:13 -05:00
Tim Raymond 3dc2fa9592 Add I and Name to protobufs
I and Name were added to support react-grid-layout. They were added to
the chronograf types, but not to the protobuf definitions, so the only
layouts that could make use of them were the canned variety. This allows
layouts' I and Name to be persisted as well.
2016-10-28 18:03:34 -04:00
Chris Goller 12348d72cb Refactor to remove autogenerated code. 2016-10-26 22:10:52 -05:00
Chris Goller 8911b0fd78 Update name to chronograf 2016-10-20 09:39:40 -05:00
Chris Goller f6770830f9 Update layouts to use ID generation. 2016-10-10 21:00:49 -05:00
Chris Goller c9dc1d492a Add pre-canned application layout store. 2016-10-10 20:40:16 -05:00
Chris Goller 41d6341a36 Update layout to use uuid v4 string as ID parameter. 2016-10-10 17:08:52 -05:00
Chris Goller 7aec0e93bf Add ability to to filter layouts by apps or measurements. 2016-10-06 18:31:56 -05:00
Chris Goller 21ec6cd72f Add layouts endpoint and storage 2016-10-05 23:43:13 -05:00
Chris Goller 53537041a9 Fix exploration update time; fix exploration PATCH to be RFC 7396; update exploration PATCH to return 200 and body. 2016-10-04 15:33:32 -05:00
Chris Goller 5f24c1994e Update kapacitor endpoint to be scoped to sources 2016-10-04 12:49:12 -05:00
Chris Goller ab6d177dc6 Add kapacitors endpoint (persist/proxy/rest) 2016-10-04 12:48:36 -05:00
Chris Goller 2b56cae221 Add persistence to sources and use bolt by default 2016-09-30 15:39:27 -05:00
gunnaraasen 16b79cebec Update exploration store interface to return exploration on add 2016-09-29 10:24:54 -04:00
gunnaraasen e45dbdc630 Refactor the exploration store 2016-09-29 09:38:35 -04:00