Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
9200235f
Commit
9200235f
authored
Mar 12, 2016
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Page(distribution): retry to get again the file if it was deleted
parent
1eae9d7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
debomatic-webui/lib/app.coffee
debomatic-webui/lib/app.coffee
+1
-0
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+15
-4
No files found.
debomatic-webui/lib/app.coffee
View file @
9200235f
...
...
@@ -110,4 +110,5 @@ server.on "error", (e) ->
process
.
exit
3
else
console
.
error
e
console
.
error
e
.
stack
return
debomatic-webui/public/javascripts/page_distribution.js
View file @
9200235f
...
...
@@ -413,10 +413,12 @@ function Page_Distrubion(socket) {
var
file
=
{
set
:
function
(
socket_data
)
{
back_on_top_pressed
=
false
;
error
.
clean
()
var
new_content
=
Utils
.
escape_html
(
socket_data
.
file
.
content
);
var
file_content
=
$
(
'
#file .content
'
);
view
.
file
=
Utils
.
clone
(
socket_data
.
file
);
file_content
.
html
(
new_content
);
$
(
'
#file
'
).
show
();
file_content
.
show
();
if
(
current_file_in_preview
)
file_content
.
scrollTop
(
file_content
[
0
].
scrollHeight
);
...
...
@@ -446,7 +448,7 @@ function Page_Distrubion(socket) {
file_content
.
scrollTop
(
file_content
[
0
].
scrollHeight
);
}
},
get
:
function
(
force
)
{
get
:
function
(
force
,
noShowFeedback
)
{
if
(
Utils
.
check_view_file
(
view
))
{
if
(
force
)
{
file
.
set_preview
(
false
);
...
...
@@ -459,9 +461,12 @@ function Page_Distrubion(socket) {
query_data
.
file
=
view
.
file
;
query_data
.
file
.
content
=
null
;
query_data
.
file
.
force
=
force
;
// get a feedback to user while downloading file
$
(
'
#file .content
'
).
html
(
'
<div class="loading">Downloading file, please wait a while ... <img src="/images/loading.gif" /></div>
'
);
$
(
'
#file
'
).
show
();
if
(
!
noShowFeedback
)
{
// get a feedback to user while downloading file
error
.
clean
();
$
(
'
#file .content
'
).
html
(
'
<div class="loading">Downloading file, please wait a while ... <img src="/images/loading.gif" /></div>
'
);
$
(
'
#file
'
).
show
();
}
debug_socket
(
'
emit
'
,
_e
.
file
,
query_data
);
socket
.
emit
(
_e
.
file
,
query_data
);
}
...
...
@@ -588,6 +593,12 @@ function Page_Distrubion(socket) {
var
error
=
{
set
:
function
(
socket_error
)
{
// try to retrieve the file after 1s if it was deleted
if
(
socket_error
.
match
(
/File
(
.*
)
deleted
(
.*
)
/
)
||
socket_error
.
match
(
/ENOENT, open /
))
{
setTimeout
(
function
()
{
file
.
get
(
null
,
true
);
},
1000
);
}
if
(
$
(
'
#error
'
).
is
(
'
:visible
'
))
return
;
socket_error
=
socket_error
.
replace
(
/File
(
.*
)
deleted
(
.*
)
/
,
...
...
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