nextcloud显示上传速度
nextcloud显示上传信息改一个js文件就可以了,改完记得刷新。
1. 进入js文件的目录
cd /var/www/html/nextcloud/apps/files/js/
2. 备份原文件
sudo cp file-upload.js file-upload.js-original
3. 编辑js文件
sudo vi file-upload.js
4. 输入:1153跳转到1153行(nextcloud 15),在1153行你会看到类似以下代码:
var h = moment.duration(smoothRemainingSeconds, "seconds").humanize();if (!(smoothRemainingSeconds >= 0 && smoothRemainingSeconds < 14400)) {
// show "Uploading ..." for durations longer than 4 hours
h = t('files', 'Uploading ...');}
5. 在上面代码的下一行添加:
a). 倒计时+速度
// add xfr speed to time remaining
h = h + t('files', ' @ {bitrate}' , {
bitrate: humanFileSize(data.bitrate / 8) + '/s'
});// ========================================
b). 只有速度
// xfr speed replaces time remaining
h = t('files', '{bitrate}' , {
loadedSize: humanFileSize(data.loaded),
totalSize: humanFileSize(data.total),
bitrate: humanFileSize(data.bitrate / 8) + '/s'
});// ========================================
c). 已载入/总大小
// uploaded of total size replaces time remaining
h = t('files', '{loadedSize} of {totalSize}' , {
loadedSize: humanFileSize(data.loaded),
totalSize: humanFileSize(data.total)
});// ========================================
d). 已载入/总大小+速度
// uploaded of total size and xfr speed replaces time remaining
h = t('files', '{loadedSize} of {totalSize} ({bitrate})' , {
loadedSize: humanFileSize(data.loaded),
totalSize: humanFileSize(data.total),
bitrate: humanFileSize(data.bitrate / 8) + '/s'
});// ========================================
想恢复原状,直接删除注释部分代码即可。