Better crash display, closes #88

This commit is contained in:
Dane Everitt 2016-09-17 19:27:02 -04:00
parent e526cf73c4
commit 7b7bbdf576
1 changed files with 38 additions and 37 deletions

View File

@ -98,6 +98,9 @@
if (data.status === 1) {
color = '#53B30C';
selector = 'fa-check-circle';
} else if (data.status === 2) {
color = '#5bc0de';
selector = 'fa-circle-o-notch fa-spin'
}
$('#applyUpdate').removeClass('fa-circle-o-notch fa-spinner fa-spin fa-check-circle fa-times-circle').addClass(selector).css({ color: color });
@ -105,8 +108,6 @@
// Socket Recieves New Status from Scales
socket.on('status', function(data) {
if(data.status !== 'crashed') {
var newStatus, selector = 'fa-times-circle';
var color = '#E33200';
@ -121,6 +122,8 @@
break;
case 2:
newStatus = 'STARTING';
color = '#5bc0de';
selector = 'fa-circle-o-notch fa-spin'
break;
case 3:
newStatus = 'STOPPING';
@ -134,17 +137,15 @@
}, {
type: 'info'
});
});
} else {
socket.on('crashed', function () {
$.notify({
message: '{{ trans('server.ajax.socket_status_crashed') }}'
}, {
delay: 5000,
type: 'danger'
});
}
});
});