luci-mod-status: use raw dsl values and format them ourselves 4635/head
authorAndre Heider <a.heider@gmail.com>
Fri, 4 Dec 2020 08:42:52 +0000 (09:42 +0100)
committerAndre Heider <a.heider@gmail.com>
Fri, 4 Dec 2020 11:47:51 +0000 (12:47 +0100)
Currently lantiq_dsl.sh performs these formats expensively in a shell
script. Use the raw values so the preformatted onces can be removed to
cut down the runtime or the script.

Signed-off-by: Andre Heider <a.heider@gmail.com>
modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js

index cafd554f9a110bf6ae01b54554820b47eec99bb5..4150b5513335c5eff9655871a7cc4ff7ab200a22 100644 (file)
@@ -16,12 +16,12 @@ function renderbox(dsl) {
                        L.itemlist(E('span'), [
                                _('Line State'), '%s [0x%x]'.format(dsl.line_state, dsl.line_state_detail),
                                _('Line Mode'), dsl.line_mode_s || '-',
-                               _('Line Uptime'), dsl.line_uptime_s || '-',
+                               _('Line Uptime'), '%t'.format(dsl.line_uptime),
                                _('Annex'), dsl.annex_s || '-',
                                _('Profile'), dsl.profile_s || '-',
-                               _('Data Rate'), '%s/s / %s/s'.format(dsl.data_rate_down_s, dsl.data_rate_up_s),
-                               _('Max. Attainable Data Rate (ATTNDR)'), '%s/s / %s/s'.format(dsl.max_data_rate_down_s, dsl.max_data_rate_up_s),
-                               _('Latency'), '%s / %s'.format(dsl.latency_num_down, dsl.latency_num_up),
+                               _('Data Rate'), '%1000.3mb/s / %1000.3mb/s'.format(dsl.data_rate_down, dsl.data_rate_up),
+                               _('Max. Attainable Data Rate (ATTNDR)'), '%1000.3mb/s / %1000.3mb/s'.format(dsl.max_data_rate_down, dsl.max_data_rate_up),
+                               _('Latency'), '%.2f ms / %.2f ms'.format(dsl.latency_down / 1000, dsl.latency_up / 1000),
                                _('Line Attenuation (LATN)'), '%.1f dB / %.1f dB'.format(dsl.line_attenuation_down, dsl.line_attenuation_up),
                                _('Signal Attenuation (SATN)'), '%.1f dB / %.1f dB'.format(dsl.signal_attenuation_down, dsl.signal_attenuation_up),
                                _('Noise Margin (SNR)'), '%.1f dB / %.1f dB'.format(dsl.noise_margin_down, dsl.noise_margin_up),