Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change SettingsGeneralTab file #1475

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 52 additions & 64 deletions src/components/settings/SettingsGeneralTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,67 @@
<div>
<v-card flat>
<v-card-text>
<settings-row :title="$t('Settings.GeneralTab.PrinterName').toString()">
<settings-row :title="$t('Settings.GeneralTab.PrinterName')">
<v-text-field v-model="printerName" hide-details outlined dense></v-text-field>
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.GeneralTab.Language').toString()">
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.Language')">
<v-select
v-model="currentLanguage"
:items="availableLanguages"
hide-details
outlined
dense
attach></v-select>
attach />
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.GeneralTab.DateFormat').toString()">
<v-select
v-model="dateFormat"
:items="dateFormatItems"
hide-details
outlined
dense
attach></v-select>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.DateFormat')">
<v-select v-model="dateFormat" :items="dateFormatItems" hide-details outlined dense attach />
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.GeneralTab.TimeFormat').toString()">
<v-select
v-model="timeFormat"
:items="timeFormatItems"
hide-details
outlined
dense
attach></v-select>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.TimeFormat')">
<v-select v-model="timeFormat" :items="timeFormatItems" hide-details outlined dense attach />
</settings-row>
<v-divider class="my-2"></v-divider>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.GeneralTab.CalcPrintProgress').toString()"
:sub-title="$t('Settings.GeneralTab.CalcPrintProgressDescription').toString()">
:title="$t('Settings.GeneralTab.CalcPrintProgress')"
:sub-title="$t('Settings.GeneralTab.CalcPrintProgressDescription')">
<v-select
v-model="calcPrintProgress"
:items="calcPrintProgressItems"
hide-details
dense
outlined
attach></v-select>
attach />
</settings-row>
<v-divider class="my-2"></v-divider>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.GeneralTab.CalcEstimateTime').toString()"
:sub-title="$t('Settings.GeneralTab.CalcEstimateTimeDescription').toString()">
:title="$t('Settings.GeneralTab.CalcEstimateTime')"
:sub-title="$t('Settings.GeneralTab.CalcEstimateTimeDescription')">
<v-select
v-model="calcEstimateTime"
:items="calcEstimateItems"
multiple
hide-details
dense
outlined
attach></v-select>
attach />
</settings-row>
<v-divider class="my-2"></v-divider>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.GeneralTab.CalcEtaTime').toString()"
:sub-title="$t('Settings.GeneralTab.CalcEtaTimeDescription').toString()">
:title="$t('Settings.GeneralTab.CalcEtaTime')"
:sub-title="$t('Settings.GeneralTab.CalcEtaTimeDescription')">
<v-select
v-model="calcEtaTime"
:items="calcEtaTimeItems"
multiple
hide-details
dense
outlined
attach></v-select>
attach />
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.GeneralTab.MoonrakerDb').toString()" :dynamic-slot-width="true">
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.MainsailSettingsMoonrakerDb')" :dynamic-slot-width="true">
<input
ref="uploadBackupFile"
type="file"
Expand All @@ -88,8 +76,8 @@
{{ $t('Settings.GeneralTab.Restore') }}
</v-btn>
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.GeneralTab.FactoryReset').toString()" :dynamic-slot-width="true">
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.FactoryReset')" :dynamic-slot-width="true">
<v-btn color="error" small @click="resetMainsail">
{{ $t('Settings.GeneralTab.FactoryReset') }}
</v-btn>
Expand All @@ -98,7 +86,7 @@
</v-card>
<v-dialog v-model="dialogBackupMainsail" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.Backup').toString()"
:title="$t('Settings.GeneralTab.Backup')"
card-class="mainsail-backup-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
Expand All @@ -121,14 +109,14 @@
:label="db.label"
hide-details
class="mt-0"
@change="changeNamespace(db.name)"></v-checkbox>
@change="changeNamespace(db.name)" />
</template>
<v-checkbox
v-if="availableNamespaces.includes('timelapse')"
:label="$t('Settings.GeneralTab.DbTimelapseSettings')"
hide-details
class="mt-0"
@change="changeNamespace('timelapse')"></v-checkbox>
@change="changeNamespace('timelapse')" />
</v-col>
</v-row>
<v-row>
Expand All @@ -143,7 +131,7 @@
</v-dialog>
<v-dialog v-model="dialogResetMainsail" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.FactoryReset').toString()"
:title="$t('Settings.GeneralTab.FactoryReset')"
card-class="factory-reset-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
Expand All @@ -166,26 +154,26 @@
:label="db.label"
hide-details
class="mt-0"
@change="changeNamespace(db.name)"></v-checkbox>
@change="changeNamespace(db.name)" />
</template>
<v-checkbox
v-if="availableNamespaces.includes('timelapse')"
:label="$t('Settings.GeneralTab.DbTimelapseSettings')"
hide-details
class="mt-0"
@change="changeNamespace('timelapse')"></v-checkbox>
@change="changeNamespace('timelapse')" />
<v-checkbox
v-if="moonrakerComponents.includes('history')"
:label="$t('Settings.GeneralTab.DbHistoryJobs')"
hide-details
class="mt-0"
@change="changeNamespace('history_jobs')"></v-checkbox>
@change="changeNamespace('history_jobs')" />
<v-checkbox
v-if="moonrakerComponents.includes('history')"
:label="$t('Settings.GeneralTab.DbHistoryTotals')"
hide-details
class="mt-0"
@change="changeNamespace('history_totals')"></v-checkbox>
@change="changeNamespace('history_totals')" />
</v-col>
</v-row>
<v-row>
Expand All @@ -203,7 +191,7 @@
</v-dialog>
<v-dialog v-model="dialogRestoreMainsail" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.Restore').toString()"
:title="$t('Settings.GeneralTab.Restore')"
card-class="factory-reset-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
Expand All @@ -226,7 +214,7 @@
:label="db.label"
hide-details
class="mt-0"
@change="changeNamespace(db.name)"></v-checkbox>
@change="changeNamespace(db.name)" />
</template>
</v-col>
</v-row>
Expand Down Expand Up @@ -279,59 +267,59 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
return [
{
name: 'general',
label: this.$t('Settings.GeneralTab.General').toString(),
label: this.$t('Settings.GeneralTab.General'),
},
{
name: 'console',
label: this.$t('Settings.ConsoleTab.Console').toString(),
label: this.$t('Settings.ConsoleTab.Console'),
},
{
name: 'control',
label: this.$t('Settings.ControlTab.Control').toString(),
label: this.$t('Settings.ControlTab.Control'),
},
{
name: 'dashboard',
label: this.$t('Settings.DashboardTab.Dashboard').toString(),
label: this.$t('Settings.DashboardTab.Dashboard'),
},
{
name: 'editor',
label: this.$t('Settings.EditorTab.Editor').toString(),
label: this.$t('Settings.EditorTab.Editor'),
},
{
name: 'gcodeViewer',
label: this.$t('Settings.GCodeViewerTab.GCodeViewer').toString(),
label: this.$t('Settings.GCodeViewerTab.GCodeViewer'),
},
{
name: 'gcodehistory',
label: this.$t('Settings.GeneralTab.DbConsoleHistory').toString(),
label: this.$t('Settings.GeneralTab.DbConsoleHistory'),
},
{
name: 'macros',
label: this.$t('Settings.MacrosTab.Macros').toString(),
label: this.$t('Settings.MacrosTab.Macros'),
},
{
name: 'notifications',
label: this.$t('App.Notifications.Notifications').toString(),
label: this.$t('App.Notifications.Notifications'),
},
{
name: 'presets',
label: this.$t('Settings.PresetsTab.PreheatPresets').toString(),
label: this.$t('Settings.PresetsTab.PreheatPresets'),
},
{
name: 'remoteprinters',
label: this.$t('Settings.RemotePrintersTab.RemotePrinters').toString(),
label: this.$t('Settings.RemotePrintersTab.RemotePrinters'),
},
{
name: 'timelapse',
label: this.$t('Settings.TimelapseTab.Timelapse').toString(),
label: this.$t('Settings.TimelapseTab.Timelapse'),
},
{
name: 'uiSettings',
label: this.$t('Settings.UiSettingsTab.UiSettings').toString(),
label: this.$t('Settings.UiSettingsTab.UiSettings'),
},
{
name: 'view',
label: this.$t('Settings.GeneralTab.DbView').toString(),
label: this.$t('Settings.GeneralTab.DbView'),
},
]
}
Expand Down Expand Up @@ -413,13 +401,13 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
value: '24hours',
text: this.$t('Settings.GeneralTab.24hours', {
time: date.toLocaleTimeString(userLocale, { hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }),
}).toString(),
}),
},
{
value: '12hours',
text: this.$t('Settings.GeneralTab.12hours', {
time: date.toLocaleTimeString(userLocale, { hour: '2-digit', minute: '2-digit', hourCycle: 'h12' }),
}).toString(),
}),
},
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@
"FactoryReset": "Werkseinstellungen",
"General": "Allgemein",
"Language": "Sprache",
"MoonrakerDb": "Moonraker Datenbank",
"MainsailSettingsMoonrakerDb": "Mainsail Einstellungen in Moonraker DB",
"PrinterName": "Druckername",
"Reset": "zurücksetzen",
"Restore": "Wiederherstellung",
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@
"FactoryReset": "Factory reset",
"General": "General",
"Language": "Language",
"MoonrakerDb": "Moonraker DB",
"MainsailSettingsMoonrakerDb": "Mainsail Settings in Moonraker DB",
"PrinterName": "Printer Name",
"Reset": "reset",
"Restore": "Restore",
Expand Down
Loading