|
|
|
@ -24,11 +24,11 @@ end
|
|
|
|
|
nodered.home = function()
|
|
|
|
|
local uci = require "luci.model.uci".cursor()
|
|
|
|
|
local home_dirs = {}
|
|
|
|
|
home_dirs["main_dir"] = uci:get_first("quickstart", "main", "main_dir", "/root")
|
|
|
|
|
home_dirs["Configs"] = uci:get_first("quickstart", "main", "conf_dir", home_dirs["main_dir"].."/Configs")
|
|
|
|
|
home_dirs["main_dir"] = uci:get_first("quickstart", "main", "main_dir", "/opt/docker2/compose")
|
|
|
|
|
home_dirs["Configs"] = uci:get_first("quickstart", "main", "conf_dir", home_dirs["main_dir"].."/nodered-app/Configs")
|
|
|
|
|
home_dirs["Public"] = uci:get_first("quickstart", "main", "pub_dir", home_dirs["main_dir"].."/Public")
|
|
|
|
|
home_dirs["Downloads"] = uci:get_first("quickstart", "main", "dl_dir", home_dirs["Public"].."/Downloads")
|
|
|
|
|
home_dirs["Caches"] = uci:get_first("quickstart", "main", "tmp_dir", home_dirs["main_dir"].."/Caches")
|
|
|
|
|
home_dirs["Caches"] = uci:get_first("quickstart", "main", "tmp_dir", home_dirs["main_dir"].."/nodered-app/Caches")
|
|
|
|
|
return home_dirs
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -36,14 +36,14 @@ nodered.find_paths = function(blocks, home_dirs, path_name)
|
|
|
|
|
local default_path = ''
|
|
|
|
|
local configs = {}
|
|
|
|
|
|
|
|
|
|
default_path = home_dirs[path_name] .. "/nodered"
|
|
|
|
|
default_path = home_dirs[path_name] .. "/nodered-app"
|
|
|
|
|
if #blocks == 0 then
|
|
|
|
|
table.insert(configs, default_path)
|
|
|
|
|
else
|
|
|
|
|
for _, val in pairs(blocks) do
|
|
|
|
|
table.insert(configs, val .. "/" .. path_name .. "/nodered")
|
|
|
|
|
table.insert(configs, val .. "/" .. path_name .. "/nodered-app")
|
|
|
|
|
end
|
|
|
|
|
local without_conf_dir = "/root/" .. path_name .. "/nodered"
|
|
|
|
|
local without_conf_dir = "/root/" .. path_name .. "/nodered-app"
|
|
|
|
|
if default_path == without_conf_dir then
|
|
|
|
|
default_path = configs[1]
|
|
|
|
|
end
|
|
|
|
|