mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-02 15:34:05 +01:00
Update dslstats page
This commit is contained in:
parent
94eedf07bd
commit
a4e06c7c8f
2 changed files with 56 additions and 84 deletions
|
|
@ -1,43 +1,17 @@
|
|||
<luci-layout-with-sidebar>
|
||||
<div id="dslstats" ng-controller="StatsCtrl" ng-form='myForm'>
|
||||
<h2 translate>DSL Status</h2>
|
||||
<div ng-hide="online">
|
||||
{{'status.dsl.offline'|translate}}
|
||||
</div>
|
||||
<div >
|
||||
<!--<luci-table
|
||||
title="{{'DSL Connection'|translate}}"
|
||||
data="dslConnectionInfo">
|
||||
</luci-table>-->
|
||||
<luci-table
|
||||
title="{{'DSL Mode'|translate}}"
|
||||
data="dslModeInfo">
|
||||
</luci-table>
|
||||
<luci-table
|
||||
title="{{'DSL Status Information'|translate}}"
|
||||
columns="[ '', '', 'Current' ]"
|
||||
data="dslStatusInfo">
|
||||
</luci-table>
|
||||
<luci-table
|
||||
title="{{'Bit Rate'|translate}}"
|
||||
columns="[ '', 'Downstream', 'Upstream' ]"
|
||||
data="dslRateInfo">
|
||||
</luci-table>
|
||||
<luci-table
|
||||
title="{{'Operating Data'|translate}}"
|
||||
columns="[ '', 'Downstream', 'Upstream' ]"
|
||||
data="dslOpInfo">
|
||||
</luci-table>
|
||||
<luci-table
|
||||
title="{{'Error Counter'|translate}}"
|
||||
columns="[ '', 'Downstream', 'Upstream' ]"
|
||||
data="dslErrorInfo">
|
||||
</luci-table>
|
||||
<luci-table
|
||||
title="{{'Cell Statistics'|translate}}"
|
||||
columns="[ '', 'Transmitted', 'Received' ]"
|
||||
data="dslCellInfo">
|
||||
</luci-table>
|
||||
<p translate>dsl.status.info</p>
|
||||
<div ng-repeat="tbl in tables track by $index">
|
||||
<h2>{{tbl.title|translate}}</h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th ng-repeat="col in tbl.columns track by $index" style="{{($index != 0)?'text-align: center;width: 30%':''}}">{{col}}</th>
|
||||
</thead>
|
||||
<tr ng-repeat="row in tbl.rows track by $index">
|
||||
<td ng-repeat="cell in row track by $index" style="{{($index != 0)?'text-align: center;':''}}">{{cell}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</luci-layout-with-sidebar>
|
||||
|
|
|
|||
|
|
@ -42,54 +42,52 @@ JUCI.app
|
|||
dslstats.line_type = "TODO";
|
||||
}
|
||||
|
||||
// compute floating point values (because ubus blobs do not support floats yet)
|
||||
function reconstruct_floats(obj) {
|
||||
for (var property in obj) {
|
||||
if (obj.hasOwnProperty(property)) {
|
||||
if (typeof obj[property] == "object") {
|
||||
reconstruct_floats(obj[property]);
|
||||
} else {
|
||||
var matches = property.match(/(.*)_x([\d]*)/);
|
||||
if(matches && matches.length == 3){
|
||||
try {
|
||||
obj[matches[1]] = parseFloat(String(obj[property])) / parseFloat(matches[2]);
|
||||
} catch(e) {
|
||||
obj[matches[1]] = "Err";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
reconstruct_floats(dslstats);
|
||||
|
||||
//alert("Settings stats to: "+JSON.stringify(stats));
|
||||
// map data to the view tables
|
||||
|
||||
/*$scope.dslConnectionInfo.rows = [
|
||||
[ dslstats.ip, dslstats.ipstate ]
|
||||
];*/
|
||||
$scope.dslModeInfo.rows = [
|
||||
[ dslstats.mode, dslstats.traffic ]
|
||||
$scope.tables = [
|
||||
{
|
||||
title: gettext("DSL Mode"),
|
||||
columns: ["", "", "Current"],
|
||||
rows: [
|
||||
[ dslstats.mode, "", dslstats.traffic ]
|
||||
]
|
||||
},
|
||||
{
|
||||
title: gettext("DSL Status Information"),
|
||||
columns: [ '', '', 'Current' ],
|
||||
rows: [
|
||||
[ gettext("Line Status"), "", dslstats.status ]
|
||||
]
|
||||
},
|
||||
{
|
||||
title: gettext("Bit Rate"),
|
||||
columns: [ '', 'Downstream', 'Upstream' ],
|
||||
rows: [
|
||||
[ gettext('Actual Data Rate'), dslstats.bearers[0].rate_down, dslstats.bearers[0].rate_up ]
|
||||
]
|
||||
},
|
||||
{
|
||||
title: gettext("Operating Data"),
|
||||
columns: [ '', 'Downstream', 'Upstream' ],
|
||||
rows: [
|
||||
[ gettext('SNR Margin'), dslstats.snr_down, dslstats.snr_up ],
|
||||
[ gettext('Loop Attenuation'), dslstats.attn_down, dslstats.attn_up ]
|
||||
]
|
||||
},
|
||||
{
|
||||
title: gettext("Error Counter"),
|
||||
columns: [ '', 'Downstream', 'Upstream' ],
|
||||
rows: [
|
||||
[ gettext('FEC Corrections'), dslstats.counters.totals.fec_down, dslstats.counters.totals.fec_up ],
|
||||
[ gettext('CRC Errors'), dslstats.counters.totals.crc_down, dslstats.counters.totals.crc_up ]
|
||||
]
|
||||
},
|
||||
{
|
||||
title: gettext("Cell Statistics"),
|
||||
columns: [ '', 'Transmitted', 'Received' ],
|
||||
rows: [
|
||||
[ gettext('Cell Counter'), dslstats.bearers[0].total_cells_down, dslstats.bearers[0].total_cells_up ]
|
||||
]
|
||||
}
|
||||
];
|
||||
$scope.dslStatusInfo.rows = [
|
||||
[ $tr(gettext('Line Status')), "", dslstats.status ],
|
||||
//[ $tr(gettext('Line Type')), dslstats.line_type_configured, dslstats.line_type ]
|
||||
];
|
||||
$scope.dslRateInfo.rows = [
|
||||
[ $tr(gettext('Actual Data Rate')), dslstats.bearers[0].rate_down, dslstats.bearers[0].rate_up ]
|
||||
];
|
||||
$scope.dslOpInfo.rows = [
|
||||
[ $tr(gettext('SNR Margin')), dslstats.snr_down, dslstats.snr_up ],
|
||||
[ $tr(gettext('Loop Attenuation')), dslstats.attn_down, dslstats.attn_up ]
|
||||
];
|
||||
$scope.dslErrorInfo.rows = [
|
||||
[ $tr(gettext('FEC Corrections')), dslstats.counters.totals.fec_down, dslstats.counters.totals.fec_up ],
|
||||
[ $tr(gettext('CRC Errors')), dslstats.counters.totals.crc_down, dslstats.counters.totals.crc_up ]
|
||||
];
|
||||
$scope.dslCellInfo.rows = [
|
||||
[ $tr(gettext('Cell Counter')), dslstats.bearers[0].total_cells_down, dslstats.bearers[0].total_cells_up ]
|
||||
];
|
||||
$scope.dslstats = dslstats;
|
||||
$scope.$apply();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue