此文章转载自nodeseek论坛,归TomyJan
所有。
以下根据需求修改部分,最终效果
哪吒监控
前台
<!-- 哪吒探针前台美化 版本 2025.04.11 by TomyJan -->
<!-- 详细说明与支持请前往: https://www.nodeseek.com/post-311746-1 -->
<script>
/* 这是我的 Umami 统计, 因为直接插入 JS 标签无法运行, 可以参考, 抄代码别把这段也抄走了 */
// const script = document.createElement('script');
// script.defer = true;
// script.src = 'https://umami.amoe.cc/script.js';
// script.setAttribute('data-website-id', '0a02b043-af0d-44b4-ac17-d715e0916238');
// document.body.appendChild(script);
/* 这部分这几个挂在 window 下的变量是哪吒内置的, 详见 https://nezha.wiki/guide/settings.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E4%BB%A3%E7%A0%81 */
window.CustomBackgroundImage = 'https://api.tomys.top/api/acgimg'; /* PC 端背景图, 这是我自己的随机图 API, 自定义背景图建议配合下方的压暗和模糊食用 */
window.CustomMobileBackgroundImage = 'https://api.tomys.top/api/acgimg'; /* 移动端背景图, 这是我自己的随机图 API, 自定义背景图建议配合下方的压暗和模糊食用 */
window.CustomLogo = 'https://tongzx.cn/usr/uploads/icon.jpg'; /* 页面左上角和标题栏展示的 Logo, 换成你自己的 */
window.CustomDesc = 'Love from TikW'; /* 页面左上角副标题 */
window.ShowNetTransfer = true; /* 服务器卡片是否显示上下行流量, 默认不显示 */
/* window.DisableAnimatedMan = true; /* 为 true 则基佬死开, 和下方 CustomIllustration 冲突 */
window.CustomIllustration = 'https://s2.loli.net/2024/12/24/fj3EXY7umsyR9NW.webp'; /* 把基佬图换成你想换的图, 此处图抄袭自 https://misaka.se/ */
window.FixedTopServerName = true; /* 是否固定顶部显示服务器名称, 默认不固定 */
window.CustomLinks = '[{\"link\":\"https://tongzx.cn/\",\"name\":\"首页\"},{\"link\":\"https://game.tongzx.cn/\",\"name\":\"游戏\"}]'; /* 自定义导航栏链接 */
/* window.ForceTheme = 'dark'; /* 强制主题色, 可选值为 light 或 dark */
/* window.ForceUseSvgFlag = false; /* 是否强制使用 svg 旗帜 */
/* 自定义字体, 注意需要同步修改下方 CSS 中的 font-family */
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://font.sec.miui.com/font/css?family=MiSans:400,700:MiSans'; // MiSans
// link.href = 'https://npm.elemecdn.com/[email protected]/style.css'; // 霞鹜文楷, font-family: 'LXGW WenKai Screen'
document.head.appendChild(link);
/* 修改页脚, 可使用 HTML 元素, 请保留哪吒版权信息, 与下方 CSS 中的 不显示页脚 冲突 */
/* 左侧哪吒�����本 */
const observerFooterLeft = new MutationObserver(() => {
const footerLeft = document.querySelector('.server-footer-name > div:first-child');
if (footerLeft) {
// footerLeft.innerHTML = 'Powered by <a href="https://github.com/nezhahq/nezha" target="_blank">NeZha</a>';
footerLeft.style.visibility = 'hidden'; // 隐藏
observerFooterLeft.disconnect();
}
});
observerFooterLeft.observe(document.body, { childList: true, subtree: true });
/* 右侧主题文本 */
const observerFooterRight = new MutationObserver(() => {
const footerRight = document.querySelector('.server-footer-theme');
if (footerRight) {
footerRight.innerHTML = '<section>Powered by <a href="https://github.com/nezhahq/nezha" target="_blank">NeZha</a></section>';
// footerRight.style.visibility = 'hidden'; // 隐藏
observerFooterRight.disconnect();
}
});
observerFooterRight.observe(document.body, { childList: true, subtree: true });
</script>
<style>
/* 自定义字体, 注意需要在上方 JS 中引入相应字体 */
* {
font-family: 'MiSans';
}
h1, h2, h3, h4, h5 {
font-family: 'MiSans', sans-serif;
}
/* 背景压暗和模糊, 开了背景图建议开启 */
.dark .bg-cover::after {
content: '';
position: absolute;
inset: 0;
backdrop-filter: blur(0px);
background-color: rgba(0, 0, 0, 0.6);
}
.light .bg-cover::after {
content: '';
position: absolute;
inset: 0;
backdrop-filter: blur(0px);
background-color: rgba(255, 255, 255, 0.3);
}
/* 不显示右上角语言切换按钮 */
/* [id="radix-:r0:"] {
display: none;
} */
/* 不显示右上角主题切换按钮 */
/* [id="radix-:r2:"] {
display: none;
} */
/* 不显示页脚, 请保留哪吒版权信息, 与上方 JS 中的 修改页脚文本 冲突 */
/* footer {
display: none;
} */
</style>
后台
<!-- 哪吒探针后台美化 版本 2025.04.11 by TomyJan -->
<!-- 详细说明与支持请前往: https://www.nodeseek.com/post-311746-1 -->
<script>
/* 这是我的 Umami 统计, 因为直接插入 JS 标签无法运行, 可以参考, 抄代码别把这段也抄走了 */
// const script = document.createElement('script');
// script.defer = true;
// script.src = 'https://umami.amoe.cc/script.js';
// script.setAttribute('data-website-id', '0a02b043-af0d-44b4-ac17-d715e0916238');
// document.body.appendChild(script);
window.DisableAnimatedMan = true; /* 基佬死开, 后台自定义官方仅支持这一个变量 */
/* 自定义字体, 注意需要同步修改下方 CSS 中的 font-family */
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://font.sec.miui.com/font/css?family=MiSans:400,700:MiSans'; // MiSans
// link.href = 'https://npm.elemecdn.com/[email protected]/style.css'; // 霞鹜文楷, font-family: 'LXGW WenKai Screen'
document.head.appendChild(link);
/* 修改后台左上角标题 */
const observerAdminTitle = new MutationObserver(mutations => {
mutations.forEach(mutation => {
mutation.addedNodes.forEach(node => {
if (node.nodeType === 1) { // 元素节点
const links = node.matches('.transition-opacity') ? [node] : node.querySelectorAll('.transition-opacity');
links.forEach(link => {
const textNode = Array.from(link.childNodes).find(n => n.nodeType === Node.TEXT_NODE && n.textContent.trim() === '哪吒监控');
if (textNode) {
textNode.textContent = 'TikW探针';
observerAdminTitle.disconnect();
}
});
}
});
});
});
observerAdminTitle.observe(document.body, { childList: true, subtree: true });
/* 修改页脚文本, 与下方 CSS 中的 不显示页脚 冲突 */
// const footer = document.querySelector('footer');
// if (footer) {
// footer.textContent = '页脚文本';
// }
</script>
<style>
/* 自定义字体, 注意需要在上方 JS 中引入相应字体 */
* {
font-family: 'MiSans';
}
h1, h2, h3, h4, h5 {
font-family: 'MiSans', sans-serif;
}
/* 修改后台右上角基佬头像 */
img[src*="https://api.dicebear.com/7.x/notionists/svg"] {
content: url("https://tongzx.cn/usr/uploads/Profile Photo.jpg");
}
/* 修改后台左上角 Logo */
img[src*="/dashboard/logo.svg"] {
content: url("https://tongzx.cn/usr/uploads/icon.jpg");
}
/* 不显示页脚, 与上方 JS 中的 修改页脚文本 冲突 */
footer {
display: none;
}
</style>