Commit b66894f7 by Torkel Ödegaard

Added system admin page skeleton

parent 1d769fe4
......@@ -45,19 +45,19 @@ function (angular) {
};
$scope.getDatasources = function() {
backendSrv.get('/api/admin/datasources/list').then(function(results) {
backendSrv.get('/api/datasources/list').then(function(results) {
$scope.datasources = results;
});
};
$scope.remove = function(ds) {
backendSrv.delete('/api/admin/datasources/' + ds.id).then(function() {
backendSrv.delete('/api/datasources/' + ds.id).then(function() {
$scope.getDatasources();
});
};
$scope.update = function() {
backendSrv.post('/api/admin/datasources', $scope.current).then(function() {
backendSrv.post('/api/datasources', $scope.current).then(function() {
$scope.editor.index = 0;
$scope.getDatasources();
});
......@@ -68,7 +68,7 @@ function (angular) {
return;
}
backendSrv.put('/api/admin/datasources', $scope.current)
backendSrv.put('/api/datasources', $scope.current)
.then(function() {
$scope.editor.index = 0;
$scope.getDatasources();
......
......@@ -6,7 +6,7 @@
<div class="dashboard-editor-header">
<div class="dashboard-editor-title">
<i class="icon icon-sitemap"></i>
<i class="fa fa-sitemap"></i>
Data sources
</div>
......
define([
'angular',
],
function (angular) {
'use strict';
var module = angular.module('grafana.controllers');
module.controller('AdminCtrl', function($scope) {
$scope.init = function() {
$scope.editor = {index: 0};
};
$scope.init();
});
});
<div ng-include="'app/partials/navbar.html'" ng-init="pageTitle='Admin'"></div>
<div class="dashboard-edit-view" style="min-height: 500px">
<div class="editor-row">
<div class="section">
<div class="dashboard-editor-header">
<div class="dashboard-editor-title">
<i class="fa fa-instiution"></i>
System administration
</div>
<div ng-model="editor.index" bs-tabs style="text-transform:capitalize;">
<div ng-repeat="tab in ['Settings','Users', 'Log', 'Audit']" data-title="{{tab}}">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
......@@ -7,7 +7,8 @@ define([
'./opentsdb/datasource',
'./elasticsearch/datasource',
'./dashboard/all',
'./admin/accountCtrl',
'./admin/datasourcesCtrl',
'./account/accountCtrl',
'./account/datasourcesCtrl',
'./admin/adminCtrl',
'./grafanaDatasource/datasource',
], function () {});
......@@ -20,13 +20,16 @@
<i class="fa fa-bolt" style="padding-right: 23px"></i>
Alerts
</a>
<a class="pro-sidemenu-link" href="admin/datasources">
<a class="pro-sidemenu-link" href="account/datasources">
<i class="fa fa-sitemap"></i>
Data sources
</a>
<a class="pro-sidemenu-link" href="account">
<i class="fa fa-user"></i>
Account settings
Account
</a>
<a class="pro-sidemenu-link" href="admin">
<i class="fa fa-institution"></i>Admin
</a>
<a class="pro-sidemenu-link" href="login?logout">
<i class="fa fa-sign-out"></i>
......
......@@ -30,14 +30,18 @@ define([
controller : 'DashFromImportCtrl',
reloadOnSearch: false,
})
.when('/admin/datasources', {
templateUrl: 'app/features/admin/partials/datasources.html',
.when('/account/datasources', {
templateUrl: 'app/features/account/partials/datasources.html',
controller : 'DataSourcesCtrl',
})
.when('/account', {
templateUrl: 'app/features/admin/partials/account.html',
templateUrl: 'app/features/account/partials/account.html',
controller : 'AccountCtrl',
})
.when('/admin/', {
templateUrl: 'app/features/admin/partials/admin.html',
controller : 'AdminCtrl',
})
.when('/login', {
templateUrl: 'app/partials/login.html',
controller : 'LoginCtrl',
......
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