icons url for self hosted instances

This commit is contained in:
Kyle Spearrin 2017-10-23 18:11:29 -04:00
parent 4323341d19
commit b52ecd8085
7 changed files with 10 additions and 10 deletions

View File

@ -2,6 +2,7 @@
"appSettings": {
"apiUri": "https://preview-api.bitwarden.com",
"identityUri": "https://preview-identity.bitwarden.com",
"iconsUri": "https://icons.bitwarden.com",
"stripeKey": "pk_test_KPoCfZXu7mznb9uSCPZ2JpTD",
"braintreeKey": "sandbox_r72q8jq6_9pnxkwm75f87sdc2",
"whitelistDomains": [

View File

@ -2,6 +2,7 @@
"appSettings": {
"apiUri": "https://api.bitwarden.com",
"identityUri": "https://identity.bitwarden.com",
"iconsUri": "https://icons.bitwarden.com",
"stripeKey": "pk_live_bpN0P37nMxrMQkcaHXtAybJk",
"braintreeKey": "production_qfbsv8kc_njj2zjtyngtjmbjd",
"whitelistDomains": [

View File

@ -2,6 +2,7 @@
"appSettings": {
"apiUri": "http://localhost:4000",
"identityUri": "http://localhost:33656",
"iconsUri": "https://icons.bitwarden.com",
"stripeKey": "pk_test_KPoCfZXu7mznb9uSCPZ2JpTD",
"braintreeKey": "sandbox_r72q8jq6_9pnxkwm75f87sdc2",
"whitelistDomains": [

View File

@ -189,7 +189,7 @@ angular
};
function setLoginIcon(cipher, uri, setImage) {
if (!appSettings.selfHosted && !_service.disableWebsiteIcons && uri) {
if (!_service.disableWebsiteIcons && uri) {
var hostnameUri = uri,
isWebsite = false;
@ -210,7 +210,7 @@ angular
if (setImage && isWebsite) {
try {
var url = new URL(hostnameUri);
cipher.meta.image = 'https://icons.bitwarden.com/' + url.hostname + '/icon.png';
cipher.meta.image = appSettings.iconsUri + '/' + url.hostname + '/icon.png';
}
catch (e) { }
}

View File

@ -1,2 +1,2 @@
angular.module("bit")
.constant("appSettings", {"apiUri":"https://api.bitwarden.com","identityUri":"https://identity.bitwarden.com","stripeKey":"pk_live_bpN0P37nMxrMQkcaHXtAybJk","braintreeKey":"production_qfbsv8kc_njj2zjtyngtjmbjd","whitelistDomains":["api.bitwarden.com"],"selfHosted":false,"version":"1.18.0","environment":"Production"});
.constant("appSettings", {"apiUri":"https://api.bitwarden.com","identityUri":"https://identity.bitwarden.com","iconsUri":"https://icons.bitwarden.com","stripeKey":"pk_live_bpN0P37nMxrMQkcaHXtAybJk","braintreeKey":"production_qfbsv8kc_njj2zjtyngtjmbjd","whitelistDomains":["api.bitwarden.com"],"selfHosted":false,"version":"1.18.0","environment":"Production"});

View File

@ -2,8 +2,7 @@
.module('bit.settings')
.controller('settingsController', function ($scope, $state, $uibModal, apiService, toastr, authService, $localStorage,
appSettings, $rootScope, cipherService) {
$scope.selfHosted = appSettings.selfHosted;
$rootScope, cipherService) {
$scope.model = {
profile: {},
email: null,
@ -61,10 +60,8 @@
};
$scope.optionsSave = function () {
if (!$scope.selfHosted) {
$localStorage.disableWebsiteIcons = cipherService.disableWebsiteIcons = $scope.model.disableWebsiteIcons;
$rootScope.vaultCiphers = null;
}
toastr.success('Options have been updated.', 'Success!');
};

View File

@ -86,7 +86,7 @@
</div>
</form>
</div>
<div class="box box-default" ng-if="!selfHosted">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">Web Vault Options</h3>
</div>