Skip to content

Commit

Permalink
Add version to navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Akkadius committed Nov 30, 2021
1 parent fa43b4a commit 47c5d99
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [1.0.3]
* Add version to navbar

## [1.0.2]
* Embed the changelog you're reading into the app

Expand Down
18 changes: 18 additions & 0 deletions frontend/src/views/layout/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@

</ul>

<h6 class="navbar-heading" v-if="appVersion">
Version {{ appVersion }}
</h6>

<!-- &lt;!&ndash; Heading &ndash;&gt;-->
<!-- <h6 class="navbar-heading">-->
<!-- Editors-->
Expand Down Expand Up @@ -218,13 +222,16 @@ import NavbarUserSettingsCog from "@/views/layout/NavbarUserSettingsCog";
import UserContext from "@/app/user/UserContext";
import NavSectionComponent from "@/views/layout/NavSectionComponent";
import {ROUTE} from "@/routes";
import {SpireApiClient} from "@/app/api/spire-api-client";
import * as util from "util";
export default {
components: { NavSectionComponent, NavbarDropdownMenu, NavbarUserSettingsCog },
data() {
return {
backendBaseUrl: "",
user: null,
appVersion: "",
componentNavs: [
{ title: "Progress Bars", to: "/components#progress-bars" },
{ title: "Page Headers", to: "/components#page-headers" },
Expand Down Expand Up @@ -277,6 +284,17 @@ export default {
},
async mounted() {
SpireApiClient.v1().get(`/app/env`).then((response) => {
if (response.data && response.data.data) {
// console.log(response.data.data)
const env = response.data.data.env
const version = response.data.data.version
this.appVersion = util.format("%s (%s)", env, version)
}
})
this.backendBaseUrl = App.BACKEND_BASE_URL
this.user = await UserContext.getUser()
},
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/views/pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ export default {
result = md.render(result);
console.log(result)
// doc
this.changelog = "<div>" + result + "</div>"
Expand Down
1 change: 0 additions & 1 deletion internal/http/controllers/app_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ type PackageJson struct {

func (d *AppController) env(c echo.Context) error {
data, _ := d.cache.Get("packageJson")

pJson, ok := data.([]byte)
if ok {
var pkg PackageJson
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func main() {

// ran via executable on desktop
if len(os.Args) == 1 && runtime.GOOS == "windows" {
_ = os.Setenv("APP_ENV", "desktop")
app.Desktop().Boot()
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spire",
"version": "1.0.2",
"version": "1.0.3",
"repository": {
"type": "git",
"url": "https://github.com/Akkadius/spire.git"
Expand Down

0 comments on commit 47c5d99

Please sign in to comment.