Commit ed989ecc by Torkel Ödegaard

Merge branch 'master' of github.com:grafana/grafana

parents a147015e 8cf7fb7f
......@@ -31,5 +31,5 @@ public/css/*.min.css
conf/custom.ini
fig.yml
profile.cov
grafana
/grafana
.notouch
# 3.0.0 (unrelased master branch)
### New Features ###
* **Playlists**: Playlists can now be persisted and started from urls, closes [#3655](https://github.com/grafana/grafana/pull/3655)
### Breaking changes
**InfluxDB 0.8.x** The data source for the old version of influxdb (0.8.x) is no longer included in default builds. Can easily be installed via improved plugin system, closes #3523
**KairosDB** The data source is no longer included in default builds. Can easily be installed via improved plugin system, closes #3524
......
......@@ -147,6 +147,11 @@ func Register(r *macaron.Macaron) {
r.Put("/quotas/:target", bind(m.UpdateOrgQuotaCmd{}), wrap(UpdateOrgQuota))
}, reqGrafanaAdmin)
// orgs (admin routes)
r.Group("/orgs/name/:name", func() {
r.Get("/", wrap(GetOrgByName))
}, reqGrafanaAdmin)
// auth api keys
r.Group("/auth/keys", func() {
r.Get("/", wrap(GetApiKeys))
......
......@@ -20,6 +20,33 @@ func GetOrgById(c *middleware.Context) Response {
return getOrgHelper(c.ParamsInt64(":orgId"))
}
// Get /api/orgs/:name
func GetOrgByName(c *middleware.Context) Response {
query := m.GetOrgByNameQuery{Name: c.Params(":name")}
if err := bus.Dispatch(&query); err != nil {
if err == m.ErrOrgNotFound {
return ApiError(404, "Organization not found", err)
}
return ApiError(500, "Failed to get organization", err)
}
org := query.Result
result := m.OrgDetailsDTO{
Id: org.Id,
Name: org.Name,
Address: m.Address{
Address1: org.Address1,
Address2: org.Address2,
City: org.City,
ZipCode: org.ZipCode,
State: org.State,
Country: org.Country,
},
}
return Json(200, &result)
}
func getOrgHelper(orgId int64) Response {
query := m.GetOrgByIdQuery{Id: orgId}
......
///<reference path="../../../headers/common.d.ts" />
class GrafanaDatasource {
constructor(private backendSrv) {}
query(options) {
return this.backendSrv.get('/api/metrics/test', {
from: options.range.from.valueOf(),
to: options.range.to.valueOf(),
maxDataPoints: options.maxDataPoints
});
}
}
export {GrafanaDatasource};
///<reference path="../../../headers/common.d.ts" />
import angular from 'angular';
import {GrafanaDatasource} from './datasource';
var module = angular.module('grafana.directives');
module.directive('metricQueryEditorGrafana', function() {
return {templateUrl: 'app/plugins/datasource/grafana/partials/query.editor.html'};
});
export {GrafanaDatasource, GrafanaDatasource as Datasource};
///<reference path="../../../headers/common.d.ts" />
import angular from 'angular';
import {MixedDatasource} from './datasource';
var module = angular.module('grafana.directives');
module.directive('metricQueryEditorMixed', function() {
return {templateUrl: 'app/plugins/datasource/mixed/partials/query.editor.html'};
});
export {MixedDatasource, MixedDatasource as Datasource};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment