mirror of
https://github.com/woodchen-ink/proxy-go.git
synced 2025-07-18 08:31:55 +08:00
refactor(metrics): remove historical data section from metrics dashboard template
- Eliminated the historical data section from the metrics dashboard, including time range buttons and associated chart containers. - Streamlined the metrics template for improved clarity and focus on current metrics display. - This change enhances the user experience by simplifying the dashboard layout.
This commit is contained in:
parent
837820639f
commit
a009dd04a8
@ -751,42 +751,6 @@ func (h *ProxyHandler) MetricsPageHandler(w http.ResponseWriter, r *http.Request
|
|||||||
|
|
||||||
func (h *ProxyHandler) MetricsDashboardHandler(w http.ResponseWriter, r *http.Request) {
|
func (h *ProxyHandler) MetricsDashboardHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
metricsTemplate = strings.Replace(metricsTemplate,
|
|
||||||
`</div>
|
|
||||||
|
|
||||||
<span id="lastUpdate"></span>`,
|
|
||||||
`</div>
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<h2>历史数据</h2>
|
|
||||||
<div class="time-range-buttons">
|
|
||||||
<button class="time-btn" data-hours="1">1小时</button>
|
|
||||||
<button class="time-btn" data-hours="6">6小时</button>
|
|
||||||
<button class="time-btn" data-hours="12">12小时</button>
|
|
||||||
<button class="time-btn active" data-hours="24">24小时</button>
|
|
||||||
<button class="time-btn" data-hours="72">3天</button>
|
|
||||||
<button class="time-btn" data-hours="120">5天</button>
|
|
||||||
<button class="time-btn" data-hours="168">7天</button>
|
|
||||||
<button class="time-btn" data-hours="360">15天</button>
|
|
||||||
<button class="time-btn" data-hours="720">30天</button>
|
|
||||||
</div>
|
|
||||||
<div id="historyChart">
|
|
||||||
<div class="chart-container">
|
|
||||||
<div class="chart">
|
|
||||||
<canvas id="requestsChart"></canvas>
|
|
||||||
</div>
|
|
||||||
<div class="chart">
|
|
||||||
<canvas id="errorRateChart"></canvas>
|
|
||||||
</div>
|
|
||||||
<div class="chart">
|
|
||||||
<canvas id="bytesChart"></canvas>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<span id="lastUpdate"></span>`, 1)
|
|
||||||
|
|
||||||
w.Write([]byte(metricsTemplate))
|
w.Write([]byte(metricsTemplate))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user