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>
This commit is contained in:
@@ -1,12 +1,34 @@
|
||||
<!DOCTYPE html><html lang="zh"><head><meta charset="UTF-8"><title>Example</title>
|
||||
<style>body{font-family:monospace;background:#0e1416;color:#e0e3e4;padding:16px}
|
||||
h2{color:#00bcd4}.card{background:#1a1f21;border-radius:8px;padding:12px;margin:8px 0}
|
||||
button{background:#00bcd4;color:#000;padding:8px 16px;border:none;border-radius:4px;cursor:pointer}
|
||||
.counter{font-size:48px;color:#4caf50;text-align:center;padding:20px}
|
||||
.log{background:#000;color:#0f0;padding:8px;border-radius:4px;max-height:200px;overflow-y:auto;font-size:12px}
|
||||
<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"><h3>Counter</h3><div class="counter" id="count">0</div>
|
||||
<button onclick="inc()">+1</button> <button onclick="reset()">Reset</button></div>
|
||||
<div class="card"><h3>Events (SSE)</h3><div class="log" id="log">Waiting...</div></div>
|
||||
<script>let 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}const es=new EventSource("/SenSu/plugin/example_plugin/sse");es.addEventListener("counter",e=>{const d=JSON.parse(e.data);document.getElementById("log").innerHTML+=new Date().toLocaleTimeString()+" counter="+d.value+"<br>"})</script></body></html>
|
||||
<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>
|
||||
Reference in New Issue
Block a user