From a0c826de2dac76f497167ab4f8bc21dd2d3449a1 Mon Sep 17 00:00:00 2001 From: CzBiX Date: Tue, 16 Apr 2019 13:11:21 +0800 Subject: [PATCH] Add set cateogry feature --- src/Api.ts | 4 +++ src/App.vue | 8 +++-- src/components/AddForm.vue | 65 +++++++++++++++++++++++++++---------- src/components/Torrents.vue | 47 +++++++++++++++++++++++++++ 4 files changed, 105 insertions(+), 19 deletions(-) diff --git a/src/Api.ts b/src/Api.ts index 9d9bddd..890cb60 100644 --- a/src/Api.ts +++ b/src/Api.ts @@ -79,6 +79,10 @@ class Api { return this.actionTorrents('resume', hashes); } + public setTorrentsCategory(hashes: string[], category: string) { + return this.actionTorrents('setCategory', hashes, {category}); + } + private actionTorrents(action: string, hashes: string[], extra?: any) { const params: any = { hashes: hashes.join('|'), diff --git a/src/App.vue b/src/App.vue index 44ffdbf..8e81d99 100644 --- a/src/App.vue +++ b/src/App.vue @@ -33,7 +33,7 @@ - + @@ -89,7 +89,11 @@ export default Vue.extend({ } }, computed: { - ...mapState(['mainData', 'rid']), + ...mapState([ + 'mainData', + 'rid', + 'preferences', + ]), ...mapGetters(['config']), }, methods: { diff --git a/src/components/AddForm.vue b/src/components/AddForm.vue index a580770..d97a958 100644 --- a/src/components/AddForm.vue +++ b/src/components/AddForm.vue @@ -6,20 +6,19 @@ color="primary" fixed right - :disabled="!prefs" @click="dialog = !dialog" class="btn-add" :class="{'with-footer': $vuetify.breakpoint.smAndUp}" > mdi-link-plus - + mdi-link-plus - Add Torrents from URLs + Add Torrents + + + @@ -49,9 +60,10 @@ @@ -83,53 +95,72 @@