mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'pro' of github.com:torkelo/grafana-private into pro
Conflicts: src/test/test-main.js
This commit is contained in:
commit
9b2476451e
@ -14,7 +14,7 @@ function (angular, config, _, $, store) {
|
||||
|
||||
$scope.grafanaVersion = grafanaVersion[0] === '@' ? 'master' : grafanaVersion;
|
||||
$scope.consoleEnabled = store.getBool('grafanaConsole');
|
||||
$scope.showProSideMenu = store.getBool('grafanaProSideMenu');
|
||||
//$scope.showProSideMenu = store.getBool('grafanaProSideMenu');
|
||||
|
||||
$rootScope.profilingEnabled = store.getBool('profilingEnabled');
|
||||
$rootScope.performance = { loadStart: new Date().getTime() };
|
||||
|
@ -2,7 +2,7 @@ define([
|
||||
'angular',
|
||||
'app',
|
||||
'lodash',
|
||||
'../graph/timeSeries',
|
||||
'components/timeSeries',
|
||||
'services/panelSrv',
|
||||
],
|
||||
function (angular, app, _, timeSeries) {
|
||||
|
@ -42,6 +42,12 @@
|
||||
<strong>Login failed:</strong> {{loginError}}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="register-box text-center">
|
||||
<h3>If you do not already have an account<h3>
|
||||
</a> <a href="/register" class="btn btn-info btn-large">Sign up now!</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
51
src/app/partials/pro/register.html
Normal file
51
src/app/partials/pro/register.html
Normal file
@ -0,0 +1,51 @@
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="login-box">
|
||||
|
||||
<div class="login-box-logo">
|
||||
<img src="/img/logo_transparent_200x75.png">
|
||||
</div>
|
||||
|
||||
<div class="text-center" style="margin-bottom: 50px">
|
||||
<h3>Account registration</32>
|
||||
</div>
|
||||
|
||||
<form name="loginForm" class="form-horizontal">
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputEmail">Email</label>
|
||||
<div class="controls">
|
||||
<input type="text" required ng-model="loginModel.email" id="inputEmail" placeholder="Email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputPassword">Password</label>
|
||||
<div class="controls">
|
||||
<input type="password" required ng-model="loginModel.password" id="inputPassword" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputPassword2">Confirm password</label>
|
||||
<div class="controls">
|
||||
<input type="password" required ng-model="loginModel.password2" id="password2" placeholder="Confirm password">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span4">
|
||||
<button type="submit" ng-click="register()" class="btn btn-success btn-large">
|
||||
<i class="icon-lock"></i>
|
||||
Sign up
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-error" ng-show="loginError">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<strong>Login failed:</strong> {{loginError}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
@ -38,6 +38,7 @@ function (angular) {
|
||||
$scope.emitAppEvent('setup-dashboard', dashboard);
|
||||
}).then(null, function(error) {
|
||||
alertSrv.set('Error', error, 'error');
|
||||
$scope.emitAppEvent('setup-dashboard', {});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -11,9 +11,43 @@ function (angular) {
|
||||
.when('/login', {
|
||||
templateUrl: 'app/partials/pro/login.html',
|
||||
controller : 'LoginCtrl',
|
||||
})
|
||||
.when('/register', {
|
||||
templateUrl: 'app/partials/pro/register.html',
|
||||
controller : 'RegisterCtrl',
|
||||
});
|
||||
});
|
||||
|
||||
module.controller('RegisterCtrl', function($scope, $http, $location, $routeParams) {
|
||||
$scope.loginModel = {};
|
||||
|
||||
$scope.init = function() {
|
||||
if ($routeParams.logout) {
|
||||
$scope.logout();
|
||||
}
|
||||
};
|
||||
|
||||
$scope.register = function() {
|
||||
delete $scope.registerError;
|
||||
|
||||
if (!$scope.loginForm.$valid) { return; }
|
||||
if ($scope.loginModel.password !== $scope.loginModel.password2) {
|
||||
$scope.registerError = "Passwords do not match";
|
||||
return;
|
||||
}
|
||||
|
||||
$http.post('/api/register/user', $scope.loginModel).then(function() {
|
||||
$location.path('/login');
|
||||
}, function(err) {
|
||||
$scope.registerError = "Unexpected error: " + err;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.init();
|
||||
|
||||
});
|
||||
|
||||
|
||||
module.controller('LoginCtrl', function($scope, $http, $location, $routeParams, alertSrv) {
|
||||
$scope.loginModel = {};
|
||||
|
||||
|
@ -42,9 +42,14 @@ function (angular) {
|
||||
};
|
||||
|
||||
GrafanaDatasource.prototype.saveDashboard = function(dashboard) {
|
||||
// remove id if title has changed
|
||||
if (dashboard.title !== dashboard.originalTitle) {
|
||||
dashboard.id = null;
|
||||
}
|
||||
|
||||
return $http.post('/api/dashboard/', { dashboard: dashboard })
|
||||
.then(function() {
|
||||
return { title: dashboard.title, url: '/dashboard/db/' + dashboard.title };
|
||||
.then(function(result) {
|
||||
return { title: dashboard.title, url: '/dashboard/db/' + result.data.slug };
|
||||
}, function(data) {
|
||||
throw "Failed to search: " + data;
|
||||
});
|
||||
|
@ -115,6 +115,7 @@ require([
|
||||
angular.module('grafana.filters', []);
|
||||
|
||||
require([
|
||||
'specs/overview-ctrl-specs',
|
||||
'specs/lexer-specs',
|
||||
'specs/parser-specs',
|
||||
'specs/gfunc-specs',
|
||||
@ -133,7 +134,7 @@ require([
|
||||
'specs/templateValuesSrv-specs',
|
||||
'specs/kbn-format-specs',
|
||||
'specs/dashboardSrv-specs',
|
||||
'specs/dashboardViewStateSrv-specs'
|
||||
'specs/dashboardViewStateSrv-specs',
|
||||
], function () {
|
||||
window.__karma__.start();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user