Improve alert messages a bit
This commit is contained in:
parent
dc9bd97eb4
commit
c22cd3c28c
|
@ -67,7 +67,7 @@ function(syscall, time, alerts, utils, rootScope, uri) {
|
||||||
if (configurations.length) {
|
if (configurations.length) {
|
||||||
// configuration worked, save it in cookie for next time and
|
// configuration worked, save it in cookie for next time and
|
||||||
// delete the pipelined configurations!!
|
// delete the pipelined configurations!!
|
||||||
alerts.log('success alas!! saving current configuration');
|
alerts.log('Success alas! Saving the current configuration…');
|
||||||
configurations = [];
|
configurations = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,11 +107,11 @@ function(syscall, time, alerts, utils, rootScope, uri) {
|
||||||
error: function() {
|
error: function() {
|
||||||
// If some proposed configurations are still in the pipeline then retry
|
// If some proposed configurations are still in the pipeline then retry
|
||||||
if (configurations.length) {
|
if (configurations.length) {
|
||||||
alerts.log('trying another configuration, last one didnt connect');
|
alerts.log("The last connection attempt was unsuccessful. Trying another configuration");
|
||||||
timeout = setTimeout(update, 0);
|
timeout = setTimeout(update, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
alerts.addAlert('<strong>Oh Snap!</strong> Could not connect to the aria2 server, retrying after ' + time / 1000 + ' secs. You might want to recheck the connection settings for your aria2 server by going to settings > connection settings', 'error');
|
alerts.addAlert('<strong>Oh Snap!</strong> Could not connect to the aria2 RPC server. Will retry in ' + time / 1000 + ' secs. You might want to check the connection settings by going to Settings > Connection Settings', 'error');
|
||||||
timeout = setTimeout(update, time);
|
timeout = setTimeout(update, time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,18 +28,18 @@ function(_, JSON, name, utils, alerts) {
|
||||||
_.each(sockRPC.handles, function(h) { h.error() });
|
_.each(sockRPC.handles, function(h) { h.error() });
|
||||||
sockRPC.handles = [];
|
sockRPC.handles = [];
|
||||||
sockRPC.initialized = false;
|
sockRPC.initialized = false;
|
||||||
alerts.log('Cannot talk to aria2 over websocket, resorting to http requests');
|
alerts.log('Cannot talk to aria2 over WebSockets! Switching to regular HTTP requests…');
|
||||||
|
|
||||||
},
|
},
|
||||||
onclose: function(ev) {
|
onclose: function(ev) {
|
||||||
if (sockRPC.handles && sockRPC.handles.length)
|
if (sockRPC.handles && sockRPC.handles.length)
|
||||||
sockRPC.onerror('Connection reset while pending calls to aria2');
|
sockRPC.onerror('Connection reset while calling aria2');
|
||||||
sockRPC.initialized = false;
|
sockRPC.initialized = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// when connection opens
|
// when connection opens
|
||||||
onopen: function() {
|
onopen: function() {
|
||||||
alerts.addAlert('Connected to aria2 successfully over websocket!', 'success');
|
alerts.addAlert('Successfully connected to aria2 over a WebSocket!', 'success');
|
||||||
sockRPC.initialized = true;
|
sockRPC.initialized = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ function(_, JSON, name, utils, alerts) {
|
||||||
sockRPC.initialized = false;
|
sockRPC.initialized = false;
|
||||||
|
|
||||||
if (typeof WebSocket == "undefined") {
|
if (typeof WebSocket == "undefined") {
|
||||||
alerts.addAlert('Web sockets not supported, falling back to jsonp', 'info');
|
alerts.addAlert('Web sockets are not supported! Falling back to JSONP.', 'info');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sockRPC.conf = conf || sockRPC.conf;
|
sockRPC.conf = conf || sockRPC.conf;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user