diff options
Diffstat (limited to 'applications/luci-app-travelmate/luasrc/model/cbi')
-rw-r--r-- | applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_order.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_order.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_order.lua new file mode 100644 index 0000000000..5734841030 --- /dev/null +++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_order.lua @@ -0,0 +1,22 @@ +-- Copyright 2017 Dirk Brenken (dev@brenken.org) +-- This is free software, licensed under the Apache License, Version 2.0 + +local uci = require("luci.model.uci").cursor() +local http = require("luci.http") +local cfg = http.formvalue("cfg") +local pos = http.formvalue("pos") +local dir = http.formvalue("dir") + +if cfg ~= nil then + if dir == "up" then + pos = pos - 1 + uci:reorder("wireless", cfg, pos) + elseif dir == "down" then + pos = pos + 1 + uci:reorder("wireless", cfg, pos) + end + uci:save("wireless") + uci:commit("wireless") +end + +http.redirect(luci.dispatcher.build_url("admin/services/travelmate/stations")) |