mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-02-18 00:02:02 +03:00
Feat: Show connection status at the bottom of Navbar (#255)
This commit is contained in:
parent
7230db60a2
commit
204d74c4e8
2 changed files with 64 additions and 4 deletions
40
src/components/Navbar/ConnectionStatus.vue
Normal file
40
src/components/Navbar/ConnectionStatus.vue
Normal file
|
@ -0,0 +1,40 @@
|
|||
<template>
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on }">
|
||||
<div class="d-flex justify-center fill-height">
|
||||
<v-icon class="white--text" v-on="on">
|
||||
{{ currentIcon }}
|
||||
</v-icon>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<span>{{ status || 'unknown' }}</span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mdiCheckNetwork,
|
||||
mdiNetworkOff,
|
||||
mdiCloseNetwork,
|
||||
mdiHelpNetwork
|
||||
} from '@mdi/js'
|
||||
|
||||
export default {
|
||||
props: ['status'],
|
||||
computed: {
|
||||
currentIcon() {
|
||||
const icons = {
|
||||
connected: mdiCheckNetwork,
|
||||
disconnected: mdiNetworkOff,
|
||||
firewalled: mdiCloseNetwork
|
||||
}
|
||||
const icon = icons?.[this.status]
|
||||
|
||||
if (!this.status || !icon) return mdiHelpNetwork
|
||||
|
||||
return icon
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -54,6 +54,9 @@
|
|||
<span>done notification</span>
|
||||
</v-tooltip>
|
||||
</v-col>-->
|
||||
<v-col>
|
||||
<connection-status :status="connectionStatus" />
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on }">
|
||||
|
@ -78,10 +81,22 @@
|
|||
<script>
|
||||
import qbit from '@/services/qbit'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { mdiBrightness4, mdiSpeedometerSlow, mdiBrightness7, mdiSpeedometer, mdiExitToApp, mdiBell, mdiBellOff } from '@mdi/js'
|
||||
import {
|
||||
mdiBrightness4,
|
||||
mdiSpeedometerSlow,
|
||||
mdiBrightness7,
|
||||
mdiSpeedometer,
|
||||
mdiExitToApp,
|
||||
mdiBell,
|
||||
mdiBellOff
|
||||
} from '@mdi/js'
|
||||
import ConnectionStatus from './ConnectionStatus.vue'
|
||||
|
||||
export default {
|
||||
name: 'BottomActions',
|
||||
components: {
|
||||
ConnectionStatus
|
||||
},
|
||||
data: () => ({
|
||||
//commonStyle: 'primarytext--text',
|
||||
commonStyle: 'white--text',
|
||||
|
@ -104,11 +119,16 @@ export default {
|
|||
alarm() {
|
||||
return this.getAlarm()
|
||||
},
|
||||
status() {
|
||||
return this.getStatus()
|
||||
},
|
||||
altSpeed() {
|
||||
const status = this.getStatus()
|
||||
if (status && status.altSpeed) return status.altSpeed
|
||||
if (this.status && this.status.altSpeed) return this.status.altSpeed
|
||||
|
||||
return null
|
||||
},
|
||||
connectionStatus() {
|
||||
return this.status.status
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -130,4 +150,4 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
|
Loading…
Add table
Reference in a new issue