js
<style>
/* 屏幕适配 */
@media only screen and (min-width: 1200px) {
.ui.container {
width: 80% !important;
}
}
/* 整体图标 */
i.icon {
color: #000;
width: 1.2em !important;
}
/* 背景图片 */
body {
content: " " !important;
background: fixed !important;
z-index: -1 !important;
top: 0 !important;
right: 0 !important;
bottom: 0 !important;
left: 0 !important;
background-position: top !important;
background-repeat: no-repeat !important;
background-size: cover !important;
background-image: url(https://im.mibo.live/system/cache/media_attachments/files/111/860/641/805/938/534/original/32d28906e08af63e.jpeg) !important;
font-family: Arial,Helvetica,sans-serif !important;
}
/* 导航栏 */
.ui.large.menu {
border: 0 !important;
border-radius: 0px !important;
background-color: rgba(255, 255, 255, 55%) !important;
}
/* 首页按钮 */
.ui.menu .active.item {
background-color: transparent !important;
}
/* 导航栏下拉框 */
.ui.dropdown .menu {
border: 0 !important;
border-radius: 0 !important;
background-color: rgba(255, 255, 255, 80%) !important;
}
/* 登陆按钮 */
.nezha-primary-btn {
background-color: transparent !important;
color: #000 !important;
}
/* 大卡片 */
#app .ui.fluid.accordion {
background-color: #fbfbfb26 !important;
border-radius: 0.4rem !important;
}
/* 小卡片 */
.ui.four.cards>.card {
border-radius: 0.6rem !important;
background-color: #fafafaa3 !important;
}
.status.cards .wide.column {
padding-top: 0 !important;
padding-bottom: 0 !important;
height: 3.3rem !important;
}
.status.cards .three.wide.column {
padding-right: 0rem !important;
}
.status.cards .wide.column:nth-child(1) {
margin-top: 2rem !important;
}
.status.cards .wide.column:nth-child(2) {
margin-top: 2rem !important;
}
.status.cards .description {
padding-bottom: 0 !important;
}
/* 小鸡名 */
.status.cards .flag {
margin-right: 0.5rem !important;
}
/* 弹出卡片图标 */
.status.cards .header > .info.icon {
margin-right: 0 !important;
}
.nezha-secondary-font {
color: #21ba45 !important;
}
/* 进度条 */
.ui.progress {
border-radius: 50rem !important;
}
.ui.progress .bar {
min-width: 1.8em !important;
border-radius: 15px !important;
line-height: 1.65em !important;
}
.ui.fine.progress> .bar {
background-color: #21ba45 !important;
}
.ui.progress> .bar {
background-color: #000 !important;
}
.ui.progress.fine .bar {
background-color: #21ba45 !important;
}
.ui.progress.warning .bar {
background-color: #ff9800 !important;
}
.ui.progress.error .bar {
background-color: #e41e10 !important;
}
.ui.progress.offline .bar {
background-color: #000 !important;
}
/* 上传下载 */
.status.cards .outline.icon {
margin-right: 1px !important;
}
i.arrow.alternate.circle.down.outline.icon {
color: #21ba45 !important;
}
i.arrow.alternate.circle.up.outline.icon {
color: red !important;
}
/* 弹出卡片小箭头 */
.ui.right.center.popup {
margin: -3px 0 0 0.914286em !important;
-webkit-transform-origin: left 50% !important;
transform-origin: left 50% !important;
}
.ui.bottom.left.popup {
margin-left: 1px !important;
margin-top: 3px !important;
}
.ui.top.left.popup {
margin-left: 0 !important;
margin-bottom: 10px !important;
}
.ui.top.right.popup {
margin-right: 0 !important;
margin-bottom: 8px !important;
}
.ui.left.center.popup {
margin: -3px .91428571em 0 0 !important;
-webkit-transform-origin: right 50% !important;
transform-origin: right 50% !important;
}
.ui.right.center.popup:before,
.ui.left.center.popup:before {
border: 0px solid #fafafaeb !important;
background: #fafafaeb !important;
}
.ui.top.popup:before {
border-color: #fafafaeb transparent transparent !important;
}
.ui.popup:before {
border-color: #fafafaeb transparent transparent !important;
}
.ui.bottom.left.popup:before {
border-radius: 0 !important;
border: 1px solid transparent !important;
border-color: #fafafaeb transparent transparent !important;
background: #fafafaeb !important;
-webkit-box-shadow: 0px 0px 0 0 #fafafaeb !important;
box-shadow: 0px 0px 0 0 #fafafaeb !important;
-webkit-tap-highlight-color: rgba(0,0,0,0) !important;
}
.ui.bottom.right.popup:before {
border-radius: 0 !important;
border: 1px solid transparent !important;
border-color: #fafafaeb transparent transparent !important;
background: #fafafaeb !important
-webkit-box-shadow: 0px 0px 0 0 #fafafaeb !important;
box-shadow: 0px 0px 0 0 #fafafaeb !important;
-webkit-tap-highlight-color: rgba(0,0,0,0) !important;
}
.ui.top.left.popup:before {
border-radius: 0 !important;
border: 1px solid transparent !important;
border-color: #fafafaeb transparent transparent !important;
background: #fafafaeb !important;
-webkit-box-shadow: 0px 0px 0 0 #fafafaeb !important;
box-shadow: 0px 0px 0 0 #fafafaeb !important;
-webkit-tap-highlight-color: rgba(0,0,0,0) !important;
}
.ui.top.right.popup:before {
border-radius: 0 !important;
border: 1px solid transparent !important;
border-color: #fafafaeb transparent transparent !important;
background: #fafafaeb !important;
-webkit-box-shadow: 0px 0px 0 0 #fafafaeb !important;
box-shadow: 0px 0px 0 0 #fafafaeb !important;
-webkit-tap-highlight-color: rgba(0,0,0,0) !important;
}
.ui.left.center.popup:before {
border-radius: 0 !important;
border: 1px solid transparent !important;
border-color: #fafafaeb transparent transparent !important;
background: #fafafaeb !important;
-webkit-box-shadow: 0px 0px 0 0 #fafafaeb !important;
box-shadow: 0px 0px 0 0 #fafafaeb !important;
-webkit-tap-highlight-color: rgba(0,0,0,0) !important;
}
/* 弹出卡片 */
.status.cards .ui.content.popup {
min-width: 20rem !important;
line-height: 2rem !important;
border-radius: 5px !important;
border: 1px solid transparent !important;
background-color: #fafafaeb !important;
font-family: Arial,Helvetica,sans-serif !important;
}
.ui.content {
margin: 0 !important;
padding: 1em !important;
}
/* 服务页 */
.ui.table {
background: RGB(225,225,225,0.6) !important;
}
.ui.table thead th {
background: transparent !important;
}
/* 服务页进度条 */
.service-status .good {
background-color: #21ba45 !important;
}
.service-status .danger {
background-color: red !important;
}
.service-status .warning {
background-color: orange !important;
}
/* 版权 */
.ui.inverted.segment, .ui.primary.inverted.segment {
color: #000 !important;
font-weight: bold !important;
background-color: #fafafaa3 !important;
}
</style>
<!--Logo和版权-->
<script>
window.onload = function(){
var avatar=document.querySelector(".item img")
var footer=document.querySelector("div.is-size-7")
footer.innerHTML="CopyRihgt @ nezha.free.hr"
footer.style.visibility="visible"
avatar.src="https://ip.mibo.live/favicon.ico"
avatar.style.visibility="visible"
}
var faviconurl="https://ip.mibo.live/favicon.ico" ;
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = faviconurl;
document.getElementsByTagName('head')[0].appendChild(link);
</script>
<script>
document.addEventListener("DOMContentLoaded", function() {
// 通过标签名获取图片元素
var imgElement = document.querySelector('.navbar-brand img');
// 确保元素存在后再修改src属性
if (imgElement) {
imgElement.src = "https://ip.mibo.live/favicon.ico";
} else {
console.error("找不到图片元素");
}
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var downtimeCells = document.querySelectorAll('th.node-cell.os.center');
downtimeCells.forEach(function(cell) {
// 创建一个新的 <th> 元素
var newTh = document.createElement('th');
// 添加 class 属性
newTh.className = 'node-cell downtime center';
// 设置新元素的文本内容
newTh.textContent = '备注';
// 将新元素插入到当前单元格的后面
cell.parentNode.insertBefore(newTh, cell.nextSibling);
});
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const affLinks = {
19: {
// expiration: new Date('2024-12-31'),
content: {
type: 'link',
value: 'https://baidu.com',
label: '购买同款',
icon: 'https://img.icons8.com/?size=24&id=63312&format=png',
iconAlt: 'Icon'
}
},
31: {
// expiration: new Date('2024-12-31'),
content: {
type: 'icon',
value: 'https://img.icons8.com/?size=24&id=g8ltXTwIfJ1n&format=png',
// label: 'Icon',
// text: '赞'
}
},
37: {
expiration: new Date('2024-12-31'),
content: {
type: 'text',
// value: 'https://cdn3.iconfinder.com/data/icons/font-awesome-regular-1/640/handshake-64.png',
// label: 'Icon',
value: ''
}
},
39: {
//expiration: new Date('2024-12-31'),
content: {
type: 'text',
// value: 'https://cdn3.iconfinder.com/data/icons/font-awesome-regular-1/640/handshake-64.png',
// label: 'Icon',
value: '一切从白嫖开始'
}
},
36: {
expiration: new Date('3014-12-31'),
content: {
type: 'text',
value: ''
}
}
};
const createLink = (linkConfig) => {
const $link = document.createElement('a');
$link.href = linkConfig.value;
$link.textContent = linkConfig.label || linkConfig.value;
if (linkConfig.icon) {
const $icon = document.createElement('img');
$icon.src = linkConfig.icon;
$icon.alt = linkConfig.iconAlt || '';
$link.appendChild($icon);
}
if (linkConfig.text) {
const $text = document.createElement('span');
$text.textContent = linkConfig.text;
$link.appendChild(document.createTextNode(' '));
$link.appendChild($text);
}
return $link;
};
const createIcon = (iconConfig) => {
const $icon = document.createElement('img');
$icon.src = iconConfig.value;
$icon.alt = iconConfig.label || 'Icon';
if (iconConfig.text) {
const $text = document.createElement('span');
$text.textContent = iconConfig.text;
$icon.appendChild(document.createTextNode(' '));
$icon.appendChild($text);
}
return $icon;
};
const createCountdown = (expirationDate) => {
const $countdown = document.createElement('div');
$countdown.textContent = ' ';
const $countdownTime = document.createElement('span');
const updateCountdown = () => {
const now = new Date();
const diff = expirationDate.getTime() - now.getTime();
if (diff <= 0) {
clearInterval(countdownInterval);
$countdownTime.textContent = '已过期';
return;
}
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
$countdownTime.textContent = `${days}天 ${hours}小时 ${minutes}分钟 ${seconds}秒`;
};
const countdownInterval = setInterval(updateCountdown, 1000);
updateCountdown();
$countdown.appendChild($countdownTime);
return $countdown;
};
const rows = document.querySelectorAll('tr');
rows.forEach((row, index) => {
let osCell = row.querySelector('td.node-cell.os.center');
let downtimeCell = document.createElement('td');
downtimeCell.classList.add('node-cell', 'downtime', 'center');
let nodeId = row.id.substring(1);
let affLink = affLinks[nodeId];
if (!affLink) {
affLink = {
content: {
type: 'text',
value: '未定义'
}
};
}
if (osCell && affLink && affLink.content) {
switch (affLink.content.type) {
case 'link':
let link = createLink(affLink.content);
downtimeCell.appendChild(link);
break;
case 'icon':
let icon = createIcon(affLink.content);
downtimeCell.appendChild(icon);
break;
default:
let text = document.createTextNode(affLink.content.value);
downtimeCell.appendChild(text);
break;
}
if (affLink.expiration) {
let countdown = createCountdown(affLink.expiration);
downtimeCell.appendChild(countdown);
}
osCell.parentNode.insertBefore(downtimeCell, osCell.nextSibling);
}
});
});
</script>
本文作者:cheng
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!