-- luci-app-openclaw — 基本设置 CBI Model
local sys = require "luci.sys"
m = Map("openclaw", "OpenClaw AI 网关",
"OpenClaw 是一个 AI 编程代理网关,支持 GitHub Copilot、Claude、GPT、Gemini 等大模型以及 Telegram、Discord 等多种消息渠道。")
-- 隐藏底部的「保存并应用」「保存」「复位」按钮 (本页无可编辑的 UCI 选项)
m.pageaction = false
-- ═══════════════════════════════════════════
-- 状态面板
-- ═══════════════════════════════════════════
m:section(SimpleSection).template = "openclaw/status"
-- ═══════════════════════════════════════════
-- 快捷操作
-- ═══════════════════════════════════════════
s3 = m:section(SimpleSection, nil, "快捷操作")
s3.template = "cbi/nullsection"
act = s3:option(DummyValue, "_actions")
act.rawhtml = true
act.cfgvalue = function(self, section)
local ctl_url = luci.dispatcher.build_url("admin", "services", "openclaw", "service_ctl")
local log_url = luci.dispatcher.build_url("admin", "services", "openclaw", "setup_log")
local check_url = luci.dispatcher.build_url("admin", "services", "openclaw", "check_update")
local update_url = luci.dispatcher.build_url("admin", "services", "openclaw", "do_update")
local upgrade_log_url = luci.dispatcher.build_url("admin", "services", "openclaw", "upgrade_log")
local uninstall_url = luci.dispatcher.build_url("admin", "services", "openclaw", "uninstall")
local plugin_upgrade_url = luci.dispatcher.build_url("admin", "services", "openclaw", "plugin_upgrade")
local plugin_upgrade_log_url = luci.dispatcher.build_url("admin", "services", "openclaw", "plugin_upgrade_log")
local html = {}
-- 按钮区域
html[#html+1] = '
'
html[#html+1] = ''
html[#html+1] = ''
html[#html+1] = ''
html[#html+1] = ''
html[#html+1] = ''
html[#html+1] = '
'
html[#html+1] = ''
html[#html+1] = ''
-- 版本选择对话框 (默认隐藏)
html[#html+1] = ''
html[#html+1] = '
'
html[#html+1] = '
📦 选择安装版本
'
html[#html+1] = '
'
-- 稳定版选项
html[#html+1] = '
'
-- 最新版选项
html[#html+1] = '
'
html[#html+1] = '
'
-- 按钮区
html[#html+1] = '
'
html[#html+1] = ''
html[#html+1] = ''
html[#html+1] = '
'
html[#html+1] = '
'
-- 安装日志面板 (默认隐藏)
html[#html+1] = ''
html[#html+1] = '
'
html[#html+1] = '📋 安装日志'
html[#html+1] = ''
html[#html+1] = '
'
html[#html+1] = '
'
html[#html+1] = '
'
html[#html+1] = '
'
-- JavaScript
html[#html+1] = ''
return table.concat(html, "\n")
end
-- ═══════════════════════════════════════════
-- 使用指南
-- ═══════════════════════════════════════════
s4 = m:section(SimpleSection, nil)
s4.template = "cbi/nullsection"
guide = s4:option(DummyValue, "_guide")
guide.rawhtml = true
guide.cfgvalue = function()
local html = {}
html[#html+1] = ''
html[#html+1] = '
📖 使用指南'
html[#html+1] = '
'
html[#html+1] = '① 首次使用请点击 「安装运行环境」,安装完成后服务会自动启动
'
html[#html+1] = '② 进入 「配置管理」 使用交互式向导快速配置 AI 模型和 API Key
'
html[#html+1] = '③ 进入 「Web 控制台」 配置消息渠道,直接开始对话'
html[#html+1] = '
'
return table.concat(html, "\n")
end
return m