mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-02-18 00:02:02 +03:00
feat: 1st torrent progress in title #166
This commit is contained in:
parent
354fe4f5f8
commit
5faa248395
3 changed files with 6 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
import { formatBytes } from '@/helpers'
|
||||
|
||||
export class setDocumentTitle {
|
||||
export class DocumentTitle {
|
||||
static setDefault() {
|
||||
this.set('VueTorrent')
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ export class setDocumentTitle {
|
|||
|
||||
static setFirstTorrentStatus(torrent) {
|
||||
if (!torrent) return
|
||||
this.set(`${torrent.state.toLowerCase()} - ${torrent.progress}% - ${torrent.name}`)
|
||||
this.set(`[D: ${formatBytes(torrent.dlspeed)}/s, U: ${formatBytes(torrent.upspeed)}/s] ${torrent.progress}%`)
|
||||
}
|
||||
|
||||
static updateTitle(mode, speeds, torrent) {
|
|
@ -1,5 +1,5 @@
|
|||
import { setDocumentTitle } from './setDocumentTitle'
|
||||
import { DocumentTitle } from './DocumentTitle'
|
||||
|
||||
export {
|
||||
setDocumentTitle
|
||||
DocumentTitle
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import Torrent from '../models/Torrent'
|
|||
import Status from '../models/Status'
|
||||
import qbit from '../services/qbit'
|
||||
import { getHostName } from '@/helpers'
|
||||
import { setDocumentTitle } from '@/actions'
|
||||
import { DocumentTitle } from '@/actions'
|
||||
|
||||
export default {
|
||||
SET_APP_VERSION(state, version) {
|
||||
|
@ -84,7 +84,7 @@ export default {
|
|||
state.torrents = data.map(t => new Torrent(t))
|
||||
|
||||
// update document title
|
||||
setDocumentTitle.updateTitle(
|
||||
DocumentTitle.updateTitle(
|
||||
state.webuiSettings.title,
|
||||
[state.status.dlspeed, state.status.upspeed],
|
||||
state.torrents ? state.torrents[0] : null
|
||||
|
|
Loading…
Add table
Reference in a new issue