1 -- Copyright 2017 Yousong Zhou <yszhou4tech@gmail.com>
2 -- Licensed to the public under the Apache License 2.0.
4 module("luci.controller.shadowsocks-libev", package.seeall)
7 entry({"admin", "services", "shadowsocks-libev"},
8 alias("admin", "services", "shadowsocks-libev", "instances"),
9 _("Shadowsocks-libev"), 59)
11 entry({"admin", "services", "shadowsocks-libev", "instances"},
12 arcombine(cbi("shadowsocks-libev/instances"), cbi("shadowsocks-libev/instance-details")),
13 _("Local Instances"), 10).leaf = true
15 entry({"admin", "services", "shadowsocks-libev", "servers"},
16 cbi("shadowsocks-libev/servers"),
17 _("Remote Servers"), 20).leaf = true
19 entry({"admin", "services", "shadowsocks-libev", "rules"},
20 cbi("shadowsocks-libev/rules"),
21 _("Redir Rules"), 30).leaf = true
23 entry({"admin", "services", "shadowsocks-libev", "status"}, call("ss_status"), nil).leaf = true
28 local ut = require "luci.util"
29 local rv = ut.ubus("service", "list", {name = "shadowsocks-libev"})["shadowsocks-libev"] or {_=0}
31 luci.http.prepare_content("application/json")
32 luci.http.write_json(rv)