mirror of https://github.com/grafana/grafana.git
began work on reset password view, and angular controller
This commit is contained in:
parent
89418a155a
commit
e40b462040
|
|
@ -6,6 +6,7 @@ define([
|
|||
'./inspectCtrl',
|
||||
'./jsonEditorCtrl',
|
||||
'./loginCtrl',
|
||||
'./resetPasswordCtrl',
|
||||
'./sidemenuCtrl',
|
||||
'./errorCtrl',
|
||||
], function () {});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
define([
|
||||
'angular',
|
||||
'app',
|
||||
'lodash'
|
||||
],
|
||||
function (angular, app, _) {
|
||||
'use strict';
|
||||
|
||||
var module = angular.module('grafana.controllers');
|
||||
|
||||
module.controller('ResetPasswordCtrl', function($scope, contextSrv, backendSrv) {
|
||||
|
||||
contextSrv.sidemenu = false;
|
||||
$scope.sendMode = true;
|
||||
$scope.formModel = {};
|
||||
|
||||
$scope.sendResetEmail = function() {
|
||||
if (!$scope.loginForm.$valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
backendSrv.post('/api/user/password/send-reset-email', $scope.formModel).then(function() {
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
@ -91,7 +91,15 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-top: 100px">
|
||||
<div class="row" style="margin-top: 40px">
|
||||
<div class="text-center">
|
||||
<a href="reset-password/send">
|
||||
Forgot your password?
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-top: 50px">
|
||||
<div class="version-footer text-center small">
|
||||
Grafana version: {{buildInfo.version}}, commit: {{buildInfo.commit}},
|
||||
build date: {{buildInfo.buildstamp | date: 'yyyy-MM-dd HH:mm:ss' }}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
<div class="container">
|
||||
|
||||
<div class="login-box">
|
||||
|
||||
<div class="login-box-logo">
|
||||
<img src="img/logo_transparent_200x75.png">
|
||||
</div>
|
||||
|
||||
<div class="login-inner-box">
|
||||
<div class="login-tab-header">
|
||||
<button class="btn-login-tab" class="active">
|
||||
Reset password
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<form name="sendResetForm" class="login-form">
|
||||
<div class="tight-form" ng-if="sendMode">
|
||||
<ul class="tight-form-list">
|
||||
<li class="tight-form-item" style="width: 78px">
|
||||
<strong>User</strong>
|
||||
</li>
|
||||
<li>
|
||||
<input type="text" name="username" class="tight-form-input last" required ng-model='formModel.userOrEmail' placeholder="email or username" style="width: 253px">
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
<div class="login-submit-button-row">
|
||||
<button type="submit" class="btn" ng-click="sendResetEmail();" ng-class="{'btn-inverse': !sendResetForm.$valid, 'btn-primary': sendResetForm.$valid}">
|
||||
Send reset instructions
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -97,6 +97,10 @@ define([
|
|||
templateUrl: 'app/partials/login.html',
|
||||
controller : 'LoginCtrl',
|
||||
})
|
||||
.when('/reset-password/send', {
|
||||
templateUrl: 'app/partials/reset_password.html',
|
||||
controller : 'ResetPasswordCtrl',
|
||||
})
|
||||
.otherwise({
|
||||
templateUrl: 'app/partials/error.html',
|
||||
controller: 'ErrorCtrl'
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
padding: 9px 7px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
width: 150px;
|
||||
min-width: 150px;
|
||||
display: inline-block;
|
||||
border: 1px solid lighten(@btnInverseBackground, 10%);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue