Merge branch 'dev-defuj' of github.com:defuj/eis into dev-bagus

This commit is contained in:
kur0nek-o 2024-04-18 10:36:41 +07:00
commit 755b04cdab
3 changed files with 33 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "eis",
"version": "0.0.1",
"version": "0.0.111",
"private": true,
"scripts": {
"dev": "vite",

View File

@ -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()

View File

@ -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>