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
374e5483
Commit
374e5483
authored
Jul 17, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use callback instead of updater - fix function name - fix err/error variable name
parent
21db8f2e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
debomatic-webui/lib/client.coffee
debomatic-webui/lib/client.coffee
+3
-3
debomatic-webui/lib/utils.coffee
debomatic-webui/lib/utils.coffee
+6
-6
No files found.
debomatic-webui/lib/client.coffee
View file @
374e5483
...
...
@@ -89,7 +89,7 @@ __send_file = (event_name, socket, data, last_lines) ->
file_path
=
utils
.
get_file_path
(
data
)
fs
.
readFile
file_path
,
"utf8"
,
(
err
,
content
)
->
if
err
utils
.
errors_handler
"client:__send_file"
,
err
,
socket
utils
.
errors_handler
(
"client:__send_file"
,
err
,
socket
)
return
data
.
file
.
orig_name
=
file_path
.
split
(
"/"
).
pop
()
if
last_lines
>
0
...
...
@@ -100,13 +100,13 @@ __send_file = (event_name, socket, data, last_lines) ->
config
.
routes
.
debomatic
)
socket
.
emit
event_name
,
data
return
return
__handler_get_file
=
(
socket
,
data
)
->
file_path
=
utils
.
get_file_path
(
data
)
send
=
(
event_name
,
socket
,
data
)
->
data
.
file
.
content
=
null
socket
.
emit
event_name
,
data
socket
.
emit
(
event_name
,
data
)
utils
.
watch_path_onsocket
(
_e
.
file_newcontent
,
socket
,
data
,
file_path
,
send
)
if
data
.
file
.
name
in
config
.
web
.
file
.
preview
and
not
data
.
file
.
force
...
...
debomatic-webui/lib/utils.coffee
View file @
374e5483
...
...
@@ -59,7 +59,7 @@ get_files_list = (dir, onlyDirectories, callback) ->
callback
(
result
)
watch_path_onsocket
=
(
event_name
,
socket
,
data
,
watch_path
,
updater
)
->
watch_path_onsocket
=
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
->
socket_watchers
=
socket
.
watchers
or
{}
try
watcher
=
socket_watchers
[
event_name
]
...
...
@@ -75,13 +75,13 @@ watch_path_onsocket = (event_name, socket, data, watch_path, updater) ->
persistent
:
true
,
(
event
,
fileName
)
->
if
event
is
"rename"
updater
(
event_name
,
socket
,
data
))
callback
(
event_name
,
socket
,
data
))
else
if
stats
.
isFile
()
watcher
=
new
Tail
(
watch_path
)
watcher
.
on
(
"line"
,
(
new_content
,
tailInfo
)
->
watcher
.
on
"line"
,
(
new_content
,
tailInfo
)
->
data
.
file
.
new_content
=
new_content
+
"
\n
"
updater
event_name
,
socket
,
data
)
callback
(
event_name
,
socket
,
data
)
watcher
.
on
"error"
,
(
msg
)
->
socket
.
emit
config
.
events
.
error
,
msg
...
...
@@ -91,7 +91,7 @@ watch_path_onsocket = (event_name, socket, data, watch_path, updater) ->
catch
err
errors_handler
(
"watch_path_onsocket <- "
+
arguments
_
.
callee
.
caller
.
name
,
arguments
.
callee
.
caller
.
name
,
err
,
socket
)
return
...
...
@@ -113,7 +113,7 @@ send_distributions = (socket) ->
socket
.
emit
config
.
events
.
broadcast
.
distributions
,
distributions
errors_handler
=
(
from
,
err
or
,
socket
)
->
errors_handler
=
(
from
,
err
,
socket
)
->
from
=
"NO SOCKET: "
+
from
unless
socket
console
.
error
from
,
err
.
message
socket
.
emit
config
.
events
.
error
,
err
.
message
if
socket
...
...
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