Frontend: Code clean-up in library.vue and settings.vue

This commit is contained in:
Michael Mayer 2020-12-18 14:10:12 +01:00
parent 43714c00d5
commit 29145e77b6
2 changed files with 14 additions and 25 deletions

View file

@ -26,9 +26,9 @@
</template>
<script>
import tabImport from "pages/library/import.vue";
import tabIndex from "pages/library/index.vue";
import tabLogs from "pages/library/logs.vue";
import Import from "pages/library/import.vue";
import Index from "pages/library/index.vue";
import Logs from "pages/library/logs.vue";
function initTabs(flag, tabs) {
let i = 0;
@ -46,11 +46,6 @@ export default {
props: {
tab: String,
},
components: {
'p-tab-index': tabIndex,
'p-tab-import': tabImport,
'p-tab-logs': tabLogs,
},
data() {
const config = this.$config.values;
const isDemo = this.$config.get("demo");
@ -61,7 +56,7 @@ export default {
const tabs = [
{
'name': 'library-index',
'component': tabIndex,
'component': Index,
'label': this.$gettext('Index'),
'class': '',
'path': '/library',
@ -71,7 +66,7 @@ export default {
},
{
'name': 'library-import',
'component': tabImport,
'component': Import,
'label': this.$gettext('Import'),
'class': '',
'path': '/library/import',
@ -81,7 +76,7 @@ export default {
},
{
'name': 'library-logs',
'component': tabLogs,
'component': Logs,
'label': this.$gettext('Logs'),
'class': '',
'path': '/library/logs',

View file

@ -27,10 +27,10 @@
</template>
<script>
import tabGeneral from "pages/settings/general.vue";
import tabLibrary from "pages/settings/library.vue";
import tabSync from "pages/settings/sync.vue";
import tabAccount from "pages/settings/account.vue";
import General from "pages/settings/general.vue";
import Library from "pages/settings/library.vue";
import Sync from "pages/settings/sync.vue";
import Account from "pages/settings/account.vue";
function initTabs(flag, tabs) {
let i = 0;
@ -48,19 +48,13 @@ export default {
props: {
tab: String,
},
components: {
'p-settings-general': tabGeneral,
'p-settings-library': tabLibrary,
'p-settings-sync': tabSync,
'p-settings-account': tabAccount,
},
data() {
const isDemo = this.$config.get("demo");
const isPublic = this.$config.get("public");
const tabs = [
{
'name': 'settings-general',
'component': tabGeneral,
'component': General,
'label': this.$gettext('General'),
'class': '',
'path': '/settings',
@ -70,7 +64,7 @@ export default {
},
{
'name': 'settings-library',
'component': tabLibrary,
'component': Library,
'label': this.$gettext('Library'),
'class': '',
'path': '/settings/library',
@ -80,7 +74,7 @@ export default {
},
{
'name': 'settings-sync',
'component': tabSync,
'component': Sync,
'label': this.$gettext('Sync'),
'class': '',
'path': '/settings/sync',
@ -90,7 +84,7 @@ export default {
},
{
'name': 'settings-account',
'component': tabAccount,
'component': Account,
'label': this.$gettext('Account'),
'class': '',
'path': '/settings/account',