1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-06 10:33:57 +00:00

stubbed out new two-step settings page

This commit is contained in:
Kyle Spearrin
2017-06-19 15:29:33 -04:00
parent cddabebe86
commit 10fe79c558
7 changed files with 141 additions and 2 deletions

View File

@@ -0,0 +1,56 @@
angular
.module('bit.settings')
.controller('settingsTwoStepController', function ($scope, apiService, authService, toastr, $analytics, constants,
$filter) {
$scope.providers = [
{
type: constants.twoFactorProvider.authenticator,
name: 'Authenticator App',
description: 'Use auth app.',
enabled: false,
free: true
},
{
type: constants.twoFactorProvider.yubikey,
name: 'YubiKey OTP',
description: '',
enabled: false
},
{
type: constants.twoFactorProvider.duo,
name: 'Duo',
description: '',
enabled: false
},
{
type: constants.twoFactorProvider.u2f,
name: 'FIDO U2F Security Key',
description: '',
enabled: false
},
{
type: constants.twoFactorProvider.email,
name: 'Email',
description: '',
enabled: false
}
];
apiService.twoFactor.list({}, function (response) {
for (var i = 0; i < response.Data.length; i++) {
if (!response.Data[i].Enabled) {
continue;
}
var provider = $filter('filter')($scope.providers, { type: response.Data[i].Type });
if (provider.length) {
provider[0].enabled = true;
}
}
});
authService.getUserProfile().then(function (profile) {
_profile = profile;
});
});

View File

@@ -0,0 +1,59 @@
<section class="content-header">
<h1>Two-step Login <small>secure your account</small></h1>
</section>
<section class="content">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">Recovery Code</h3>
</div>
<div class="box-body">
Get it!
</div>
</div>
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">Providers</h3>
</div>
<div class="box-body no-padding">
<div class="table-responsive">
<table class="table table-striped table-hover table-vmiddle">
<tbody>
<tr ng-repeat="provider in providers">
<td style="width: 70px;">
<div class="btn-group" data-append-to="body">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-cog"></i> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="#" stop-click ng-click="edit(provider)">
<i class="fa fa-fw fa-pencil"></i>
{{provider.enabled ? 'Edit' : 'Enable'}}
</a>
</li>
<li>
<a href="#" stop-click ng-click="disable(provider)" class="text-red"
ng-if="provider.enabled">
<i class="fa fa-fw fa-ban"></i> Disable
</a>
</li>
</ul>
</div>
</td>
<td>
<a href="#" stop-click ng-click="edit(provider)">{{::provider.name}}</a>
<div class="text-muted text-sm">{{::provider.description}}</div>
</td>
<td style="width: 100px;" class="text-right">
<span class="label"
ng-class="{ 'label-success': provider.enabled, 'label-default': !provider.enabled }">
{{provider.enabled ? 'Enabled' : 'Disabled'}}
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>