From 150e0806821d32948dedfc9b3aa23dbd5492d2f8 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Fri, 4 Dec 2020 09:42:52 +0100 Subject: [PATCH] luci-mod-status: use raw dsl values and format them ourselves 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 --- .../luci-static/resources/view/status/include/50_dsl.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js index cafd554f9a..4150b55133 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js @@ -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), -- 2.30.2