|
1 | 1 | <script lang="tsx" setup> |
2 | | -import { NDataTable, NProgress, type DataTableColumns } from 'naive-ui'; |
| 2 | +import { type DataTableColumns, NDataTable, NProgress } from 'naive-ui'; |
3 | 3 | import type { QbTorrentInfo, TorrentGroup } from '#/downloader'; |
4 | 4 |
|
5 | 5 | definePage({ |
@@ -43,12 +43,12 @@ function formatSize(bytes: number): string { |
43 | 43 | if (bytes === 0) return '0 B'; |
44 | 44 | const units = ['B', 'KB', 'MB', 'GB', 'TB']; |
45 | 45 | const i = Math.floor(Math.log(bytes) / Math.log(1024)); |
46 | | - return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + units[i]; |
| 46 | + return `${(bytes / 1024**i).toFixed(1) } ${ units[i]}`; |
47 | 47 | } |
48 | 48 |
|
49 | 49 | function formatSpeed(bytesPerSec: number): string { |
50 | 50 | if (bytesPerSec === 0) return '-'; |
51 | | - return formatSize(bytesPerSec) + '/s'; |
| 51 | + return `${formatSize(bytesPerSec) }/s`; |
52 | 52 | } |
53 | 53 |
|
54 | 54 | function formatEta(seconds: number): string { |
@@ -255,9 +255,9 @@ function groupCheckedKeys(group: TorrentGroup): string[] { |
255 | 255 | {{ selectedHashes.length }} {{ $t('downloader.selected') }} |
256 | 256 | </span> |
257 | 257 | <div class="action-bar-buttons"> |
258 | | - <ab-button @click="resumeSelected">{{ $t('downloader.action.resume') }}</ab-button> |
259 | | - <ab-button @click="pauseSelected">{{ $t('downloader.action.pause') }}</ab-button> |
260 | | - <ab-button type="warn" @click="deleteSelected(false)">{{ $t('downloader.action.delete') }}</ab-button> |
| 258 | + <ab-button size="small" @click="resumeSelected">{{ $t('downloader.action.resume') }}</ab-button> |
| 259 | + <ab-button size="small" @click="pauseSelected">{{ $t('downloader.action.pause') }}</ab-button> |
| 260 | + <ab-button size="small" type="warn" @click="deleteSelected(false)">{{ $t('downloader.action.delete') }}</ab-button> |
261 | 261 | </div> |
262 | 262 | </div> |
263 | 263 | </Transition> |
|
0 commit comments