diff --git a/pkg/api/index.go b/pkg/api/index.go index 3f4e5032905..da696df1210 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -99,8 +99,8 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) { dashboardChildNavs := []*dtos.NavLink{ {Text: "Home", Url: setting.AppSubUrl + "/", Icon: "fa fa-fw fa-home"}, - {Text: "Playlists", Url: setting.AppSubUrl + "/playlists", Icon: "fa fa-fw fa-film"}, - {Text: "Snapshots", Url: setting.AppSubUrl + "/dashboard/snapshots", Icon: "icon-gf icon-gf-snapshot"}, + {Text: "Playlists", Id: "playlists", Url: setting.AppSubUrl + "/playlists", Icon: "fa fa-fw fa-film"}, + {Text: "Snapshots", Id: "snapshots", Url: setting.AppSubUrl + "/dashboard/snapshots", Icon: "icon-gf icon-gf-snapshot"}, } data.NavTree = append(data.NavTree, &dtos.NavLink{ @@ -249,10 +249,11 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) { Icon: "fa fa-fw fa-shield", Url: setting.AppSubUrl + "/admin", Children: []*dtos.NavLink{ - {Text: "Global Users", Url: setting.AppSubUrl + "/admin/users"}, - {Text: "Global Orgs", Url: setting.AppSubUrl + "/admin/orgs"}, - {Text: "Server Settings", Url: setting.AppSubUrl + "/admin/settings"}, - {Text: "Server Stats", Url: setting.AppSubUrl + "/admin/stats"}, + {Text: "Global Users", Id: "global-users", Url: setting.AppSubUrl + "/admin/users"}, + {Text: "Global Orgs", Id: "global-orgs", Url: setting.AppSubUrl + "/admin/orgs"}, + {Text: "Server Settings", Id: "server-settings", Url: setting.AppSubUrl + "/admin/settings"}, + {Text: "Server Stats", Id: "server-stats", Url: setting.AppSubUrl + "/admin/stats"}, + {Text: "Style Guide", Id: "styleguide", Url: setting.AppSubUrl + "/admin/styleguide"}, }, }) } diff --git a/public/app/core/components/gf_page.ts b/public/app/core/components/gf_page.ts new file mode 100644 index 00000000000..d5ac3e55c88 --- /dev/null +++ b/public/app/core/components/gf_page.ts @@ -0,0 +1,42 @@ +/// + +import coreModule from 'app/core/core_module'; + +const template = ` +
+ +
+ + +
+
+
+
+`; + +export function gfPageDirective() { + return { + restrict: 'E', + template: template, + scope: { + "model": "=", + }, + transclude: { + 'header': '?gfPageHeader', + 'body': 'gfPageBody', + }, + link: function(scope, elem, attrs) { + console.log(scope); + } + }; +} + +coreModule.directive('gfPage', gfPageDirective); diff --git a/public/app/core/core.ts b/public/app/core/core.ts index fed63f37955..65b8fbbc4ec 100644 --- a/public/app/core/core.ts +++ b/public/app/core/core.ts @@ -52,6 +52,7 @@ import {NavModelSrv, NavModel} from './nav_model_srv'; import {userPicker} from './components/user_picker'; import {userGroupPicker} from './components/user_group_picker'; import {geminiScrollbar} from './components/scroll/scroll'; +import {gfPageDirective} from './components/gf_page'; export { arrayJoin, @@ -83,4 +84,5 @@ export { userPicker, userGroupPicker, geminiScrollbar, + gfPageDirective }; diff --git a/public/app/features/admin/admin.ts b/public/app/features/admin/admin.ts index 00024b6983e..98cddd1cefc 100644 --- a/public/app/features/admin/admin.ts +++ b/public/app/features/admin/admin.ts @@ -10,7 +10,7 @@ class AdminSettingsCtrl { /** @ngInject **/ constructor($scope, backendSrv, navModelSrv) { - this.navModel = navModelSrv.getAdminNav(); + this.navModel = navModelSrv.getNav('cfg', 'admin', 'server-settings'); backendSrv.get('/api/admin/settings').then(function(settings) { $scope.settings = settings; @@ -34,7 +34,7 @@ export class AdminStatsCtrl { /** @ngInject */ constructor(backendSrv: any, navModelSrv) { - this.navModel = navModelSrv.getAdminNav(); + this.navModel = navModelSrv.getNav('cfg', 'admin', 'server-stats'); backendSrv.get('/api/admin/stats').then(stats => { this.stats = stats; @@ -42,8 +42,7 @@ export class AdminStatsCtrl { } } -export class ConfigurationHomeCtrl { - navModel: any; +export class ConfigurationHomeCtrl { navModel: any; /** @ngInject */ constructor(private $scope, private backendSrv, private navModelSrv) { diff --git a/public/app/features/admin/adminEditOrgCtrl.js b/public/app/features/admin/adminEditOrgCtrl.js index 3121f5eb27b..9e569a89b46 100644 --- a/public/app/features/admin/adminEditOrgCtrl.js +++ b/public/app/features/admin/adminEditOrgCtrl.js @@ -9,7 +9,7 @@ function (angular) { module.controller('AdminEditOrgCtrl', function($scope, $routeParams, backendSrv, $location, navModelSrv) { $scope.init = function() { - $scope.navModel = navModelSrv.getAdminNav(); + $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-orgs'); if ($routeParams.id) { $scope.getOrg($routeParams.id); diff --git a/public/app/features/admin/adminEditUserCtrl.js b/public/app/features/admin/adminEditUserCtrl.js index 007a5d79153..3580c89e71a 100644 --- a/public/app/features/admin/adminEditUserCtrl.js +++ b/public/app/features/admin/adminEditUserCtrl.js @@ -11,7 +11,7 @@ function (angular, _) { $scope.user = {}; $scope.newOrg = { name: '', role: 'Editor' }; $scope.permissions = {}; - $scope.navModel = navModelSrv.getAdminNav(); + $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-users'); $scope.init = function() { if ($routeParams.id) { diff --git a/public/app/features/admin/adminListOrgsCtrl.js b/public/app/features/admin/adminListOrgsCtrl.js index c7f8225ea7e..14c5085b0d3 100644 --- a/public/app/features/admin/adminListOrgsCtrl.js +++ b/public/app/features/admin/adminListOrgsCtrl.js @@ -9,7 +9,7 @@ function (angular) { module.controller('AdminListOrgsCtrl', function($scope, backendSrv, navModelSrv) { $scope.init = function() { - $scope.navModel = navModelSrv.getAdminNav(); + $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-orgs'); $scope.getOrgs(); }; diff --git a/public/app/features/admin/admin_list_users_ctrl.ts b/public/app/features/admin/admin_list_users_ctrl.ts index fafe1dc3ac4..8a65223abb9 100644 --- a/public/app/features/admin/admin_list_users_ctrl.ts +++ b/public/app/features/admin/admin_list_users_ctrl.ts @@ -12,7 +12,7 @@ export default class AdminListUsersCtrl { /** @ngInject */ constructor(private $scope, private backendSrv, private navModelSrv) { - this.navModel = navModelSrv.getAdminNav(); + this.navModel = navModelSrv.getNav('cfg', 'admin', 'global-users'); this.query = ''; this.getUsers(); } diff --git a/public/app/features/admin/partials/admin_home.html b/public/app/features/admin/partials/admin_home.html index 4409f518f0b..266a4698cdc 100644 --- a/public/app/features/admin/partials/admin_home.html +++ b/public/app/features/admin/partials/admin_home.html @@ -2,30 +2,34 @@
- - Manage Users - - - - Manage Organizations - - - - View Server Settings - - - - View Server Stats - - - - Style guide - +
+
    +
  1. + +
    +
    +
    +
    +
    +
    + +
    +
    +
    + {{navItem.text}} +
    +
    + {{navItem.description}} +
    +
    +
    +
    +
  2. +
+
diff --git a/public/app/features/admin/partials/configuration_home.html b/public/app/features/admin/partials/configuration_home.html index fa7ed8024b4..697925b2645 100644 --- a/public/app/features/admin/partials/configuration_home.html +++ b/public/app/features/admin/partials/configuration_home.html @@ -1,12 +1,8 @@ - -
+
diff --git a/public/app/features/playlist/partials/playlist.html b/public/app/features/playlist/partials/playlist.html index bb9d1ffc110..233f3ae3e2e 100644 --- a/public/app/features/playlist/partials/playlist.html +++ b/public/app/features/playlist/partials/playlist.html @@ -2,8 +2,7 @@

A playlist rotates through a pre-selected list of Dashboards. A Playlist can be a great way to build situational awareness, or just show off your metrics to your team or visitors.

diff --git a/public/app/features/playlist/partials/playlists.html b/public/app/features/playlist/partials/playlists.html index 582174e44ff..b24d11bf70b 100644 --- a/public/app/features/playlist/partials/playlists.html +++ b/public/app/features/playlist/partials/playlists.html @@ -2,7 +2,7 @@