Skip to content

Commit

Permalink
Add description
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Delporte committed May 7, 2024
1 parent b8d31f8 commit 388fbf8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public BoardInfoView() {
setSizeFull();
setJustifyContentMode(JustifyContentMode.START);

add(new Paragraph(
new Span("Information about all the Raspberry Pi boards. This info is based on the "),
new Anchor("https://pi4j.com/documentation/board-info", "board info", AnchorTarget.BLANK),
new Span(" provided by the Pi4J library.")));

listBox.addValueChangeListener(e -> showBoard(e.getValue()));
listBox.setMinWidth(300, Unit.PIXELS);
listBox.setHeightFull();
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/com/pi4j/boardinfoservice/views/SystemInfoView.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.grid.ColumnTextAlign;
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.html.Anchor;
import com.vaadin.flow.component.html.AnchorTarget;
import com.vaadin.flow.component.html.Paragraph;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.PageTitle;
import com.vaadin.flow.router.Route;
Expand All @@ -25,6 +29,11 @@ public SystemInfoView(@Autowired SystemInfoService systemInfoService) {

setSpacing(false);

add(new Paragraph(
new Span("Information about the Raspberry Pi board that runs this webservice. This info is returned by the "),
new Anchor("https://github.com/Pi4J/pi4j-v2/blob/develop/pi4j-core/src/main/java/com/pi4j/boardinfo/util/BoardInfoHelper.java", "BoardInfoHelper", AnchorTarget.BLANK),
new Span(", which is available in the Pi4J Core library.")));

Grid<InfoLine> grid = new Grid<>(InfoLine.class, false);
grid.addColumn(InfoLine::type)
.setHeader("Type")
Expand All @@ -44,8 +53,8 @@ public SystemInfoView(@Autowired SystemInfoService systemInfoService) {
add(grid);

setSizeFull();
setJustifyContentMode(JustifyContentMode.CENTER);
setDefaultHorizontalComponentAlignment(Alignment.CENTER);
//setJustifyContentMode(JustifyContentMode.LEF);
//setDefaultHorizontalComponentAlignment(Alignment.CENTER);
getStyle().set("text-align", "center");
}

Expand Down

0 comments on commit 388fbf8

Please sign in to comment.