Skip to content

Commit 4cc3229

Browse files
committed
feat(webUI): sort commands and place their buttons in 3 columns
1 parent 5a807a1 commit 4cc3229

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/main/java/ru/ewc/checklogic/server/CommandMetadata.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ public CommandMetadata(final Map<String, List<String>> metadata) {
6363
* @return The command names as an HTML list to be used in a page template.
6464
*/
6565
public String namesAsHtmlList(final ServerInstance computation, final String outcome) {
66-
return this.names.stream().map(
66+
return this.names.stream().sorted().map(
6767
command -> """
68-
<button class="btn %2$s"
68+
<div class="col-4 px-2">
69+
<button class="btn %2$s col-12"
6970
hx-get="/command" hx-target="body" hx-swap="beforeend"
7071
hx-vals='{"command":"%1$s"}'>%1$s</button>
72+
</div>
7173
""".formatted(command, buttonCssClass(computation, command, outcome))
7274
).collect(Collectors.joining());
7375
}

src/main/resources/templates/state.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ <h1>Context</h1>
6868
<button class="btn btn-primary" type="submit">Update commands</button>
6969
</form>
7070
<h1>Commands</h1>
71-
<div id="commands" class="btn-group-vertical"></div>
71+
<div id="commands" class="row g-2"></div>
7272
</div>
7373
</div>

0 commit comments

Comments
 (0)