Commit Graph

3337 Commits (9c9bc6a0b4b4ec0d01a69c94c14001a75b15102d)

Author SHA1 Message Date
Hunter Trujillo 9c9bc6a0b4 Merge pull request #1433 from influxdata/bugfix/router-fix
Fall back to useRouterHistory method.
2017-05-08 17:42:12 -07:00
Luke Morris 3b9acd0848 Remove redundant if/else 2017-05-08 17:33:07 -07:00
Luke Morris ebee9f7dca Cowabunga, it's dashboard 🕑 2017-05-08 17:12:04 -07:00
Jade McGough bf8e6f62a7 Merge pull request #1417 from influxdata/fix/safari-presentation-mode
support escaping from presentation mode with safari
2017-05-08 16:39:56 -07:00
Jade McGough 3bbde66c8b add comment 2017-05-08 16:39:14 -07:00
Jade McGough 84f3957658 Yehuda says to use keyCode for cross-browser support 2017-05-08 16:29:54 -07:00
Hunter Trujillo 92f84e7a83 Update CHANGELOG. 2017-05-08 16:22:45 -07:00
Jade McGough da704c0b1e avoid using deprecated keydown attribute 2017-05-08 16:10:05 -07:00
Hunter Trujillo 3955b935c7 Fall back to useRouterHistory method. 2017-05-08 16:01:06 -07:00
Jade McGough 556e756b0e update changelog 2017-05-08 15:35:02 -07:00
Jade McGough 3a728e4927 support escaping from presentation mode with safari 2017-05-08 15:31:13 -07:00
Regan Kuchan 3642ceb198 Merge pull request #1414 from influxdata/chronorc
Updates for 1.3.0~rc1
2017-05-08 14:57:23 -07:00
Regan Kuchan d27234be55 Updates for 1.3.0~rc1 2017-05-08 14:56:57 -07:00
Timothy J. Raymond ea9ec6e636 Merge pull request #1407 from influxdata/1369-fix/router_basepath
Fix OAuth when using a Basepath
2017-05-08 14:48:06 -07:00
Tim Raymond 3fdc1bd526 Update CHANGELOG with OAuth/basepath fix 2017-05-08 14:40:50 -07:00
Tim Raymond 24160ed6ef Force prefixing in several locations
The Basepath option should be applied in anything that will be consumed
by the React application. This is because from its perspective, the
proxy sitting between it and the backend wants those prefixes regardless
of what it does with them before handing the request back to the
Chronograf backend. Consequently, there's situations in the backend
where we need to have the `opts.Basepath` or the `basepath` that we
alter when `opts.PrefixRoutes` is set. The `basepath` is strictly for
altering routing decisions made by the backend.

There's subtle places where routes are supplied to the frontend that
need to always have the `opts.Basepath` set as well. Another commit
addressed the "Location" header of Redirects, for example.
2017-05-08 14:40:50 -07:00
Tim Raymond 5cf21f6cbd Add PrefixedRedirect function
The router that we use has a feature that will automatically redirect
routes in certain situations where it feels a trailing slash would be
appropriate. Because the underlying router is totally unaware of
upstream prefixing activity, the "Location" that it sends clients to is
incorrect because it doesn't have the prefix.

This introduces a middleware that catches any downstream 3XX class
responses and replaces the Location header with the prefixed version of
it, plus a trailing slash. It does this only when the prefix has not
been applied already by some downstream middleware.
2017-05-08 14:40:50 -07:00
Tim Raymond ccf7964e78 Add HTTP status code to logs
This adds the status code to the response log message to make it easier
to diagnose issues. It also replaces the placeholder "Success" message
with the decoded value of the HTTP Status, resulting in messages like:

INFO[0041] Response: Temporary Redirect                  code=307

...and so on. Both easily consumable by humans and machines.
2017-05-08 14:40:50 -07:00
Tim Raymond a0117e8255 Fix missing renaming of logout => logoutLink
During development, this was previously named `logout`. This cleans up a
remaining instance of `logout`, renaming it to the preferred
`logoutLink` to remain consistent with the rest of the codebase.
2017-05-08 14:40:50 -07:00
Tim Raymond 33e5eb0e30 Use Basepath over string concatenation
Basepath was previously not working here because the strings constructed
via concatenation had a trailing slash at the end:

Before:
  rootPath => "/someprefix/chronograf/v1/"

After:
  rootPath => "/someprefix/chronograf/v1"

The julienschmidt/httprouter that the bouk/httprouter is based on has
support for ignoring trailing slashes, which is behavior that we want.
However, routing decisions involving this rootPath string were being
made by a `strings.HasPrefix` function. This conditional seeks to
apply the token middleware only in cases where routes _under_
`/chronograf/v1` are accessed (e.g. `/chronograf/v1/sources`). In cases
where the paths were effectively equal, this conditional accidentally
worked because the string `/chronograf/v1` does not have the prefix
`/chronograf/v1/`. When this was corrected to use `path.Join`, this case
became true and caused the token middleware to be applied.

`path.Join` is the correct way to construct paths, since this prevents
issues where a fragment like `/foo/` is concatenated with a fragment
like `/bar/quux/` to yield the string `/foo//bar/quux/`.

Given that continuing to use concatenation is no longer an option, the
solution is to compare the lengths of the strings to ensure that the
path under comparison is longer than the prefix it's being tested
against. This guarantees that the subject path is a route underneath the
`/chronograf/v1` route.
2017-05-08 14:40:50 -07:00
Tim Raymond 5897e62928 Remove broken path.Join logic
It is entirely unclear why this doesn't work.
2017-05-08 14:40:50 -07:00
Tim Raymond & Jared Scheib 337c7b16a5 Fix OAuth when using Basepath
Updated the logout link in the UI to use a link provided by the
/chronograf/v1/ endpoint. We also replaced many instances of string
concatenation of URL paths with path.Join, which better handles cases
where prefixed and suffixed "/" characters may be present in provided
basepaths. We also refactored how Basepath was being prefixed when using
Auth. Documentation was also updated to warn users that basepaths should
be applied to the OAuth callback link when configuring OAuth with their
provider.
2017-05-08 14:40:50 -07:00
Tim Raymond 7a9ca4a397 Add logging of response times
This makes monitoring Chronograf 👍
2017-05-08 14:40:50 -07:00
Jared Scheib 9c7fb0904b Notify user about --prefix-routes when using --basepath 2017-05-08 14:40:50 -07:00
Jared Scheib 7e468b98ae Fix links assignment on some AJAX requests 2017-05-08 14:40:50 -07:00
Jared Scheib 4eec2002b8 Add / to routes and use simpler basename api 2017-05-08 14:40:50 -07:00
Jared Scheib 1b0a77b215 Remove unnecessary basepath logic 2017-05-08 14:40:50 -07:00
Jade McGough 97e1f01d77 Merge pull request #1412 from influxdata/fix/alerts-on-kapacitor-refresh
validate kapacitor connection after updating config
2017-05-08 12:41:03 -07:00
Jade McGough 93b5846203 fix dumb copypasta 2017-05-08 12:20:57 -07:00
Jade McGough 71259b35b1 make checkKapacitorConnection async 2017-05-08 12:17:49 -07:00
Jade McGough 3cc94185d1 redirect to kapacitor edit route after creating new kapacitor 2017-05-08 12:05:09 -07:00
Jade McGough 6d6c6e6717 pull kapacitor connection checks out of callbacks 2017-05-08 11:32:35 -07:00
Jade McGough 4626651f36 remove line from another PR 2017-05-08 11:08:38 -07:00
Jade McGough 543f7e072e update changelog 2017-05-08 11:08:24 -07:00
Jade McGough 9c56fd8d2c validate kapacitor connection after updating config 2017-05-08 11:03:54 -07:00
lukevmorris 1bf39d9f37 Submit tvars when asking for a queryConfig (#1408) 2017-05-05 23:05:14 -07:00
lukevmorris e4a0d7f320 Feature/varmoji dash (#1397)
* Support dashes in tempVars with two regex passes

* Rename CustomTimeRange component to CustomTimeRangeDropdown for discovery and consistency

* Update tests for template varmojis

* Give names to each step of regex multipass
2017-05-05 15:04:13 -07:00
lukevmorris 6cda25cbc7 Need RangeValue to correctly calculate Alert graph range (#1406)
* Need RangeValue to correctly calculate Alert graph range

* Update CHANGELOG
2017-05-05 15:00:04 -07:00
Chris Goller 870dbc72d1 Merge pull request #1201 from influxdata/feature/reverse-kapa
Kapacitor AST parsing / display all kapacitor tasks
2017-05-05 16:42:00 -05:00
Chris Goller d16286c505 Fix null queryConfig and add substantial test coverage to kapacitor
storage
2017-05-05 16:14:02 -05:00
Chris Goller 3ce89c14a5 Fix bad commit to Makefile 2017-05-05 14:47:02 -05:00
Chris Goller dcf5838e91 Merge branch 'master' into feature/reverse-kapa 2017-05-05 14:41:06 -05:00
Chris Goller 1505b1eb7d Update CHANGELOG to mention enable/disable all tickscripts 2017-05-05 14:40:11 -05:00
Chris Goller 8aaed06402 Update Kapacitor alerts to set queryConfig to null if not parsable. 2017-05-05 14:30:20 -05:00
Andrew Watkins fc2b83c971 Fix link 2017-05-05 12:24:12 -07:00
Andrew Watkins a4d9d3745a Handle deadman trigger validation 2017-05-05 12:16:01 -07:00
Jade McGough df079349d3 Merge pull request #1401 from influxdata/delete-kapacitor
add ability to delete kapacitor config
2017-05-05 11:42:16 -07:00
Alex Paxton 6da685aef9 Merge pull request #1385 from influxdata/condense-de-lists
Query Builder Upgrade and Resizer Refactor
2017-05-05 11:33:11 -07:00
Jade McGough 78f4de2669 use link from kapacitor object 2017-05-05 11:25:52 -07:00
Alex P 141ea851d6 Follow correct pattern with naming 2017-05-05 11:25:02 -07:00