Skip to content

Commit 2e469b0

Browse files
cikzhdavidv1992
authored andcommitted
Time source card redesign and some small fixes
1 parent ec9a43a commit 2e469b0

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

nts-pool-management/assets/components.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,14 @@ h2 {
8585
margin-bottom: var(--space-sm);
8686
}
8787

88+
h3 {
89+
color: var(--primary);
90+
}
91+
8892
.card {
8993
background-color: var(--white);
9094
border-radius: var(--border-radius);
91-
margin-top: var(--space-md);
92-
padding: var(--space-sm) var(--space-md) var(--space-md) var(--space-md);
95+
padding: calc((var(--space-md) + var(--space-sm)) / 2) var(--space-md) var(--space-sm) var(--space-md);
9396
}
9497

9598
dl {

nts-pool-management/assets/main.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,9 @@ details.toast > summary {
175175
max-width: 8rem;
176176
}
177177
}
178+
179+
.time-sources-list {
180+
display: flex;
181+
gap: var(--space-md);
182+
flex-wrap: wrap;
183+
}

nts-pool-management/templates/admin/monitors.html.j2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
<label for="name">Name</label>
1414
<input name="name" type="text" />
1515
</fieldset>
16-
<button type="submit">Add</button>
16+
<div>
17+
<button type="submit">Add</button>
18+
</div>
1719
</form>
1820
</section>
1921
<section>
20-
<h2>Current monitors</h2>
22+
<h2>Monitors</h2>
2123
<table>
2224
<thead>
2325
<th>Name</th>

nts-pool-management/templates/management/time_sources_page.html.j2

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,29 @@
1717
<input name="port" type="text" />
1818
</fieldset>
1919
</div>
20-
<button type="submit">Add</button>
20+
<div>
21+
<button type="submit">Add</button>
22+
</div>
2123
</form>
2224
</section>
2325
<section>
2426
<h2>Time source servers</h2>
27+
<div class="time-sources-list">
28+
{% if time_sources.is_empty() %}
29+
<article>No time sources servers added</article>
30+
{% endif %}
2531
{%- for ts in time_sources %}
2632
<article class="card">
33+
<h3>{{ ts.hostname }}{% if let Some(p) = ts.port %}<span class="port">:{{ p }}</span>{% endif %}</h3>
2734
<form action="/management/time-sources/{{ ts.id }}/update" method="POST">
2835
<input type="hidden" />
2936
<dl>
30-
<dd>Hostname</dd>
31-
<dt>{{ ts.hostname }}{% if let Some(p) = ts.port %}<span class="port">:{{ p }}</span>{% endif %}</dt>
32-
<dd>Weight</dd>
33-
<dt><input type="number" name="weight" value="{{ ts.weight }}" /></dt>
34-
<dd>Ipv4 score</dd>
37+
<dd>IPv4 score</dd>
3538
<dt>{{ ts.ipv4_score | fmt("{:.1}") }}</dt>
36-
<dd>Ipv6 score</dd>
39+
<dd>IPv6 score</dd>
3740
<dt>{{ ts.ipv6_score | fmt("{:.1}") }}</dt>
41+
<dd>Weight</dd>
42+
<dt><input type="number" name="weight" value="{{ ts.weight }}" /></dt>
3843
</dl>
3944
<button type="submit" class="btn-sm">Save</button>
4045
</form>
@@ -49,5 +54,6 @@
4954
</form>
5055
</article>
5156
{% endfor %}
57+
</div>
5258
</section>
5359
{% endblock %}

0 commit comments

Comments
 (0)