mirror of
https://github.com/gwenhael-le-moine/credger.git
synced 2024-12-26 09:58:36 +01:00
red/green total in tooltip
This commit is contained in:
parent
08861e44bc
commit
bbbc714f68
3 changed files with 15 additions and 13 deletions
2
Makefile
2
Makefile
|
@ -14,7 +14,7 @@ pull-deps:
|
||||||
cd public/vendor; npm install
|
cd public/vendor; npm install
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm public/js/app.min.js public/js/app.js
|
-rm public/js/app.min.js public/js/app.js credger
|
||||||
|
|
||||||
clean-all:
|
clean-all:
|
||||||
-rm -fr lib/ public/vendor/node_modules
|
-rm -fr lib/ public/vendor/node_modules
|
||||||
|
|
|
@ -94,6 +94,8 @@ app.component('dashboard',
|
||||||
return series.filter((s) => { return s.value != 0; });
|
return series.filter((s) => { return s.value != 0; });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let total = e.series.reduce((memo, serie) => { return memo + serie.value; }, 0);
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<h2>${e.value}</h2>
|
<h2>${e.value}</h2>
|
||||||
<table>
|
<table>
|
||||||
|
@ -101,10 +103,10 @@ app.component('dashboard',
|
||||||
${prepare_series(e.series).map((s) => { return format_line(s); }).join("")}
|
${prepare_series(e.series).map((s) => { return format_line(s); }).join("")}
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr style="color: #ececec; background-color: ${total < 0 ? 'green' : 'red'}">
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td style="text-align: right; text-decoration: underline; font-weight: bold;">Total</td>
|
<td style="text-align: right; text-decoration: underline; font-weight: bold;">Total</td>
|
||||||
<td style="text-align: right; font-weight: bold;">${e.series.reduce((memo, serie) => { return memo + serie.value; }, 0)}</td>
|
<td style="text-align: right; font-weight: bold;">${total}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -2,7 +2,7 @@ version: 1.0
|
||||||
shards:
|
shards:
|
||||||
kemal:
|
kemal:
|
||||||
github: kemalcr/kemal
|
github: kemalcr/kemal
|
||||||
commit: 8cb9770ec3c6cf5897e644229dad8d0b5c360941
|
commit: 50f82f51874babe92cbb808013647a7989d54354
|
||||||
|
|
||||||
kilt:
|
kilt:
|
||||||
github: jeromegn/kilt
|
github: jeromegn/kilt
|
||||||
|
|
Loading…
Reference in a new issue