调整
This commit is contained in:
parent
4b20b67e4d
commit
b4441bcdfb
1
app/wails/frontend/components.d.ts
vendored
1
app/wails/frontend/components.d.ts
vendored
@ -15,6 +15,7 @@ declare module 'vue' {
|
||||
ElProgress: typeof import('element-plus/es')['ElProgress']
|
||||
ElRow: typeof import('element-plus/es')['ElRow']
|
||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||
ElStatistic: typeof import('element-plus/es')['ElStatistic']
|
||||
ElTableV2: typeof import('element-plus/es')['ElTableV2']
|
||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||
|
@ -7,18 +7,28 @@ const networkSumRate = useNetworkSumRate()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>实时下载速度:</div>
|
||||
<div> {{bytesToSizeWithUnit(networkSumRate.recv)}}/s </div>
|
||||
<div class="text-center">
|
||||
<el-statistic title="实时下载速度"
|
||||
:formatter="bytesToSizeWithUnit"
|
||||
suffix="/s"
|
||||
:value="networkSumRate.recv">
|
||||
</el-statistic>
|
||||
|
||||
<div>
|
||||
接收: {{bytesToSizeWithUnit(networkSumCounter.bytesRecv || 0)}}
|
||||
</div>
|
||||
<el-statistic title="接收"
|
||||
:formatter="bytesToSizeWithUnit"
|
||||
:value="networkSumCounter.bytesRecv">
|
||||
</el-statistic>
|
||||
|
||||
<div>实时上传速度:</div>
|
||||
<div>{{bytesToSizeWithUnit(networkSumRate.sent)}}/s </div>
|
||||
<el-statistic title="实时上传速度"
|
||||
:formatter="bytesToSizeWithUnit"
|
||||
suffix="/s"
|
||||
:value="networkSumRate.sent">
|
||||
</el-statistic>
|
||||
|
||||
<div>
|
||||
发送: {{bytesToSizeWithUnit(networkSumCounter.bytesSent || 0)}}
|
||||
<el-statistic title="发送"
|
||||
:formatter="bytesToSizeWithUnit"
|
||||
:value="networkSumCounter.bytesSent">
|
||||
</el-statistic>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -68,7 +68,11 @@ export function convertToFileSizeWithUnit(anySize:string, defaultUnit:FileUnitTy
|
||||
}
|
||||
}
|
||||
|
||||
export function bytesToSizeWithUnit(byteSize:number){
|
||||
export function bytesToSizeWithUnit(byteSize?:number){
|
||||
if(byteSize == null){
|
||||
return `0${FileUnit.B.unit}`
|
||||
}
|
||||
|
||||
let targetUnitIndex = Object.values(FileUnit).findIndex(item => item.size > byteSize) || 0
|
||||
let targetUnit:FileUnitType
|
||||
if(targetUnitIndex > 0){
|
||||
|
Loading…
Reference in New Issue
Block a user