Settings: Rename "Server" tab to "Advanced"

This commit is contained in:
Michael Mayer 2020-12-18 23:15:57 +01:00
parent 0b52e536e2
commit db98dfdc64
4 changed files with 34 additions and 29 deletions

View file

@ -1,6 +1,6 @@
<template> <template>
<div class="p-tab p-tab-import"> <div class="p-tab p-tab-import">
<v-form ref="form" class="p-photo-import" lazy-validation @submit.prevent="submit" dense> <v-form ref="form" class="p-photo-import" lazy-validation dense @submit.prevent="submit">
<v-container fluid> <v-container fluid>
<p class="subheading"> <p class="subheading">
<span v-if="fileName"><translate :translate-params="{name: fileName}">Importing %{name}</translate></span> <span v-if="fileName"><translate :translate-params="{name: fileName}">Importing %{name}</translate></span>
@ -10,18 +10,18 @@
</p> </p>
<v-autocomplete <v-autocomplete
@change="onChange" v-model="settings.import.path"
@focus="onFocus"
color="secondary-dark" color="secondary-dark"
class="my-3 input-import-folder" class="my-3 input-import-folder"
hide-details hide-no-data flat solo hide-details
v-model="settings.import.path" hide-no-data flat solo browser-autocomplete="off"
browser-autocomplete="off"
:items="dirs" :items="dirs"
:loading="loading" :loading="loading"
:disabled="busy" :disabled="busy"
item-text="name" item-text="name"
item-value="path" item-value="path"
@change="onChange"
@focus="onFocus"
> >
</v-autocomplete> </v-autocomplete>
@ -33,15 +33,15 @@
<v-layout wrap align-top class="pb-2"> <v-layout wrap align-top class="pb-2">
<v-flex xs12 class="px-2 pb-2 pt-2"> <v-flex xs12 class="px-2 pb-2 pt-2">
<v-checkbox <v-checkbox
@change="onChange" v-model="settings.import.move"
:disabled="busy" :disabled="busy"
class="ma-0 pa-0" class="ma-0 pa-0"
v-model="settings.import.move"
color="secondary-dark" color="secondary-dark"
:label="$gettext('Move Files')" :label="$gettext('Move Files')"
:hint="$gettext('Remove imported files to save storage. Unsupported file types will never be deleted, they remain in their current location.')" :hint="$gettext('Remove imported files to save storage. Unsupported file types will never be deleted, they remain in their current location.')"
prepend-icon="delete" prepend-icon="delete"
persistent-hint persistent-hint
@change="onChange"
> >
</v-checkbox> </v-checkbox>
</v-flex> </v-flex>
@ -84,7 +84,7 @@
@click.stop="startImport()" @click.stop="startImport()"
> >
<translate>Import</translate> <translate>Import</translate>
<v-icon right dark>create_new_folder</v-icon> <v-icon right dark>sync</v-icon>
</v-btn> </v-btn>
</v-container> </v-container>
</v-form> </v-form>
@ -101,9 +101,9 @@ import Util from "common/util";
import {Folder, RootImport} from "model/folder"; import {Folder, RootImport} from "model/folder";
export default { export default {
name: 'p-tab-import', name: 'PTabImport',
data() { data() {
const root = {"path": "/", "name": this.$gettext("All files from import folder")} const root = {"path": "/", "name": this.$gettext("All files from import folder")};
const settings = new Settings(this.$config.settings()); const settings = new Settings(this.$config.settings());
return { return {
@ -117,7 +117,13 @@ export default {
source: null, source: null,
root: root, root: root,
dirs: [root, {path: settings.import.path, name: "/" + Util.truncate(settings.import.path, 100, "…")}], dirs: [root, {path: settings.import.path, name: "/" + Util.truncate(settings.import.path, 100, "…")}],
} };
},
created() {
this.subscriptionId = Event.subscribe('import', this.handleEvent);
},
destroyed() {
Event.unsubscribe(this.subscriptionId);
}, },
methods: { methods: {
onChange() { onChange() {
@ -179,7 +185,7 @@ export default {
if (Axios.isCancel(e)) { if (Axios.isCancel(e)) {
// run in background // run in background
return return;
} }
Notify.error(this.$gettext("Import failed")); Notify.error(this.$gettext("Import failed"));
@ -210,15 +216,9 @@ export default {
this.fileName = ''; this.fileName = '';
break; break;
default: default:
console.log(data) console.log(data);
} }
}, },
}, },
created() {
this.subscriptionId = Event.subscribe('import', this.handleEvent);
},
destroyed() {
Event.unsubscribe(this.subscriptionId);
},
}; };
</script> </script>

View file

@ -31,7 +31,7 @@ import General from "pages/settings/general.vue";
import Library from "pages/settings/library.vue"; import Library from "pages/settings/library.vue";
import Sync from "pages/settings/sync.vue"; import Sync from "pages/settings/sync.vue";
import Account from "pages/settings/account.vue"; import Account from "pages/settings/account.vue";
import Server from "pages/settings/server.vue"; import Advanced from "pages/settings/advanced.vue";
function initTabs(flag, tabs) { function initTabs(flag, tabs) {
let i = 0; let i = 0;
@ -61,6 +61,7 @@ export default {
'path': '/settings', 'path': '/settings',
'icon': 'tv', 'icon': 'tv',
'public': true, 'public': true,
'admin': true,
'demo': true, 'demo': true,
}, },
{ {
@ -71,16 +72,18 @@ export default {
'path': '/settings/library', 'path': '/settings/library',
'icon': 'camera_roll', 'icon': 'camera_roll',
'public': true, 'public': true,
'admin': true,
'demo': true, 'demo': true,
}, },
{ {
'name': 'settings-system', 'name': 'settings-advanced',
'component': Server, 'component': Advanced,
'label': this.$gettext('Server'), 'label': this.$gettext('Advanced'),
'class': '', 'class': '',
'path': '/settings/system', 'path': '/settings/advanced',
'icon': 'dns', 'icon': 'build',
'public': false, 'public': false,
'admin': true,
'demo': false, 'demo': false,
}, },
{ {
@ -91,6 +94,7 @@ export default {
'path': '/settings/sync', 'path': '/settings/sync',
'icon': 'sync_alt', 'icon': 'sync_alt',
'public': true, 'public': true,
'admin': true,
'demo': true, 'demo': true,
}, },
{ {
@ -101,6 +105,7 @@ export default {
'path': '/settings/account', 'path': '/settings/account',
'icon': 'person', 'icon': 'person',
'public': false, 'public': false,
'admin': true,
'demo': true, 'demo': true,
}, },
]; ];

View file

@ -318,8 +318,8 @@ export default [
props: { tab: "settings-account" }, props: { tab: "settings-account" },
}, },
{ {
name: "settings_system", name: "settings_advanced",
path: "/settings/system", path: "/settings/advanced",
component: Settings, component: Settings,
meta: { meta: {
title: $gettext("Settings"), title: $gettext("Settings"),
@ -328,7 +328,7 @@ export default [
settings: true, settings: true,
background: "application-light", background: "application-light",
}, },
props: { tab: "settings-system" }, props: { tab: "settings-advanced" },
}, },
{ {
name: "discover", name: "discover",