mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 15:29:26 +00:00
App.vue and router update to include authorization.
This commit is contained in:
parent
c4d66d130c
commit
d38f999b27
2 changed files with 35 additions and 5 deletions
|
|
@ -5,20 +5,41 @@
|
|||
</div>
|
||||
<MainMenu />
|
||||
<RouterView />
|
||||
<AlertComp
|
||||
v-if="!isLocal() && !handshake && route.fullPath !== '/devices'"
|
||||
variant="warning"
|
||||
:page-wide="true"
|
||||
href="/devices"
|
||||
>
|
||||
<h4>Not authorized!</h4>
|
||||
<p>Click here to start authorization and open the "Devices" page on your PC.</p>
|
||||
</AlertComp>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import MainMenu from '@/components/base/MainMenu.vue'
|
||||
import { onMounted } from 'vue'
|
||||
import { RouterView } from 'vue-router'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { RouterView, useRoute } from 'vue-router'
|
||||
import { useDeviceStore } from './stores/device'
|
||||
import { isLocal } from './services/ApiService'
|
||||
import AlertComp from './components/base/AlertComp.vue'
|
||||
|
||||
const device = useDeviceStore()
|
||||
|
||||
onMounted(() => {
|
||||
const route = useRoute()
|
||||
const handshake = ref(false)
|
||||
|
||||
onMounted(async () => {
|
||||
device.uuid()
|
||||
|
||||
const hsReq = await device.remoteHandshake()
|
||||
handshake.value = hsReq
|
||||
|
||||
device.$subscribe((mutation, state) => {
|
||||
console.log(mutation)
|
||||
})
|
||||
// Setting device uuid from localstorage
|
||||
// If not present in LocalStorage a new uuidV4 will be generated
|
||||
device.uuid()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
@ -45,7 +66,6 @@ onMounted(() => {
|
|||
top-[10%]
|
||||
left-[10%]
|
||||
scale-[1.8]
|
||||
p-28
|
||||
opacity-35
|
||||
mix-blend-overlay;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,16 @@ const router = createRouter({
|
|||
name: 'panels',
|
||||
component: () => import('../views/PanelsView.vue'),
|
||||
},
|
||||
{
|
||||
path: '/panel/edit/:dirname',
|
||||
name: 'panel-edit',
|
||||
component: () => import('../views/PanelsView.vue'),
|
||||
},
|
||||
{
|
||||
path: '/panel/view/:dirname',
|
||||
name: 'panel-view',
|
||||
component: () => import('../views/PanelsView.vue'),
|
||||
},
|
||||
{
|
||||
path: '/macros',
|
||||
name: 'macros',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue