From bc56530307e0e92b94a1abb5d38368f04b92e990 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期四, 12 三月 2026 15:52:15 +0800
Subject: [PATCH] 1
---
zy-acs-hex/src/main/webapp/views/index.html | 706 ++++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 600 insertions(+), 106 deletions(-)
diff --git a/zy-acs-hex/src/main/webapp/views/index.html b/zy-acs-hex/src/main/webapp/views/index.html
index 63acba4..47f972d 100644
--- a/zy-acs-hex/src/main/webapp/views/index.html
+++ b/zy-acs-hex/src/main/webapp/views/index.html
@@ -10,156 +10,650 @@
padding: 0;
box-sizing: border-box;
}
+
body {
- font-family: Arial, sans-serif;
- background-color: #f0f2f5;
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
+ background-color: #f5f7fa;
+ color: #333;
}
+
.header {
- background-color: #1890ff;
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
- padding: 15px 20px;
+ padding: 15px 30px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
+ }
+
+ .header h1 {
+ font-size: 22px;
+ font-weight: 600;
+ }
+
+ .header button {
+ background-color: rgba(255, 255, 255, 0.2);
+ color: white;
+ border: 1px solid rgba(255, 255, 255, 0.3);
+ padding: 8px 20px;
+ border-radius: 20px;
+ cursor: pointer;
+ font-size: 14px;
+ transition: all 0.3s ease;
+ }
+
+ .header button:hover {
+ background-color: rgba(255, 255, 255, 0.3);
+ }
+
+ .container {
+ padding: 30px;
+ }
+
+ .filter-section {
+ background-color: white;
+ padding: 20px;
+ border-radius: 12px;
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
+ margin-bottom: 20px;
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
+ gap: 15px;
+ animation: fadeIn 0.5s ease-in-out;
+ }
+
+ @keyframes fadeIn {
+ from {
+ opacity: 0;
+ transform: translateY(20px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+ }
+
+ .filter-group {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .filter-group label {
+ margin-bottom: 8px;
+ font-weight: 500;
+ color: #666;
+ font-size: 14px;
+ }
+
+ .filter-group select,
+ .filter-group input {
+ padding: 10px 12px;
+ border: 2px solid #e0e0e0;
+ border-radius: 8px;
+ font-size: 14px;
+ transition: border-color 0.3s ease;
+ }
+
+ .filter-group select:focus,
+ .filter-group input:focus {
+ outline: none;
+ border-color: #667eea;
+ box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
+ }
+
+ .filter-actions {
+ grid-column: 1 / -1;
+ display: flex;
+ gap: 10px;
+ margin-top: 10px;
+ }
+
+ .btn {
+ padding: 10px 20px;
+ border: none;
+ border-radius: 8px;
+ font-size: 14px;
+ font-weight: 500;
+ cursor: pointer;
+ transition: all 0.3s ease;
+ }
+
+ .btn-primary {
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+ color: white;
+ }
+
+ .btn-primary:hover {
+ transform: translateY(-2px);
+ box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
+ }
+
+ .btn-secondary {
+ background-color: #f0f0f0;
+ color: #333;
+ }
+
+ .btn-secondary:hover {
+ background-color: #e0e0e0;
+ }
+
+ .log-section {
+ background-color: white;
+ border-radius: 12px;
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
+ overflow: hidden;
+ }
+
+ .log-header {
+ padding: 20px;
+ border-bottom: 1px solid #f0f0f0;
display: flex;
justify-content: space-between;
align-items: center;
}
- .header h1 {
- font-size: 20px;
+
+ .log-header h2 {
+ font-size: 18px;
+ font-weight: 600;
+ color: #333;
}
- .header button {
- background-color: transparent;
- color: white;
- border: 1px solid white;
- padding: 5px 15px;
- border-radius: 4px;
- cursor: pointer;
+
+ .log-content {
+ padding: 0;
}
- .header button:hover {
- background-color: rgba(255,255,255,0.1);
- }
- .container {
- padding: 20px;
- }
- .refresh-btn {
- background-color: #1890ff;
- color: white;
- border: none;
- padding: 8px 16px;
- border-radius: 4px;
- cursor: pointer;
- margin-bottom: 20px;
- }
- .refresh-btn:hover {
- background-color: #40a9ff;
- }
+
table {
width: 100%;
border-collapse: collapse;
- background-color: white;
- box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
+
th, td {
- padding: 12px;
+ padding: 15px 20px;
text-align: left;
- border-bottom: 1px solid #ddd;
+ border-bottom: 1px solid #f0f0f0;
}
+
th {
- background-color: #f5f5f5;
- font-weight: bold;
+ background-color: #f9f9f9;
+ font-weight: 600;
+ color: #666;
+ font-size: 14px;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
}
+
tr:hover {
- background-color: #f5f5f5;
+ background-color: #f9f9f9;
}
+
+ td {
+ font-size: 14px;
+ color: #555;
+ }
+
.loading {
text-align: center;
- padding: 20px;
- color: #666;
+ padding: 60px;
+ color: #999;
+ font-size: 16px;
}
+
.error {
text-align: center;
- padding: 20px;
- color: red;
+ padding: 60px;
+ color: #ff4d4f;
+ font-size: 16px;
+ }
+
+ .empty {
+ text-align: center;
+ padding: 60px;
+ color: #999;
+ font-size: 16px;
+ }
+
+ .status-badge {
+ display: inline-block;
+ padding: 4px 12px;
+ border-radius: 12px;
+ font-size: 12px;
+ font-weight: 500;
+ }
+
+ .status-up {
+ background-color: #e6f7ee;
+ color: #52c41a;
+ }
+
+ .status-down {
+ background-color: #fff2e8;
+ color: #fa8c16;
+ }
+
+ @media (max-width: 768px) {
+ .container {
+ padding: 15px;
+ }
+
+ .filter-section {
+ grid-template-columns: 1fr;
+ }
+
+ .filter-actions {
+ flex-direction: column;
+ }
+
+ .btn {
+ width: 100%;
+ }
+
+ table {
+ display: block;
+ overflow-x: auto;
+ }
}
</style>
</head>
<body>
- <div class="header">
- <h1>鏈哄櫒浜轰笂涓嬭鏃ュ織</h1>
- <button id="logoutBtn">鐧诲嚭</button>
+<div class="header">
+ <h1>鏈哄櫒浜轰笂涓嬭鏃ュ織</h1>
+ <button id="logoutBtn">鐧诲嚭</button>
+</div>
+<div class="container">
+ <div class="filter-section">
+ <div class="filter-group">
+ <label for="deviceId">灏忚溅缂栧彿</label>
+ <input type="text" id="deviceId" placeholder="璇疯緭鍏ュ皬杞︾紪鍙�">
+ </div>
+ <div class="filter-group">
+ <label for="messageType">娑堟伅绫诲瀷</label>
+ <select id="messageType">
+ <option value="">鍏ㄩ儴</option>
+ <!-- 浠庡悗鍙版帴鍙h幏鍙� -->
+ </select>
+ </div>
+ <div class="filter-group">
+ <label for="tag">鏍囩</label>
+ <select id="tag">
+ <option value="">鍏ㄩ儴</option>
+ <!-- 浠庡悗鍙版帴鍙h幏鍙� -->
+ </select>
+ </div>
+ <div class="filter-group">
+ <label for="startTime">寮�濮嬫椂闂�</label>
+ <input type="datetime-local" id="startTime" step="1">
+ </div>
+ <div class="filter-group">
+ <label for="endTime">缁撴潫鏃堕棿</label>
+ <input type="datetime-local" id="endTime" step="1">
+ </div>
+ <div class="filter-actions">
+ <button class="btn btn-primary" id="searchBtn">鏌ヨ</button>
+ <button class="btn btn-secondary" id="resetBtn">閲嶇疆</button>
+ <button class="btn btn-secondary" id="refreshBtn">鍒锋柊</button>
+ </div>
</div>
- <div class="container">
- <button class="refresh-btn" id="refreshBtn">鍒锋柊鏁版嵁</button>
- <div id="loading" class="loading">鍔犺浇涓�...</div>
- <div id="error" class="error" style="display: none;"></div>
- <table id="logTable" style="display: none;">
- <thead>
- <tr>
- <th>鏃堕棿</th>
- <th>璁惧ID</th>
- <th>娑堟伅绫诲瀷</th>
- <th>娑堟伅鍐呭</th>
- </tr>
- </thead>
- <tbody id="logTableBody">
- </tbody>
- </table>
+
+ <div class="log-section">
+ <div class="log-header">
+ <h2>鏃ュ織璁板綍</h2>
+ <span id="recordCount">鍏� 0 鏉¤褰�</span>
+ </div>
+ <div class="log-content">
+ <div id="loading" class="loading">鍔犺浇涓�...</div>
+ <div id="error" class="error" style="display: none;"></div>
+ <div id="empty" class="empty" style="display: none;">鏆傛棤绗﹀悎鏉′欢鐨勬棩蹇楄褰�</div>
+ <table id="logTable" style="display: none;">
+ <thead>
+ <tr>
+ <th>鏃堕棿</th>
+ <th>璁惧ID</th>
+ <th>娑堟伅绫诲瀷</th>
+ <th>鏍囩</th>
+ <th>娑堟伅鍐呭</th>
+ <th>鎿嶄綔</th>
+ </tr>
+ </thead>
+ <tbody id="logTableBody">
+ </tbody>
+ </table>
+ </div>
</div>
- <script>
- // 妫�鏌ョ櫥褰曠姸鎬�
- function checkLogin() {
- if (!localStorage.getItem('loggedIn')) {
- window.location.href = '/login';
- }
- }
-
- // 鐧诲嚭鍔熻兘
- document.getElementById('logoutBtn').addEventListener('click', function() {
- localStorage.removeItem('loggedIn');
+</div>
+<script>
+ // 妫�鏌ョ櫥褰曠姸鎬�
+ function checkLogin() {
+ if (!localStorage.getItem('loggedIn')) {
window.location.href = '/login';
- });
-
- // 鍔犺浇鏃ュ織鏁版嵁
- function loadLogData() {
- document.getElementById('loading').style.display = 'block';
- document.getElementById('error').style.display = 'none';
- document.getElementById('logTable').style.display = 'none';
-
- fetch('/deviceLog/query')
- .then(response => response.json())
- .then(data => {
- document.getElementById('loading').style.display = 'none';
- if (data && data.length > 0) {
+ }
+ }
+
+ // 鐧诲嚭鍔熻兘
+ document.getElementById('logoutBtn').addEventListener('click', function () {
+ localStorage.removeItem('loggedIn');
+ window.location.href = '/login';
+ });
+
+ // 閲嶇疆绛涢�夋潯浠�
+ document.getElementById('resetBtn').addEventListener('click', function () {
+ document.getElementById('deviceId').value = '';
+ document.getElementById('messageType').value = '';
+ document.getElementById('tag').value = '';
+ document.getElementById('startTime').value = '';
+ document.getElementById('endTime').value = '';
+ loadLogData();
+ });
+
+ // 鏌ヨ鎸夐挳鐐瑰嚮浜嬩欢
+ document.getElementById('searchBtn').addEventListener('click', loadLogData);
+
+ // 鍒锋柊鎸夐挳鐐瑰嚮浜嬩欢
+ document.getElementById('refreshBtn').addEventListener('click', loadLogData);
+
+ // 鍔犺浇鏃ュ織鏁版嵁
+ function loadLogData() {
+ document.getElementById('loading').style.display = 'block';
+ document.getElementById('error').style.display = 'none';
+ document.getElementById('empty').style.display = 'none';
+ document.getElementById('logTable').style.display = 'none';
+
+ // 鑾峰彇绛涢�夋潯浠�
+ const deviceId = document.getElementById('deviceId').value;
+ const messageType = document.getElementById('messageType').value;
+ const tag = document.getElementById('tag').value;
+ const startTime = document.getElementById('startTime').value;
+ const endTime = document.getElementById('endTime').value;
+
+ // 鏋勫缓鏌ヨ鍙傛暟
+ const params = new URLSearchParams();
+ if (deviceId) params.append('deviceId', deviceId);
+ if (messageType) params.append('type', messageType);
+ if (tag) params.append('event', tag);
+ if (startTime) {
+ // 浣跨敤鍘熷鐨勬棩鏈熸牸寮�
+ params.append('startTime', startTime+"Z");
+ }
+ if (endTime) {
+ // 浣跨敤鍘熷鐨勬棩鏈熸牸寮�
+ params.append('endTime', endTime+"Z");
+ }
+
+ // 璋冪敤鏌ヨ鎺ュ彛
+ fetch(`/deviceLog/query?${params.toString()}`)
+ .then(response => response.json())
+ .then(data => {
+ document.getElementById('loading').style.display = 'none';
+
+ // 妫�鏌ユ帴鍙h繑鍥炴牸寮�
+ if (data && data.code === 200 && data.data) {
+ // 搴旂敤绛涢�夋潯浠讹紙濡傛灉鍚庡彴娌℃湁澶勭悊绛涢�夛級
+ let filteredData = data.data;
+ if (deviceId) {
+ // 妯$硦鍖归厤璁惧ID
+ filteredData = filteredData.filter(item => {
+ return item.deviceId && item.deviceId.includes(deviceId);
+ });
+ }
+ if (messageType) {
+ // 鐩存帴浣跨敤messageType杩涜鍖归厤
+ filteredData = filteredData.filter(item => {
+ return item.type && item.type === messageType;
+ });
+ }
+ if (tag) {
+ // 浣跨敤event瀛楁浣滀负鏍囩杩涜绛涢��
+ filteredData = filteredData.filter(item => {
+ return item.event && item.event === tag;
+ });
+ }
+ if (startTime) {
+ const start = new Date(startTime).getTime();
+ filteredData = filteredData.filter(item => {
+ const itemTime = new Date(item.timestamp).getTime();
+ return itemTime >= start;
+ });
+ }
+ if (endTime) {
+ const end = new Date(endTime).getTime();
+ filteredData = filteredData.filter(item => {
+ const itemTime = new Date(item.timestamp).getTime();
+ return itemTime <= end;
+ });
+ }
+
+ // 鏇存柊璁板綍鏁�
+ document.getElementById('recordCount').textContent = `鍏� ${filteredData.length} 鏉¤褰昤;
+
+ if (filteredData && filteredData.length > 0) {
document.getElementById('logTable').style.display = 'table';
const tbody = document.getElementById('logTableBody');
tbody.innerHTML = '';
-
- data.forEach(item => {
- const row = document.createElement('tr');
- row.innerHTML = `
- <td>${item.time || '-'}</td>
- <td>${item.deviceId || '-'}</td>
- <td>${item.messageType || '-'}</td>
- <td>${item.messageContent || '-'}</td>
- `;
- tbody.appendChild(row);
- });
+
+ filteredData.forEach(item => {
+ const row = document.createElement('tr');
+ const statusClass = item.type === 'up' ? 'status-up' : 'status-down';
+ const statusText = item.type === 'up' ? '涓婅' : '涓嬭';
+ const sourceHexStr = item.sourceHexStr || '';
+
+ // 鏍煎紡鍖栨椂闂存埑
+ let formattedTime = '-';
+ if (item.timestamp) {
+ try {
+ const date = new Date(item.timestamp/1000/1000);
+ formattedTime = date.toLocaleString('zh-CN', {
+ year: 'numeric',
+ month: '2-digit',
+ day: '2-digit',
+ hour: '2-digit',
+ minute: '2-digit',
+ second: '2-digit'
+ });
+ } catch (e) {
+ formattedTime = item.timestamp;
+ }
+ }
+
+ row.innerHTML = `
+ <td>${formattedTime}</td>
+ <td>${item.deviceId || '-'}</td>
+ <td><span class="status-badge ${statusClass}">${statusText}</span></td>
+ <td>${item.event || '-'}</td>
+ <td>${sourceHexStr}</td>
+ <td>
+ <button class="btn btn-secondary parse-btn" data-hex="${sourceHexStr}">瑙f瀽</button>
+ </td>
+ `;
+ tbody.appendChild(row);
+ });
+
+ // 涓鸿В鏋愭寜閽坊鍔犵偣鍑讳簨浠�
+ document.querySelectorAll('.parse-btn').forEach(btn => {
+ btn.addEventListener('click', function() {
+ const hexData = this.getAttribute('data-hex');
+ console.log('瑙f瀽鎸夐挳鐐瑰嚮锛宧exData:', hexData);
+ if (hexData) {
+ parseHexData(hexData);
+ } else {
+ alert('娌℃湁鍙В鏋愮殑娑堟伅鍐呭');
+ }
+ });
+ });
} else {
- document.getElementById('error').textContent = '鏆傛棤鏃ュ織鏁版嵁';
- document.getElementById('error').style.display = 'block';
+ document.getElementById('empty').style.display = 'block';
}
- })
- .catch(error => {
- document.getElementById('loading').style.display = 'none';
- document.getElementById('error').textContent = '鍔犺浇鏁版嵁澶辫触: ' + error.message;
+ } else {
+ document.getElementById('error').textContent = '鍔犺浇鏁版嵁澶辫触: ' + (data.message || '鏈煡閿欒');
document.getElementById('error').style.display = 'block';
- });
+ }
+ })
+ .catch(error => {
+ document.getElementById('loading').style.display = 'none';
+ document.getElementById('error').textContent = '鍔犺浇鏁版嵁澶辫触: ' + error.message;
+ document.getElementById('error').style.display = 'block';
+ });
+ }
+
+ // 浠庡悗鍙版帴鍙h幏鍙栨秷鎭被鍨嬪拰鏍囩
+ function loadFilterOptions() {
+ // 鑾峰彇娑堟伅绫诲瀷
+ fetch('/deviceLog/queryType')
+ .then(response => response.json())
+ .then(data => {
+ if (data && data.code === 200 && data.data) {
+ const messageTypeSelect = document.getElementById('messageType');
+ messageTypeSelect.innerHTML = '<option value="">鍏ㄩ儴</option>';
+ data.data.forEach(type => {
+ const option = document.createElement('option');
+ option.value = type.label;
+ option.textContent = type.value;
+ messageTypeSelect.appendChild(option);
+ });
+ // 娑堟伅绫诲瀷鍙樺寲鏃讹紝閲嶆柊鍔犺浇鏍囩
+ messageTypeSelect.addEventListener('change', function () {
+ loadTags(this.value);
+ });
+ // 鍒濆鍔犺浇鏍囩
+ loadTags('');
+ }
+ })
+ .catch(error => {
+ console.error('鍔犺浇娑堟伅绫诲瀷澶辫触:', error);
+ });
+ }
+
+ // 鍔犺浇鏍囩
+ function loadTags(directionType) {
+ let url = '/deviceLog/queryEvent';
+ if (directionType) {
+ url += '?directionType=' + directionType;
+ }
+ fetch(url)
+ .then(response => response.json())
+ .then(data => {
+ if (data && data.code === 200 && data.data) {
+ const tagSelect = document.getElementById('tag');
+ tagSelect.innerHTML = '<option value="">鍏ㄩ儴</option>';
+ data.data.forEach(tag => {
+ const option = document.createElement('option');
+ option.value = tag.value;
+ option.textContent = tag.label;
+ tagSelect.appendChild(option);
+ });
+ }
+ })
+ .catch(error => {
+ console.error('鍔犺浇鏍囩澶辫触:', error);
+ });
+ }
+
+ // 瑙f瀽鍗佸叚杩涘埗鏁版嵁
+ function parseHexData(hexData) {
+ console.log('寮�濮嬭В鏋愶紝hexData:', hexData);
+
+ // 鍏堝叧闂箣鍓嶇殑鍔犺浇鐘舵�佸拰缁撴灉寮圭獥
+ const oldLoading = document.getElementById('parseLoading');
+ if (oldLoading) {
+ oldLoading.remove();
}
- // 鍒锋柊鎸夐挳鐐瑰嚮浜嬩欢
- document.getElementById('refreshBtn').addEventListener('click', loadLogData);
+ const oldResult = document.querySelector('[id^="resultDiv"]');
+ if (oldResult) {
+ oldResult.remove();
+ }
+
+ // 鏄剧ず鍔犺浇鐘舵��
+ const loadingDiv = document.createElement('div');
+ loadingDiv.className = 'loading';
+ loadingDiv.textContent = '瑙f瀽涓�...';
+ loadingDiv.style.position = 'fixed';
+ loadingDiv.style.top = '50%';
+ loadingDiv.style.left = '50%';
+ loadingDiv.style.transform = 'translate(-50%, -50%)';
+ loadingDiv.style.backgroundColor = 'rgba(255, 255, 255, 0.9)';
+ loadingDiv.style.padding = '20px';
+ loadingDiv.style.borderRadius = '8px';
+ loadingDiv.style.boxShadow = '0 2px 10px rgba(0,0,0,0.1)';
+ loadingDiv.id = 'parseLoading';
+ document.body.appendChild(loadingDiv);
+
+ // 鏋勫缓璇锋眰URL
+const url = `/proxy/decode?hexData=${encodeURIComponent(hexData)}`;
+console.log('璇锋眰URL:', url);
+
+ // 璋冪敤瑙f瀽鎺ュ彛
+ fetch(url, {
+ method: 'GET',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Accept': 'application/json'
+ },
+ mode: 'cors' // 鍏佽璺ㄥ煙璇锋眰
+ })
+ .then(response => {
+ console.log('鍝嶅簲鐘舵��:', response.status);
+ console.log('鍝嶅簲澶�:', response.headers);
+ if (!response.ok) {
+ throw new Error(`瑙f瀽澶辫触锛岀姸鎬佺爜: ${response.status}`);
+ }
+ return response.json();
+ })
+ .then(data => {
+ console.log('瑙f瀽缁撴灉:', data);
+ // 绉婚櫎鍔犺浇鐘舵��
+ document.getElementById('parseLoading').remove();
+
+ // 鏄剧ず瑙f瀽缁撴灉
+ const resultDiv = document.createElement('div');
+ resultDiv.id = 'resultDiv_' + Date.now(); // 娣诲姞鍞竴ID
+ resultDiv.style.position = 'fixed';
+ resultDiv.style.top = '50%';
+ resultDiv.style.left = '50%';
+ resultDiv.style.transform = 'translate(-50%, -50%)';
+ resultDiv.style.backgroundColor = 'white';
+ resultDiv.style.padding = '20px';
+ resultDiv.style.borderRadius = '8px';
+ resultDiv.style.boxShadow = '0 2px 20px rgba(0,0,0,0.2)';
+ resultDiv.style.maxWidth = '80%';
+ resultDiv.style.maxHeight = '80%';
+ resultDiv.style.overflow = 'auto';
+ resultDiv.style.zIndex = '1000';
+
+ // 鏋勫缓缁撴灉HTML
+ let resultHTML = '<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">';
+ resultHTML += '<h3 style="margin: 0;">瑙f瀽缁撴灉</h3>';
+ resultHTML += '<button id="closeResult" style="padding: 5px 10px; background-color: #f0f0f0; color: #333; border: none; border-radius: 4px; cursor: pointer;">脳</button>';
+ resultHTML += '</div>';
+ resultHTML += '<pre style="background-color: #f5f5f5; padding: 10px; border-radius: 4px; font-family: monospace; margin: 0;">';
+ resultHTML += JSON.stringify(data, null, 2);
+ resultHTML += '</pre>';
+
+ resultDiv.innerHTML = resultHTML;
+ document.body.appendChild(resultDiv);
+
+ // 鍏抽棴鎸夐挳鐐瑰嚮浜嬩欢
+ document.getElementById('closeResult').addEventListener('click', function() {
+ resultDiv.remove();
+ });
+ })
+ .catch(error => {
+ console.error('瑙f瀽閿欒:', error);
+ // 绉婚櫎鍔犺浇鐘舵��
+ document.getElementById('parseLoading').remove();
+
+ // 鏄剧ず璇︾粏鐨勯敊璇俊鎭�
+ let errorMessage = '瑙f瀽澶辫触: ' + error.message;
+ if (error.message.includes('Failed to fetch')) {
+ errorMessage += '\n鍙兘鐨勫師鍥狅細\n1. 瑙f瀽鏈嶅姟鏈惎鍔╘n2. 璺ㄥ煙闂\n3. 缃戠粶杩炴帴闂';
+ }
+ alert(errorMessage);
+ });
+ }
// 椤甸潰鍔犺浇鏃舵鏌ョ櫥褰曠姸鎬佸苟鍔犺浇鏁版嵁
checkLogin();
+ loadFilterOptions();
loadLogData();
- </script>
+</script>
</body>
</html>
\ No newline at end of file
--
Gitblit v1.9.1