Skip to content

Commit

Permalink
feat(ui): display latest version on top bar
Browse files Browse the repository at this point in the history
close #1188
  • Loading branch information
tchiotludo committed May 23, 2023
1 parent c7e8ad9 commit 62345f3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
14 changes: 13 additions & 1 deletion ui/src/components/layout/TopNavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
</el-breadcrumb>
</div>
<div class="side ms-auto ps-2">
<a v-if="version" :href="version.url"
target="_blank"
class="el-button el-button--small version is-text is-has-bg">
🎉 New release v{{ version.latest }}
</a>
<a href="https://api.kestra.io/v1/communities/slack/redirect"
target="_blank"
class="el-button el-button--small is-text is-has-bg">
Expand All @@ -43,6 +48,7 @@
},
computed: {
...mapState("layout", ["topNavbar"]),
...mapState("api", ["version"]),
title() {
return this.topNavbar.title;
},
Expand Down Expand Up @@ -125,6 +131,7 @@
}
}
.is-text {
font-weight: bold;
border: 1px solid var(--bs-border-color);
Expand All @@ -133,9 +140,14 @@
background-color: var(--bs-white) !important;
html.dark & {
color: var(--bs-white);
color: var(--bs-white) !important;
background-color: var(--bs-gray-500) !important;
}
&.version, html.dark &.version {
background: var(--el-color-primary) !important;
border-color: var(--el-color-primary-dark-2) !important;
}
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions ui/src/stores/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ export default {
namespaced: true,
state: {
feeds: [],
version: undefined,
},

actions: {
loadFeeds({commit}, options) {
return axios.get(API_URL + "/v1/feeds/latest", {
return axios.get(API_URL + "/v1/feeds", {
params: {
iid: options.iid,
uid: options.uid,
version: options.version
}
}).then(response => {
commit("setFeeds", response.data)
commit("setFeeds", response.data.feeds)
commit("setVersion", response.data.version)

return response.data;
})
Expand All @@ -45,6 +47,9 @@ export default {
mutations: {
setFeeds(state, feeds) {
state.feeds = feeds
},
setVersion(state, version) {
state.version = version
}
}
}

0 comments on commit 62345f3

Please sign in to comment.