Added bitrate column to management tools

This commit is contained in:
Nicholas 2024-01-01 20:57:27 -07:00
parent 9a2b93fb37
commit 038ad7018a
2 changed files with 20 additions and 5 deletions

View file

@ -15,6 +15,17 @@ Vue.prototype.$bytesPretty = (bytes, decimals = 2) => {
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]
}
Vue.prototype.$bitratePretty = (bitrate, decimals = 1) => {
if (isNaN(bitrate) || bitrate == 0) {
return '0'
}
const k = 1000
const dm = decimals < 0 ? 0 : decimals
const sizes = ['', 'k', 'm']
const i = Math.floor(Math.log(bitrate) / Math.log(k))
return parseFloat((bitrate / Math.pow(k, i)).toFixed(dm)) + sizes[i]
}
Vue.prototype.$elapsedPretty = (seconds, useFullNames = false) => {
if (seconds < 60) {
return `${Math.floor(seconds)} sec${useFullNames ? 'onds' : ''}`
@ -146,7 +157,7 @@ Vue.prototype.$parseCronExpression = (expression) => {
}
Vue.prototype.$getNextScheduledDate = (expression) => {
const interval = cronParser.parseExpression(expression);
const interval = cronParser.parseExpression(expression)
return interval.next().toDate()
}