Commit Graph

50 Commits

Author SHA1 Message Date
Torkel Ödegaard
fed35909cc tech: progress on react poc 2017-09-21 13:32:57 +02:00
Patrick O'Carroll
d6725d4fbe updated error page html+css, added ds_store to ignore (#9285) 2017-09-18 14:04:55 +02:00
Alexander Zobnin
e4dabb657c code-editor: initial directive for rich code editor (ace) 2017-08-07 19:31:50 +03:00
Torkel Ödegaard
9ff4ab1236 Merge branch 'master' into query_troubleshooting 2017-06-13 16:47:04 -04:00
sanchitraizada
77c046aac6 Implement review feedback 2017-06-01 17:57:09 -04: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
6ad1a396a5 feat: query troubleshooter 2017-05-19 16:00:01 +02:00
Torkel Ödegaard
5513d3c9d1 feat: moved json-formatter-js into core grafana to be able to make changes 2017-05-19 13:16:05 +02:00
Torkel Ödegaard
f65878c21d ux: working on query troubleshooting 2017-05-18 17:04:31 +02:00
Alexander Zobnin
96e91b5a0f Move css styles to public/sass/components/_panel_heatmap.scss 2017-03-24 15:15:01 +03: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
Torkel Ödegaard
fd512457d8 Merge remote-tracking branch 'origin/master' into getting-started-panel-css2 2016-11-18 16:31:54 +01:00
Torkel Ödegaard
e6776f71d9 cleanup(sass): removed tight-form styles 2016-11-16 18:26:39 +01:00
Torkel Ödegaard
d7e8753c59 cleanup(): removed unused gfbox style 2016-11-16 18:08:45 +01:00
Torkel Ödegaard
de74bf0c33 Merge branch 'master' into getting-started-panel 2016-11-10 13:24:10 +01:00
Torkel Ödegaard
bd996a4810 ux(viewmode): refining view mode #6476 2016-11-05 21:05:12 +01:00
Torkel Ödegaard
2da2d5df56 Merge branch 'master' of github.com:grafana/grafana 2016-11-04 12:15:08 +01:00
Carl Bergquist
61c48aecc2 [Alertlist] Set max-height to respect row height (#6454)
* feat(alertlist): max-height to respect row height

closes #6417

* feat(alertlist): use pre calculated panel.height instead

* style(alertlist): rearrange variable order
2016-11-03 11:01:21 +01:00
Matt Toback
15e369ec02 First pass of getting started panel for home dashboard 2016-11-02 17:21:11 -04:00
Torkel Ödegaard
591f6536f8 feat(ux): trying to simplify display rules for edit mode / row actions 2016-10-29 13:10:20 +02:00
Torkel Ödegaard
3b69c8f687 feat(alerting): new design for alert tab with sidemenu 2016-07-31 09:31:32 +02:00
Torkel Ödegaard
3ad38eefd2 feat(alerting): test results look better 2016-07-21 13:57:19 +02:00
Torkel Ödegaard
68bd82f1b6 Merge branch 'master' into query-editor-style 2016-04-16 13:46:05 -04:00
Matt Toback
d2421d964a New styles almost ready 2016-04-08 18:46:45 -04:00
Torkel Ödegaard
6bb001e416 Merge branch 'master' into query-editor-style 2016-04-04 13:55:55 -04:00
Torkel Ödegaard
d2239427f2 ux(): big progress on updating query editors 2016-03-29 19:03:24 +02:00
Matt Toback
ef89dabb61 Go away extra line 2016-03-28 18:37:52 -04:00
Matt Toback
9be1ffd633 Fixed code blocks in Grafana 2016-03-28 18:37:02 -04:00
Torkel Ödegaard
5e52aaac6f ux(): checkbox style test 2016-03-21 11:07:37 +01:00
bergquist
aadc6e0bbd fix(fonts): move icon fonts back to main css 2016-03-16 14:45:39 +01:00
bergquist
99e068643b feat(fonts): download fonts from grafana instead of CDN
Makes its possible to run grafana without internet access.
The performance hit by not using a cdn is very small since
most grafana instances are setup on locally.

closes #4223
2016-03-16 10:51:59 +01:00
Torkel Ödegaard
82eb32a71e ux(): initial pass at new card / list design, #4364 2016-03-15 09:15:24 +01:00
Torkel Ödegaard
c148d89004 feat(plugins): progress on plugins page 2016-02-26 18:25:39 +01:00
Torkel Ödegaard
c521182ceb feat(plugins): more work on plugins list/edit view 2016-02-25 15:56:28 +01:00
Torkel Ödegaard
26c5029256 ux(): new dashboard tabs view 2016-02-23 13:20:59 +01:00
Torkel Ödegaard
fa5cf602f5 removed old popover and unused boostrap components 2016-02-22 18:56:35 +01:00
Torkel Ödegaard
f375c3000d ux(): help popover 2016-02-22 11:41:50 +01:00
Torkel Ödegaard
a93fe5b2b2 poc(): tether drop 2016-02-21 18:08:44 +01:00
Torkel Ödegaard
ac45ccbad7 fix(panel): fixed text panel issue due to recent style changes, fixes #4095 2016-02-21 08:51:01 +01:00
Matt
3ca8e8a6d2 Added a mixin to handle vendor prefixes for animations. Trying out slight opacity on menu 2016-02-20 14:40:16 -05:00
Torkel Ödegaard
52241b8e0b ux(): completed gf-size class rename 2016-02-20 14:48:10 +01:00
bergquist
d769f6c084 ux(timepicker): fix css for the timepicker 2016-02-19 09:13:22 +01:00
Torkel Ödegaard
65f9cc986a ux(): styleguide with auto generated colors generated from the sass variable files 2016-02-18 18:01:24 +01:00
Torkel Ödegaard
3003a8cb6e ux(sass): a lot of polish on headings and margins, ONLY USE bottom margins, othewise margin collapse causes issues 2016-02-18 12:16:47 +01:00
Torkel Ödegaard
c97dbf390e ux(): fixed invite box 2016-02-16 14:39:45 +01:00
Torkel Ödegaard
b05939ec9a ux(sass): work on sass variables, getting messy 2016-02-16 12:15:09 +01:00
Torkel Ödegaard
7c917156ee ux(sass): variable refactoring 2016-02-16 10:42:06 +01:00
Torkel Ödegaard
41b775561a ux(): datasource form tweaks 2016-02-16 07:57:58 +01:00
Torkel Ödegaard
6fc2b69697 ux(sass): restored old responsive rules 2016-02-15 19:04:35 +01:00
Torkel Ödegaard
9045be0c12 ux(sass): rename less folder to sass 2016-02-15 18:17:06 +01:00