Better crash display, closes #88

This commit is contained in:
Dane Everitt 2016-09-17 19:27:02 -04:00
parent e526cf73c4
commit 7b7bbdf576

View file

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