From be8ec241063e43a880abcd292e177aa00316ea25 Mon Sep 17 00:00:00 2001 From: simnv Date: Tue, 15 Mar 2016 16:05:32 +0500 Subject: [PATCH 01/27] Slash escape regex Slash symbol "/" wasn't escaped when we chose variable from template dropdown, so we couldn't choose interface names like Gi9/10 when querying from influxdb. --- public/app/features/templating/templateSrv.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/features/templating/templateSrv.js b/public/app/features/templating/templateSrv.js index ece69302196..98103f5259f 100644 --- a/public/app/features/templating/templateSrv.js +++ b/public/app/features/templating/templateSrv.js @@ -35,7 +35,7 @@ function (angular, _) { }; function regexEscape(value) { - return value.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + return value.replace(/[\\^$*+?.()|[\]{}\/]/g, '\\$&'); } function luceneEscape(value) { From 5af54c57baf9867689146cf02723df043ec306cb Mon Sep 17 00:00:00 2001 From: Matt Toback Date: Thu, 17 Mar 2016 14:31:55 -0400 Subject: [PATCH 02/27] Update admin.md --- docs/sources/reference/admin.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/sources/reference/admin.md b/docs/sources/reference/admin.md index c5d5073020d..266fc998092 100644 --- a/docs/sources/reference/admin.md +++ b/docs/sources/reference/admin.md @@ -30,7 +30,8 @@ From the Grafana Server Admin page, you can access the System Info page which su ## Why would I have multiple Organizations? -In many cases, a Grafana installation will only have one Organization. There's no need to create multiple Organizations -if you want all your users to have access to the same set of dashboards and data. In a multitenant deployment, +Organizations in Grafana are best suited for a **multi-tenant deployment**. In a multi-tenant deployment, Organizations can be used to provide a full Grafana experience to different sets of users from a single Grafana instance, -at the convenience of the Grafana Administrator. +at the convenience of the Grafana Administrator. + +In most cases, a Grafana installation will only have **one** Organization. Since dashboards, data sources and other configuration items are not shared between organizations, there's no need to create multiple Organizations if you want all your users to have access to the same set of dashboards and data. From 6016033b8b11a17f48a8beab49c3adba7d0c77d5 Mon Sep 17 00:00:00 2001 From: Matt Toback Date: Thu, 17 Mar 2016 15:14:26 -0400 Subject: [PATCH 03/27] Finishing touches --- public/app/features/org/partials/newOrg.html | 28 +++++++++---------- .../app/features/org/partials/orgDetails.html | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/public/app/features/org/partials/newOrg.html b/public/app/features/org/partials/newOrg.html index 916c73177b7..88c348db78f 100644 --- a/public/app/features/org/partials/newOrg.html +++ b/public/app/features/org/partials/newOrg.html @@ -1,21 +1,21 @@ -
-
+
+ -

Add Organization

+

Each organization contains their own dashboards, data sources and configuration, and cannot be shared between orgs. While users may belong to more than one, mutiple organization are most frequently used in multi-tenant deployments.

-
-
- Org. name - -
-
-
- -
-
+
+
+ Org. name + +
+
+
+ +
- diff --git a/public/app/features/org/partials/orgDetails.html b/public/app/features/org/partials/orgDetails.html index d0f99e23eb7..fe988570e50 100644 --- a/public/app/features/org/partials/orgDetails.html +++ b/public/app/features/org/partials/orgDetails.html @@ -3,7 +3,7 @@

General

From 9d4fa87914adb429d6b3b4af8b3a68d8e4cbb9bd Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Fri, 18 Mar 2016 01:13:34 -0700 Subject: [PATCH 04/27] Viewer not able to delete snapshot --- pkg/api/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/api.go b/pkg/api/api.go index 30bf617e1b6..29f7863ff60 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -78,7 +78,7 @@ func Register(r *macaron.Macaron) { r.Post("/api/snapshots/", bind(m.CreateDashboardSnapshotCommand{}), CreateDashboardSnapshot) r.Get("/api/snapshot/shared-options/", GetSharingOptions) r.Get("/api/snapshots/:key", GetDashboardSnapshot) - r.Get("/api/snapshots-delete/:key", DeleteDashboardSnapshot) + r.Get("/api/snapshots-delete/:key", reqEditorRole, DeleteDashboardSnapshot) // api renew session based on remember cookie r.Get("/api/login/ping", quota("session"), LoginApiPing) From 2b0499c968de9e06767fd5a958ba63657d80cced Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 17 Mar 2016 08:26:55 +0100 Subject: [PATCH 05/27] docs(plugin): update link to datasource docs --- docs/sources/plugins/datasources.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/plugins/datasources.md b/docs/sources/plugins/datasources.md index 6bd11242f52..c44cd842844 100644 --- a/docs/sources/plugins/datasources.md +++ b/docs/sources/plugins/datasources.md @@ -4,7 +4,7 @@ page_description: Datasource plugins for Grafana page_keywords: grafana, plugins, documentation --- - > Our goal is not to have a very extensive documentation but rather have actual code that people can look at. An example implementation of a datasource can be found in the grafana repo under /examples/datasource-plugin-genericdatasource + > Our goal is not to have a very extensive documentation but rather have actual code that people can look at. An example implementation of a datasource can be found in this [example datasource repo](https://github.com/grafana/simple-json-datasource) # Datasources From 3c39a935f8d6fe2ba0138f3f7a43c0326767870a Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 17 Mar 2016 10:15:10 +0100 Subject: [PATCH 06/27] docs(plugins): docs for app plugins --- docs/sources/plugins/app.md | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/sources/plugins/app.md diff --git a/docs/sources/plugins/app.md b/docs/sources/plugins/app.md new file mode 100644 index 00000000000..fcb1c556175 --- /dev/null +++ b/docs/sources/plugins/app.md @@ -0,0 +1,41 @@ +--- +page_title: App plugin +page_description: App plugin for Grafana +page_keywords: grafana, plugins, documentation +--- + + > Our goal is not to have a very extensive documentation but rather have actual code that people can look at. An example implementation of an app can be found in this [example app repo](https://github.com/grafana/example-app) + +# Apps + +App plugins is a new kind of grafana plugin that can bundle datasource and panel plugins within one package. It also enable the plugin author to create custom pages within grafana. The custom pages enables the plugin author to include things like documentation, sign up forms or controlling other services using HTTP requests. + +Datasource and panel plugins will show up like normal plugins. The custom pages will be available in the main menu. + +## README.md + +The readme file in the mounted folder will show up in the overview tab on the app page. + +## Module exports +```javascript +export { + ExampleAppConfigCtrl as ConfigCtrl, + StreamPageCtrl, + LogsPageCtrl +}; +``` +The only required export is the ConfigCtrl. Both StreamPageCtrl and LogsPageCtrl are custom pages defined in plugin.json + +## Custom pages +Custom pages are defined in the plugin.json like this. +```json +"pages": [ + { "name": "Live stream", "component": "StreamPageCtrl", "role": "Editor"}, + { "name": "Log view", "component": "LogsPageCtrl", "role": "Viewer"} +] +``` +The component field have to match one of the components exported in the module.js in the root of the plugin. + +## Bundled plugins + +When Grafana starts it will scan all directories within an app plugin and load folders containing a plugin.json as an plugin. From b1881e5f54a397d2a760641112c2af2fecba0349 Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 17 Mar 2016 11:30:25 +0100 Subject: [PATCH 07/27] docs(plugins): update links to new examples --- docs/sources/plugins/developing_plugins.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/sources/plugins/developing_plugins.md b/docs/sources/plugins/developing_plugins.md index b235fa8d3de..91d1ff3f84e 100644 --- a/docs/sources/plugins/developing_plugins.md +++ b/docs/sources/plugins/developing_plugins.md @@ -22,9 +22,7 @@ The easiset way to try your plugin with grafana is to [setup grafana for develop ## Examples / boilerplate We currently have three different examples that you can fork to get started developing your grafana plugin. - - [generic-datasource](https://github.com/grafana/grafana/tree/master/examples/datasource-plugin-genericdatasource) (small datasource plugin for quering json data from backends) + - [simple-json-datasource](https://github.com/grafana/simple-json-datasource) (small datasource plugin for quering json data from backends) - [panel-boilderplate-es5](https://github.com/grafana/grafana/tree/master/examples/panel-boilerplate-es5) - - [nginx-app](https://github.com/grafana/grafana/tree/master/examples/nginx-app) + - [example-app](https://github.com/grafana/example-app) -## Publish your plugin -We are currently working on this. From 35e53ee511b0cd329448e878680983e58d5ab585 Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 17 Mar 2016 15:13:16 +0100 Subject: [PATCH 08/27] docs(plugin): add info about enabling apps --- docs/sources/plugins/app.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/sources/plugins/app.md b/docs/sources/plugins/app.md index fcb1c556175..250af25c57d 100644 --- a/docs/sources/plugins/app.md +++ b/docs/sources/plugins/app.md @@ -10,7 +10,12 @@ page_keywords: grafana, plugins, documentation App plugins is a new kind of grafana plugin that can bundle datasource and panel plugins within one package. It also enable the plugin author to create custom pages within grafana. The custom pages enables the plugin author to include things like documentation, sign up forms or controlling other services using HTTP requests. -Datasource and panel plugins will show up like normal plugins. The custom pages will be available in the main menu. +Datasource and panel plugins will show up like normal plugins. The app pages will be available in the main menu. + + + +## Enabling app plugins +After installing an app it have to be enabled before it show up as an datasource or panel. You can do that on the app page in the config tab. ## README.md From 4c7f638f3c15c15ce5bdcd8cdf7cb0327bf98de3 Mon Sep 17 00:00:00 2001 From: bergquist Date: Fri, 18 Mar 2016 09:47:41 +0100 Subject: [PATCH 09/27] fix(datasources): fixes header condition closes #4402 --- public/app/features/plugins/partials/ds_edit.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/features/plugins/partials/ds_edit.html b/public/app/features/plugins/partials/ds_edit.html index 1470a312bb0..1866fad50a0 100644 --- a/public/app/features/plugins/partials/ds_edit.html +++ b/public/app/features/plugins/partials/ds_edit.html @@ -4,8 +4,8 @@