Commit Graph

75 Commits

Author SHA1 Message Date
Torkel Ödegaard
9b60a63778 ux: metrics tab v3 2017-08-30 16:39:00 +02:00
Torkel Ödegaard
e5b499a958 fix: Text area css issue prevented scrolling, fixes #8797 2017-07-06 09:36:57 +02:00
Denis Doria
eaba985f25 Fix issue with kilovolt-ampere reactive (kvar) #8596 (#8650)
This changes the css to handle overflow of the string on the input fields.
If an overflow happends an ellipsis is used.
2017-06-19 16:23:12 -04:00
Torkel Ödegaard
9ff4ab1236 Merge branch 'master' into query_troubleshooting 2017-06-13 16:47:04 -04:00
Torkel Ödegaard
88da3a99e1 refactoring: trying to remove all the css overrides in history tab and make the styles more more inline with best practice css, and if needed use modifier overrides instead 2017-06-06 11:03:56 +02:00
sanchitraizada
e6616cc551 Merge pull request #10 from walmartlabs/version-control
History and Version Control for Dashboard Updates
2017-05-25 14:50:47 -07:00
Ben Tranter
b6e46c9eb8 History and Version Control for Dashboard Updates
A simple version control system for dashboards. Closes #1504.

Goals

1. To create a new dashboard version every time a dashboard is saved.
2. To allow users to view all versions of a given dashboard.
3. To allow users to rollback to a previous version of a dashboard.
4. To allow users to compare two versions of a dashboard.

Usage

Navigate to a dashboard, and click the settings cog. From there, click
the "Changelog" button to be brought to the Changelog view. In this
view, a table containing each version of a dashboard can be seen. Each
entry in the table represents a dashboard version. A selectable
checkbox, the version number, date created, name of the user who created
that version, and commit message is shown in the table, along with a
button that allows a user to restore to a previous version of that
dashboard. If a user wants to restore to a previous version of their
dashboard, they can do so by clicking the previously mentioned button.
If a user wants to compare two different versions of a dashboard, they
can do so by clicking the checkbox of two different dashboard versions,
then clicking the "Compare versions" button located below the dashboard.
From there, the user is brought to a view showing a summary of the
dashboard differences. Each summarized change contains a link that can
be clicked to take the user a JSON diff highlighting the changes line by
line.

Overview of Changes

Backend Changes

- A `dashboard_version` table was created to store each dashboard
  version, along with a dashboard version model and structs to represent
  the queries and commands necessary for the dashboard version API
  methods.
- API endpoints were created to support working with dashboard
  versions.
- Methods were added to create, update, read, and destroy dashboard
  versions in the database.
  - Logic was added to compute the diff between two versions, and
  display it to the user.
  - The dashboard migration logic was updated to save a "Version
  1" of each existing dashboard in the database.

Frontend Changes

- New views
- Methods to pull JSON and HTML from endpoints

New API Endpoints

Each endpoint requires the authorization header to be sent in
the format,

```
Authorization: Bearer <jwt>
```

where `<jwt>` is a JSON web token obtained from the Grafana
admin panel.

`GET "/api/dashboards/db/:dashboardId/versions?orderBy=<string>&limit=<int>&start=<int>"`

Get all dashboard versions for the given dashboard ID. Accepts
three URL parameters:

- `orderBy` String to order the results by. Possible values
  are `version`, `created`, `created_by`, `message`. Default
  is `versions`. Ordering is always in descending order.
- `limit` Maximum number of results to return
- `start` Position in results to start from

`GET "/api/dashboards/db/:dashboardId/versions/:id"`

Get an individual dashboard version by ID, for the given
dashboard ID.

`POST "/api/dashboards/db/:dashboardId/restore"`

Restore to the given dashboard version. Post body is of
content-type `application/json`, and must contain.

```json
{
  "dashboardId": <int>,
  "version": <int>
}
```

`GET "/api/dashboards/db/:dashboardId/compare/:versionA...:versionB"`

Compare two dashboard versions by ID for the given
dashboard ID, returning a JSON delta formatted
representation of the diff. The URL format follows
what GitHub does. For example, visiting
[/api/dashboards/db/18/compare/22...33](http://ec2-54-80-139-44.compute-1.amazonaws.com:3000/api/dashboards/db/18/compare/22...33)
will return the diff between versions 22 and 33 for
the dashboard ID 18.

Dependencies Added

- The Go package [gojsondiff](https://github.com/yudai/gojsondiff)
  was added and vendored.
2017-05-24 19:14:39 -04:00
Torkel Ödegaard
912301fe24 query: more work on metrics tab changes 2017-05-20 10:14:41 +02:00
Torkel Ödegaard
878121bb46 fix: templating variable name validation detecting global variable naming wrongly, fixes #8423 2017-05-19 11:14:11 +02:00
Torkel Ödegaard
ea53e7221e mysql: added query help 2017-04-21 15:52:42 +02:00
Daniel Lee
b9940e618c profile: locks login fields if disable_login_form
If the auth config variable, disable_login_form, is set to true then
the username and email fields are set to read-only on the profile page.

The reason for this is so that the user does not lock themselves out by
changing their email address or username. Or create a new user by
changing both.

ref #7810
2017-03-21 14:42:32 +01:00
bergquist
9b6571fab1 template: dont allow template variables to begin with '__'
closes #7678
2017-02-28 17:04:47 +01:00
utkarshcmu
6b26a0f91d Fixed hover position 2016-12-06 05:53:33 -08:00
utkarshcmu
42de27a2cb Added help text for users 2016-12-06 03:54:44 -08:00
Daniel Lee
0618122bcd feat(httpsettings): add tls auth option
- Three text areas where the user can paste
in the CA Cert (optional), Client Cert
and Client Key.

- Tooltips for Auth checkboxes with brief
descriptions of what With Credentials and
With CA Cert are.

- Adds popover for TLS Auth header too.

- Aligns gf-form elements as labels and
checkboxes were not aligned before.

- Makes CA Cert optional as it is only
needed for self-signed certs.
2016-11-24 13:33:28 +01:00
Torkel Ödegaard
8a715cd122 using gf-form in row header 2016-10-25 10:47:13 +02:00
Torkel Ödegaard
f3d4a97f49 Merge branch 'master' into graph-panel-non-timeseries 2016-09-22 14:03:06 +02:00
Torkel Ödegaard
46ab09ed60 feat(links): fixed styling for dashboard links 2016-09-21 14:20:59 +02:00
Torkel Ödegaard
83b9db51e3 feat(templating): great progress on adhoc filters, #6038 2016-09-14 17:36:28 +02:00
Torkel Ödegaard
395213abd7 feat(graph panel): more refactoring of #5917 2016-09-05 11:46:16 +02:00
bergquist
88e208bddf feat(gf-form): add support for small input fields 2016-06-25 23:30:51 +02:00
bergquist
3adee1eda0 tech(sass): sasslint fixes for css3
Pseudo-elements must start with double colons pseudo-element
2016-06-20 10:37:47 +02:00
Torkel Ödegaard
c3708b3096 feat(import): import directly from grafana.net id/url now works 2016-05-27 16:11:05 +02:00
Torkel Ödegaard
0e4b70a4a8 feat(query_editors): more work 2016-04-28 10:13:18 +02:00
Torkel Ödegaard
7b560f9080 feat(query editors): converted OpenTSDB editor to new form styles 2016-04-27 16:29:59 +02:00
Torkel Ödegaard
bca0894f73 feat(query editors): progress on query editors 2016-04-26 09:58:55 +02:00
Torkel Ödegaard
bbf4d00319 fix(query editors): added select style to segment, used by data source selector 2016-04-25 15:49:33 +02:00
Torkel Ödegaard
6b813b4e2a feat(query editors): remember collapsed state 2016-04-25 15:11:40 +02:00
Torkel Ödegaard
39cdaf5175 ux(query-editors): more progress and fixes 2016-04-18 11:35:24 -04:00
Torkel Ödegaard
4515e66783 feat(query editors): more progress on ES query editor 2016-04-18 08:43:11 -04:00
Torkel Ödegaard
1069f485da ux(query_editors): handle text overflow in collapsed mode 2016-04-17 22:24:40 -04:00
Torkel Ödegaard
4c4835e869 ux(query-editors): more progress on elastic query editor 2016-04-17 22:04:43 -04:00
Torkel Ödegaard
33f7b8479e ux(query editors): progress on new query editor styles 2016-04-17 12:14:25 -04:00
Torkel Ödegaard
68bd82f1b6 Merge branch 'master' into query-editor-style 2016-04-16 13:46:05 -04:00
Torkel Ödegaard
e307ada374 ux(): tooltip improvement 2016-04-15 19:56:39 -04:00
Torkel Ödegaard
d2239427f2 ux(): big progress on updating query editors 2016-03-29 19:03:24 +02:00
Torkel Ödegaard
a4f9621473 Merge branch 'master' into query-editor-style 2016-03-29 17:45:24 +02:00
Torkel Ödegaard
32c8f495ab ux(): redesign of axis & grid forms 2016-03-29 12:32:40 +02:00
Torkel Ödegaard
14326b626e ux(): checkbox now works in dark and white theme 2016-03-28 13:10:42 +02:00
Torkel Ödegaard
1dabd68327 Merge branch 'master' into checkboxv3 2016-03-28 11:22:23 +02:00
Torkel Ödegaard
b06d809364 ux(): changed name again 2016-03-23 15:42:46 +01:00
Torkel Ödegaard
f8fb97d912 ux(): restored natural language input class 2016-03-23 15:41:01 +01:00
Torkel Ödegaard
b7d198793f refactor(): minor refactoring of #4455 2016-03-23 15:09:48 +01:00
Matt Toback
30b2a7169f Form adjustments for app work 2016-03-22 18:41:04 -04:00
Torkel Ödegaard
64312ceded ux(): updated http settings view with new checkboxes 2016-03-21 21:36:30 +01:00
Torkel Ödegaard
98206ab49f ux(): created new gf-form-switch directive clean/refactoring 2016-03-21 21:24:06 +01:00
Torkel Ödegaard
530b6a5088 ux(): another checkbox design 2016-03-21 11:27:53 +01:00
Torkel Ödegaard
5e52aaac6f ux(): checkbox style test 2016-03-21 11:07:37 +01:00
Torkel Ödegaard
55189200a4 ux(): updated query editor test 2016-03-20 16:18:31 +01:00
Matt Toback
084ad69c53 Beginngings of style adjustments to support worldPing app 2016-03-18 19:32:50 -04:00