refactor: rename webcamTab to webcamsTab in settings menu
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
parent
877c7ee861
commit
d12f1cbb32
@ -52,7 +52,7 @@ import Component from 'vue-class-component'
|
|||||||
import {Mixins, Watch} from 'vue-property-decorator'
|
import {Mixins, Watch} from 'vue-property-decorator'
|
||||||
import BaseMixin from '@/components/mixins/base'
|
import BaseMixin from '@/components/mixins/base'
|
||||||
import SettingsGeneralTab from '@/components/settings/SettingsGeneralTab.vue'
|
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 SettingsMacrosTab from '@/components/settings/SettingsMacrosTab.vue'
|
||||||
import SettingsControlTab from '@/components/settings/SettingsControlTab.vue'
|
import SettingsControlTab from '@/components/settings/SettingsControlTab.vue'
|
||||||
import SettingsConsoleTab from '@/components/settings/SettingsConsoleTab.vue'
|
import SettingsConsoleTab from '@/components/settings/SettingsConsoleTab.vue'
|
||||||
@ -73,7 +73,7 @@ import Panel from '@/components/ui/Panel.vue'
|
|||||||
SettingsConsoleTab,
|
SettingsConsoleTab,
|
||||||
SettingsControlTab,
|
SettingsControlTab,
|
||||||
SettingsMacrosTab,
|
SettingsMacrosTab,
|
||||||
SettingsWebcamTab,
|
SettingsWebcamsTab,
|
||||||
SettingsGeneralTab,
|
SettingsGeneralTab,
|
||||||
SettingsDashboardTab,
|
SettingsDashboardTab,
|
||||||
SettingsGCodeViewerTab,
|
SettingsGCodeViewerTab,
|
||||||
@ -106,9 +106,9 @@ export default class TheSettingsMenu extends Mixins(BaseMixin) {
|
|||||||
title: this.$t('Settings.DashboardTab.Dashboard')
|
title: this.$t('Settings.DashboardTab.Dashboard')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'mdi-webcams',
|
icon: 'mdi-webcam',
|
||||||
name: 'webcam',
|
name: 'webcams',
|
||||||
title: this.$t('Settings.WebcamTab.Webcams')
|
title: this.$t('Settings.WebcamsTab.Webcams')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'mdi-code-tags',
|
icon: 'mdi-code-tags',
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<v-card flat v-if="!form.bool">
|
<v-card flat v-if="!form.bool">
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<h3 class="text-h5 mb-3">{{ $t('Settings.WebcamTab.Webcams') }}</h3>
|
<h3 class="text-h5 mb-3">{{ $t('Settings.WebcamsTab.Webcams') }}</h3>
|
||||||
<div v-for="(webcam) in webcams" v-bind:key="webcam.id">
|
<div v-for="(webcam) in webcams" v-bind:key="webcam.id">
|
||||||
<v-divider class="my-2"></v-divider>
|
<v-divider class="my-2"></v-divider>
|
||||||
<settings-row :title="webcam.name" :icon="webcam.icon" :sub-title="getSubtitle(webcam)">
|
<settings-row :title="webcam.name" :icon="webcam.icon" :sub-title="getSubtitle(webcam)">
|
||||||
@ -16,13 +16,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions class="d-flex justify-end">
|
<v-card-actions class="d-flex justify-end">
|
||||||
<v-btn text color="primary" @click="createWebcam">{{ $t("Settings.WebcamTab.AddWebcam")}}</v-btn>
|
<v-btn text color="primary" @click="createWebcam">{{ $t("Settings.WebcamsTab.AddWebcam")}}</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
<v-card flat v-else>
|
<v-card flat v-else>
|
||||||
<v-form v-model="form.valid" @submit.prevent="saveWebcam">
|
<v-form v-model="form.valid" @submit.prevent="saveWebcam">
|
||||||
<v-card-title>
|
<v-card-title>
|
||||||
{{ form.id === null ? $t("Settings.WebcamTab.CreateWebcam") : $t("Settings.WebcamTab.EditWebcam") }}
|
{{ form.id === null ? $t("Settings.WebcamsTab.CreateWebcam") : $t("Settings.WebcamsTab.EditWebcam") }}
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-row>
|
<v-row>
|
||||||
@ -52,7 +52,7 @@
|
|||||||
<v-col class="col-10">
|
<v-col class="col-10">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="form.name"
|
v-model="form.name"
|
||||||
:label="$t('Settings.WebcamTab.Name')"
|
:label="$t('Settings.WebcamsTab.Name')"
|
||||||
hide-details="auto"
|
hide-details="auto"
|
||||||
:rules="[rules.required, rules.unique]"
|
:rules="[rules.required, rules.unique]"
|
||||||
dense
|
dense
|
||||||
@ -63,7 +63,7 @@
|
|||||||
<v-col class="py-1">
|
<v-col class="py-1">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="form.urlStream"
|
v-model="form.urlStream"
|
||||||
:label="$t('Settings.WebcamTab.UrlStream')"
|
:label="$t('Settings.WebcamsTab.UrlStream')"
|
||||||
hide-details="auto"
|
hide-details="auto"
|
||||||
:rules="[rules.required]"
|
:rules="[rules.required]"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
@ -73,7 +73,7 @@
|
|||||||
<v-col class="py-1">
|
<v-col class="py-1">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="form.urlSnapshot"
|
v-model="form.urlSnapshot"
|
||||||
:label="$t('Settings.WebcamTab.UrlSnapshot')"
|
:label="$t('Settings.WebcamsTab.UrlSnapshot')"
|
||||||
hide-details="auto"
|
hide-details="auto"
|
||||||
:rules="[rules.requiredMjpegAdaptive]"
|
:rules="[rules.requiredMjpegAdaptive]"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
@ -85,7 +85,7 @@
|
|||||||
v-model="form.service"
|
v-model="form.service"
|
||||||
:items="serviceItems"
|
:items="serviceItems"
|
||||||
hide-details
|
hide-details
|
||||||
:label="$t('Settings.WebcamTab.Service')"
|
:label="$t('Settings.WebcamsTab.Service')"
|
||||||
></v-select>
|
></v-select>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@ -94,7 +94,7 @@
|
|||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="form.targetFps"
|
v-model="form.targetFps"
|
||||||
hide-details
|
hide-details
|
||||||
:label="$t('Settings.WebcamTab.TargetFPS')"
|
:label="$t('Settings.WebcamsTab.TargetFPS')"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@ -104,7 +104,7 @@
|
|||||||
v-model="form.flipX"
|
v-model="form.flipX"
|
||||||
hide-details
|
hide-details
|
||||||
class="mt-1"
|
class="mt-1"
|
||||||
:label="$t('Settings.WebcamTab.FlipHorizontally')"
|
:label="$t('Settings.WebcamsTab.FlipHorizontally')"
|
||||||
></v-checkbox>
|
></v-checkbox>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@ -114,7 +114,7 @@
|
|||||||
v-model="form.flipY"
|
v-model="form.flipY"
|
||||||
hide-details
|
hide-details
|
||||||
class="mt-1"
|
class="mt-1"
|
||||||
:label="$t('Settings.WebcamTab.FlipVertically')"
|
:label="$t('Settings.WebcamsTab.FlipVertically')"
|
||||||
></v-checkbox>
|
></v-checkbox>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@ -125,7 +125,7 @@
|
|||||||
<v-progress-circular slot="preloader" indeterminate color="primary"></v-progress-circular>
|
<v-progress-circular slot="preloader" indeterminate color="primary"></v-progress-circular>
|
||||||
<template slot="error">
|
<template slot="error">
|
||||||
<v-icon x-large>mdi-webcam-off</v-icon>
|
<v-icon x-large>mdi-webcam-off</v-icon>
|
||||||
<div class="subtitle-1 mt-2">{{ $t('Settings.WebcamTab.UrlNotAvailable') }}</div>
|
<div class="subtitle-1 mt-2">{{ $t('Settings.WebcamsTab.UrlNotAvailable') }}</div>
|
||||||
</template>
|
</template>
|
||||||
</vue-load-image>
|
</vue-load-image>
|
||||||
<video v-if="['ipstream'].includes(form.service)" :src="form.urlStream" autoplay :style="webcamStyle" />
|
<video v-if="['ipstream'].includes(form.service)" :src="form.urlStream" autoplay :style="webcamStyle" />
|
||||||
@ -144,7 +144,7 @@
|
|||||||
text
|
text
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
{{ form.id === null ? $t("Settings.WebcamTab.SaveWebcam") : $t("Settings.WebcamTab.UpdateWebcam") }}
|
{{ form.id === null ? $t("Settings.WebcamsTab.SaveWebcam") : $t("Settings.WebcamsTab.UpdateWebcam") }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-form>
|
</v-form>
|
||||||
@ -176,7 +176,7 @@ interface webcamForm {
|
|||||||
@Component({
|
@Component({
|
||||||
components: {SettingsRow}
|
components: {SettingsRow}
|
||||||
})
|
})
|
||||||
export default class SettingsWebcamTab extends Mixins(BaseMixin) {
|
export default class SettingsWebcamsTab extends Mixins(BaseMixin) {
|
||||||
|
|
||||||
private form: webcamForm = {
|
private form: webcamForm = {
|
||||||
bool: false,
|
bool: false,
|
||||||
@ -193,34 +193,34 @@ export default class SettingsWebcamTab extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private rules = {
|
private rules = {
|
||||||
required: (value: string) => value !== '' || this.$t('Settings.WebcamTab.Required'),
|
required: (value: string) => value !== '' || this.$t('Settings.WebcamsTab.Required'),
|
||||||
requiredMjpegAdaptive: (value: string) => (value !== '' && this.form.service === 'mjpegstreamer-adaptive') || this.$t('Settings.WebcamTab.Required'),
|
requiredMjpegAdaptive: (value: string) => (value !== '' && this.form.service === 'mjpegstreamer-adaptive') || this.$t('Settings.WebcamsTab.Required'),
|
||||||
unique: (value: string) => !this.existsWebcamName(value) || this.$t('Settings.WebcamTab.NameAlreadyExists'),
|
unique: (value: string) => !this.existsWebcamName(value) || this.$t('Settings.WebcamsTab.NameAlreadyExists'),
|
||||||
}
|
}
|
||||||
|
|
||||||
get webcams() {
|
get webcams() {
|
||||||
return this.$store.getters['gui/webcam/getWebcams'] ?? []
|
return this.$store.getters['gui/webcams/getWebcams'] ?? []
|
||||||
}
|
}
|
||||||
|
|
||||||
get iconItems() {
|
get iconItems() {
|
||||||
return [
|
return [
|
||||||
{ value: 'mdi-printer-3d', text: this.$t('Settings.WebcamTab.IconPrinter') },
|
{ value: 'mdi-printer-3d', text: this.$t('Settings.WebcamsTab.IconPrinter') },
|
||||||
{ value: 'mdi-printer-3d-nozzle', text: this.$t('Settings.WebcamTab.IconNozzle') },
|
{ value: 'mdi-printer-3d-nozzle', text: this.$t('Settings.WebcamsTab.IconNozzle') },
|
||||||
{ value: 'mdi-radiator-disabled', text: this.$t('Settings.WebcamTab.IconBed') },
|
{ value: 'mdi-radiator-disabled', text: this.$t('Settings.WebcamsTab.IconBed') },
|
||||||
{ value: 'mdi-webcams', text: this.$t('Settings.WebcamTab.IconCam') },
|
{ value: 'mdi-webcams', text: this.$t('Settings.WebcamsTab.IconCam') },
|
||||||
{ value: 'mdi-album', text: this.$t('Settings.WebcamTab.IconFilament') },
|
{ value: 'mdi-album', text: this.$t('Settings.WebcamsTab.IconFilament') },
|
||||||
{ value: 'mdi-door', text: this.$t('Settings.WebcamTab.IconDoor') },
|
{ value: 'mdi-door', text: this.$t('Settings.WebcamsTab.IconDoor') },
|
||||||
{ value: 'mdi-raspberry-pi', text: this.$t('Settings.WebcamTab.IconMcu') },
|
{ value: 'mdi-raspberry-pi', text: this.$t('Settings.WebcamsTab.IconMcu') },
|
||||||
{ value: 'mdi-campfire', text: this.$t('Settings.WebcamTab.IconHot') },
|
{ value: 'mdi-campfire', text: this.$t('Settings.WebcamsTab.IconHot') },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
get serviceItems() {
|
get serviceItems() {
|
||||||
return [
|
return [
|
||||||
{ value: 'mjpegstreamer', text: this.$t('Settings.WebcamTab.Mjpegstreamer')},
|
{ value: 'mjpegstreamer', text: this.$t('Settings.WebcamsTab.Mjpegstreamer')},
|
||||||
{ value: 'mjpegstreamer-adaptive', text: this.$t('Settings.WebcamTab.MjpegstreamerAdaptive') },
|
{ value: 'mjpegstreamer-adaptive', text: this.$t('Settings.WebcamsTab.MjpegstreamerAdaptive') },
|
||||||
{ value: 'uv4l-mjpeg', text: this.$t('Settings.WebcamTab.Uv4lMjpeg') },
|
{ value: 'uv4l-mjpeg', text: this.$t('Settings.WebcamsTab.Uv4lMjpeg') },
|
||||||
{ value: 'ipstream', text: this.$t('Settings.WebcamTab.Ipstream') },
|
{ value: 'ipstream', text: this.$t('Settings.WebcamsTab.Ipstream') },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -524,7 +524,7 @@
|
|||||||
"FactoryInfo": "Do you really want to reset mainsail to factory settings?",
|
"FactoryInfo": "Do you really want to reset mainsail to factory settings?",
|
||||||
"ResetMainsail": "reset mainsail"
|
"ResetMainsail": "reset mainsail"
|
||||||
},
|
},
|
||||||
"WebcamTab": {
|
"WebcamsTab": {
|
||||||
"Webcams": "Webcams",
|
"Webcams": "Webcams",
|
||||||
"AddWebcam": "add webcam",
|
"AddWebcam": "add webcam",
|
||||||
"CreateWebcam": "Create Webcam",
|
"CreateWebcam": "Create Webcam",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user