translation

This commit is contained in:
Hayden 2021-01-17 14:57:09 -09:00
commit 46cd62059a
3 changed files with 24 additions and 27 deletions

View file

@ -1,19 +1,25 @@
<template> <template>
<v-card :loading="loading"> <v-card :loading="loading">
<v-card-title> Create a Backup </v-card-title> <v-card-title> {{ $t("settings.backup.create-heading") }} </v-card-title>
<v-card-text class="mt-n3"> <v-card-text class="mt-n3">
<v-text-field dense label="Backup Tag" v-model="tag"></v-text-field> <v-text-field
dense
:label="$t('settings.backup.backup-tag')"
v-model="tag"
></v-text-field>
</v-card-text> </v-card-text>
<v-card-actions class="mt-n9"> <v-card-actions class="mt-n9">
<v-switch v-model="fullBackup" :label="switchLabel"></v-switch> <v-switch v-model="fullBackup" :label="switchLabel"></v-switch>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn color="success" text @click="createBackup()"> Create </v-btn> <v-btn color="success" text @click="createBackup()">
{{ $t("general.create") }}
</v-btn>
</v-card-actions> </v-card-actions>
<v-card-text v-if="!fullBackup" class="mt-n6"> <v-card-text v-if="!fullBackup" class="mt-n6">
<v-row> <v-row>
<v-col sm="4"> <v-col sm="4">
<p>Options:</p> <p>{{ $t("general.options") }}:</p>
<v-checkbox <v-checkbox
v-for="option in options" v-for="option in options"
:key="option.text" :key="option.text"
@ -24,7 +30,7 @@
></v-checkbox> ></v-checkbox>
</v-col> </v-col>
<v-col> <v-col>
<p>Templates:</p> <p>{{ $t("general.templates") }}:</p>
<v-checkbox <v-checkbox
v-for="template in availableTemplates" v-for="template in availableTemplates"
:key="template" :key="template"
@ -50,15 +56,15 @@ export default {
options: { options: {
recipes: { recipes: {
value: true, value: true,
text: "Recipes", text: this.$t("general.recipes"),
}, },
settings: { settings: {
value: true, value: true,
text: "Settings", text: this.$t("general.settings"),
}, },
themes: { themes: {
value: true, value: true,
text: "Themes", text: this.$t("general.themes"),
}, },
}, },
availableTemplates: [], availableTemplates: [],

View file

@ -16,7 +16,7 @@
</p> </p>
</v-col> </v-col>
</v-row> </v-row>
<v-divider class="mb-3"></v-divider> <v-divider class="my-3"></v-divider>
<AvailableBackupCard <AvailableBackupCard
@loading="backupLoading = true" @loading="backupLoading = true"
@ -50,11 +50,7 @@ export default {
failedImports: [], failedImports: [],
successfulImports: [], successfulImports: [],
backupLoading: false, backupLoading: false,
backupTag: null,
selectedBackup: null,
selectedTemplate: null,
availableBackups: [], availableBackups: [],
availableTemplates: [],
}; };
}, },
mounted() { mounted() {
@ -77,17 +73,6 @@ export default {
this.backupLoading = false; this.backupLoading = false;
} }
}, },
async createBackup() {
this.backupLoading = true;
let response = await api.backups.create(this.backupTag, this.templates);
if (response.status == 201) {
this.selectedBackup = null;
this.getAvailableBackups();
this.backupLoading = false;
}
},
processFinished(successful = null, failed = null) { processFinished(successful = null, failed = null) {
this.getAvailableBackups(); this.getAvailableBackups();
this.backupLoading = false; this.backupLoading = false;

View file

@ -29,7 +29,11 @@
"enabled": "Enabled", "enabled": "Enabled",
"download": "Download", "download": "Download",
"import": "Import", "import": "Import",
"delete-data": "Delete Data" "delete-data": "Delete Data",
"options": "Options",
"templates": "Templates",
"recipes": "Recipes",
"themes": "Themes"
}, },
"login": { "login": {
"stay-logged-in": "Stay logged in?", "stay-logged-in": "Stay logged in?",
@ -113,7 +117,9 @@
"backup": { "backup": {
"import-recipes": "Import Recipes", "import-recipes": "Import Recipes",
"import-themes": "Import Themes", "import-themes": "Import Themes",
"import-settings": "Import Settings" "import-settings": "Import Settings",
"create-heading": "Create a Backup",
"backup-tag": "Backup Tag"
} }
}, },
"migration": { "migration": {