125 lines
4.0 KiB
HTML
Executable File
125 lines
4.0 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>MySQL 5.7 备份监控</title>
|
|
<style>
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
margin: 0;
|
|
padding: 20px;
|
|
background-color: #f5f5f5;
|
|
}
|
|
.container {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
background: white;
|
|
padding: 20px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
}
|
|
h1 {
|
|
color: #333;
|
|
text-align: center;
|
|
margin-bottom: 30px;
|
|
}
|
|
.status-card {
|
|
background: #e8f5e8;
|
|
border: 1px solid #4caf50;
|
|
border-radius: 5px;
|
|
padding: 15px;
|
|
margin-bottom: 20px;
|
|
}
|
|
.backup-list {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
|
gap: 15px;
|
|
margin-top: 20px;
|
|
}
|
|
.backup-item {
|
|
background: #f9f9f9;
|
|
border: 1px solid #ddd;
|
|
border-radius: 5px;
|
|
padding: 15px;
|
|
}
|
|
.backup-item h3 {
|
|
margin: 0 0 10px 0;
|
|
color: #333;
|
|
}
|
|
.backup-item p {
|
|
margin: 5px 0;
|
|
color: #666;
|
|
}
|
|
.refresh-btn {
|
|
background: #007bff;
|
|
color: white;
|
|
border: none;
|
|
padding: 10px 20px;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
margin-bottom: 20px;
|
|
}
|
|
.refresh-btn:hover {
|
|
background: #0056b3;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>🗄️ MySQL 5.7 备份监控</h1>
|
|
|
|
<div class="status-card">
|
|
<h3>📊 备份状态</h3>
|
|
<p><strong>服务状态:</strong> <span id="service-status">检查中...</span></p>
|
|
<p><strong>最后备份:</strong> <span id="last-backup">检查中...</span></p>
|
|
<p><strong>备份数量:</strong> <span id="backup-count">检查中...</span></p>
|
|
</div>
|
|
|
|
<button class="refresh-btn" onclick="refreshStatus()">🔄 刷新状态</button>
|
|
|
|
<div class="backup-list" id="backup-list">
|
|
<p>正在加载备份列表...</p>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function refreshStatus() {
|
|
// 这里可以添加 AJAX 请求来获取实时状态
|
|
document.getElementById('service-status').textContent = '运行中';
|
|
document.getElementById('last-backup').textContent = new Date().toLocaleString();
|
|
document.getElementById('backup-count').textContent = '检查中...';
|
|
|
|
// 模拟加载备份列表
|
|
setTimeout(() => {
|
|
loadBackupList();
|
|
}, 1000);
|
|
}
|
|
|
|
function loadBackupList() {
|
|
// 这里可以添加 AJAX 请求来获取备份列表
|
|
const backupList = document.getElementById('backup-list');
|
|
backupList.innerHTML = `
|
|
<div class="backup-item">
|
|
<h3>📁 全量备份</h3>
|
|
<p><strong>目录:</strong> /backup/full/</p>
|
|
<p><strong>最新备份:</strong> 2024-01-15_02:00:00</p>
|
|
<p><strong>大小:</strong> 2.5 GB</p>
|
|
</div>
|
|
<div class="backup-item">
|
|
<h3>📁 增量备份</h3>
|
|
<p><strong>目录:</strong> /backup/incremental/</p>
|
|
<p><strong>最新备份:</strong> 2024-01-15_14:00:00</p>
|
|
<p><strong>大小:</strong> 150 MB</p>
|
|
</div>
|
|
`;
|
|
}
|
|
|
|
// 页面加载时自动刷新
|
|
window.onload = function() {
|
|
refreshStatus();
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|