scan progress bar added

This commit is contained in:
zurdi zurdo
2023-03-24 02:02:59 +01:00
parent 3abb411330
commit dd7b4e7e5a
2 changed files with 14 additions and 9 deletions

View File

@@ -1,19 +1,21 @@
<script setup>
import { ref, inject } from "vue";
import { useTheme } from "vuetify";
import Navigation from '@/components/Navigation.vue'
// Props
useTheme().global.name.value = localStorage.getItem('theme') || 'dark'
const scanning = ref(false)
</script>
<template>
<v-app>
<navigation/>
<v-main>
<v-container fluid>
<router-view />
<router-view/>
</v-container>
</v-main>

View File

@@ -56,7 +56,7 @@ async function scan() {
// Complete scan of by platform
console.log("scanning...")
scanning.value = true
console.log(scanning)
emitter.emit('scanning', true)
const platforms = []
toRaw(platformsToScan)._rawValue.forEach(p => {
platforms.push(toRaw(p))
@@ -68,7 +68,9 @@ async function scan() {
console.log("scan completed")
console.log(response.data)
}).catch((error) => {console.log(error)})
router.go()
scanning.value = false
emitter.emit('scanning', false)
// router.go()
}
else{
platforms.forEach(async p => {
@@ -80,7 +82,9 @@ async function scan() {
console.log("scan "+p.name+" completed")
console.log(response.data)
}).catch((error) => {console.log(error)})
router.go()
scanning.value = false
emitter.emit('scanning', false)
// router.go()
});
}
}
@@ -140,13 +144,12 @@ getPlatforms()
<v-toolbar-title class="align-center text-h6 ml-2 d-sm-none">
<v-avatar class="mr-3" :rounded="0"><v-img :src="'/assets/platforms/'+currentPlatformSlug+'.png'"></v-img></v-avatar>
</v-toolbar-title>
<!-- App bar - Scan progress bar -->
<v-progress-linear absolute bottom :active="scanning" :indeterminate="true" id="scan-progress"/>
<!-- App bar - Search bar -->
<v-text-field hide-details label="search" variant="outlined" density="compact" class="ml-5 mr-3" clearable prepend-inner-icon="mdi-magnify" v-model="filter" @keyup="setFilter(filter)" @click:clear="setFilter('')"/>
<!-- App bar - Settings -->
<v-app-bar-nav-icon @click="settings = !settings" rounded="0">
<v-icon v-if="!scanning" >mdi-cog</v-icon>
<v-progress-circular v-show="scanning" indeterminate color="primary" :width="2" :size="20" class="ml-2 mr-4" />
</v-app-bar-nav-icon>
<v-app-bar-nav-icon @click="settings = !settings" rounded="0"><v-icon>mdi-cog</v-icon></v-app-bar-nav-icon>
</v-app-bar>
<!-- Platforms drawer -->