Update main.js

This commit is contained in:
Igor Nurullaev
2019-09-04 17:15:16 +03:00
parent fc040718c0
commit e95c2feb3d

View File

@@ -49,7 +49,19 @@ var table = new Tabulator("#copters-table", {
return animation;
}
},
{title: "Batt voltage", field: "batt_voltage"},
{
title: "Batt voltage", field: "batt_voltage", formatter: function (cell) {
let voltage = cell.getValue();
if (parseFloat(voltage) > 30) {
cell.getElement().style.background = green;
} else if (voltage) {
cell.getElement().style.background = red;
} else {
cell.getElement().style.background = null;
}
return voltage;
}
},
{
title: "Cell voltage", field: "cell_voltage", formatter: function (cell) {
let cell_voltage = cell.getValue();