Skip to content

Commit

Permalink
Enable transition at view changing
Browse files Browse the repository at this point in the history
SysInfo: Add data updating
  • Loading branch information
SanyaPilot committed Jun 21, 2022
1 parent 08d1fab commit 0e6387b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 16 deletions.
37 changes: 21 additions & 16 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@
</v-navigation-drawer>

<v-main>
<v-container fluid>
<keep-alive>
<router-view></router-view>
</keep-alive>
</v-container>
<v-scroll-x-reverse-transition>
<v-container fluid v-show="mainViewShown">
<keep-alive>
<router-view></router-view>
</keep-alive>
</v-container>
</v-scroll-x-reverse-transition>
</v-main>
</v-app>
</template>
Expand Down Expand Up @@ -85,22 +87,24 @@ export default {
null,
'System logs'
],
titleShown: false
titleShown: false,
mainViewShown: false
}),
methods: {
changeMainView(view) {
this.titleShown = false
console.log(this.titleShown)
this.$router.push(view)
let context = this
//setTimeout(function() {
//
//}, 1000)
this.mainViewShown = false
setTimeout(function() {
this.mainViewShown = true
this.$router.push(view)
console.log(view)
}.bind(this), 400)
setTimeout(function() {
context.drawer.selectedItem = context.drawer.tempSelectedItem
context.titleShown = true
}, 400)
console.log(this.titleShown)
this.drawer.selectedItem = this.drawer.tempSelectedItem
this.titleShown = true
}.bind(this), 400)
},
getSelectedItem() {
this.drawer.selectedItem = this.drawer.items.findIndex(e => e.view == this.$route.name)
Expand All @@ -123,6 +127,7 @@ export default {
console.log(this.$vuetify.breakpoint)
console.log(this.$vuetify)
this.titleShown = true
this.mainViewShown = true
}
};
</script>
16 changes: 16 additions & 0 deletions src/components/SysInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<v-card
:hover="!$vuetify.breakpoint.mobile"
:outlined="$vuetify.breakpoint.mobile"
class="d-flex flex-wrap"
style="height: 100%;"
>
<v-card-title class="title-img">
{{card.label}}
Expand Down Expand Up @@ -41,6 +43,8 @@ import { getInterfaceAddressesData, getActiveInterface, getHostname } from '../A
import getTimeData from '../API/time.js'
import getPythonData from '../API/python.js'
let updateTimer
export default {
name: 'SysInfo',
Expand Down Expand Up @@ -144,12 +148,24 @@ export default {
await this.updateTimeData()
await this.updatePythonData()
},
async activated() {
updateTimer = setInterval(async function() {
await this.updateHardwareData()
await this.updateNetworkData()
await this.updateTimeData()
}.bind(this), 3000)
},
deactivated() {
clearInterval(updateTimer)
},
};
</script>

<style>
.title-img {
justify-content: space-between;
width: 100%;
height: fit-content;
}
.data-table {
border-spacing: 0px;
Expand Down

0 comments on commit 0e6387b

Please sign in to comment.