diff --git a/.gitignore b/.gitignore
index 20e8fffb3b1..a78b4a15da5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,6 +54,7 @@ profile.cov
/pkg/cmd/grafana-server/grafana-server
/pkg/cmd/grafana-server/debug
/pkg/extensions
+/public/app/enterprise
debug.test
/examples/*/dist
/packaging/**/*.rpm
diff --git a/pkg/api/api.go b/pkg/api/api.go
index 39b332aeb9f..602f5a8d596 100644
--- a/pkg/api/api.go
+++ b/pkg/api/api.go
@@ -10,10 +10,10 @@ import (
)
func (hs *HTTPServer) registerRoutes() {
- reqSignedIn := middleware.Auth(&middleware.AuthOptions{ReqSignedIn: true})
- reqGrafanaAdmin := middleware.Auth(&middleware.AuthOptions{ReqSignedIn: true, ReqGrafanaAdmin: true})
- reqEditorRole := middleware.RoleAuth(m.ROLE_EDITOR, m.ROLE_ADMIN)
- reqOrgAdmin := middleware.RoleAuth(m.ROLE_ADMIN)
+ reqSignedIn := middleware.ReqSignedIn
+ reqGrafanaAdmin := middleware.ReqGrafanaAdmin
+ reqEditorRole := middleware.ReqEditorRole
+ reqOrgAdmin := middleware.ReqOrgAdmin
redirectFromLegacyDashboardURL := middleware.RedirectFromLegacyDashboardURL()
redirectFromLegacyDashboardSoloURL := middleware.RedirectFromLegacyDashboardSoloURL()
quota := middleware.Quota
diff --git a/pkg/middleware/middleware.go b/pkg/middleware/middleware.go
index 475dce089b1..3e83a60f94b 100644
--- a/pkg/middleware/middleware.go
+++ b/pkg/middleware/middleware.go
@@ -14,6 +14,13 @@ import (
"github.com/grafana/grafana/pkg/util"
)
+var (
+ ReqGrafanaAdmin = Auth(&AuthOptions{ReqSignedIn: true, ReqGrafanaAdmin: true})
+ ReqSignedIn = Auth(&AuthOptions{ReqSignedIn: true})
+ ReqEditorRole = RoleAuth(m.ROLE_EDITOR, m.ROLE_ADMIN)
+ ReqOrgAdmin = RoleAuth(m.ROLE_ADMIN)
+)
+
func GetContextHandler() macaron.Handler {
return func(c *macaron.Context) {
ctx := &m.ReqContext{
diff --git a/public/app/app.ts b/public/app/app.ts
index 8e30747072e..7fed8d5a44b 100644
--- a/public/app/app.ts
+++ b/public/app/app.ts
@@ -29,6 +29,12 @@ _.move = (array, fromIndex, toIndex) => {
import { coreModule, registerAngularDirectives } from './core/core';
import { setupAngularRoutes } from './routes/routes';
+// import enterprise frontend
+const enterpriseIndex = (require as any).context('.', true, /enterprise\/index.ts/);
+enterpriseIndex.keys().forEach(key => {
+ enterpriseIndex(key);
+});
+
declare var System: any;
export class GrafanaApp {
diff --git a/public/app/extensions/index.ts b/public/app/extensions/index.ts
deleted file mode 100644
index d265303a6ee..00000000000
--- a/public/app/extensions/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-let components = (require as any).context('.', true, /\.tsx?/);
-components.keys().forEach(key => {
- console.log('extension component', components(key));
-});
diff --git a/public/app/extensions/test/test.ts b/public/app/extensions/test/test.ts
deleted file mode 100644
index be4fd52ed2d..00000000000
--- a/public/app/extensions/test/test.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export class Tester {}
-
-console.log('Tester');
diff --git a/public/app/features/admin/index.ts b/public/app/features/admin/index.ts
index 44628deb94f..7d06155b6f8 100644
--- a/public/app/features/admin/index.ts
+++ b/public/app/features/admin/index.ts
@@ -4,7 +4,6 @@ import AdminListOrgsCtrl from './AdminListOrgsCtrl';
import AdminEditOrgCtrl from './AdminEditOrgCtrl';
import StyleGuideCtrl from './StyleGuideCtrl';
-import config from 'app/core/config';
import coreModule from 'app/core/core_module';
class AdminSettingsCtrl {
@@ -36,21 +35,3 @@ coreModule.controller('AdminEditOrgCtrl', AdminEditOrgCtrl);
coreModule.controller('AdminSettingsCtrl', AdminSettingsCtrl);
coreModule.controller('AdminHomeCtrl', AdminHomeCtrl);
coreModule.controller('StyleGuideCtrl', StyleGuideCtrl);
-
-if (config.buildInfo.isEnterprise) {
- class AdminLicensingCtrl {
- navModel: any;
-
- /** @ngInject */
- constructor($scope, backendSrv, navModelSrv) {
- this.navModel = navModelSrv.getNav('cfg', 'admin', 'licensing', 1);
-
- backendSrv.get('/api/licensing/token').then(token => {
- token.maxUsers = token.max_users >= 0 ? token.max_users : 'Unlimited';
- $scope.token = token;
- });
- }
- }
-
- coreModule.controller('AdminLicensingCtrl', AdminLicensingCtrl);
-}
diff --git a/public/app/features/admin/partials/licensing.html b/public/app/features/admin/partials/licensing.html
deleted file mode 100644
index 8ff4836bc4a..00000000000
--- a/public/app/features/admin/partials/licensing.html
+++ /dev/null
@@ -1,56 +0,0 @@
-
| License Details | -|
| License ID | -{{token.lid}} (View Details) | -
| Licensed URL | -{{token.sub}} | -
| Company | -{{token.company}} | -
| Products | -
- {{product}}
- |
-
| Max Users | -{{token.maxUsers}} | -
| License Issued | -{{token.nbf*1000 | date:'medium'}} | -
| License Expires | -{{token.lexp*1000 | date:'medium'}} | -
| Token Details | -|
| Token ID | -{{token.jti}} | -
| Token Issued | -{{token.iat*1000 | date:'medium'}} | -
| Token Expires | -{{token.exp*1000 | date:'medium'}} | -