Repository navigation
给你的Harness增加一个背景美化 #1575
halosb
started this conversation in
Show Your Plugins!
Replies: 1 comment
|
我是插件库,我感觉你的想法很好,我想收录,可以提ISSUE。 具体提的方法如下。 我也帮你置顶帖子,省得被埋没。 被收录的插件审核前送STAR |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
dsh-bg-beautify
以官方插件机制安装,不修改任何 DSH 源码(
apps/web、packages/client一概不动),也不需要重新构建前端。特性
/bg/文件名(插件内置伺服)、https://外链、data:URIassets/并填入/bg/文件名config.json,重启不丢;不依赖宿主设置服务的白名单效果预览
工作原理(30 秒)
package.json声明dsh.bundle(贡献一行组合配置)+dsh.client(声明浏览器端 bundle)。bg-beautify行;dsh-client-modules把/plugins/dsh-bg-beautify/client.js编入window.__DSH_BOOT__引导图,浏览器端运行时加载——无需构建前端。apply():注入<style>设背景图 + 用官方主题接口ctx.theme.overrideTokens(...)覆盖面板底色(亮/暗两套)。GET/POST /bg/settings→ 插件目录config.json)。环境要求
dshCLI)安装
安装后必须重启
dsh web(客户端模块的包扫描与引导图在启动时组装):pnpm dsh web # 默认端口 3080;可用 --port 换端口使用
打开 Web UI → 左下角 设置 → 背景美化 分区:
/bg/文件名/https://.../data:image/...;留空 = 无图assets/,自动填入/bg/文件名改动即时生效、持久保存。
默认值
image/bg/placeholder.svg''= 无图)size/position/fixedopacityMainopacitySidebaropacityCardopacityInput卸载
常见问题
dsh web;② 浏览器硬刷新 Ctrl+F5/bg/xxx.jpg404assets// 格式不支持(jpg/png/gif/webp/avif/svg)pnpm dsh web --port 8080;--port 0自动分配仓库结构
开发
client.js顶部DEFAULTS可换默认值;改完重启dsh web生效。pnpm run dev:web的 HMR watcher 正在运行)。config.json已在.gitignore)。反馈
有问题或建议,欢迎通过邮箱联系作者:
许可证
MIT
All reactions