|
|
@@ -233,34 +233,14 @@
|
|
|
|
|
|
<div class="controls">
|
|
|
<div class="control-group">
|
|
|
- <div class="control-item">
|
|
|
- <label for="symbolSelect">选择币对:</label>
|
|
|
- <select id="symbolSelect">
|
|
|
- <option value="">请选择币对...</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- <div class="control-item">
|
|
|
- <label for="timeRange">时间范围:</label>
|
|
|
- <select id="timeRange">
|
|
|
- <option value="1">1小时</option>
|
|
|
- <option value="6">6小时</option>
|
|
|
- <option value="24" selected>24小时</option>
|
|
|
- <option value="72">3天</option>
|
|
|
- <option value="168">7天</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- <div class="control-item">
|
|
|
- <label for="autoRefresh">自动刷新:</label>
|
|
|
- <select id="autoRefresh">
|
|
|
- <option value="0">关闭</option>
|
|
|
- <option value="5">5秒</option>
|
|
|
- <option value="10" selected>10秒</option>
|
|
|
- <option value="30">30秒</option>
|
|
|
- <option value="60">1分钟</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- <button class="btn" onclick="loadData()">刷新数据</button>
|
|
|
+ <div class="control-item">
|
|
|
+ <label for="symbolSelect">选择币对:</label>
|
|
|
+ <select id="symbolSelect">
|
|
|
+ <option value="">请选择币对...</option>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
+ <button class="btn" onclick="loadData()">刷新数据</button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="content">
|
|
|
@@ -329,17 +309,6 @@
|
|
|
loadData();
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- document.getElementById('timeRange').addEventListener('change', function() {
|
|
|
- const symbol = document.getElementById('symbolSelect').value;
|
|
|
- if (symbol) {
|
|
|
- loadData();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- document.getElementById('autoRefresh').addEventListener('change', function() {
|
|
|
- setupAutoRefresh();
|
|
|
- });
|
|
|
}
|
|
|
|
|
|
async function loadSymbols() {
|
|
|
@@ -363,7 +332,6 @@
|
|
|
|
|
|
async function loadData() {
|
|
|
const symbol = document.getElementById('symbolSelect').value;
|
|
|
- const hours = document.getElementById('timeRange').value;
|
|
|
|
|
|
if (!symbol) {
|
|
|
showError('请先选择币对');
|
|
|
@@ -375,8 +343,8 @@
|
|
|
try {
|
|
|
// 并行加载数据、统计信息和24小时缩略图
|
|
|
const [dataResponse, statsResponse, latestResponse, thumbnailResponse] = await Promise.all([
|
|
|
- axios.get(`${API_BASE}/data/${symbol}?hours=${hours}&limit=1000`),
|
|
|
- axios.get(`${API_BASE}/stats/${symbol}?hours=${hours}`),
|
|
|
+ axios.get(`${API_BASE}/data/${symbol}?hours=24&limit=1000`),
|
|
|
+ axios.get(`${API_BASE}/stats/${symbol}?hours=24`),
|
|
|
axios.get(`${API_BASE}/latest/${symbol}`),
|
|
|
axios.get(`${API_BASE}/thumbnail/${symbol}`)
|
|
|
]);
|