diff --git a/htdocs/frontend/images/chart_curve.png b/htdocs/frontend/images/chart_curve.png deleted file mode 100644 index 01e933a..0000000 Binary files a/htdocs/frontend/images/chart_curve.png and /dev/null differ diff --git a/htdocs/frontend/images/types/bolt.png b/htdocs/frontend/images/types/bolt.png new file mode 100644 index 0000000..9680afd Binary files /dev/null and b/htdocs/frontend/images/types/bolt.png differ diff --git a/htdocs/frontend/images/types/clock.png b/htdocs/frontend/images/types/clock.png new file mode 100644 index 0000000..e2672c2 Binary files /dev/null and b/htdocs/frontend/images/types/clock.png differ diff --git a/htdocs/frontend/images/types/cloud.png b/htdocs/frontend/images/types/cloud.png new file mode 100644 index 0000000..3f73eaa Binary files /dev/null and b/htdocs/frontend/images/types/cloud.png differ diff --git a/htdocs/frontend/images/types/flame.png b/htdocs/frontend/images/types/flame.png new file mode 100644 index 0000000..c1e564b Binary files /dev/null and b/htdocs/frontend/images/types/flame.png differ diff --git a/htdocs/frontend/images/folder.png b/htdocs/frontend/images/types/folder.png similarity index 100% rename from htdocs/frontend/images/folder.png rename to htdocs/frontend/images/types/folder.png diff --git a/htdocs/frontend/images/types/house.png b/htdocs/frontend/images/types/house.png new file mode 100644 index 0000000..fed6221 Binary files /dev/null and b/htdocs/frontend/images/types/house.png differ diff --git a/htdocs/frontend/images/types/propeller.png b/htdocs/frontend/images/types/propeller.png new file mode 100644 index 0000000..976187e Binary files /dev/null and b/htdocs/frontend/images/types/propeller.png differ diff --git a/htdocs/frontend/images/types/radioactivity.png b/htdocs/frontend/images/types/radioactivity.png new file mode 100644 index 0000000..4dad70c Binary files /dev/null and b/htdocs/frontend/images/types/radioactivity.png differ diff --git a/htdocs/frontend/images/types/rain.png b/htdocs/frontend/images/types/rain.png new file mode 100644 index 0000000..cb3d54d Binary files /dev/null and b/htdocs/frontend/images/types/rain.png differ diff --git a/htdocs/frontend/images/types/sun.png b/htdocs/frontend/images/types/sun.png new file mode 100644 index 0000000..0156c26 Binary files /dev/null and b/htdocs/frontend/images/types/sun.png differ diff --git a/htdocs/frontend/images/types/thermometer.png b/htdocs/frontend/images/types/thermometer.png new file mode 100644 index 0000000..674efbf Binary files /dev/null and b/htdocs/frontend/images/types/thermometer.png differ diff --git a/htdocs/frontend/images/types/user.png b/htdocs/frontend/images/types/user.png new file mode 100644 index 0000000..79f35cc Binary files /dev/null and b/htdocs/frontend/images/types/user.png differ diff --git a/htdocs/frontend/images/types/waterdrop.png b/htdocs/frontend/images/types/waterdrop.png new file mode 100644 index 0000000..9d645ff Binary files /dev/null and b/htdocs/frontend/images/types/waterdrop.png differ diff --git a/htdocs/frontend/javascripts/entity.js b/htdocs/frontend/javascripts/entity.js index 2827a5a..0cd9ce0 100644 --- a/htdocs/frontend/javascripts/entity.js +++ b/htdocs/frontend/javascripts/entity.js @@ -148,6 +148,7 @@ Entity.prototype.getRow = function() { .append($('') .text(this.title) .addClass('indicator') + .css('background-image', 'url(images/types/' + this.definition.icon + ')') ) ) .append($('').text(this.definition.translation[vz.options.language])) // channel type @@ -211,20 +212,23 @@ Entity.prototype.loadData = function() { vz.options.plot.yaxis.min = null; } - // update entity table - var unit = ' ' + this.definition.unit; + // update details in table $('#entity-' + this.uuid + ' .min') - .text(vz.wui.formatNumber(this.data.min[1]) + unit) + .text(vz.wui.formatNumber(this.data.min[1]) + this.definition.unit) .attr('title', $.plot.formatDate(new Date(this.data.min[0]), '%d. %b %h:%M:%S', vz.options.plot.xaxis.monthNames)); $('#entity-' + this.uuid + ' .max') - .text(vz.wui.formatNumber(this.data.max[1]) + unit) + .text(vz.wui.formatNumber(this.data.max[1]) + this.definition.unit) .attr('title', $.plot.formatDate(new Date(this.data.max[0]), '%d. %b %h:%M:%S', vz.options.plot.xaxis.monthNames)); $('#entity-' + this.uuid + ' .average') - .text(vz.wui.formatNumber(this.data.average) + unit); + .text(vz.wui.formatNumber(this.data.average) + this.definition.unit); $('#entity-' + this.uuid + ' .last') - .text(vz.wui.formatNumber(this.data.tuples.last()[1]) + unit); + .text(vz.wui.formatNumber(this.data.tuples.last()[1]) + this.definition.unit); if (this.definition.interpreter == 'Volkszaehler\\Interpreter\\MeterInterpreter') { // sensors have no consumption - $('#entity-' + this.uuid + ' .consumption').text(vz.wui.formatNumber(this.data.consumption) + unit + 'h'); + var consumption = vz.wui.formatNumber((this.data.consumption > 1000) ? this.data.consumption / 1000 : this.data.consumption); + var unit = ((this.data.consumption > 1000) ? ' k' : ' ') + this.definition.unit + 'h'; + var cost = (this.cost !== undefined) ? ' (' + vz.wui.formatNumber(this.cost * this.data.consumption) + ' €)' : ''; + + $('#entity-' + this.uuid + ' .consumption').text(consumption + unit + cost); } } else { // no data available, clear table