From d12f1cbb3209fa0505a246c33e787f4061f39610 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 7 Nov 2021 17:05:19 +0100 Subject: [PATCH] refactor: rename webcamTab to webcamsTab in settings menu Signed-off-by: Stefan Dej --- src/components/TheSettingsMenu.vue | 10 ++-- ...gsWebcamTab.vue => SettingsWebcamsTab.vue} | 58 +++++++++---------- src/locales/en.json | 2 +- 3 files changed, 35 insertions(+), 35 deletions(-) rename src/components/settings/{SettingsWebcamTab.vue => SettingsWebcamsTab.vue} (91%) diff --git a/src/components/TheSettingsMenu.vue b/src/components/TheSettingsMenu.vue index 88a32a9c..792e1a0b 100644 --- a/src/components/TheSettingsMenu.vue +++ b/src/components/TheSettingsMenu.vue @@ -52,7 +52,7 @@ import Component from 'vue-class-component' import {Mixins, Watch} from 'vue-property-decorator' import BaseMixin from '@/components/mixins/base' import SettingsGeneralTab from '@/components/settings/SettingsGeneralTab.vue' -import SettingsWebcamTab from '@/components/settings/SettingsWebcamTab.vue' +import SettingsWebcamsTab from '@/components/settings/SettingsWebcamsTab.vue' import SettingsMacrosTab from '@/components/settings/SettingsMacrosTab.vue' import SettingsControlTab from '@/components/settings/SettingsControlTab.vue' import SettingsConsoleTab from '@/components/settings/SettingsConsoleTab.vue' @@ -73,7 +73,7 @@ import Panel from '@/components/ui/Panel.vue' SettingsConsoleTab, SettingsControlTab, SettingsMacrosTab, - SettingsWebcamTab, + SettingsWebcamsTab, SettingsGeneralTab, SettingsDashboardTab, SettingsGCodeViewerTab, @@ -106,9 +106,9 @@ export default class TheSettingsMenu extends Mixins(BaseMixin) { title: this.$t('Settings.DashboardTab.Dashboard') }, { - icon: 'mdi-webcams', - name: 'webcam', - title: this.$t('Settings.WebcamTab.Webcams') + icon: 'mdi-webcam', + name: 'webcams', + title: this.$t('Settings.WebcamsTab.Webcams') }, { icon: 'mdi-code-tags', diff --git a/src/components/settings/SettingsWebcamTab.vue b/src/components/settings/SettingsWebcamsTab.vue similarity index 91% rename from src/components/settings/SettingsWebcamTab.vue rename to src/components/settings/SettingsWebcamsTab.vue index 4856d3b9..a42f2e68 100644 --- a/src/components/settings/SettingsWebcamTab.vue +++ b/src/components/settings/SettingsWebcamsTab.vue @@ -2,7 +2,7 @@
-

{{ $t('Settings.WebcamTab.Webcams') }}

+

{{ $t('Settings.WebcamsTab.Webcams') }}

@@ -16,13 +16,13 @@
- {{ $t("Settings.WebcamTab.AddWebcam")}} + {{ $t("Settings.WebcamsTab.AddWebcam")}}
- {{ form.id === null ? $t("Settings.WebcamTab.CreateWebcam") : $t("Settings.WebcamTab.EditWebcam") }} + {{ form.id === null ? $t("Settings.WebcamsTab.CreateWebcam") : $t("Settings.WebcamsTab.EditWebcam") }} @@ -52,7 +52,7 @@ @@ -73,7 +73,7 @@ @@ -85,7 +85,7 @@ v-model="form.service" :items="serviceItems" hide-details - :label="$t('Settings.WebcamTab.Service')" + :label="$t('Settings.WebcamsTab.Service')" > @@ -94,7 +94,7 @@ @@ -104,7 +104,7 @@ v-model="form.flipX" hide-details class="mt-1" - :label="$t('Settings.WebcamTab.FlipHorizontally')" + :label="$t('Settings.WebcamsTab.FlipHorizontally')" > @@ -114,7 +114,7 @@ v-model="form.flipY" hide-details class="mt-1" - :label="$t('Settings.WebcamTab.FlipVertically')" + :label="$t('Settings.WebcamsTab.FlipVertically')" > @@ -125,7 +125,7 @@ @@ -176,7 +176,7 @@ interface webcamForm { @Component({ components: {SettingsRow} }) -export default class SettingsWebcamTab extends Mixins(BaseMixin) { +export default class SettingsWebcamsTab extends Mixins(BaseMixin) { private form: webcamForm = { bool: false, @@ -193,34 +193,34 @@ export default class SettingsWebcamTab extends Mixins(BaseMixin) { } private rules = { - required: (value: string) => value !== '' || this.$t('Settings.WebcamTab.Required'), - requiredMjpegAdaptive: (value: string) => (value !== '' && this.form.service === 'mjpegstreamer-adaptive') || this.$t('Settings.WebcamTab.Required'), - unique: (value: string) => !this.existsWebcamName(value) || this.$t('Settings.WebcamTab.NameAlreadyExists'), + required: (value: string) => value !== '' || this.$t('Settings.WebcamsTab.Required'), + requiredMjpegAdaptive: (value: string) => (value !== '' && this.form.service === 'mjpegstreamer-adaptive') || this.$t('Settings.WebcamsTab.Required'), + unique: (value: string) => !this.existsWebcamName(value) || this.$t('Settings.WebcamsTab.NameAlreadyExists'), } get webcams() { - return this.$store.getters['gui/webcam/getWebcams'] ?? [] + return this.$store.getters['gui/webcams/getWebcams'] ?? [] } get iconItems() { return [ - { value: 'mdi-printer-3d', text: this.$t('Settings.WebcamTab.IconPrinter') }, - { value: 'mdi-printer-3d-nozzle', text: this.$t('Settings.WebcamTab.IconNozzle') }, - { value: 'mdi-radiator-disabled', text: this.$t('Settings.WebcamTab.IconBed') }, - { value: 'mdi-webcams', text: this.$t('Settings.WebcamTab.IconCam') }, - { value: 'mdi-album', text: this.$t('Settings.WebcamTab.IconFilament') }, - { value: 'mdi-door', text: this.$t('Settings.WebcamTab.IconDoor') }, - { value: 'mdi-raspberry-pi', text: this.$t('Settings.WebcamTab.IconMcu') }, - { value: 'mdi-campfire', text: this.$t('Settings.WebcamTab.IconHot') }, + { value: 'mdi-printer-3d', text: this.$t('Settings.WebcamsTab.IconPrinter') }, + { value: 'mdi-printer-3d-nozzle', text: this.$t('Settings.WebcamsTab.IconNozzle') }, + { value: 'mdi-radiator-disabled', text: this.$t('Settings.WebcamsTab.IconBed') }, + { value: 'mdi-webcams', text: this.$t('Settings.WebcamsTab.IconCam') }, + { value: 'mdi-album', text: this.$t('Settings.WebcamsTab.IconFilament') }, + { value: 'mdi-door', text: this.$t('Settings.WebcamsTab.IconDoor') }, + { value: 'mdi-raspberry-pi', text: this.$t('Settings.WebcamsTab.IconMcu') }, + { value: 'mdi-campfire', text: this.$t('Settings.WebcamsTab.IconHot') }, ] } get serviceItems() { return [ - { value: 'mjpegstreamer', text: this.$t('Settings.WebcamTab.Mjpegstreamer')}, - { value: 'mjpegstreamer-adaptive', text: this.$t('Settings.WebcamTab.MjpegstreamerAdaptive') }, - { value: 'uv4l-mjpeg', text: this.$t('Settings.WebcamTab.Uv4lMjpeg') }, - { value: 'ipstream', text: this.$t('Settings.WebcamTab.Ipstream') }, + { value: 'mjpegstreamer', text: this.$t('Settings.WebcamsTab.Mjpegstreamer')}, + { value: 'mjpegstreamer-adaptive', text: this.$t('Settings.WebcamsTab.MjpegstreamerAdaptive') }, + { value: 'uv4l-mjpeg', text: this.$t('Settings.WebcamsTab.Uv4lMjpeg') }, + { value: 'ipstream', text: this.$t('Settings.WebcamsTab.Ipstream') }, ] } diff --git a/src/locales/en.json b/src/locales/en.json index 1a2d0362..ba2b88d5 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -524,7 +524,7 @@ "FactoryInfo": "Do you really want to reset mainsail to factory settings?", "ResetMainsail": "reset mainsail" }, - "WebcamTab": { + "WebcamsTab": { "Webcams": "Webcams", "AddWebcam": "add webcam", "CreateWebcam": "Create Webcam",