perf: Add switch to hide Shutdown button (#685) @Larsluph

This commit is contained in:
Rémi Marseault 2023-03-02 14:08:32 +01:00 committed by GitHub
parent 3706fafc5d
commit 19e4eef0b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 27 additions and 6 deletions

2
package-lock.json generated
View file

@ -6,7 +6,7 @@
"packages": {
"": {
"name": "vuetorrent",
"version": "1.3.2",
"version": "1.4.0",
"dependencies": {
"ajv": "^8.12.0",
"apexcharts": "^3.35.0",

View file

@ -39,7 +39,7 @@
<span>{{ theme }}</span>
</v-tooltip>
</v-col>
<v-col>
<v-col v-if="webuiSettings.showShutdownButton">
<v-tooltip top>
<template #activator="{ on }">
<v-btn text tile block v-on="on" @click="createModal('ConfirmShutdownModal')">
@ -80,10 +80,7 @@ export default {
}),
computed: {
...mapState(['webuiSettings']),
...mapGetters(['isDarkMode', 'getWebuiSettings', 'getStatus']),
webuiSettings() {
return this.getWebuiSettings()
},
...mapGetters(['isDarkMode', 'getStatus']),
theme() {
return this.isDarkMode() ? this.$t('navbar.action.dark') : this.$t('navbar.action.light')
},

View file

@ -120,6 +120,19 @@
</v-col>
</v-row>
</v-list-item>
<v-list-item>
<v-row dense>
<v-col>
<v-switch
v-model="webuiSettings.showShutdownButton"
class="v-input--reverse pa-0 ma-0"
hide-details
inset
:label="$t('modals.settings.pageVueTorrent.pageGeneral.showShutdownButton')"
/>
</v-col>
</v-row>
</v-list-item>
<v-list-item>
<v-row dense>
<v-col cols="8" sm="8" md="10">

View file

@ -189,6 +189,7 @@
"vueTorrentTitle": "VueTorrent title:",
"dateFormat": "Date Format",
"openSideBarOnStart": "Open Side Bar on launch",
"showShutdownButton": "Show shutdown button",
"currentVersion": "Current Version:",
"qbittorrentVersion": "QBittorrent Version:",
"importSettings": "Import Settings",

View file

@ -185,6 +185,7 @@
"vueTorrentTitle": "Titre de la page:",
"dateFormat": "Format de date",
"openSideBarOnStart": "Ouvrir la barre latérale au lancement",
"showShutdownButton": "Afficher le bouton d'arrêt",
"currentVersion": "Version actuelle:",
"qbittorrentVersion": "Version de QBittorrent:",
"importSettings": "Importer la configuration",

View file

@ -101,6 +101,7 @@ export default new Vuex.Store<StoreState>({
paginationSize: 15,
dateFormat: 'DD/MM/YYYY, HH:mm:ss',
openSideBarOnStart: true,
showShutdownButton: true,
busyTorrentProperties: JSON.parse(JSON.stringify(propertiesTemplate)),
doneTorrentProperties: JSON.parse(JSON.stringify(propertiesTemplate))
}

View file

@ -26,6 +26,7 @@ export default interface WebUISettings {
paginationSize: number
dateFormat: string
openSideBarOnStart: boolean
showShutdownButton: boolean
busyTorrentProperties: TorrentProperty[]
doneTorrentProperties: TorrentProperty[]
}

View file

@ -66,6 +66,13 @@ exports[`General > render correctly 1`] = `
</v-col-stub>
</v-row-stub>
</v-list-item-stub>
<v-list-item-stub data-v-7da6d3e2=\\"\\" activeclass=\\"\\" tag=\\"div\\">
<v-row-stub data-v-7da6d3e2=\\"\\" tag=\\"div\\" dense=\\"true\\">
<v-col-stub data-v-7da6d3e2=\\"\\" tag=\\"div\\">
<v-switch-stub data-v-7da6d3e2=\\"\\" errorcount=\\"1\\" errormessages=\\"\\" messages=\\"\\" rules=\\"\\" successmessages=\\"\\" backgroundcolor=\\"\\" hidedetails=\\"true\\" ripple=\\"true\\" valuecomparator=\\"[Function]\\" inset=\\"true\\" class=\\"v-input--reverse pa-0 ma-0\\"></v-switch-stub>
</v-col-stub>
</v-row-stub>
</v-list-item-stub>
<v-list-item-stub data-v-7da6d3e2=\\"\\" activeclass=\\"\\" tag=\\"div\\">
<v-row-stub data-v-7da6d3e2=\\"\\" tag=\\"div\\" dense=\\"true\\">
<v-col-stub data-v-7da6d3e2=\\"\\" cols=\\"8\\" sm=\\"8\\" md=\\"10\\" tag=\\"div\\">