mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
improve upload ui (#2780)
This commit is contained in:
@@ -363,6 +363,24 @@ export const Utils = {
|
||||
}
|
||||
},
|
||||
|
||||
formatBitRate: function(bits) {
|
||||
var Bs;
|
||||
if (typeof bits !== 'number') {
|
||||
return '';
|
||||
}
|
||||
Bs = bits / 8;
|
||||
if (Bs >= 1000000000) {
|
||||
return (Bs / 1000000000).toFixed(2) + ' GB/s';
|
||||
}
|
||||
if (Bs >= 1000000) {
|
||||
return (Bs / 1000000).toFixed(2) + ' MB/s';
|
||||
}
|
||||
if (Bs >= 1000) {
|
||||
return (Bs / 1000).toFixed(2) + ' kB/s';
|
||||
}
|
||||
return Bs.toFixed(2) + ' B/s';
|
||||
},
|
||||
|
||||
isMarkdownFile: function(filePath) {
|
||||
let index = filePath.lastIndexOf('.');
|
||||
if (index === -1) {
|
||||
|
Reference in New Issue
Block a user