diff --git a/static/js/app.js b/static/js/app.js index 6df910d..94ca198 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -170,10 +170,20 @@ const WeatherApp = { try { const hexID = WeatherUtils.decimalToHex(decimalId); const stationID = `RS485-${hexID}`; + const endPlus3Str = (() => { + try { + const d = new Date(endTime); + if (!isNaN(d)) { + const d2 = new Date(d.getTime() + 3 * 60 * 60 * 1000); + return WeatherUtils.formatDatetimeLocal(d2).replace('T', ' ') + ':00'; + } + } catch (e) {} + return endTime.replace('T', ' ') + ':00'; + })(); const forecastParams = new URLSearchParams({ station_id: stationID, from: startTime.replace('T', ' ') + ':00', - to: endTime.replace('T', ' ') + ':00', + to: endPlus3Str, provider: forecastProvider, versions: '3' }); diff --git a/static/js/weather-chart.js b/static/js/weather-chart.js index 0a5cd95..3a144e0 100644 --- a/static/js/weather-chart.js +++ b/static/js/weather-chart.js @@ -295,9 +295,7 @@ WeatherChart.applyLegendMode = function(mode) { }; switch (mode) { - case 'combo_compact': - setVisible(['temp_actual','hum_actual','rain_actual','rain_fcst_h1']); - break; + case 'verify_all': setVisible(['temp_actual','temp_fcst','hum_actual','hum_fcst','pressure_actual','pressure_fcst','wind_actual','wind_fcst','rain_actual','rain_fcst_h1','rain_fcst_h2','rain_fcst_h3']); break; @@ -318,7 +316,7 @@ WeatherChart.applyLegendMode = function(mode) { break; case 'combo_standard': default: - setVisible(['temp_actual','hum_actual','rain_actual','rain_fcst_h1','rain_fcst_h2','rain_fcst_h3']); + setVisible(['temp_actual','temp_fcst','rain_actual','rain_fcst_h1','rain_fcst_h2','rain_fcst_h3']); break; } this.chart.update(); diff --git a/templates/index.html b/templates/index.html index 97cf34b..c34e574 100644 --- a/templates/index.html +++ b/templates/index.html @@ -67,6 +67,7 @@ display: flex; align-items: center; gap: 5px; + flex-wrap: wrap; flex-shrink: 0; } @@ -487,7 +488,6 @@ 显示历史预报