Files
SenSu/plugins/example_plugin/dashboard.html
T
qinglong 9de094ea54 fix: 移除遗留fmfuncs目录创建 + 清理init_service无用导入 + 文件管理器SVG图标 + 示例插件MD3改造
- init_service: 删除_load_fmfuncs方法和fmfuncs目录创建(已迁移到sdk/)
- init_service: 清理未使用的importlib.util和sys导入
- 文件管理器: 全部emoji替换为MD3 SVG矢量图标(文件夹/文件类型/右键菜单)
- 示例插件: dashboard.html改为MD3风格 CSS变量自动适配日夜主题
- 面包屑: 加底色+模糊+左右外边距
- CSS: .btn::after加pointer-events:none
- 插件开发指南: 更新2.6节MD3主题同步和完善的CSS变量/组件类参考表

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 19:00:19 +08:00

34 lines
1.6 KiB
HTML

<!DOCTYPE html><html lang="zh"><head><meta charset="UTF-8"><title>Example</title>
<style>
.plugin-page-root{font-family:system-ui,sans-serif;padding:20px;min-height:100%}
h2{color:var(--primary);font-weight:500;margin-bottom:16px}
.counter{font-size:48px;color:var(--primary);text-align:center;padding:20px}
.log{background:var(--md-sys-color-surface-container-lowest);color:#4caf50;padding:8px 12px;border-radius:var(--shape-xs);max-height:200px;overflow-y:auto;font-size:12px;font-family:monospace;line-height:1.6}
</style></head><body>
<h2>Example Plugin Panel</h2>
<div class="card" style="margin-bottom:16px">
<h3 style="margin-bottom:8px">Counter</h3>
<div class="counter" id="count">0</div>
<div style="display:flex;gap:8px;justify-content:center">
<button class="btn btn-sm btn-filled" onclick="inc()">+1</button>
<button class="btn btn-sm btn-outlined" onclick="reset()">Reset</button>
</div>
</div>
<div class="card">
<h3 style="margin-bottom:8px">Events (SSE)</h3>
<div class="log" id="log">Waiting...</div>
</div>
<script>
var n=0;
function inc(){
n++;
document.getElementById("count").textContent=n;
fetch("/SenSu/plugin/example_plugin/event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"counter",value:n})});
}
function reset(){n=0;document.getElementById("count").textContent=0;}
var es=new EventSource("/SenSu/plugin/example_plugin/sse");
es.addEventListener("counter",function(e){
var d=JSON.parse(e.data);
document.getElementById("log").innerHTML+=new Date().toLocaleTimeString()+" counter="+d.value+"<br>";
});
</script></body></html>