Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andy Craze
funkwhale
Commits
02debeb9
Commit
02debeb9
authored
5 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "Library Upload: missing retry upload button"
parent
109c4906
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/changelog.d/942.enhancement
+1
-0
1 addition, 0 deletions
changes/changelog.d/942.enhancement
front/src/components/library/FileUpload.vue
+42
-5
42 additions, 5 deletions
front/src/components/library/FileUpload.vue
with
43 additions
and
5 deletions
changes/changelog.d/942.enhancement
0 → 100644
+
1
−
0
View file @
02debeb9
Added a retry option for failed uploads (#942)
This diff is collapsed.
Click to expand it.
front/src/components/library/FileUpload.vue
+
42
−
5
View file @
02debeb9
...
...
@@ -91,9 +91,20 @@
<table
class=
"ui unstackable table"
>
<thead>
<tr>
<th><translate
translate-context=
"Content/Library/Table.Label"
>
Filename
</translate></th>
<th
class=
"ten wide"
><translate
translate-context=
"Content/Library/Table.Label"
>
Filename
</translate></th>
<th><translate
translate-context=
"Content/*/*/Noun"
>
Size
</translate></th>
<th><translate
translate-context=
"*/*/*"
>
Status
</translate></th>
<th><translate
translate-context=
"*/*/*"
>
Actions
</translate></th>
</tr>
<tr
v-if=
"retryableFiles.length > 1"
>
<th
class=
"ten wide"
></th>
<th></th>
<th></th>
<th>
<button
class=
"ui right floated small basic button"
@
click.prevent=
"retry(retryableFiles)"
>
<translate
translate-context=
"Content/Library/Table"
>
Retry failed uploads
</translate>
</button>
</th>
</tr>
</thead>
<tbody>
...
...
@@ -113,9 +124,20 @@
<translate
translate-context=
"Content/Library/Table"
key=
"2"
>
Uploading…
</translate>
(
{{
parseInt
(
file
.
progress
)
}}
%)
</span>
<template
v-else
>
<span
class=
"ui label"
><translate
translate-context=
"Content/Library/*/Short"
key=
"3"
>
Pending
</translate></span>
<button
class=
"ui tiny basic red icon button"
@
click.prevent=
"$refs.upload.remove(file)"
><i
class=
"delete icon"
></i></button>
<span
v-else
class=
"ui label"
><translate
translate-context=
"Content/Library/*/Short"
key=
"3"
>
Pending
</translate></span>
</td>
<td>
<template
v-if=
"file.error"
>
<button
class=
"ui tiny basic icon right floated button"
:title=
"labels.retry"
@
click.prevent=
"retry([file])"
v-if=
"retryableFiles.indexOf(file) > -1"
>
<i
class=
"redo icon"
></i>
</button>
</
template
>
<
template
v-else-if=
"!file.success"
>
<button
class=
"ui tiny basic red icon right floated button"
@
click.prevent=
"$refs.upload.remove(file)"
><i
class=
"delete icon"
></i></button>
</
template
>
</td>
</tr>
...
...
@@ -251,6 +273,13 @@ export default {
self
.
uploads
.
objects
[
event
.
upload
.
uuid
]
=
event
.
upload
;
self
.
needsRefresh
=
true
});
},
retry
(
files
)
{
files
.
forEach
((
file
)
=>
{
this
.
$refs
.
upload
.
update
(
file
,
{
error
:
''
,
progress
:
'
0.00
'
})
})
this
.
$refs
.
upload
.
active
=
true
;
}
},
computed
:
{
...
...
@@ -274,6 +303,7 @@ export default {
server
,
network
,
timeout
,
retry
:
this
.
$pgettext
(
'
*/*/*/Verb
'
,
"
Retry
"
),
extension
:
this
.
$gettextInterpolate
(
extension
,
{
extensions
:
this
.
supportedExtensions
.
join
(
"
,
"
)
})
...
...
@@ -295,6 +325,11 @@ export default {
return
f
.
error
;
}).
length
;
},
retryableFiles
()
{
return
this
.
files
.
filter
(
f
=>
{
return
f
.
error
;
});
},
processableFiles
()
{
return
(
this
.
uploads
.
pending
+
...
...
@@ -342,7 +377,9 @@ export default {
uploadedSize
()
{
let
uploaded
=
0
this
.
files
.
forEach
((
f
)
=>
{
uploaded
+=
f
.
size
*
(
f
.
progress
/
100
)
if
(
!
f
.
error
)
{
uploaded
+=
f
.
size
*
(
f
.
progress
/
100
)
}
})
return
uploaded
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment