Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
0131942e
Commit
0131942e
authored
Sep 29, 2016
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
纠正上传文件名显示
上传速度展示为可读形式
parent
e1c0fda5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
video-upload.vue
src/frontend/web/js/components/common/video-upload.vue
+17
-3
No files found.
src/frontend/web/js/components/common/video-upload.vue
View file @
0131942e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
</div>
</div>
<div
class=
"upload-ready"
style=
"display:none;"
>
<div
class=
"upload-ready"
style=
"display:none;"
>
<h3>
IMG_0760
</h3>
<h3></h3>
<div
class=
"video-detail"
>
视频大小:
<span
class=
"upload-info-size"
></span>
速度:
<span
class=
"upload-info-speed"
></span></div>
<div
class=
"video-detail"
>
视频大小:
<span
class=
"upload-info-size"
></span>
速度:
<span
class=
"upload-info-speed"
></span></div>
<div
class=
"video-loading-text clearfix"
>
<div
class=
"video-loading-text clearfix"
>
<div
class=
"upload pull-left"
>
已上传
<span
class=
"upload-info-progress"
></span>
%
</div>
<div
class=
"upload pull-left"
>
已上传
<span
class=
"upload-info-progress"
></span>
%
</div>
...
@@ -43,6 +43,19 @@ moment.locale('zh-cn', {
...
@@ -43,6 +43,19 @@ moment.locale('zh-cn', {
}
}
});
});
function
filesize
(
bytes
)
{
var
filesizeUnits
=
[
'Bytes'
,
'KB'
,
'MB'
,
'GB'
,
'TB'
,
'PB'
,
'EB'
,
'ZB'
,
'YB'
];
var
base
=
1024
;
if
(
bytes
)
{
var
i
=
0
;
if
(
bytes
>=
base
)
{
var
a
=
bytes
;
while
(
1
)
{
a
/=
base
;
i
++
;
if
(
a
<
base
)
break
;
}
}
return
parseFloat
((
bytes
/
Math
.
pow
(
base
,
i
)).
toFixed
(
2
))
+
' '
+
filesizeUnits
[
i
];
}
else
return
'0 Bytes'
;
}
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -91,7 +104,8 @@ export default {
...
@@ -91,7 +104,8 @@ export default {
init
:
{
init
:
{
'FilesAdded'
:
function
(
up
,
files
)
{
'FilesAdded'
:
function
(
up
,
files
)
{
plupload
.
each
(
files
,
function
(
file
)
{
plupload
.
each
(
files
,
function
(
file
)
{
ready
.
find
(
".upload-info-size"
).
text
(
file
.
origSize
);
ready
.
find
(
".upload-info-size"
).
text
(
filesize
(
file
.
origSize
));
ready
.
find
(
"h3"
).
text
(
file
.
name
);
});
});
container
.
find
(
".upload-video-btn"
).
hide
();
container
.
find
(
".upload-video-btn"
).
hide
();
...
@@ -108,7 +122,7 @@ export default {
...
@@ -108,7 +122,7 @@ export default {
'UploadProgress'
:
function
(
up
,
file
)
{
'UploadProgress'
:
function
(
up
,
file
)
{
progress
.
css
(
"width"
,
file
.
percent
+
"%"
);
progress
.
css
(
"width"
,
file
.
percent
+
"%"
);
infoProgress
.
text
(
file
.
percent
);
infoProgress
.
text
(
file
.
percent
);
infoSpeed
.
text
(
up
.
total
.
bytesPerSec
);
infoSpeed
.
text
(
filesize
(
up
.
total
.
bytesPerSec
)
);
// var avgSpeed = file.loaded / (((new Date()).getTime() - startTime) / 1000);
// var avgSpeed = file.loaded / (((new Date()).getTime() - startTime) / 1000);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment