Skip to content

Commit

Permalink
Merge pull request #3 from FRC-1721/addition/show_branch
Browse files Browse the repository at this point in the history
Show the full git desc
  • Loading branch information
dublUayaychtee authored Mar 24, 2024
2 parents 6f584bd + 1cfc5be commit 7ae9e3d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ stage: # Prepares dist/ for deployment
make build
cp entrypoint.sh $(STAGEDIR)
cp run.bat $(STAGEDIR)
find dist/ -type f -exec sed -i 's/%baked_ver%/${shell git describe --always}/g' {} +
2 changes: 2 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
</div>
</div>
</div>
Dashboard version %baked_ver%
<img id="camera-error" src="asset/doh.png" alt="" />
<img id="camera" src="http://10.17.21.11:5800" alt="" />
<div id="thermal">
Expand All @@ -56,6 +57,7 @@
</div>
<div class="spacer"></div>
<div id="git">
<div id="git-hash"></div>
<div id="git-branch"></div>
<div id="git-user"></div>
</div>
Expand Down
9 changes: 7 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,19 @@ function onValueChanged(key, value, isNew) {
if (key === "/SmartDashboard/BuildData/git-branch") {
$("#git-branch").text(value);
}

if (key === "/SmartDashboard/BuildData/git-desc") {
$("#git-hash").text(value);
}

if (key === "/SmartDashboard/BuildData/deploy-user") {
$("#git-user").text(value);
var color = "";
switch (value) {
case "SimUser":
color = "#d3869b";
break;
case "joe":
case "KenwoodFox":
color = "#831598";
break;
case "dublu":
Expand All @@ -165,7 +170,7 @@ function onValueChanged(key, value, isNew) {
case _:
color = "#282828";
}
$("#git-user").css("border-right", "6px solid " + color);
$("#git-user").css("border-right", "20px solid " + color);
}

if (key === "/SmartDashboard/Auto/Angle") {
Expand Down

0 comments on commit 7ae9e3d

Please sign in to comment.