ssl and video settings

This commit is contained in:
Matias Alejo Garcia 2014-06-10 10:06:08 -03:00
commit 33fc4f8623
4 changed files with 16 additions and 14 deletions

View file

@ -25,6 +25,7 @@ var defaultConfig = {
host: '162.242.219.26', host: '162.242.219.26',
port: 10000, port: 10000,
path: '/', path: '/',
secure: false,
// other PeerJS config // other PeerJS config
maxPeers: 15, maxPeers: 15,

View file

@ -720,30 +720,29 @@
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>Insight API server</legend> <legend>Insight API server</legend>
<div class="row">
<label for="insight-host">Host</label> <label for="insight-host">Host</label>
<input type="text" ng-model="insightHost" class="form-control" name="insight-host"> <input type="text" ng-model="insightHost" class="form-control" name="insight-host">
</div>
<div class="row">
<label for="insight-port">Port</label> <label for="insight-port">Port</label>
<input type="number" ng-model="insightPort" class="form-control" name="insight-port"> <input type="number" ng-model="insightPort" class="form-control" name="insight-port">
</div>
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>PeerJS server</legend> <legend>PeerJS server</legend>
<div class="row">
<label for="peerjs-key">Key</label> <label for="peerjs-key">Key</label>
<input type="text" ng-model="networkKey" class="form-control" name="peerjs-key"> <input type="text" ng-model="networkKey" class="form-control" name="peerjs-key">
</div>
<div class="row">
<label for="peerjs-host">Host</label> <label for="peerjs-host">Host</label>
<input type="text" ng-model="networkHost" class="form-control" name="peerjs-host"> <input type="text" ng-model="networkHost" class="form-control" name="peerjs-host">
</div>
<div class="row">
<label for="peerjs-port">Port</label> <label for="peerjs-port">Port</label>
<input type="number" ng-model="networkPort" class="form-control" name="peerjs-port"> <input type="number" ng-model="networkPort" class="form-control" name="peerjs-port">
</div> <input id="peerjs-secure" type="checkbox" ng-model="networkSecure" class="form-control" disabled="disabled">
<label for="peerjs-secure">Use SSL (disabled)</label>
</fieldset> </fieldset>
<fieldset>
<legend>Videoconferencing</legend>
<input id="disableVideo-opt" type="checkbox" ng-model="disableVideo" class="form-control">
<label for="disableVideo-opt">Enable videoconferencing (only for fast Networks)</label>
</fieldset>
</div> </div>
<div class="row"> <div class="row">
<div class="large-12 columns line-dashed"> <div class="large-12 columns line-dashed">

View file

@ -10,8 +10,8 @@ angular.module('copayApp.controllers').controller('SettingsController',
$scope.networkKey = config.network.key; $scope.networkKey = config.network.key;
$scope.networkHost = config.network.host; $scope.networkHost = config.network.host;
$scope.networkPort = config.network.port; $scope.networkPort = config.network.port;
$scope.networkSecure = config.network.secure || false;
$scope.disableVideo = config.disableVideo || true;
$scope.$watch('networkName', function(net) { $scope.$watch('networkName', function(net) {
$scope.insightHost = net === 'testnet' ? 'test.insight.is' : 'live.insight.is'; $scope.insightHost = net === 'testnet' ? 'test.insight.is' : 'live.insight.is';
@ -22,6 +22,7 @@ angular.module('copayApp.controllers').controller('SettingsController',
network.key = $scope.networkKey; network.key = $scope.networkKey;
network.host = $scope.networkHost; network.host = $scope.networkHost;
network.port = $scope.networkPort; network.port = $scope.networkPort;
network.secure = $scope.networkSecure;
localStorage.setItem('config', JSON.stringify({ localStorage.setItem('config', JSON.stringify({
networkName: $scope.networkName, networkName: $scope.networkName,
@ -33,7 +34,8 @@ angular.module('copayApp.controllers').controller('SettingsController',
host: $scope.insightHost, host: $scope.insightHost,
port: $scope.insightPort port: $scope.insightPort
}, },
network: network network: network,
disableVideo: $scope.disableVideo,
}) })
); );

View file

@ -31,7 +31,7 @@ function Network(opts) {
ts:parseInt(64), ts:parseInt(64),
}; };
this.opts = {}; this.opts = {};
['config', 'port', 'host', 'path', 'debug', 'key'].forEach(function(k) { ['config', 'port', 'host', 'path', 'debug', 'key', 'secure'].forEach(function(k) {
if (opts[k]) self.opts[k] = opts[k]; if (opts[k]) self.opts[k] = opts[k];
}); });
this.cleanUp(); this.cleanUp();