Translated using Weblate (Polish)
[oweals/luci.git] / applications / luci-app-radicale2 / luasrc / controller / radicale2.lua
1 -- Licensed to the public under the Apache License 2.0.
2
3 module("luci.controller.radicale2", package.seeall)
4
5 function index()
6         local page
7
8         -- no config create an empty one
9         if not nixio.fs.access("/etc/config/radicale2") then
10                 nxfs.writefile("/etc/config/radicale2", "")
11         end
12
13         page = entry({"admin", "services", "radicale2"}, alias("admin", "services", "radicale2", "server"), _("Radicale 2.x"))
14         page.leaf = false
15
16         page = entry({"admin", "services", "radicale2", "server"}, cbi("radicale2/server"), _("Server Settings"))
17         page.leaf = true
18         page.order = 10
19
20         page = entry({"admin", "services", "radicale2", "auth"}, cbi("radicale2/auth"), _("Authentication / Users"))
21         page.leaf = true
22         page.order = 20
23
24         page = entry({"admin", "services", "radicale2", "storage"}, cbi("radicale2/storage"), _("Storage"))
25         page.leaf = true
26         page.order = 30
27
28         page = entry({"admin", "services", "radicale2", "logging"}, cbi("radicale2/logging"), _("Logging"))
29         page.leaf = true
30         page.order = 40
31 end
32
33 function pymodexists(module)
34    retfun = luci.util.execi('python3 -c \'import importlib.util as util;found_module = util.find_spec("' .. module .. '");print(found_module is not None);print("\\n")\'')
35    retval = retfun() == "True"
36    while retfun() do end
37    return retval
38 end