added PeerJS settings

This commit is contained in:
Mario Colque 2014-05-15 15:25:58 -03:00
parent 926bb953bd
commit ea065282c1
2 changed files with 29 additions and 18 deletions

View File

@ -598,25 +598,29 @@
<label for="network-name">Livenet</label> <label for="network-name">Livenet</label>
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>Blockchain</legend> <legend>Insight API server</legend>
<div class="row"> <div class="row">
<label for="blockchain-host">Host</label> <label for="insight-host">Host</label>
<input type="text" ng-model="blockchainHost"> <input type="text" ng-model="insightHost">
</div> </div>
<div class="row"> <div class="row">
<label for="blockchain-port">Port</label> <label for="insight-port">Port</label>
<input type="number" ng-model="blockchainPort"> <input type="number" ng-model="insightPort">
</div> </div>
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>Socket</legend> <legend>PeerJS server</legend>
<div class="row"> <div class="row">
<label for="socket-host">Host</label> <label for="peerjs-key">Host</label>
<input type="text" ng-model="socketHost"> <input type="text" ng-model="networkKey">
</div>
<div class="row">
<label for="peerjs-host">Host</label>
<input type="text" ng-model="networkHost">
</div> </div>
<div class="row"> <div class="row">
<label for="socket-port">Port</label> <label for="socket-port">Port</label>
<input type="number" ng-model="socketPort"> <input type="number" ng-model="networkPort">
</div> </div>
</fieldset> </fieldset>
</div> </div>

View File

@ -5,22 +5,29 @@ angular.module('copay.settings').controller('SettingsController',
$scope.title = 'Settings'; $scope.title = 'Settings';
$scope.networkName = config.networkName; $scope.networkName = config.networkName;
$scope.blockchainHost = config.blockchain.host; $scope.insightHost = config.blockchain.host;
$scope.blockchainPort = config.blockchain.port; $scope.insightPort = config.blockchain.port;
$scope.socketHost = config.socket.host; $scope.networkKey = config.network.key;
$scope.socketPort = config.socket.port; $scope.networkHost = config.network.host;
$scope.networkPort = config.network.port;
$scope.save = function() { $scope.save = function() {
var network = config.network;
network.key = $scope.networkKey;
network.host = $scope.networkHost;
network.port = $scope.networkPort;
localStorage.setItem('config', JSON.stringify({ localStorage.setItem('config', JSON.stringify({
networkName: $scope.networkName, networkName: $scope.networkName,
blockchain: { blockchain: {
host: $scope.blockchainHost, host: $scope.insightHost,
port: $scope.blockchainPort port: $scope.insightPort
}, },
socket: { socket: {
host: $scope.socketHost, host: $scope.insightHost,
port: $scope.socketPort port: $scope.insightPort
} },
network: network
}) })
); );