Commit Graph

378 Commits

Author SHA1 Message Date
Marcus Efraimsson
f08932b78a WIP: folder api. #10630 2018-01-30 10:53:28 +01:00
Daniel Lee
94a54248c1 dashfolders: show folders use can save to in picker
Instead of returning all folders a user has some sort of access to,
this change creates a new end point that returns folders the user
has write access to. This new endpoint is used in the folder picker
2018-01-20 01:58:28 +01:00
Daniel Lee
ae69c96518 dashfolders: allow any signed in user to get list of teams 2018-01-09 14:44:36 +01:00
Daniel Lee
3ae1bf0c16 dashfolders: permissions for saving annotations
ref #10275 Use folder permissions instead of hard coded
permissions on the annotations routes.
2018-01-09 14:44:36 +01:00
Daniel Lee
61ed0b0381 dashfolders: remove role requirements on dashboard routes
and rely on the permission system instead.
2018-01-09 14:44:36 +01:00
Marcus Efraimsson
af34f9977e Add avatar to team and team members page (#10305)
* teams: add db migration for email column in teams table

* teams: /teams should render index page with a 200 OK

* teams: additional backend functionality for team and team members

Possibility to save/update email for teams.
Possibility to retrive avatar url when searching for teams.
Possibility to retrive avatar url when searching for team members.

* teams: display team avatar and team member avatars

Possibility to save and update email for a team

* teams: create team on separate page instead of modal dialog
2017-12-20 21:20:12 +01:00
Marcus Efraimsson
e136b7c286 dashfolders: /dashboards should render index page with a 200 OK 2017-12-14 11:30:57 +01:00
Torkel Ödegaard
ccbd18006e ux: org user management changes 2017-12-13 13:16:44 +01:00
Alexander Zobnin
d8612380e9 refactor: rename User Groups to Teams 2017-12-08 18:25:45 +03:00
Torkel Ödegaard
0e44fe082b Merge branch 'master' into develop 2017-11-17 15:49:17 +01:00
Torkel Ödegaard
303e3de488 fix: fix for avatar images when gzip is turned on, fixes #5952 2017-11-17 13:13:58 +01:00
Marcus Efraimsson
909601d6ab api: fix so that datasources functions returns Response 2017-11-16 16:29:05 +01:00
Marcus Efraimsson
89b27b35ba fix: Use Response as return type 2017-11-16 16:19:01 +01:00
Marcus Efraimsson
540d540ea9 fix: return id from api when creating new annotation/graphite annotation, fixes #9798
When creating a region annotation the response will include both
id (region start id) and endId (region end id), if not only id.
2017-11-16 16:19:01 +01:00
Torkel Ödegaard
9605ab4475 Merge branch 'master' into develop 2017-10-26 15:59:50 +02:00
bergquist
9b6535cca1 alerting: only editors can pause rules
closes #9640
2017-10-24 11:01:08 +02:00
Daniel Lee
b866383ec0 api: fix for dashboard version history 2017-10-16 14:09:52 +02:00
Torkel Ödegaard
48c8e4d627 fix: various fixes for new grid 2017-10-12 17:38:49 +02:00
Torkel Ödegaard
88ceb19d96 Merge branch 'master' into develop 2017-10-12 16:32:44 +02:00
Alexander Zobnin
04ea7efac9 annotations: add endpoint for writing graphite-like events (#9495)
* annotations: add endpoint for writing graphite-like events

* annotations: fix new line handling in tooltip

* annotations: support tags in prior to Graphite 0.10.0 format
2017-10-12 10:12:15 +02:00
Torkel Ödegaard
647a3cc5ae Merge branch 'master' into develop 2017-10-09 16:01:54 +02:00
Torkel Ödegaard
25aa9df270 Create annotations (#8197)
* annotations: add 25px space for events section

* annotations: restored create annotation action

* annotations: able to use fa icons as event markers

* annotations: initial emoji support from twemoji lib

* annotations: adjust fa icon position

* annotations: initial emoji picker

* annotation: include user info into annotation requests

* annotation: add icon info

* annotation: display user info in tooltip

* annotation: fix region saving

* annotation: initial region markers

* annotation: fix region clearing (add flot-temp-elem class)

* annotation: adjust styles a bit

* annotations: minor fixes

* annoations: removed userId look in loop, need a sql join or a user cache for this

* annotation: fix invisible events

* lib: changed twitter emoij lib to be npm dependency

* annotation: add icon picker to Add Annotation dialog

* annotation: save icon to annotation table

* annotation: able to set custom icon for annotation added by user

* annotations: fix emoji after library upgrade (switch to 72px)

* emoji: temporary remove bad code points

* annotations: improve icon picker

* annotations: icon show icon picker at the top

* annotations: use svg for emoji

* annotations: fix region drawing when add annotation editor opened

* annotations: use flot lib for drawing region fill

* annotations: move regions building into event_manager

* annotations: don't draw additional space if no events are got

* annotations: deduplicate events

* annotations: properly render cut regions

* annotations: fix cut region building

* annotations: refactor

* annotations: adjust event section size

* add-annotations: fix undefined default icon

* create-annotations:  edit event (frontend part)

* fixed bug causes error when hover event marker

* create-annotations:  update event (backend)

* ignore grafana-server debug binary in git (created VS Code)

* create-annotations: use PUT request for updating annotation.

* create-annotations: fixed time format when editing existing event

* create-annotations: support for region update

* create-annotations: fix bug with limit and event type

* create-annotations: delete annotation

* create-annotations: show only selected icon in edit mode

* create-annotations: show event editor only for users with at least Editor role

* create-annotations: handle double-sized emoji codepoints

* create-annotations: refactor

use CP_SEPARATOR from emojiDef

* create-annotations: update emoji list, add categories.

* create-annotations: copy SVG emoji into public/vendor/npm and use it as a base path

* create-annotations: initial tabs for emoji picker

* emoji-picker: adjust styles

* emoji-picker: minor refactor

* emoji-picker: refactor - rename and move into one directory

* emoji-picker: build emoji elements on app load, not on picker open

* emoji-picker: fix emoji searching

* emoji-picker: refactor

* emoji-picker: capitalize category name

* emoji-picker: refactor

move buildEmojiElem() into emoji_converter.ts for future reuse.

* jquery.flot.events: refactor

use buildEmojiElem() for making emojis, remove unused code for font awesome based icons.

* emoji_converter: handle converting error

* tech: updated

* merged with master

* shore: clean up some stuff

* annotation: wip tags

* annotation: filtering by tags

* tags: parse out spaces etc. from a tags string

* annotations: use tagsinput component for tag filtering

* annotation: wip work on how we query alert & panel annotations

* annotations: support for updating tags in an annotation

* linting

* annotations: work on unifying how alert history annotations and manual panel annotations are created

* tslint: fixes

* tags: create tag on blur as well

Currently, the tags directive only creates the tag when the
user presses enter. This change means the tag is created on
blur as well (when the user clicks outside the input field).

* annotations: fix update after refactoring

* annotations: progress on how alert annotations are fetched

* annotations: minor progress

* annotations: progress

* annotation: minor progress

* annotations: move tag parsing from tooltip to ds

Instead of parsing a tag string into an array in the annotation_tooltip
class, this moves the parsing to the datasources. InfluxDB ds already
does that parsing. Graphite now has it.

* annotations: more work on querying

* annotations: change from tags as string to array

when saving in the db and in the api.

* annotations: delete tag link if removed on edit

* annotation: more work on depricating annotation title

* annotations: delete tag links on delete

* annotations: fix for find

* annotation: added user to annotation tooltip and added alertName to annoation dto

* annotations: use id from route instead from cmd for updating

* annotations: http api docs

* create annotation: last edits

* annotations: minor fix for querying annotations before dashboard saved

* annotations: fix for popover placement when legend is on the side (and doubel render pass is causing original marker to be removed)

* annotations: changing how the built in query gets added

* annotation: added time to header in edit mode

* tests: fixed jshint built issue
2017-10-07 10:31:39 +02:00
Torkel Ödegaard
18337f610d Merge branch 'master' into develop 2017-09-22 08:42:07 +02:00
Torkel Ödegaard
41e01184aa Merge branch 'master' into develop 2017-09-18 12:32:29 +02:00
bergquist
e3211f6e48 use route as span name 2017-09-18 11:08:58 +02:00
bergquist
9c30bf53cf introduce concept of named middleware 2017-09-14 14:26:32 +02:00
bergquist
6372e22180 migrate handlers to new register 2017-09-14 14:26:32 +02:00
bergquist
6d22a67a30 return /metrics before session middleware 2017-09-14 14:26:32 +02:00
bergquist
d6b8c6a2d2 add graphite bridge that support delta counters 2017-09-14 14:26:32 +02:00
Torkel Ödegaard
a38ded9e7e Merge branch 'master' into develop-newgrid-row-design2 2017-09-07 15:05:41 +02:00
Torkel Ödegaard
84d4958a3c plugin change: make interval, cache timeout & max data points options in plugin.json, remove query.options component feature, add help markdown feature and toggle for data sources 2017-08-31 14:05:52 +02:00
Torkel Ödegaard
4f9fbcc211 dataproxy: added caching of datasources when doing data proxy requests, #9078 2017-08-23 13:31:26 +02:00
Torkel Ödegaard
63424f9866 ux: more work on sidemenu 2017-08-15 14:49:12 +02:00
Torkel Ödegaard
1dab313ca3 Merge branch 'master' into develop 2017-08-14 10:30:36 +02:00
Torkel Ödegaard
3dc9d76b38 fix: viewer role fix, fixes #8976 2017-08-02 17:33:06 +02:00
Torkel Ödegaard
3066280216 added code from #8504, and #8021 2017-06-23 17:13:58 -04:00
Torkel Ödegaard
e854fadb67 Merge branch 'master' into develop 2017-06-23 12:56:59 -04:00
Torkel Ödegaard
be29357d22 fix: added missing url route for annotation state history delete, fixes #8660 2017-06-23 11:48:58 -04:00
Torkel Ödegaard
2257c1f874 dashboard acl work 2017-06-21 19:02:03 -04:00
Torkel Ödegaard
aaf2a897b0 folders: changed api urls for dashboard acls 2017-06-19 18:11:30 -04:00
Torkel Ödegaard
e0b9ba7554 refactoring renaming dashboard folder operations 2017-06-19 17:15:25 -04:00
Daniel Lee
a861b1b9ba WIP: check permissions for delete/post dashboard 2017-06-12 23:05:32 +02:00
Daniel Lee
3913f16550 WIP: add permission check for GetDashboard 2017-06-12 16:48:51 +02:00
Daniel Lee
9eccb4e79f WIP: API - add dash permission 2017-06-12 15:49:09 +02:00
Daniel Lee
fa18b0053d WIP: delete permission in API 2017-06-12 15:49:09 +02:00
Daniel Lee
f1e1da39e3 WIP: get Dashboard Permissions
The guardian class checks if the user is allowed to get the
permissions for a dashboard.
2017-06-12 15:49:09 +02:00
Daniel Lee
552935031b WIP: API methods for add/remove members to user group 2017-06-12 15:49:09 +02:00
Daniel Lee
0a1df0905e WIP: add update user group command 2017-06-12 15:49:09 +02:00
Daniel Lee
233cd7af4a WIP: add user group search 2017-06-12 15:49:09 +02:00
Torkel Ödegaard
ef1dfed0d8 dasboard_history: big refactoring of how the compare api looked, now a POST with a model for new & base version, refactored a simplified UI code as well, this was done to lay foundation to make it possible to do diff against current in browser unsaved version 2017-06-07 11:50:09 +02:00
Torkel Ödegaard
689e366f59 refactoring: updated api url routes so they do not conflict with slug route 2017-06-06 09:51:14 +02:00
Torkel Ödegaard
c87418d060 refactoring: Dashboard history restore operation is now reusing existing
operations instead of duplicating a bunch of get & save logic.
2017-06-05 17:45:27 +02:00
Torkel Ödegaard
f3980504e2 Merge branch 'master' into walmartlabs-master 2017-06-05 13:43:00 +02:00
sanchitraizada
77c046aac6 Implement review feedback 2017-06-01 17:57:09 -04:00
Torkel Ödegaard
0d39852ef4 fix: fixed test data fake metric query, fixes #8474 2017-05-29 10:48:38 +02: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
0156a94a49 annotations: you can now read annoations via manually created annoation query 2017-04-12 15:46:41 +02:00
Alexander Zobnin
d553498a33 graph(add annotation): initial backend implementation #1286 2017-04-10 20:22:58 +03:00
Torkel Ödegaard
bd4f073425 mysql: minor update 2017-03-30 20:23:40 +02:00
Daniel Lee
193d468ed3 admin: adds paging to global user list
Currently there is a limit of 1000 users in the global
user list. This change introduces paging so that an
admin can see all users and not just the first 1000.

Adds a new route to the api - /api/users/search that
returns a list of users and a total count. It takes
two parameters perpage and page that enable paging.

Fixes #7469
2017-02-13 12:59:36 +01:00
huydx
143cbe921f (feat) support datasource delete by name api 2017-02-10 23:30:14 +09:00
Torkel Ödegaard
8a95c563bb Merge branch 'master' into websocket 2017-01-31 08:56:49 +01:00
Pavlos Daoglou
3e741315b4 [3743] Adds support for user search based on login or email (#7334)
* [3743] Adds support for user search based on login or email

* Use query parameter instead

* Use macaron Query() instead
2017-01-31 06:25:55 +01:00
Torkel Ödegaard
b8f559aecb feat(plugins): made notifiers more pluggable and easier to support many of them, new ones can now be added without modifying any existing file, #7162 2017-01-06 12:04:25 +01:00
Torkel Ödegaard
fad07f0d15 refactor(http): refactoring http server 2016-12-21 14:36:32 +01:00
bergquist
a2257ec3d0 tech(alerting): renames pause all method 2016-12-19 15:17:49 +01:00
bergquist
ecdf1888c4 feat(alerting): removes pause per datasource 2016-12-19 13:24:45 +01:00
bergquist
fb6aa0e026 feat(api): adds endpoint for mass pausing alerts
ref #6589
2016-12-16 15:00:58 +01:00
Torkel Ödegaard
22bf6420f1 Merge branch 'master' of github.com:grafana/grafana 2016-12-08 10:25:26 +01:00
bergquist
8ee85626f2 fix(api): return correct json info after updating datasource
closes #6869
2016-12-07 18:09:17 +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
e3564d12a1 fix(404): fixed 404 page 2016-11-16 17:09:00 +01:00
Torkel Ödegaard
fb57bf77da ux(getting started): progress on getting started panel and persited help flag states, #6466 2016-11-09 10:41:39 +01:00
bergquist
b2d5b920f5 feat(alerting): allow editor to modify notifications
closes #6314
2016-10-19 08:01:31 +02:00
Torkel Ödegaard
4c26c55fea fix(api): minor change to how pause alert was done 2016-10-14 09:58:22 +02:00
Torkel Ödegaard
c9d7eb0a7a feat(alerting): added clear history button to alert state history view, #6244 2016-10-14 09:33:42 +02:00
bergquist
c6cf7647ff feat(alerting): pausing alerts requires alert id 2016-10-11 10:53:24 +02:00
bergquist
804797245d feat(alerting): make it possible to pause from alert tab 2016-10-11 08:40:38 +02:00
bergquist
264590a9c2 feat(alerting): add paused api endpoint 2016-10-10 14:26:09 +02:00
Torkel Ödegaard
7c339f0794 feat(alerting): show alertin state in panel header, closes #6136 2016-09-30 17:37:47 +02:00
Torkel Ödegaard
3ecd96e682 feat(testdata): lots of work on new test data data source and scenarios 2016-09-27 18:17:39 +02:00
Carl Bergquist
d6a0ec85c4 Merge pull request #6111 from grafana/pluginreadme
allow non-admin users to view plugin readme
2016-09-22 19:51:47 +02:00
Dan Cech
2c3dd84ebb allow non-admin users to view plugin readme 2016-09-22 13:46:11 -04:00
Torkel Ödegaard
936146768f fix(snapshots): fixed issue with viewing embedded/solo/png panel from snapshot without login, fixes #3769 2016-09-22 11:46:58 +02:00
Torkel Ödegaard
d60bd77658 feat(annotations): added support to show grafana stored annotations in graphs, #5982 2016-09-08 11:25:45 +02:00
bergquist
d11bc57c37 feat(notifications): make it possible to send test alert notifications
closes #5847
2016-09-05 14:45:15 +02:00
bergquist
11a4ff0f8a feat(alerting): add basic UI for history in alert tab
ref #5850
2016-08-30 13:22:59 +02:00
bergquist
650a87dc05 feat(alerting): add alert history api endpoint
ref #5850
2016-08-30 09:32:56 +02:00
chrismartin0077
0050707134 feat(api) HEAD response, fixes #3854 2016-08-29 06:07:44 -07:00
bergquist
0cbedb4473 chore(api): remove commented endpoints 2016-08-22 16:56:28 +02:00
Torkel Ödegaard
7eb2d2cf47 feat(alerting): working on state management 2016-07-22 13:14:09 +02:00
Torkel Ödegaard
9e91aacd34 feat(alerting): progress on testing alerts 2016-07-21 10:29:11 +02:00
Torkel Ödegaard
fb636344a6 feat(alerting): began work on testing alert rule from UI without having to save it 2016-07-20 16:13:36 +02:00
Torkel Ödegaard
f13b869aa4 feat(alerting): work on alerting 2016-07-14 13:32:16 +02:00
Torkel Ödegaard
624cd6fc0a feat(alerting): cleanup, removed alert changes table and code 2016-07-13 11:58:55 +02:00
Torkel Ödegaard
d9096110f8 Merge branch 'master' into alerting
Conflicts:
	pkg/api/dashboard.go
	pkg/models/dashboards.go
	pkg/services/sqlstore/dashboard.go
2016-07-11 18:28:07 +02:00
Torkel Ödegaard
d44325affd feat(apps): progress on app dashboard imports 2016-07-08 09:35:06 +02:00
bergquist
a18506e2e4 feat(alerting): changing notifications should require org admin 2016-06-20 11:32:55 +02:00
bergquist
0c5da9155f feat(alerting): only expose DTO info when requesting all notifications 2016-06-20 11:31:20 +02:00
bergquist
96e5ad3f5c Merge branch 'alerting' into alerting_notifications 2016-06-20 10:45:05 +02:00