forked from VueTorrent/VueTorrent
/
Navbar.vue
146 lines (136 loc) · 3 KB
/
Navbar.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<template>
<nav>
<!--title-->
<v-app-bar
app
elevate-on-scroll
class="noselect"
>
<v-app-bar-nav-icon
class="grey--text text--lighten-1"
aria-label="Open Navigation Drawer"
@click.stop="drawer = !drawer"
/>
<v-toolbar-title
v-if="!$vuetify.breakpoint.xs"
:class="[
'grey--text',
{ 'subheading ml-0': $vuetify.breakpoint.smAndDown }
]"
>
<span class="font-weight-light">qBit</span>
<span>torrent</span>
</v-toolbar-title>
<v-spacer />
<TopMenu />
</v-app-bar>
<!--navigation drawer itself -->
<v-navigation-drawer
v-model="drawer"
app
class="primary drawer"
style="position: fixed;"
width="256"
height="100%"
disable-resize-watcher
:right="webuiSettings.rightDrawer"
>
<v-card
v-if="status"
style="display: flex; flex-direction: column;"
class="pt-3 primary"
flat
>
<CurrentSpeed
v-if="webuiSettings.showCurrentSpeed"
:status="status"
/>
<SpeedGraph v-if="webuiSettings.showSpeedGraph" />
<SessionStats
v-if="webuiSettings.showSessionStat"
:status="status"
/>
<FreeSpace
v-if="webuiSettings.showFreeSpace"
:space="status.freeDiskSpace"
/>
<FilterSelect :show-tracker-filter="webuiSettings.showTrackerFilter" />
<div
style="font-size: 0.9em"
class="download--text text-uppercase text-center mt-5"
>
{{ torrentCountString }}
</div>
</v-card>
<template #append>
<div class="pa-2">
<BottomActions />
</div>
</template>
</v-navigation-drawer>
</nav>
</template>
<script>
import { mapGetters } from 'vuex'
import {
BottomActions,
TopMenu,
SpeedGraph,
FreeSpace,
SessionStats,
CurrentSpeed,
FilterSelect
} from './index'
export default {
name: 'Navbar',
components: {
FreeSpace,
BottomActions,
TopMenu,
SpeedGraph,
SessionStats,
CurrentSpeed,
FilterSelect
},
data() {
return {
drawer: this.$vuetify.breakpoint.mdAndUp
}
},
computed: {
...mapGetters(['getTheme', 'getWebuiSettings', 'getStatus', 'getTorrentCountString']),
webuiSettings() {
return this.getWebuiSettings()
},
status() {
return this.getStatus()
},
torrentCountString() {
return this.getTorrentCountString()
}
},
created() {
this.$vuetify.theme.dark = this.getTheme()
}
}
</script>
<style lang="scss">
#app > div > nav > nav > div.v-navigation-drawer__content {
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-thumb {
background: #56718c;
border-radius: 20px;
}
}
.v-app-bar > .v-toolbar__content{
padding-right: 0;
}
.navbar {
@media screen and (max-width: 480px) {
.v-toolbar__title { display: none; }
.spacer { display: none; }
}
}
</style>