feat(webui): book import path is saved to local storage

This commit is contained in:
Gauthier Roebroeck 2021-05-20 18:02:38 +08:00
parent 339570e17c
commit 2473090c36
2 changed files with 13 additions and 1 deletions

View file

@ -28,6 +28,7 @@ export const persistedModule: Module<any, any> = {
sort: {},
route: {},
},
importPath: '',
},
getters: {
getCollectionFilter: (state) => (id: string) => {
@ -89,5 +90,8 @@ export const persistedModule: Module<any, any> = {
setLibraryRoute(state, {id, route}) {
state.library.route[id] = route
},
setImportPath(state, val) {
state.importPath = val ?? ''
},
},
}

View file

@ -11,6 +11,7 @@
<v-col>
<v-text-field
v-model="importPath"
clearable
:label="$t('book_import.field_import_path')"
/>
</v-col>
@ -127,7 +128,6 @@ export default Vue.extend({
selected: [] as number[],
selectedSeries: undefined as SeriesDto | undefined,
payloads: [] as BookImportDto[],
importPath: '',
transientBooks: [] as TransientBookDto[],
copyMode: CopyMode.HARDLINK,
importFinished: false,
@ -146,6 +146,14 @@ export default Vue.extend({
else this.selected = []
},
},
importPath: {
get: function (): string {
return this.$store.state.persistedState.importPath
},
set: function (val: string): void {
this.$store.commit('setImportPath', val)
},
},
copyModes(): object[] {
return [
{text: this.$t('enums.copy_mode.HARDLINK').toString(), value: CopyMode.HARDLINK},