Skip to content

Commit 309c369

Browse files
committed
update-sites/stats: tidy up some formatting
1 parent 04782bb commit 309c369

File tree

1 file changed

+69
-28
lines changed

1 file changed

+69
-28
lines changed

_pages/update-sites/stats.md

Lines changed: 69 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,75 @@ title: Update Site Statistics
33
section: Extend:Update Sites
44
---
55

6-
<div id="controls" style="left: auto; right: auto; text-align: center; margin: 0 auto;">
7-
<div>
8-
<b>Update Site:</b> <select id="site" onchange="updateChart()"></select>
9-
</div>
10-
11-
<div>
12-
<b>Time Window:</b>
13-
<input type="radio" id="time-daily" name="timeWindow" value="daily" checked onchange="updateChart()"><label for="time-daily">Daily</label>
14-
<input type="radio" id="time-monthly" name="timeWindow" value="monthly" onchange="updateChart()"><label for="time-monthly">Monthly</label>
15-
<input type="radio" id="time-yearly" name="timeWindow" value="yearly" onchange="updateChart()"><label for="time-yearly">Yearly</label>
16-
<input type="radio" id="time-ever" name="timeWindow" value="ever" onchange="updateChart()"><label for="time-ever">Ever/Cumulative</label>
17-
</div>
18-
19-
<div>
20-
<b>Count Type:</b>
21-
<input type="radio" id="count-unique" name="countType" value="unique" checked onchange="updateChart()"><label for="count-unique">Unique IPs</label>
22-
<input type="radio" id="count-total" name="countType" value="total" onchange="updateChart()"><label for="count-total">Total Checks</label>
6+
<style>
7+
#controls {
8+
margin: 0 auto;
9+
padding-bottom: 2em;
10+
width: fit-content;
11+
}
12+
#controls .grid {
13+
display: grid;
14+
grid-template-columns: 150px 1fr;
15+
gap: 0.2em 0.2em;
16+
align-items: start;
17+
}
18+
#controls .grid label.heading {
19+
font-weight: bold;
20+
text-align: right;
21+
}
22+
#controls .grid div.widgets {
23+
display: flex;
24+
gap: 2px;
25+
flex-wrap: wrap;
26+
}
27+
#controls label, #controls select {
28+
padding-right: 0.4em;
29+
}
30+
#loading {
31+
display: none;
32+
font-style: italic;
33+
color: #666;
34+
text-align: center;
35+
margin-top: 15px;
36+
}
37+
.error {
38+
color: #d32f2f;
39+
font-weight: bold;
40+
padding: 20px;
41+
text-align: center;
42+
}
43+
</style>
44+
45+
<div id="controls">
46+
<div class="grid">
47+
<label class="heading">Update Site:</label>
48+
<select id="site" onchange="updateChart()"></select>
49+
50+
<label class="heading">Time Window:</label>
51+
<div class="widgets">
52+
<label><input type="radio" id="time-daily" name="timeWindow" value="daily" checked onchange="updateChart()"> Daily</label>
53+
<label><input type="radio" id="time-monthly" name="timeWindow" value="monthly" onchange="updateChart()"> Monthly</label>
54+
<label><input type="radio" id="time-yearly" name="timeWindow" value="yearly" onchange="updateChart()"> Yearly</label>
55+
<label><input type="radio" id="time-ever" name="timeWindow" value="ever" onchange="updateChart()"> Ever/Cumulative</label>
56+
</div>
57+
58+
<label class="heading">Count Type:</label>
59+
<div class="widgets">
60+
<label><input type="radio" id="count-unique" name="countType" value="unique" checked onchange="updateChart()"> Unique IPs</label>
61+
<label><input type="radio" id="count-total" name="countType" value="total" onchange="updateChart()"> Total Checks</label>
62+
</div>
63+
64+
<label class="heading">Options:</label>
65+
<div class="widgets">
66+
<label for="rolling-average"><input type="checkbox" id="rolling-average" checked onchange="updateChart()"> 7-day rolling average</label>
67+
</div>
2368
</div>
2469

25-
<div style="margin-bottom: 15px;">
26-
<input type="checkbox" id="rolling-average" checked onchange="updateChart()"><label for="rolling-average">7-day rolling average</label>
70+
<div id="loading">Loading data...</div>
2771
</div>
2872

29-
<div id="loading" style="display: none; font-style: italic; color: #666;">Loading data...</div>
30-
</div>
73+
<div id="stats-chart" style="width: 100%"></div>
3174

32-
<div id="stats-chart" style="width: 100%;"></div>
3375
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pako.min.js"></script>
3476
<script type="text/javascript">
3577
// Data cache to avoid refetching
@@ -224,9 +266,8 @@ section: Extend:Update Sites
224266

225267
} catch (error) {
226268
document.getElementById("stats-chart").innerHTML =
227-
`<div style="padding: 20px; text-align: center; color: #d32f2f;">
228-
<p><strong>Error loading data:</strong> ${error.message}</p>
229-
<p>Please try a different selection or contact support if the problem persists.</p>
269+
`<div class="error">
270+
<p>Error loading data: ${error.message}</p>
230271
</div>`;
231272
} finally {
232273
// Hide loading indicator
@@ -314,11 +355,11 @@ You can download the raw data directly from individual update sites. Each site h
314355

315356
**URL Format:** `https://sites.imagej.net/{SITE_NAME}/{STATS_FILE}`
316357

317-
**Sites Index:** {% include link-banner url='https://sites.imagej.net/sites.json' %}
358+
**Sites Index:** https://sites.imagej.net/sites.json
318359

319360
**Example URLs:**
320-
- {% include link-banner url='https://sites.imagej.net/Java-8/stats-unique-daily.txt.gz' %}
321-
- {% include link-banner url='https://sites.imagej.net/Fiji/stats-total-monthly.txt.gz' %}
361+
- https://sites.imagej.net/Java-8/stats-unique-daily.txt.gz
362+
- https://sites.imagej.net/Fiji/stats-total-monthly.txt.gz
322363

323364
**Data Format:** Each line contains a datestamp and count value separated by a space:
324365
```

0 commit comments

Comments
 (0)