From 7a365183296f385bb8cb14b8eb6fcfc29941c7e4 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 16 Jun 2021 14:01:03 +0200 Subject: luci-app-nlbwmon: fix url When moving this application to the service section, the links were forgotten to be changed. Signed-off-by: Florian Eckert --- .../htdocs/luci-static/resources/view/nlbw/config.js | 2 +- .../htdocs/luci-static/resources/view/nlbw/display.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/config.js b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/config.js index cb13eeccec..3f0a4c969f 100644 --- a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/config.js +++ b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/config.js @@ -73,7 +73,7 @@ return view.extend({ o.value('absolute', _('Fixed interval')); o = s.taboption('general', form.DummyValue, '_warning', _('Warning')); - o.default = _('Changing the accounting interval type will invalidate existing databases!
Download backup.').format(L.url('admin/nlbw/backup')); + o.default = _('Changing the accounting interval type will invalidate existing databases!
Download backup.').format(L.url('admin/services/nlbw/backup')); o.rawhtml = true; if (/^[0-9]{4}-[0-9]{2}-[0-9]{2}\/[0-9]+$/.test(uci.get_first('nlbwmon', 'nlbwmon', 'database_interval'))) o.depends('_period', 'relative'); diff --git a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js index ccef949fb0..b7455c2035 100644 --- a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js +++ b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js @@ -421,7 +421,10 @@ return view.extend({ cbi_update_table('#layer7-data', rows, E('em', [ _('No data recorded yet.'), ' ', - E('a', { 'href': L.url('admin/nlbw/commit') }, _('Force reload…')) + E('a', { + 'href': '#', + 'click': ui.createHandlerFn(this, 'handleCommit') + }, _('Force reload…')) ])); this.pie('layer7-rx-pie', rxData); @@ -525,7 +528,10 @@ return view.extend({ cbi_update_table('#ipv6-data', rows, E('em', [ _('No data recorded yet.'), ' ', - E('a', { 'href': L.url('admin/nlbw/commit') }, _('Force reload…')) + E('a', { + 'href': '#', + 'click': ui.createHandlerFn(this, 'handleCommit') + }, _('Force reload…')) ])); var shareData = [], hostsData = []; -- cgit v1.2.3 From 6f6ec9f56cc24be9f432b0a88a29f46277dad7d5 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 17 Jun 2021 12:24:43 +0200 Subject: luci-app-nlbwmon: add missing cbi-button class for database backup Signed-off-by: Florian Eckert --- .../luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/backup.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/backup.js b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/backup.js index c5fcfe5cf8..0b13e6fdf2 100644 --- a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/backup.js +++ b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/backup.js @@ -52,12 +52,14 @@ return view.extend({ E('h5', [ _('Restore Database Backup') ]), E('p', [ E('button', { + 'class': 'cbi-button', 'click': ui.createHandlerFn(this, 'handleArchiveUpload') }, [ _('Restore') ]) ]), E('h5', [ _('Download Database Backup') ]), E('p', [ E('button', { + 'class': 'cbi-button', 'click': ui.createHandlerFn(this, 'handleArchiveDownload', hostname) }, [ _('Generate Backup') ]) ]) -- cgit v1.2.3 From d6443a629362f7ed79d1212cd964e5d6a127a9c0 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 17 Jun 2021 12:26:24 +0200 Subject: luci-app-nlbwmon: change force reload html element to button Signed-off-by: Florian Eckert --- .../htdocs/luci-static/resources/view/nlbw/display.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js index b7455c2035..029e195242 100644 --- a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js +++ b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js @@ -361,8 +361,8 @@ return view.extend({ cbi_update_table('#host-data', rows, E('em', [ _('No data recorded yet.'), ' ', - E('a', { - 'href': '#', + E('button', { + 'class': 'cbi-button', 'click': ui.createHandlerFn(this, 'handleCommit') }, _('Force reload…')) ])); @@ -421,8 +421,8 @@ return view.extend({ cbi_update_table('#layer7-data', rows, E('em', [ _('No data recorded yet.'), ' ', - E('a', { - 'href': '#', + E('button', { + 'class': 'cbi-button', 'click': ui.createHandlerFn(this, 'handleCommit') }, _('Force reload…')) ])); @@ -528,8 +528,8 @@ return view.extend({ cbi_update_table('#ipv6-data', rows, E('em', [ _('No data recorded yet.'), ' ', - E('a', { - 'href': '#', + E('button', { + 'class': 'cbi-button', 'click': ui.createHandlerFn(this, 'handleCommit') }, _('Force reload…')) ])); -- cgit v1.2.3 From 04c4499be74152c476ca1edfd6b8048252a55251 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 17 Jun 2021 12:50:40 +0200 Subject: luci-app-nlbwmon: adjused the display export page Signed-off-by: Florian Eckert --- .../luci-static/resources/view/nlbw/display.js | 54 +++++++++++++--------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js index 029e195242..4909485bbe 100644 --- a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js +++ b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js @@ -945,30 +945,42 @@ return view.extend({ ]), E('div', { 'class': 'cbi-section', 'data-tab': 'export', 'data-tab-title': _('Export') }, [ - E('ul', [ - E('li', [ - E('a', { - 'href': '#', - 'click': ui.createHandlerFn(this, 'handleDownload', 'csv', 'mac', '-rx,-tx') - }, [ _('CSV, grouped by MAC') ]) + E('div', { 'class': 'cbi-section-node cbi-sction-node-tabbed' }, [ + E('div', { 'class': 'cbi-value' }, [ + E('label', { 'class': 'cbi-value-title' }, _('Grouped by MAC (CSV)')), + E('div', { 'class': 'cbi-value-field' }, [ + E('button', { + 'class': 'cbi-button', + 'click': ui.createHandlerFn(this, 'handleDownload', 'csv', 'mac', '-rx,-tx') + }, [ _('Export') ]) + ]) ]), - E('li', [ - E('a', { - 'href': '#', - 'click': ui.createHandlerFn(this, 'handleDownload', 'csv', 'ip', '-rx,-tx') - }, [ _('CSV, grouped by IP') ]) + E('div', { 'class': 'cbi-value' }, [ + E('label', { 'class': 'cbi-value-title' }, _('Grouped by IP (CSV)')), + E('div', { 'class': 'cbi-value-field' }, [ + E('button', { + 'class': 'cbi-button', + 'click': ui.createHandlerFn(this, 'handleDownload', 'csv', 'ip', '-rx,-tx') + }, [ _('Export') ]) + ]) ]), - E('li', [ - E('a', { - 'href': '#', - 'click': ui.createHandlerFn(this, 'handleDownload', 'csv', 'layer7', '-rx,-tx') - }, [ _('CSV, grouped by protocol') ]) + E('div', { 'class': 'cbi-value' }, [ + E('label', { 'class': 'cbi-value-title' }, _('Grouped by protocol (CSV)')), + E('div', { 'class': 'cbi-value-field' }, [ + E('button', { + 'class': 'cbi-button', + 'click': ui.createHandlerFn(this, 'handleDownload', 'csv', 'layer7', '-rx,-tx') + }, [ _('Export') ]) + ]) ]), - E('li', [ - E('a', { - 'href': '#', - 'click': ui.createHandlerFn(this, 'handleDownload', 'json', null, null) - }, [ _('JSON dump') ]) + E('div', { 'class': 'cbi-value' }, [ + E('label', { 'class': 'cbi-value-title' }, _('Dump (JSON)')), + E('div', { 'class': 'cbi-value-field' }, [ + E('button', { + 'class': 'cbi-button', + 'click': ui.createHandlerFn(this, 'handleDownload', 'json', null, null) + }, [ _('Export') ]) + ]) ]) ]) ]) -- cgit v1.2.3 From a7be13ff05cc35352a02ad7c36acd704a037e37f Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 17 Jun 2021 15:06:12 +0200 Subject: luci-app-nlbwmon: showe force reload button even if data are available Signed-off-by: Florian Eckert --- .../luci-static/resources/view/nlbw/display.js | 45 ++++++++++++---------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js index 4909485bbe..a13c86b29b 100644 --- a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js +++ b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js @@ -359,13 +359,7 @@ return view.extend({ conn_total += rec.conns; } - cbi_update_table('#host-data', rows, E('em', [ - _('No data recorded yet.'), ' ', - E('button', { - 'class': 'cbi-button', - 'click': ui.createHandlerFn(this, 'handleCommit') - }, _('Force reload…')) - ])); + cbi_update_table('#host-data', rows, E('em', _('No data recorded yet.'))); this.pie('traf-pie', trafData); this.pie('conn-pie', connData); @@ -419,13 +413,7 @@ return view.extend({ } } - cbi_update_table('#layer7-data', rows, E('em', [ - _('No data recorded yet.'), ' ', - E('button', { - 'class': 'cbi-button', - 'click': ui.createHandlerFn(this, 'handleCommit') - }, _('Force reload…')) - ])); + cbi_update_table('#layer7-data', rows, E('em', _('No data recorded yet.'))); this.pie('layer7-rx-pie', rxData); this.pie('layer7-tx-pie', txData); @@ -526,13 +514,7 @@ return view.extend({ ]); } - cbi_update_table('#ipv6-data', rows, E('em', [ - _('No data recorded yet.'), ' ', - E('button', { - 'class': 'cbi-button', - 'click': ui.createHandlerFn(this, 'handleCommit') - }, _('Force reload…')) - ])); + cbi_update_table('#ipv6-data', rows, E('em', _('No data recorded yet.'))); var shareData = [], hostsData = []; @@ -862,6 +844,13 @@ return view.extend({ E('em', { 'class': 'spinning' }, [ _('Collecting data...') ]) ]) ]) + ]), + E('div', { 'class': 'right' }, [ + E('button', { + 'class': 'cbi-button', + 'click': ui.createHandlerFn(this, 'handleCommit') + }, _('Force reload…') + ) ]) ]), @@ -901,6 +890,13 @@ return view.extend({ E('em', { 'class': 'spinning' }, [ _('Collecting data...') ]) ]) ]) + ]), + E('div', { 'class': 'right' }, [ + E('button', { + 'class': 'cbi-button', + 'click': ui.createHandlerFn(this, 'handleCommit') + }, _('Force reload…') + ) ]) ]), @@ -941,6 +937,13 @@ return view.extend({ E('em', { 'class': 'spinning' }, [ _('Collecting data...') ]) ]) ]) + ]), + E('div', { 'class': 'right' }, [ + E('button', { + 'class': 'cbi-button', + 'click': ui.createHandlerFn(this, 'handleCommit') + }, _('Force reload…') + ) ]) ]), -- cgit v1.2.3