mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-03 09:03:56 +08:00
🤞 Sync 2026-09-06 22:50:31
This commit is contained in:
1 parent
bb7d626e94
commit
64c17e592d
115 files changed
+8599
-1391
No files matched your search
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=AgentFlow
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=4
|
||||
PKG_RELEASE:=5
|
||||
LUCI_DEPENDS:=+agentflow +luci-compat
|
||||
LUCI_MINIFY_CSS:=0
|
||||
LUCI_MINIFY_JS:=0
|
||||
|
||||
@@ -45,37 +45,14 @@ agentflow.find_paths = function(blocks, home_dirs)
|
||||
return paths, default_path
|
||||
end
|
||||
|
||||
local dirname = function(path)
|
||||
path = (path or ""):match("^%s*(.-)%s*$")
|
||||
path = path:gsub("/+$", "")
|
||||
return path:match("^(.*)/[^/]+$") or ""
|
||||
end
|
||||
|
||||
agentflow.runtime_dir = function(data_dir, home_dirs)
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local configured = uci:get_first("mise", "mise", "runtime_dir", "")
|
||||
if configured ~= nil and configured ~= "" then
|
||||
return configured
|
||||
end
|
||||
|
||||
local conf_dir = dirname(data_dir)
|
||||
if conf_dir == "" then
|
||||
conf_dir = home_dirs["Configs"]
|
||||
end
|
||||
agentflow.runtime_dir = function(data_dir)
|
||||
data_dir = (data_dir or ""):match("^%s*(.-)%s*$"):gsub("/+$", "")
|
||||
local conf_dir = data_dir:match("^(.*)/[^/]+$")
|
||||
if conf_dir == nil or conf_dir == "" then
|
||||
return ""
|
||||
return nil
|
||||
end
|
||||
|
||||
return conf_dir .. "/Runtime"
|
||||
end
|
||||
|
||||
agentflow.runtime_home = function(data_dir, home_dirs)
|
||||
local runtime_dir = agentflow.runtime_dir(data_dir, home_dirs)
|
||||
if runtime_dir == nil or runtime_dir == "" then
|
||||
return ""
|
||||
end
|
||||
|
||||
return runtime_dir .. "/home"
|
||||
return conf_dir .. "/Runtime/home"
|
||||
end
|
||||
|
||||
return agentflow
|
||||
@@ -34,15 +34,22 @@ for _, val in pairs(paths) do
|
||||
end
|
||||
data_dir.default = default_path
|
||||
|
||||
local runtime_home = s:option(DummyValue, "_runtime_home", translate("Shared runtime home"))
|
||||
runtime_home.description = translate("AgentFlow and other runtime-aware applications share this HOME. It is derived from the selected Configs directory unless mise has an explicit runtime directory.")
|
||||
function runtime_home.cfgvalue(self, section)
|
||||
local selected_data_dir = m.uci:get("agentflow", section, "data_dir") or default_path
|
||||
local path = agentflow_model.runtime_home(selected_data_dir, home)
|
||||
if path == "" then
|
||||
return translate("Not configured")
|
||||
function m.on_after_commit(self)
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local runtime_dir = uci:get("mise", "main", "runtime_dir")
|
||||
if runtime_dir ~= nil and runtime_dir ~= "" then
|
||||
return
|
||||
end
|
||||
|
||||
local saved_data_dir = uci:get_first("agentflow", "agentflow", "data_dir", "")
|
||||
runtime_dir = agentflow_model.runtime_dir(saved_data_dir)
|
||||
if runtime_dir == nil then
|
||||
return
|
||||
end
|
||||
|
||||
if uci:set("mise", "main", "runtime_dir", runtime_dir) then
|
||||
uci:commit("mise")
|
||||
end
|
||||
return path
|
||||
end
|
||||
|
||||
local port = s:option(Value, "port", translate("Listen port"))
|
||||
|
||||
@@ -43,15 +43,6 @@ msgstr "请选择硬盘作为数据目录"
|
||||
msgid "Required. AgentFlow stores its configuration, database and workspace data under this directory."
|
||||
msgstr "必需。AgentFlow 在此目录中保存配置、数据库和工作区数据。"
|
||||
|
||||
msgid "Shared runtime home"
|
||||
msgstr "共享运行时 HOME"
|
||||
|
||||
msgid "AgentFlow and other runtime-aware applications share this HOME. It is derived from the selected Configs directory unless mise has an explicit runtime directory."
|
||||
msgstr "AgentFlow 和其他运行时感知应用共用此 HOME。除非 mise 显式设置了运行时目录,否则它会从所选 Configs 目录推导。"
|
||||
|
||||
msgid "Not configured"
|
||||
msgstr "未配置"
|
||||
|
||||
msgid "Status"
|
||||
msgstr "状态"
|
||||
|
||||
|
||||
Reference in new issue
Block a user