Moved domain rules page out from modal into it's own page
This commit is contained in:
parent
3f6637eb8f
commit
55a5fd49dc
|
@ -87,6 +87,12 @@ angular
|
|||
controller: 'settingsController',
|
||||
data: { pageTitle: 'Settings' }
|
||||
})
|
||||
.state('backend.settingsDomains', {
|
||||
url: '^/settings/domains',
|
||||
templateUrl: 'app/settings/views/settingsDomains.html',
|
||||
controller: 'settingsDomainsController',
|
||||
data: { pageTitle: 'Domain Settings' }
|
||||
})
|
||||
.state('backend.tools', {
|
||||
url: '^/tools',
|
||||
templateUrl: 'app/tools/views/tools.html',
|
||||
|
|
|
@ -48,10 +48,6 @@ angular
|
|||
$scope.$broadcast('vaultAddFolder');
|
||||
};
|
||||
|
||||
$scope.domains = function () {
|
||||
$scope.$broadcast('settingsDomains');
|
||||
};
|
||||
|
||||
$scope.import = function () {
|
||||
$scope.$broadcast('toolsImport');
|
||||
};
|
||||
|
|
|
@ -67,14 +67,6 @@
|
|||
});
|
||||
};
|
||||
|
||||
$scope.domains = function () {
|
||||
$uibModal.open({
|
||||
animation: true,
|
||||
templateUrl: 'app/settings/views/settingsDomains.html',
|
||||
controller: 'settingsDomainsController'
|
||||
});
|
||||
};
|
||||
|
||||
$scope.delete = function () {
|
||||
$uibModal.open({
|
||||
animation: true,
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
angular
|
||||
.module('bit.settings')
|
||||
|
||||
.controller('settingsDomainsController', function ($scope, $state, apiService, $uibModalInstance, toastr, $analytics, $uibModal) {
|
||||
$analytics.eventTrack('settingsDomainsController', { category: 'Modal' });
|
||||
|
||||
.controller('settingsDomainsController', function ($scope, $state, apiService, toastr, $analytics, $uibModal) {
|
||||
$scope.globalEquivalentDomains = [];
|
||||
$scope.equivalentDomains = [];
|
||||
|
||||
|
@ -44,7 +42,6 @@
|
|||
animation: true,
|
||||
templateUrl: 'app/settings/views/settingsAddEditEquivalentDomain.html',
|
||||
controller: 'settingsAddEditEquivalentDomainController',
|
||||
size: 'sm',
|
||||
resolve: {
|
||||
domainIndex: function () { return i; },
|
||||
domains: function () { return i !== null ? $scope.equivalentDomains[i] : null; }
|
||||
|
@ -65,7 +62,15 @@
|
|||
});
|
||||
};
|
||||
|
||||
$scope.save = function () {
|
||||
$scope.saveGlobal = function () {
|
||||
$scope.globalPromise = save();
|
||||
};
|
||||
|
||||
$scope.saveCustom = function () {
|
||||
$scope.customPromise = save();
|
||||
};
|
||||
|
||||
var save = function () {
|
||||
var request = {
|
||||
ExcludedGlobalEquivalentDomains: [],
|
||||
EquivalentDomains: []
|
||||
|
@ -89,13 +94,8 @@
|
|||
request.ExcludedGlobalEquivalentDomains = null;
|
||||
}
|
||||
|
||||
$scope.submitPromise = apiService.settings.putDomains(request, function (domains) {
|
||||
$scope.close();
|
||||
return apiService.settings.putDomains(request, function (domains) {
|
||||
toastr.success('Domains have been updated.', 'Success!');
|
||||
}).$promise;
|
||||
};
|
||||
|
||||
$scope.close = function () {
|
||||
$uibModalInstance.dismiss('cancel');
|
||||
};
|
||||
});
|
||||
|
|
|
@ -17,10 +17,12 @@
|
|||
<label for="name">Domains</label> <span>*</span>
|
||||
<textarea id="domains" name="Domains" ng-model="domains" class="form-control" placeholder="ex. google.com, gmail.com"
|
||||
style="height: 100px;" required></textarea>
|
||||
|
||||
<p class="help-block">
|
||||
Only "base" domains are allowed. Do not enter subdomains.
|
||||
For example, enter "google.com" instead of "www.google.com".
|
||||
Only "base" domains are allowed. Do not enter subdomains. For example, enter "google.com" instead of
|
||||
"www.google.com".
|
||||
</p>
|
||||
<p class="help-block">
|
||||
You can also enter "androidapp://package.name" to associate an android app with other website domains.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,20 +1,61 @@
|
|||
<div class="modal-header">
|
||||
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><i class="fa fa-globe"></i> Domain Rules</h4>
|
||||
</div>
|
||||
<form name="domainsForm" ng-submit="domainsForm.$valid && save()" api-form="submitPromise">
|
||||
<div class="modal-body">
|
||||
<section class="content-header">
|
||||
<h1>Domain Rules</h1>
|
||||
</section>
|
||||
<section class="content">
|
||||
<p>
|
||||
If you have the same login across multiple different website domains, you can mark the website as "equivalent".
|
||||
"Global" domains are ones created for you by bitwarden.
|
||||
"Global" domains are ones already created for you by bitwarden.
|
||||
</p>
|
||||
<form name="customForm" ng-submit="customForm.$valid && saveCustom()" api-form="customPromise">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Custom Equivalent Domains</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" ng-click="addEdit(null)">
|
||||
<i class="fa fa-plus"></i> Add New
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Global Equivalent Domains</th>
|
||||
<tbody ng-if="equivalentDomains.length">
|
||||
<tr ng-repeat="customDomain in equivalentDomains track by $index">
|
||||
<td style="width: 80px; min-width: 80px;">
|
||||
<button type="button" class="btn btn-link btn-table" uib-tooltip="Edit" ng-click="addEdit($index)">
|
||||
<i class="fa fa-lg fa-pencil"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-link btn-table" uib-tooltip="Delete" ng-click="delete($index)">
|
||||
<i class="fa fa-lg fa-trash"></i>
|
||||
</button>
|
||||
</td>
|
||||
<td>{{customDomain}}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
<tbody ng-if="!equivalentDomains.length">
|
||||
<tr>
|
||||
<td>No domains to list.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="customForm.$loading">
|
||||
<i class="fa fa-refresh fa-spin loading-icon" ng-show="customForm.$loading"></i>Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form name="globalForm" ng-submit="globalForm.$valid && saveGlobal()" api-form="globalPromise">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Global Equivalent Domains</h3>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<tbody ng-if="globalEquivalentDomains.length">
|
||||
<tr ng-repeat="globalDomain in globalEquivalentDomains">
|
||||
<td style="width: 80px; min-width: 80px;">
|
||||
|
@ -41,43 +82,13 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
Custom Equivalent Domains
|
||||
<a href="javascript:void(0)" ng-click="addEdit(null)">
|
||||
<i class="fa fa-plus"></i> Add New
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-if="equivalentDomains.length">
|
||||
<tr ng-repeat="customDomain in equivalentDomains track by $index">
|
||||
<td style="width: 80px; min-width: 80px;">
|
||||
<button type="button" class="btn btn-link btn-table" uib-tooltip="Edit" ng-click="addEdit($index)">
|
||||
<i class="fa fa-lg fa-pencil"></i>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="globalForm.$loading">
|
||||
<i class="fa fa-refresh fa-spin loading-icon" ng-show="globalForm.$loading"></i>Save
|
||||
</button>
|
||||
<button type="button" class="btn btn-link btn-table" uib-tooltip="Delete" ng-click="delete($index)">
|
||||
<i class="fa fa-lg fa-trash"></i>
|
||||
</button>
|
||||
</td>
|
||||
<td>{{customDomain}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody ng-if="!equivalentDomains.length">
|
||||
<tr>
|
||||
<td>No domains to list.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="domainsForm.$loading">
|
||||
<i class="fa fa-refresh fa-spin loading-icon" ng-show="domainsForm.$loading"></i>Save
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
|
|
|
@ -56,11 +56,12 @@
|
|||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="treeview" ng-class="{active: $state.includes('backend.settings')}">
|
||||
<li class="treeview"
|
||||
ng-class="{active: $state.includes('backend.settings') || $state.includes('backend.settingsDomains')}">
|
||||
<a ui-sref="backend.settings"><i class="fa fa-cogs"></i> <span>Settings</span></a>
|
||||
<ul class="treeview-menu">
|
||||
<li>
|
||||
<a href="javascript:void(0)" ng-click="domains()">
|
||||
<a ui-sref="backend.settingsDomains">
|
||||
<i class="fa fa-circle-o"></i> Domain Rules
|
||||
</a>
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue