From 7416dea8950929829e9c6ff32b4a5195e8902457 Mon Sep 17 00:00:00 2001 From: CzBiX Date: Wed, 15 Jan 2020 18:59:49 +0800 Subject: [PATCH] Add piece status bar --- src/Api.ts | 10 ++++ src/components/dialogs/TorrentInfo.vue | 83 ++++++++++++++++++++++++-- 2 files changed, 88 insertions(+), 5 deletions(-) diff --git a/src/Api.ts b/src/Api.ts index 2742398..19d0da2 100644 --- a/src/Api.ts +++ b/src/Api.ts @@ -159,6 +159,16 @@ class Api { }).then(Api.handleResponse); } + public getTorrentPieceStates(hash: string) { + const params = { + hash, + }; + + return this.axios.get('/torrents/pieceStates', { + params, + }).then(Api.handleResponse); + } + public getTorrentFiles(hash: string) { const params = { hash, diff --git a/src/components/dialogs/TorrentInfo.vue b/src/components/dialogs/TorrentInfo.vue index 7e94ca8..88218ec 100644 --- a/src/components/dialogs/TorrentInfo.vue +++ b/src/components/dialogs/TorrentInfo.vue @@ -1,5 +1,10 @@ @@ -177,5 +237,18 @@ export default Vue.extend({ overflow: hidden; white-space: nowrap; } + + .progress { + margin: 0.5em; + display: flex; + + .progress-inner { + margin: 0 1em; + align-self: center; + height: 16px; + flex-grow: 1; + border: 1px inset; + } + } }