Skip to content

Commit 09850af

Browse files
committed
Fix API version and polish tx graph
1 parent 7ff26b1 commit 09850af

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

priv/admin/admin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ return {
10071007
$scope.txChartObject.options = {
10081008
"vAxes": {
10091009
0: {"title": 'Tx Time [ms]', "minValue": 0, "maxValue": 5000},
1010-
1: {"title": 'Tx in Hour [ms]', "minValue": 0, "maxValue": 36000}
1010+
1: {"title": 'Tx in Hour [ms]', "minValue": 0, "maxValue": 1}
10111011
},
10121012
"series": {
10131013
0: {"targetAxisIndex": 0},

rebar.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
]}.
1313

1414
{deps, [
15-
{lorawan_server_api, {git, "https://github.com/gotthardp/lorawan-server-api.git", {branch, "master"}}},
15+
{lorawan_server_api, {git, "https://github.com/gotthardp/lorawan-server-api.git", {tag, "v0.4.8"}}},
1616
{lager, {git, "https://github.com/basho/lager.git", {tag, "3.2.4"}}},
1717
{syn, {git, "https://github.com/ostinelli/syn.git", {tag, "1.6.1"}}},
1818
{worker_pool, {git, "https://github.com/inaka/worker_pool.git", {tag, "3.0.0"}}},

src/lorawan_admin_gwgraph.erl

+3-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ get_gateway(Req, #state{format=tgraph}=State) ->
7777
fun ({Date, {_, Duration, Sum}}) ->
7878
{true, [{c, [
7979
[{v, encode_timestamp(Date)}],
80-
[{v, Duration}],
81-
[{v, Sum}]
80+
[{v, round(Duration)}],
81+
[{v, Sum/36000}, {f, <<(integer_to_binary(round(Sum)))/binary,
82+
" (", (float_to_binary(Sum/36000, [{decimals, 3}, compact]))/binary, "%)">>}]
8283
]}]};
8384
(_Else) ->
8485
false

0 commit comments

Comments
 (0)