diff options
author | Dirk Brenken <dev@brenken.org> | 2020-09-20 22:10:52 +0200 |
---|---|---|
committer | Dirk Brenken <dev@brenken.org> | 2020-09-20 22:10:52 +0200 |
commit | 551d8cc648eca95559c5aafb331854adea00344e (patch) | |
tree | 5b49bfdfe41911fa5b3abaeacbb85927398f2b00 /applications/luci-app-travelmate/htdocs/luci-static/resources | |
parent | 7b85227e3b20fbd96fc31f37e5c5e04241db1c51 (diff) |
luci-app-travelmate: add notifications
- add notifications in case of errors during save
Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-travelmate/htdocs/luci-static/resources')
-rw-r--r-- | applications/luci-app-travelmate/htdocs/luci-static/resources/view/travelmate/stations.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/applications/luci-app-travelmate/htdocs/luci-static/resources/view/travelmate/stations.js b/applications/luci-app-travelmate/htdocs/luci-static/resources/view/travelmate/stations.js index d997636300..42a1e9aa88 100644 --- a/applications/luci-app-travelmate/htdocs/luci-static/resources/view/travelmate/stations.js +++ b/applications/luci-app-travelmate/htdocs/luci-static/resources/view/travelmate/stations.js @@ -841,14 +841,20 @@ return view.extend({ bssid = L.toArray(map.lookupOption('bssid', '_add_trm'))[0].formvalue('_add_trm'), encryption = L.toArray(map.lookupOption('encryption', '_add_trm'))[0].formvalue('_add_trm'), password = L.toArray(map.lookupOption('key', '_add_trm'))[0].formvalue('_add_trm'); - if (!ssid || ((encryption.includes('psk') || encryption.includes('wpa') || encryption.includes('sae')) && !password)) { - return; + if (!ssid || ((encryption.includes('psk') || encryption.includes('wpa') || encryption.includes('sae')) && !password )) { + if (!ssid) { + ui.addNotification(null, E('p', 'Empty SSID, the uplink station could not be saved.'), 'error'); + } + else { + ui.addNotification(null, E('p', 'Empty Password, the uplink station could not be saved.'), 'error'); + } + return ui.hideModal(); } for (var i = 0; i < w_sections.length; i++) { if (w_sections[i].device === device && w_sections[i].ssid === ssid) { if (ignore_bssid === '1' || (ignore_bssid === '0' && w_sections[i].bssid === bssid)) { - ui.hideModal(); - return; + ui.addNotification(null, E('p', 'Duplicate wireless entry, the uplink station could not be saved.'), 'error'); + return ui.hideModal(); } } } |