Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
## 0.5.1 -> new version check
Browse files Browse the repository at this point in the history
### Fixed
- "new" always show
  • Loading branch information
glennliao committed Mar 8, 2023
1 parent f244f2d commit 8225744
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
- support lua
- support ssh-agent

- 0.5.0 (?)
- 0.5.0 (2023-03-08)
- support update check
- support github action

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
- support lua
- support ssh-agent

- 0.5.0 (?)
- 0.5.0 (2023-03-08)
- support update check
- support github action

Expand Down
62 changes: 45 additions & 17 deletions ui/src/views/redis/components/VersionInfoModal.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<div style="cursor: pointer" class="flex" @click="showModal = true">
RedisMan {{version}}
<n-badge v-if="version !== latest" dot>
RedisMan {{ version }}
<n-badge v-if="version !== latest" dot>
(new)
</n-badge>
</n-badge>
</div>
<n-modal
v-model:show="showModal"
Expand All @@ -17,17 +17,40 @@
>

<div>
<div>
curVersion : {{version}}
</div>
<div >
latest: {{latest}}
<div class="flex">
<div>
https://github.com/glennliao/redisman
</div>
<div class="ml-2">
<div><a href="https://github.com/glennliao/redisman" target="_blank" style="text-decoration: none">
<n-button size="small" type="primary">download</n-button>
</a></div>
</div>
</div>
<div class="flex mt-2">
<div>
curVersion :
<n-tag type="info">
{{ version }}
</n-tag>
</div>
<div class="ml-2">
latest: {{ latest }}
<n-tag type="success">
{{ latest }}
</n-tag>
</div>
<div class="ml-4">
<n-button size="small" :loading="checking" @click="checkNewVersion" type="info">
check
</n-button>
</div>
</div>


<div class="flex mt-2">

<div>
<a href="https://github.com/glennliao/redisman" target="_blank">to download</a>
</div>
<n-button @click="checkNewVersion">check</n-button>
</div>
</div>
<template #footer>
<div class="flex justify-end">
Expand Down Expand Up @@ -55,12 +78,17 @@ export default {
footer: 'soft'
}

const version = import.meta.env.VITE_app_version
const version = import.meta.env.VITE_app_version.trim()
const latest = ref(version)

function checkNewVersion(){
checkVersion().then(data=>{
latest.value = data.latest.Version
const checking = ref(false)

function checkNewVersion() {
checking.value = true
checkVersion().then(data => {
latest.value = data.latest.Version?.trim()
}).finally(()=>{
checking.value = false
})
}

Expand All @@ -69,7 +97,7 @@ export default {
open,
showModal,
bodyStyle, segmented,
checkNewVersion,version,latest
checkNewVersion, version, latest,checking

}
}
Expand Down

0 comments on commit 8225744

Please sign in to comment.