Update version number in package.json and Welcome.vue
This commit is contained in:
parent
117c192c33
commit
df130784bd
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eis",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.111",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
@ -129,6 +129,7 @@
|
||||
<dt class="text-xs text-center text-gray-500">
|
||||
Copyright © 2023 PT PLN (Persero). All Rights Reserved
|
||||
</dt>
|
||||
<dt class="mt-4 text-xs font-bold text-center text-gray-800">Version {{ version }}</dt>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -142,6 +143,7 @@ import { type RouteRecordRaw } from 'vue-router'
|
||||
import { routes, extractLeafRoutes } from '@/router'
|
||||
import { navigationIcon } from '@/utils/route'
|
||||
import { detectOS } from '@/utils/helper'
|
||||
import { version } from '../../../package.json'
|
||||
|
||||
const os = ref(detectOS())
|
||||
const command = useCommandPalattesStore()
|
||||
|
@ -3,7 +3,37 @@ import MenuProvider from '@/components/Pages/MenuProvider.vue'
|
||||
import Navigation from '@/components/Navigation/Navigation.vue'
|
||||
import { useMenuStore } from '@/stores/menu'
|
||||
import { RouterView } from 'vue-router'
|
||||
import { useDialogStore } from '@/stores/dialog'
|
||||
import { onMounted } from 'vue'
|
||||
import { version } from '../../package.json'
|
||||
const menu = useMenuStore()
|
||||
const dialog = useDialogStore()
|
||||
|
||||
const showDialogUpdate = () => {
|
||||
dialog.type = 'success'
|
||||
dialog.title = 'Update Aplikasi'
|
||||
dialog.content =
|
||||
'Aplikasi telah diperbarui. Silahkan muat ulang aplikasi untuk melihat perubahan.'
|
||||
dialog.confirmText = 'Muat Ulang'
|
||||
dialog.showCancelButton = false
|
||||
dialog.onConfirm = () => {
|
||||
window.location.reload()
|
||||
}
|
||||
dialog.dismissOnAction = false
|
||||
dialog.open = true
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const localVersion = localStorage.getItem('version')
|
||||
if (localVersion) {
|
||||
if (localVersion !== version) {
|
||||
localStorage.setItem('version', version)
|
||||
showDialogUpdate()
|
||||
}
|
||||
} else {
|
||||
localStorage.setItem('version', version)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
Loading…
x
Reference in New Issue
Block a user