From e212cc7652492cf2862d9f19a193ab6bd420c313 Mon Sep 17 00:00:00 2001 From: CzBiX Date: Sat, 14 Sep 2019 19:27:00 +0800 Subject: [PATCH] Add files panel --- src/Api.ts | 10 ++ src/components/dialogs/InfoDialog.vue | 19 ++- src/components/dialogs/TorrentContent.vue | 136 ++++++++++++++++++++++ 3 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 src/components/dialogs/TorrentContent.vue diff --git a/src/Api.ts b/src/Api.ts index 5bbe60e..b31ef10 100644 --- a/src/Api.ts +++ b/src/Api.ts @@ -159,6 +159,16 @@ class Api { }).then(Api.handleResponse); } + public getTorrentFiles(hash: string) { + const params = { + hash, + }; + + return this.axios.get('/torrents/files', { + params, + }).then(Api.handleResponse); + } + private actionTorrents(action: string, hashes: string[], extra?: any) { const params: any = { hashes: hashes.join('|'), diff --git a/src/components/dialogs/InfoDialog.vue b/src/components/dialogs/InfoDialog.vue index 90f3cfd..7791875 100644 --- a/src/components/dialogs/InfoDialog.vue +++ b/src/components/dialogs/InfoDialog.vue @@ -23,9 +23,9 @@ Peers - + @@ -67,6 +67,19 @@ /> + + + + + @@ -81,6 +94,7 @@ import _ from 'lodash'; import Vue from 'vue'; import TorrentInfo from './TorrentInfo.vue'; +import TorrentContent from './TorrentContent.vue'; import Trackers from './Trackers.vue'; import Peers from './Peers.vue'; import Panel from './Panel.vue'; @@ -88,6 +102,7 @@ import Panel from './Panel.vue'; export default Vue.extend({ components: { TorrentInfo, + TorrentContent, Trackers, Peers, Panel, diff --git a/src/components/dialogs/TorrentContent.vue b/src/components/dialogs/TorrentContent.vue new file mode 100644 index 0000000..c6cd717 --- /dev/null +++ b/src/components/dialogs/TorrentContent.vue @@ -0,0 +1,136 @@ + + + + + \ No newline at end of file