webui: fix device edit health update icons (#5996)

Allow 0 and "" for valid health update values.
This commit is contained in:
Tony Murray 2017-02-25 04:37:13 -06:00 committed by Neil Lathwood
parent 853dd1e138
commit 5637399b95
2 changed files with 6 additions and 6 deletions

View File

@ -19,7 +19,7 @@ if (is_admin() === false) {
die('ERROR: You need to be admin');
}
if (!is_numeric($_POST['device_id']) || !is_numeric($_POST['sensor_id']) || (empty($_POST['data']) || !isset($_POST['data']))) {
if (!is_numeric($_POST['device_id']) || !is_numeric($_POST['sensor_id']) || !isset($_POST['data'])) {
echo 'error with data';
exit;
} else {

View File

@ -132,18 +132,18 @@ $( ".sensor" ).blur(function() {
dataType: "html",
success: function(data){
$this.closest('.form-group').addClass('has-success');
$this.next().addClass('fa-check');
$this.next().find('.fa').addClass('fa-check');
setTimeout(function(){
$this.closest('.form-group').removeClass('has-success');
$this.next().removeClass('fa-check');
$this.next().find('.fa').removeClass('fa-check');
}, 2000);
},
error:function(){
$(this).closest('.form-group').addClass('has-error');
$this.next().addClass('fa-times');
$this.closest('.form-group').addClass('has-error');
$this.next().find('.fa').addClass('fa-times');
setTimeout(function(){
$this.closest('.form-group').removeClass('has-error');
$this.next().removeClass('fa-times');
$this.next().find('.fa').removeClass('fa-times');
}, 2000);
}
});