Add UI support for compression
This commit is contained in:
parent
bf6e92fc24
commit
d1e6bd6698
2 changed files with 10 additions and 3 deletions
|
@ -72,6 +72,12 @@
|
||||||
Encryption. Read instructions for help
|
Encryption. Read instructions for help
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="checkbox">
|
||||||
|
<label class="control-label " for="compression">
|
||||||
|
<input type="checkbox" class="" id="compression" ng-model="compression">
|
||||||
|
Compress communication with relay
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label" for="port">Lines</label>
|
<label class="control-label" for="port">Lines</label>
|
||||||
|
|
|
@ -276,7 +276,7 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers',
|
||||||
};
|
};
|
||||||
|
|
||||||
// Takes care of the connection and websocket hooks
|
// Takes care of the connection and websocket hooks
|
||||||
var connect = function (host, port, passwd, ssl) {
|
var connect = function (host, port, passwd, ssl, compression) {
|
||||||
var proto = ssl ? 'wss':'ws';
|
var proto = ssl ? 'wss':'ws';
|
||||||
websocket = new WebSocket(proto+"://" + host + ':' + port + "/weechat");
|
websocket = new WebSocket(proto+"://" + host + ':' + port + "/weechat");
|
||||||
websocket.binaryType = "arraybuffer";
|
websocket.binaryType = "arraybuffer";
|
||||||
|
@ -291,7 +291,7 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers',
|
||||||
sendAll([
|
sendAll([
|
||||||
weeChat.Protocol.formatInit({
|
weeChat.Protocol.formatInit({
|
||||||
password: passwd,
|
password: passwd,
|
||||||
compression: 'off'
|
compression: compression ? 'zlib' : 'off'
|
||||||
}),
|
}),
|
||||||
|
|
||||||
weeChat.Protocol.formatInfo({
|
weeChat.Protocol.formatInfo({
|
||||||
|
@ -532,6 +532,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
$store.bind($scope, "port", "9001");
|
$store.bind($scope, "port", "9001");
|
||||||
$store.bind($scope, "proto", "weechat");
|
$store.bind($scope, "proto", "weechat");
|
||||||
$store.bind($scope, "ssl", false);
|
$store.bind($scope, "ssl", false);
|
||||||
|
$store.bind($scope, "compression", false);
|
||||||
$store.bind($scope, "lines", "40");
|
$store.bind($scope, "lines", "40");
|
||||||
$store.bind($scope, "savepassword", false);
|
$store.bind($scope, "savepassword", false);
|
||||||
if($scope.savepassword) {
|
if($scope.savepassword) {
|
||||||
|
@ -600,7 +601,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
|
|
||||||
|
|
||||||
$scope.connect = function() {
|
$scope.connect = function() {
|
||||||
connection.connect($scope.host, $scope.port, $scope.password, $scope.ssl);
|
connection.connect($scope.host, $scope.port, $scope.password, $scope.ssl, $scope.compression);
|
||||||
};
|
};
|
||||||
$scope.disconnect = function() {
|
$scope.disconnect = function() {
|
||||||
connection.disconnect();
|
connection.disconnect();
|
||||||
|
|
Loading…
Add table
Reference in a new issue