Skip to content

Commit

Permalink
Merge branch 'dev/1.10.2' into enterprise
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinplemelon committed Oct 18, 2024
2 parents 1c51041 + d8c5e10 commit 02eff15
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
</template>

<script setup lang="ts">
import useDashboardVersion from '@/hooks/useDashboardVersion'
import { computed } from 'vue'
import { useStore } from 'vuex'
import { useRoute, useRouter } from 'vue-router'
Expand Down Expand Up @@ -63,6 +64,9 @@ if (syncOsTheme.value) {
hadleSyncOSTheme()
}
const { printVersion } = useDashboardVersion()
printVersion()
const router = useRouter()
const route = useRoute()
const { getUserInfoFromQuery } = useGetInfoFromQuery()
Expand Down
26 changes: 26 additions & 0 deletions src/hooks/useDashboardVersion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import axios from 'axios'

export default (): {
printVersion: () => Promise<void>
} => {
const versionReg = /refs\/tags\/(.+)/
const printVersion = async () => {
try {
const { data: versionContent } = await axios({
method: 'get',
url: 'version',
baseURL: '',
})
debugger
const version = versionContent.match(versionReg)?.[1]
if (version) {
console.log('🔎 Dashboard Version:', version)
}
} catch (error) {
//
}
}
return {
printVersion,
}
}

0 comments on commit 02eff15

Please sign in to comment.