<script setup>
import {useNetworkSumCounter, useNetworkSumRate} from "src/utils/system/network";
import {bytesToSizeWithUnit} from "src/utils/file/file";

const networkSumCounter = useNetworkSumCounter()
const networkSumRate = useNetworkSumRate()
</script>

<template>
    <div class="text-center">
        <el-statistic title="实时下载速度"
                      :formatter="bytesToSizeWithUnit"
                      suffix="/s"
                      :value="networkSumRate.recv">
        </el-statistic>

        <el-statistic title="接收"
                      :formatter="bytesToSizeWithUnit"
                      :value="networkSumCounter.bytesRecv">
        </el-statistic>

        <el-statistic title="实时上传速度"
                      :formatter="bytesToSizeWithUnit"
                      suffix="/s"
                      :value="networkSumRate.sent">
        </el-statistic>

        <el-statistic title="发送"
                      :formatter="bytesToSizeWithUnit"
                      :value="networkSumCounter.bytesSent">
        </el-statistic>
    </div>
</template>

<style scoped>

</style>
