Skip to content

Commit

Permalink
client: Re-work profile dropdown to show simplified, user-facing app …
Browse files Browse the repository at this point in the history
…version
  • Loading branch information
dev-warrior777 committed Dec 18, 2024
1 parent a939101 commit c8606aa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
6 changes: 5 additions & 1 deletion client/cmd/bisonw-desktop/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import (
"runtime"
"runtime/debug"
"runtime/pprof"
"strings"
"sync"
"sync/atomic"
"syscall"
Expand Down Expand Up @@ -222,7 +223,10 @@ func mainCore() error {
}()
}

webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc, app.Version))
parts := strings.Split(app.Version, "-")
userAppVersion := parts[0]

webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc, userAppVersion))
if err != nil {
return fmt.Errorf("failed creating web server: %w", err)
}
Expand Down
8 changes: 7 additions & 1 deletion client/cmd/bisonw/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func runCore(cfg *app.Config) error {
}

if !cfg.NoWeb {
webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc, app.Version))
webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc, userAppVersion(app.Version)))
if err != nil {
return fmt.Errorf("failed creating web server: %w", err)
}
Expand Down Expand Up @@ -231,3 +231,9 @@ func promptShutdown(clientCore *core.Core) bool {
fmt.Println("Shutdown aborted.")
return false
}

// userAppVersion returns a simplified version string for end users.
func userAppVersion(fullAppVersion string) string {
parts := strings.Split(fullAppVersion, "-")
return parts[0]
}
5 changes: 3 additions & 2 deletions client/webserver/site/src/html/bodybuilder.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,15 @@
<span class="ico-profile fs16 me-2"></span>
[[[Sign Out]]]
</div>
<div class="demi d-flex align-items-center py-1" id="version">
<br>
<div class="border-bottom py-2"></div>
<div class="demi-sans d-flex align-items-center py-1" id="version">
<div class="flex-center">
[[[Version]]] {{.Version}}
</div>
</div>
</div>


</header>
{{end}}

Expand Down

0 comments on commit c8606aa

Please sign in to comment.