查看“︁Photonicat 2 小屏幕自定义”︁的源代码
←
Photonicat 2 小屏幕自定义
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{| class="wikitable" |- ! 适用 / Applies to | Photonicat 2(内置 LCD 小屏), pcat-manager-web 2026-06 及以后版本 / Photonicat 2 (built-in LCD), pcat-manager-web builds from 2026-06 onward |} Photonicat 2 的'''内置小屏幕'''不只是状态显示器——通过管理界面的 '''/screen''' 页面可以调整亮度息屏策略、'''可视化编辑屏幕布局''',甚至接入'''自定义数据源'''(HTTP 接口 / Shell 命令 / UCI 配置值),把任何你关心的数据显示到屏幕上(公网 IP、BTC 价格、家里的温度传感器……)。 The photonicat 2's '''built-in mini screen''' is more than a status display — the manager UI's '''/screen''' page lets you tune brightness/dimming, '''visually edit the screen layout''', and attach '''custom data sources''' (HTTP endpoints / shell commands / UCI values) to render any data you care about (public IP, BTC price, a home temperature sensor…). == 中文说明 == 页面地址:管理界面 → '''小屏幕(/screen)''',共三个标签页。 === 1. 屏幕设置 === * '''最大 / 最小亮度''':设定屏幕亮度范围。 * '''自动降低亮度时间''':电池供电与充电两种状态'''分别'''设定息屏/降亮延迟——插电时可以常亮,用电池时尽快变暗省电。 * '''短信显示开关及条数限制''':控制屏幕上是否显示短信以及最多显示多少条(隐私考虑可关闭)。 * '''实时预览''':页面内嵌当前屏幕画面的实时预览(后端接口 <code>/api/v1/screen/frame.png</code>),不用低头看设备就能确认显示效果。 === 2. 屏幕编辑器 === 可视化布局编辑器,在网页上的'''画布'''中直接编辑屏幕内容: * 添加/移动/删除显示元素,绑定'''数据键(data key)'''——既可用内置数据(电量、信号、速率、公网 IP 等),也可用下述自定义数据源产生的键。 * 编辑结果保存到 <code>user_config</code>,Web 后端与屏幕守护进程(Go 程序)读取'''同一份配置''',保存后屏幕立即生效。 * 恢复默认:默认布局可随时通过 <code>/api/v1/screen/default_config.json</code> 找回,改坏了不用怕。 === 3. 自定义数据源(custom_metrics) === 编辑器下方的'''数据源'''区域可添加三种类型的数据源,产生的 data key 供屏幕元素引用: {| class="wikitable" ! 类型 !! 说明 !! 典型用途 |- | '''HTTP/HTTPS 轮询''' || 周期性请求一个 URL,按配置的解析器提取数值 || 公网 IP、加密货币价格(BTC 示例用 Photonicat 官方 API)、天气、家庭传感器接口 |- | '''命令 Command''' || 周期性执行一条 shell 命令,取其输出 || CPU 温度、磁盘剩余、连接数、任意脚本 |- | '''UCI 值''' || 读取一项 OpenWrt UCI 配置 || 显示当前 SSID、APN 等配置项 |} * 每个数据源有'''启用开关'''、独立的采集周期与解析设置。 * '''状态与测试''':每个源显示最近一次取值/错误信息与成功次数,并有"立即执行"按钮(<code>/api/v1/screen/custom_metrics/<源名>/execute</code>)方便调试,不用等下一个周期。 === 4. Public IP 标签页 === 自定义公网 IP 查询(网页与 LCD 共用):多个 URL 按顺序尝试、每源可配 <code>json:字段</code> / <code>regex:正则</code> / <code>line:行号</code> 解析器、自定义 User-Agent,返回值自动校验为合法 IPv4/IPv6。photonicat.com 被墙时换成任意可达的 IP 查询源即可恢复屏幕公网 IP 显示。页面内有完整示例。 == English == Location: manager UI → '''Mini Screen (/screen)''', three tabs. === 1. Screen settings === * '''Max / min brightness''' range. * '''Auto-dim delays''' set '''separately''' for on-battery and on-charger — stay bright when plugged in, dim fast on battery. * '''SMS display toggle and count limit''' — hide messages from the screen entirely for privacy, or cap how many show. * '''Live preview''' embedded in the page (backed by <code>/api/v1/screen/frame.png</code>) so you can verify the layout without looking at the device. === 2. Screen editor === A visual canvas editor for the screen layout: * Add/move/remove display elements and bind them to '''data keys''' — built-ins (battery, signal, throughput, public IP…) or keys produced by the custom data sources below. * Layouts persist to <code>user_config</code>, read by both the web backend and the Go screen daemon — one config, applied immediately on save. * The factory layout is always recoverable via <code>/api/v1/screen/default_config.json</code>. === 3. Custom data sources (custom_metrics) === Three source types feed data keys for screen elements: {| class="wikitable" ! Type !! What it does !! Typical uses |- | '''HTTP/HTTPS poll''' || Periodically fetch a URL and extract a value with a configured parser || public IP, crypto prices (the BTC example uses the official Photonicat API), weather, home sensor endpoints |- | '''Command''' || Periodically run a shell command and take its output || CPU temperature, disk free, connection counts, any script |- | '''UCI value''' || Read an OpenWrt UCI config value || current SSID, APN, any config item |} * Each source has an '''enable toggle''', its own poll interval and parser settings. * '''Status & testing''': per-source last value/error and success count, plus an execute-now button (<code>/api/v1/screen/custom_metrics/<name>/execute</code>) for debugging without waiting a cycle. === 4. Public IP tab === Configurable public-IP lookup shared by the web UI and the LCD: ordered URLs, per-source <code>json:field</code> / <code>regex:pattern</code> / <code>line:N</code> parsers, custom User-Agent, responses validated as real IPv4/IPv6. If photonicat.com is blocked in your region, point it at any reachable IP echo service and the LCD shows your public IP again. A worked example is embedded in the page. [[Photonicat 2 管理界面新功能 (2026)]] | [[Photonicat 2 开发者 API]]
返回
Photonicat 2 小屏幕自定义
。
导航菜单
个人工具
登录
命名空间
页面
讨论
大陆简体
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
工具
链入页面
相关更改
页面信息