diff --git a/SHA256SUMS b/SHA256SUMS index 530ad83..4797c4a 100644 --- a/SHA256SUMS +++ b/SHA256SUMS @@ -7,5 +7,5 @@ ffd1790c882ca5dbcaebdfadc8f24c504159900213eebaa22e61fcdbf3facfe0 README.md 3da8b5d94e2206bffc19e1c4fa493b31880c9a90fd6a02546461fe54a7255dbd config/pigway-pi-control.conf 20c584762cae3a50a498df25e11272c3c191a62c9ce823e63f8224d14637b1d4 systemd/pigway-pi-control-api.service 35ec68e1c3040e7affad43961fbb77e9e29f3474b92aed1005502629f9acb549 systemd/pigway-pi-control.service -7dbb498b137148c0bbc77f31c1344ea4a2954814b35f190e10e3f8151fe04603 web/index.html +64c21a4e4d93a68fcca1d0b0126655a56f306a290cced6eed5350ab9d5b5004f web/index.html 73b7922be93bf57169589755137dc5ec7ec7c8059c85c2bf2ee53a344e534d7e docs/HARDWARE_PLUGIN_API.md diff --git a/web/index.html b/web/index.html index c4b3dd1..85efb73 100644 --- a/web/index.html +++ b/web/index.html @@ -57,7 +57,7 @@ const ownerNames={NORMAL_HOME:'正常主页',ROOT_READONLY:'根文件系统只 function ownerName(id){const [type,suffix]=String(id||'').split('|',2),name=ownerNames[type]||type;return tr(name)+(suffix?` · ${suffix}`:'')}function rgbName(mode){if(rgbNames[mode])return tr(rgbNames[mode]);const p=String(mode||'').split('_'),groups={CPU:'处理器',POWER:'供电',MEMORY:'内存',STORAGE:'存储',NETWORK:'网络',SERVICE:'服务'},levels={WARNING:'普通告警',CRITICAL:'严重告警',EMERGENCY:'紧急告警'};return`${tr(groups[p[0]]||p[0])} · ${tr(levels[p[1]]||p[1])}${p[2]==='BREATHE'?(LANG==='zh'?'呼吸':' breathing'):(LANG==='zh'?'闪烁':' flash')}`}function eventName(id){return tr(eventNames[id]||(LANG==='zh'?`未知事件(${id})`:String(id).toLowerCase().replaceAll('_',' ')))} function field(section,key,value,extra=''){const id=`${section}.${key}`,opts=options[id],rule=numberRules[id],label=tr(labels[id]||key),help=tr(hints[id]||''),unit=tr(units[id]||'');let control;if(opts)control=``;else{const input=``;control=unit?`
${input}${unit}
`:input}return`
${help?`
${esc(help)}
`:''}
`} function pluginText(zh,en){return LANG==='zh'?zh:en} -function renderPlugins(){return `

${pluginText('仅发现插件不会接管灯光。接入后发送监控状态;暂停或断开不会停止本地温控。','Discovery does not take over lighting. Connecting sends monitoring state; pausing or disconnecting leaves autonomous cooling running.')}

`} +function renderPlugins(){return `

${pluginText('仅发现插件不会接管插件的设备能力。接入后发送监控状态;暂停或断开联动不会停止插件的本地功能。','Discovery does not take control of plugin device capabilities. Connecting sends monitoring state; pausing or disconnecting the link does not stop the plugin’s local functions.')}

`} function pluginSummary(plugins,host){if(!Object.keys(plugins).length)return `
${pluginText('风扇与硬件插件','Fan and hardware plugins')}

${pluginText('尚未接入硬件插件,风扇状态不可用。独立安装并启动插件后,可在插件管理中接入。','No hardware plugin connected; fan status is unavailable. Install and start a plugin independently, then connect it in plugin management.')}

`;return Object.entries(plugins).map(([id,p])=>{const st=p.status||{},cap=p.capabilities||{},details=[];if(p.online){if(cap.fan)details.push(pluginText('风扇设置','Fan setting')+' '+esc(st.fan_name||'—'));if(cap.display)details.push('OLED '+esc(ownerName(st.oled_page||'')));if(cap.rgb)details.push('RGB '+esc(rgbName(st.rgb_mode||'')))}return `
${esc(p.name||id)} · ${p.online?tr('在线'):tr('离线')} ${details.join(' · ')}
`}).join('')} let pluginRows=[],pluginDraft=null,pluginSelected='';