mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-09-11 02:44:57 +08:00
🐶 Sync 2026-09-02 00:00:06
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local http = require "luci.http"
|
||||
local string = require "string"
|
||||
|
||||
module("luci.controller.quickstart", package.seeall)
|
||||
|
||||
@@ -25,6 +26,9 @@ function index()
|
||||
else
|
||||
entry({"admin", "quickstart"}, call("redirect_fallback")).leaf = true
|
||||
end
|
||||
if not nixio.fs.access("/usr/share/luci/menu.d/luci-app-dockerman.json") then
|
||||
entry({"admin", "services", "dockerman"}, call("redirect_dockerman")).leaf = true
|
||||
end
|
||||
end
|
||||
|
||||
function networkguide_index()
|
||||
@@ -39,6 +43,24 @@ function redirect_fallback()
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "status"))
|
||||
end
|
||||
|
||||
local function starts_with(str, start)
|
||||
return string.sub(str, 1, #start) == start
|
||||
end
|
||||
|
||||
local function replace_first(str, pattern, replacement)
|
||||
-- The third argument (1) limits the replacement to the first match
|
||||
local result = str:gsub(pattern, replacement, 1)
|
||||
return result
|
||||
end
|
||||
|
||||
function redirect_dockerman(path, ...)
|
||||
local newargs = {}
|
||||
if path ~= nil then
|
||||
newargs = {path == "configuration" and "config" or path, ...}
|
||||
end
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "docker", unpack(newargs)))
|
||||
end
|
||||
|
||||
local function vue_lang()
|
||||
local i18n = require("luci.i18n")
|
||||
local lang = i18n.translate("quickstart_vue_lang")
|
||||
|
||||
Reference in New Issue
Block a user