ssl and video settings

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

View File

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

View File

@ -720,30 +720,29 @@
</fieldset>
<fieldset>
<legend>Insight API server</legend>
<div class="row">
<label for="insight-host">Host</label>
<input type="text" ng-model="insightHost" class="form-control" name="insight-host">
</div>
<div class="row">
<label for="insight-port">Port</label>
<input type="number" ng-model="insightPort" class="form-control" name="insight-port">
</div>
</fieldset>
<fieldset>
<legend>PeerJS server</legend>
<div class="row">
<label for="peerjs-key">Key</label>
<input type="text" ng-model="networkKey" class="form-control" name="peerjs-key">
</div>
<div class="row">
<label for="peerjs-host">Host</label>
<input type="text" ng-model="networkHost" class="form-control" name="peerjs-host">
</div>
<div class="row">
<label for="peerjs-port">Port</label>
<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>
<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 class="row">
<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.networkHost = config.network.host;
$scope.networkPort = config.network.port;
$scope.networkSecure = config.network.secure || false;
$scope.disableVideo = config.disableVideo || true;
$scope.$watch('networkName', function(net) {
$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.host = $scope.networkHost;
network.port = $scope.networkPort;
network.secure = $scope.networkSecure;
localStorage.setItem('config', JSON.stringify({
networkName: $scope.networkName,
@ -33,7 +34,8 @@ angular.module('copayApp.controllers').controller('SettingsController',
host: $scope.insightHost,
port: $scope.insightPort
},
network: network
network: network,
disableVideo: $scope.disableVideo,
})
);

View File

@ -31,7 +31,7 @@ function Network(opts) {
ts:parseInt(64),
};
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];
});
this.cleanUp();