diff --git a/CloudServer/public/generator.html b/CloudServer/public/generator.html
index fc17c79..4f84609 100644
--- a/CloudServer/public/generator.html
+++ b/CloudServer/public/generator.html
@@ -1251,7 +1251,7 @@
async function loadList() {
try {
- const res = await fetch('/api/files/content?path=uploads/list.txt');
+ const res = await fetch('/api/files/content?path=list.txt');
const data = await res.json();
listData = [];
if (data.success && data.content) {
@@ -1418,7 +1418,7 @@
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
- path: 'uploads/list.txt',
+ path: 'list.txt',
content: content + '\n'
})
});
diff --git a/CloudServer/public/index.html b/CloudServer/public/index.html
index 13c4cc5..2302866 100644
--- a/CloudServer/public/index.html
+++ b/CloudServer/public/index.html
@@ -857,7 +857,6 @@
// --- State ---
let allFiles = [];
let currentPath = 'root';
- let expandedTrains = new Set();
let stationCodeMap = {};
let broadcastingStations = new Set();
@@ -951,101 +950,26 @@
if (!state.activeTrains || state.activeTrains.length === 0) list.innerHTML = '
+ div.innerHTML = `
+
${tr.trainId}
-
${currentStCode}
+
${currentStCode} ${tr.status || '-'}
-
${isExpanded ? ICONS.chevronUp : ICONS.chevronDown}
-
-
-
-
Trip Logs
- ${detailsHtml}
-
-
+
`;
list.appendChild(div);
});
-
- // Network Statistics
- const statsDiv = document.createElement('div');
- statsDiv.className = 'status-item';
- const isStatsExpanded = expandedTrains.has('__STATS__');
-
- let statsHtml = '
No data
';
- if (state.travelTimes) {
- const keys = Object.keys(state.travelTimes).sort();
- if (keys.length > 0) {
- statsHtml = keys.map(key => {
- const times = state.travelTimes[key];
- const [from, to] = key.split('|');
- const fromCode = stationCodeMap[from] || from;
- const toCode = stationCodeMap[to] || to;
- const avg = Math.ceil(times.reduce((a, b) => a + b, 0) / times.length);
- return `
-
- ${fromCode} → ${toCode}
- ${avg}s
- (${times.length})
-
- `;
- }).join('');
- }
- }
-
- statsDiv.innerHTML = `
-
-
-
-
-
${isStatsExpanded ? ICONS.chevronUp : ICONS.chevronDown}
-
-
-
-
- ROUTE
- AVG
- CNT
-
- ${statsHtml}
-
- `;
- list.appendChild(statsDiv);
}
}
-
- /* Removed separate Travel Times renderer */
function showRadioStream() {
document.getElementById('file-manager-view').style.display = 'none';
@@ -1120,18 +1044,6 @@
});
}
- function toggleTrain(id) {
- if (expandedTrains.has(id)) expandedTrains.delete(id);
- else expandedTrains.add(id);
- // We need to re-render to update icons/state, but since state updates often,
- // just toggling the DOM element is smoother until next update
- const details = document.getElementById(`details-${id}`);
- if (details) {
- details.classList.toggle('open');
- // Force re-render on next update will respect the Set
- }
- }
-
function addLog(logText) {
const container = document.getElementById('console-logs');
const div = document.createElement('div');
@@ -1334,14 +1246,6 @@
await fetch(`/api/trains/${encodeURIComponent(id)}`, { method: 'DELETE' });
}
- async function deleteStats() {
- if (!confirm('Are you sure you want to clear all network travel time statistics?')) return;
- const res = await fetch('/api/stats', { method: 'DELETE' });
- const data = await res.json();
- if (data.success) showToast('Success', 'Network statistics cleared');
- else showToast('Error', data.message);
- }
-
function triggerUpload() {
if (currentPath === 'config') document.getElementById('upload-config').click();
else if (currentPath === 'general') document.getElementById('upload-general').click();
diff --git a/CloudServer/public/infoboard.html b/CloudServer/public/infoboard.html
index 03fb413..a093e8a 100644
--- a/CloudServer/public/infoboard.html
+++ b/CloudServer/public/infoboard.html
@@ -184,19 +184,6 @@
background: var(--bg-hover);
}
- .train-details {
- display: none;
- background: rgba(0, 0, 0, 0.2);
- padding: 12px 20px;
- font-size: 0.8rem;
- color: var(--text-muted);
- border-top: 1px solid var(--bg-border);
- }
-
- .train-details.open {
- display: block;
- }
-
.trip-log {
display: grid;
grid-template-columns: 80px 1fr auto;
@@ -380,7 +367,6 @@
};
// --- State ---
- let expandedTrains = new Set();
let stationCodeMap = {};
let broadcastingStations = new Set();
let messageLog = [];
@@ -526,27 +512,8 @@
list.innerHTML = '
暂无活跃列车
';
} else {
state.activeTrains.forEach(tr => {
- const isExpanded = expandedTrains.has(tr.trainId);
const div = document.createElement('div');
div.className = 'status-item train-item';
- div.onclick = () => toggleTrain(tr.trainId);
-
- let detailsHtml = '';
- if (tr.tripLogs && tr.tripLogs.length > 0) {
- detailsHtml = tr.tripLogs.slice().reverse().map(log => {
- const time = new Date(log.time).toLocaleTimeString();
- const stCode = stationCodeMap[log.station] || log.station;
- return `
-
- ${time}
- ${stCode}
- ${log.action === 'Arrival' ? '到达' : '出发'}
-
- `;
- }).join('');
- } else {
- detailsHtml = '
暂无运行历史
';
- }
const currentStCode = stationCodeMap[tr.currentStation] || tr.currentStation || '-';
const statusColor = tr.status === 'At Station' ? 'var(--success)' : 'var(--warning)';
@@ -556,13 +523,9 @@
${tr.trainId} ${tr.destination || '未知终点'}
-
${currentStCode} ${tr.status === 'At Station' ? '在站' : '运行中'}
+
${currentStCode} ${tr.status === 'At Station' ? '在站' : (tr.status === 'Departed' ? '已发车' : '运行中')}
-
${isExpanded ? ICONS.chevronUp : ICONS.chevronDown}
-
-
-
运行日志 (Trip Logs)
- ${detailsHtml}
+
`;
@@ -572,15 +535,6 @@
}
}
- function toggleTrain(id) {
- if (expandedTrains.has(id)) expandedTrains.delete(id);
- else expandedTrains.add(id);
- const details = document.getElementById(`details-${id}`);
- if (details) {
- details.classList.toggle('open');
- }
- }
-
function updateStationDots() {
const dots = document.querySelectorAll('[id^="station-dot-"]');
dots.forEach(dot => {
diff --git a/CloudServer/public/listmanager.html b/CloudServer/public/listmanager.html
index b983f72..6e0f9ae 100644
--- a/CloudServer/public/listmanager.html
+++ b/CloudServer/public/listmanager.html
@@ -397,7 +397,7 @@
-
对 uploads/list.txt 进行增删改;每条记录格式:站号==音频文件1,音频文件2,... (支持多个站号用 / 分隔)
+
对 /opt/CC-StationBroadcast/list.txt 进行增删改;每条记录格式:站号==音频文件1,音频文件2,... (支持多个站号用 / 分隔)