diff --git a/index.html b/index.html index 7ef6832..5c98e7f 100755 --- a/index.html +++ b/index.html @@ -565,7 +565,7 @@
-
http://
+
http(s)://

Enter the ip or dns name of the server on which the rpc for aria2 is running (default = localhost)

diff --git a/js/connection.js b/js/connection.js index 7b1fe0c..d8a4305 100644 --- a/js/connection.js +++ b/js/connection.js @@ -87,7 +87,7 @@ var SocketRPC = function(conf) { rpc.initialized = true; }; rpc.sock.onclose = rpc.sock.onerror = function() { - _.each(handles, function(h) { h.error() }); + _.each(rpc.handles, function(h) { h.error() }); rpc.handles = []; }; rpc.sock.onmessage = function(message) { diff --git a/js/script.js b/js/script.js index 4eeedf4..b64b9e2 100755 --- a/js/script.js +++ b/js/script.js @@ -25,16 +25,18 @@ var server_conf = { port: 6800, user: "", pass: "", - encryption: false + encryption: false, + dirty: false }; -var ariaConnection = new AriaConnection(server_conf); +var ariaConnection; var set_conf_cookie = function() { setCookie('aria2_server_conf', JSON.stringify(server_conf), 30 * 12); } var get_conf_cookie = function() { if (getCookie( $.trim('aria2_server_conf'))) { server_conf = JSON.parse(getCookie('aria2_server_conf')); + server_conf.dirty = false; } } var custom_aria2_connect = function() { @@ -58,6 +60,7 @@ var update_server_conf = function() { if(port.length !== 0) { server_conf.port = port; } + server_conf.dirty = false; set_conf_cookie(); ariaConnection = new AriaConnection(server_conf); clear_dialogs(); @@ -69,7 +72,8 @@ var aria_syscall = function(conf, multicall, old) { ariaConnection.invoke(conf); } var update_ui = function() { - updateDownloads(); + if (!server_conf.dirty) + updateDownloads(); }; $(function() { @@ -93,6 +97,7 @@ $(function() { modals.new_torrent_modal = $('#new_torrent').modal(modal_conf); modals.new_metalink_modal = $('#new_metalink').modal(modal_conf); + ariaConnection = new AriaConnection(server_conf) update_ui(); globalGraphData = { downSpeed: [], @@ -931,6 +936,7 @@ function updateDownloads() { updateGlobalStatistics(data.result[3][0]); }, error: function() { + server_conf.dirty = true; modals.err_connect.modal('show'); } }, true);