mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 21:05:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,33 @@
|
||||
module("luci.controller.webviewdev", package.seeall)
|
||||
|
||||
function index()
|
||||
entry({"admin", "webviewdev"}, call("webviewdev_template"), _("webviewdev"), 5).leaf = true
|
||||
end
|
||||
|
||||
local function user_id()
|
||||
local jsonc = require "luci.jsonc"
|
||||
local json_parse = jsonc.parse
|
||||
local fs = require "nixio.fs"
|
||||
local data = fs.readfile("/etc/.app_store.id")
|
||||
|
||||
local id
|
||||
if data ~= nil then
|
||||
id = json_parse(data)
|
||||
end
|
||||
if id == nil then
|
||||
fs.unlink("/etc/.app_store.id")
|
||||
id = {arch="",uid=""}
|
||||
end
|
||||
id.version = (fs.readfile("/etc/.app_store.version") or "?"):gsub("[\r\n]", "")
|
||||
return id
|
||||
end
|
||||
function get_params()
|
||||
local data = {
|
||||
prefix=luci.dispatcher.build_url(unpack({"admin", "webviewdev"})),
|
||||
id=user_id(),
|
||||
}
|
||||
return data
|
||||
end
|
||||
function webviewdev_template()
|
||||
luci.template.render("webviewdev/main", get_params())
|
||||
end
|
||||
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="theme-color" content="#181c20" />
|
||||
<title><%=luci.sys.hostname()%></title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
|
||||
<script src="<%=resource%>/cbi.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<script type="text/javascript" src="<%=resource%>/promis.min.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<script type="text/javascript" src="<%=resource%>/luci.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<%+tasks/embed%>
|
||||
<script>
|
||||
(function(){
|
||||
var pathe_prefix = "<%=prefix%>"
|
||||
window.path_base = pathe_prefix
|
||||
window.pkg_version = "<%# PKG_VERSION %>"
|
||||
window.token = "<%=token%>"
|
||||
})();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
L = new LuCI(<%= luci.http.write_json({
|
||||
token = token,
|
||||
media = media,
|
||||
resource = resource,
|
||||
scriptname = luci.http.getenv("SCRIPT_NAME"),
|
||||
pathinfo = luci.http.getenv("PATH_INFO"),
|
||||
documentroot = luci.http.getenv("DOCUMENT_ROOT"),
|
||||
requestpath = luci.dispatcher.context.requestpath,
|
||||
dispatchpath = luci.dispatcher.context.path,
|
||||
pollinterval = luci.config.main.pollinterval or 5,
|
||||
ubuspath = luci.config.main.ubuspath or '/ubus/',
|
||||
sessionid = luci.dispatcher.context.authsession,
|
||||
nodespec = luci.dispatcher.context.dispatched,
|
||||
apply_rollback = math.max(applyconf and applyconf.rollback or 90, 30),
|
||||
apply_holdoff = math.max(applyconf and applyconf.holdoff or 4, 1),
|
||||
apply_timeout = math.max(applyconf and applyconf.timeout or 5, 1),
|
||||
apply_display = math.max(applyconf and applyconf.display or 1.5, 1),
|
||||
rollback_token = rollback_token
|
||||
}) %>);
|
||||
</script>
|
||||
|
||||
<div id="app"></div>
|
||||
<script type="module" src="http://localhost:3000/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user