fix: 1.对浏览器resize 事件进行优化2.更改kBps为Kbps

This commit is contained in:
@changcode
2022-04-26 14:00:16 +08:00
parent 089ecf86a2
commit 17ac9640ed
16 changed files with 52 additions and 27 deletions

View File

@@ -94,8 +94,8 @@
entityData.bytesSentRate
? unitConvert(
entityData.bytesSentRate,
unitTypes.byte,
).join(' ') + 'ps'
unitTypes.bps,
).join(' ')
: '-'
}}</span>
<!-- 曲线-->

View File

@@ -39,7 +39,7 @@
<div class="row__label row__label--width130">{{$t('overall.throughput')}}</div>
<div class="row__contents">
<div class="row__content">
<div class="row__charts-msg">{{$t('overall.sent')}}{{unitConvert(entityData.bytesSentRate, unitTypes.byte).join(' ')}}ps</div>
<div class="row__charts-msg">{{$t('overall.sent')}}{{unitConvert(entityData.bytesSentRate, unitTypes.bps).join(' ')}}</div>
<!-- 曲线-->
<div class="row__charts" :id="`entityDetailSend${entityData.appName}`" ></div>
</div>

View File

@@ -43,7 +43,7 @@
<div class="row__label row__label--width130">{{$t('overall.throughput')}}</div>
<div class="row__contents">
<div class="row__content">
<div class="row__charts-msg">{{$t('overall.sent')}}{{unitConvert(entityData.bytesSentRate, unitTypes.byte).join(' ')}}ps</div>
<div class="row__charts-msg">{{$t('overall.sent')}}{{unitConvert(entityData.bytesSentRate, unitTypes.bps).join(' ')}}</div>
<!-- 曲线-->
<div class="row__charts" :id="`entityDetailSend${entityData.domainName}`" ></div>
</div>

View File

@@ -39,7 +39,7 @@
<div class="row__label row__label--width130">{{$t('overall.dnsServerInfo.queryRate')}}</div>
<div class="row__contents">
<div class="row__content">
<div class="row__charts-msg">{{unitConvert(entityData.queryRate, unitTypes.byte).join(' ')}}ps</div>
<div class="row__charts-msg">{{unitConvert(entityData.queryRate, unitTypes.bps).join(' ')}}</div>
<!-- 曲线-->
<div class="row__charts" :id="`entityDnsServerInfo${entityData.ipAddr}`"></div>
</div>
@@ -62,7 +62,7 @@
<div class="row__label row__label--width130">{{$t('overall.throughput')}}</div>
<div class="row__contents">
<div class="row__content">
<div class="row__charts-msg">{{$t('overall.sent')}}{{unitConvert(entityData.bytesSentRate, unitTypes.byte).join(' ')}}ps</div>
<div class="row__charts-msg">{{$t('overall.sent')}}{{unitConvert(entityData.bytesSentRate, unitTypes.bps).join(' ')}}</div>
<!-- 曲线-->
<div class="row__charts" :id="`entityDetailSend${entityData.ipAddr}`"></div>
</div>

View File

@@ -350,11 +350,12 @@ export default {
}
},
mounted () {
window.addEventListener('resize', this.$_.debounce(this.resize, 200))
this.debounceFunc = this.$_.debounce(this.resize, 200)
window.addEventListener('resize', this.debounceFunc)
this.chartOption = _.cloneDeep(entityListLineOption)
setTimeout(() => { this.queryEntityDetail() })
},
beforeUnmount () {
window.removeEventListener('resize', this.resize)
window.removeEventListener('resize', this.debounceFunc)
}
}

View File

@@ -313,7 +313,8 @@ export default {
}
},
mounted () {
window.addEventListener('resize', this.$_.debounce(this.resize, 200))
this.debounceFunc = this.$_.debounce(this.resize, 200)
window.addEventListener('resize', this.debounceFunc)
this.chartOption = _.cloneDeep(entityListLineOption)
this.entityData = _.cloneDeep(this.entity)
setTimeout(() => {
@@ -323,6 +324,6 @@ export default {
})
},
beforeUnmount () {
window.removeEventListener('resize', this.resize)
window.removeEventListener('resize', this.debounceFunc)
}
}