From 19e4eef0b893a0e78580e04bd204fe2afb6af1fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Marseault?=
<22910497+Larsluph@users.noreply.github.com>
Date: Thu, 2 Mar 2023 14:08:32 +0100
Subject: [PATCH] perf: Add switch to hide Shutdown button (#685) @Larsluph
---
package-lock.json | 2 +-
src/components/Navbar/NavbarActions.vue | 7 ++-----
.../Settings/Tabs/VueTorrent/VGeneral.vue | 13 +++++++++++++
src/lang/en.json | 1 +
src/lang/fr.json | 1 +
src/store/index.ts | 1 +
src/types/vuetorrent/WebUISettings.ts | 1 +
tests/unit/__snapshots__/General.spec.ts.snap | 7 +++++++
8 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 211f4c65..9be9d4f0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -6,7 +6,7 @@
"packages": {
"": {
"name": "vuetorrent",
- "version": "1.3.2",
+ "version": "1.4.0",
"dependencies": {
"ajv": "^8.12.0",
"apexcharts": "^3.35.0",
diff --git a/src/components/Navbar/NavbarActions.vue b/src/components/Navbar/NavbarActions.vue
index 5c1222ac..838ca65c 100644
--- a/src/components/Navbar/NavbarActions.vue
+++ b/src/components/Navbar/NavbarActions.vue
@@ -39,7 +39,7 @@
{{ theme }}
-
+
@@ -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')
},
diff --git a/src/components/Settings/Tabs/VueTorrent/VGeneral.vue b/src/components/Settings/Tabs/VueTorrent/VGeneral.vue
index 5229b768..bc3dafb1 100644
--- a/src/components/Settings/Tabs/VueTorrent/VGeneral.vue
+++ b/src/components/Settings/Tabs/VueTorrent/VGeneral.vue
@@ -120,6 +120,19 @@
+
+
+
+
+
+
+
diff --git a/src/lang/en.json b/src/lang/en.json
index 0ea56dc1..e5045f4e 100644
--- a/src/lang/en.json
+++ b/src/lang/en.json
@@ -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",
diff --git a/src/lang/fr.json b/src/lang/fr.json
index 535d77c3..8f196821 100644
--- a/src/lang/fr.json
+++ b/src/lang/fr.json
@@ -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",
diff --git a/src/store/index.ts b/src/store/index.ts
index a1bc7072..7880d454 100644
--- a/src/store/index.ts
+++ b/src/store/index.ts
@@ -101,6 +101,7 @@ export default new Vuex.Store({
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))
}
diff --git a/src/types/vuetorrent/WebUISettings.ts b/src/types/vuetorrent/WebUISettings.ts
index cd9ad5c5..1969d407 100644
--- a/src/types/vuetorrent/WebUISettings.ts
+++ b/src/types/vuetorrent/WebUISettings.ts
@@ -26,6 +26,7 @@ export default interface WebUISettings {
paginationSize: number
dateFormat: string
openSideBarOnStart: boolean
+ showShutdownButton: boolean
busyTorrentProperties: TorrentProperty[]
doneTorrentProperties: TorrentProperty[]
}
diff --git a/tests/unit/__snapshots__/General.spec.ts.snap b/tests/unit/__snapshots__/General.spec.ts.snap
index 451abded..6515c8c1 100644
--- a/tests/unit/__snapshots__/General.spec.ts.snap
+++ b/tests/unit/__snapshots__/General.spec.ts.snap
@@ -66,6 +66,13 @@ exports[`General > render correctly 1`] = `
+
+
+
+
+
+
+