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
1cb0763d
Commit
1cb0763d
authored
Mar 09, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved generic_handler to utils
parent
359d06e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
debomatic-webui/lib/client.js
debomatic-webui/lib/client.js
+3
-8
debomatic-webui/lib/utils.js
debomatic-webui/lib/utils.js
+9
-0
No files found.
debomatic-webui/lib/client.js
View file @
1cb0763d
...
@@ -77,11 +77,6 @@ function __send_distributions(event_name, socket, data) {
...
@@ -77,11 +77,6 @@ function __send_distributions(event_name, socket, data) {
});
});
}
}
function
__generic_handler
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
{
utils
.
watch_path_onsocket
(
event_name
,
socket
,
data
,
config
.
debomatic
.
path
,
callback
)
callback
(
event_name
,
socket
,
data
)
}
function
__handler_get_file
(
socket
,
data
)
{
function
__handler_get_file
(
socket
,
data
)
{
file_path
=
utils
.
get_file_path
(
data
)
file_path
=
utils
.
get_file_path
(
data
)
utils
.
watch_path_onsocket
(
'
file_newcontent
'
,
socket
,
data
,
file_path
,
__handler_file_newcontent
)
utils
.
watch_path_onsocket
(
'
file_newcontent
'
,
socket
,
data
,
file_path
,
__handler_file_newcontent
)
...
@@ -97,20 +92,20 @@ function __handler_file_newcontent(event_name, socket, data) {
...
@@ -97,20 +92,20 @@ function __handler_file_newcontent(event_name, socket, data) {
Client
=
function
(
socket
)
{
Client
=
function
(
socket
)
{
__generic_handl
er
(
'
distributions
'
,
socket
,
null
,
config
.
debomatic
.
path
,
__send_distributions
)
utils
.
generic_handler_watch
er
(
'
distributions
'
,
socket
,
null
,
config
.
debomatic
.
path
,
__send_distributions
)
socket
.
on
(
'
get_distribution_packages
'
,
function
(
data
)
{
socket
.
on
(
'
get_distribution_packages
'
,
function
(
data
)
{
if
(
!
utils
.
check_data_distribution
(
data
))
if
(
!
utils
.
check_data_distribution
(
data
))
return
return
distribution_path
=
path
.
join
(
config
.
debomatic
.
path
,
data
.
distribution
.
name
,
'
pool
'
)
distribution_path
=
path
.
join
(
config
.
debomatic
.
path
,
data
.
distribution
.
name
,
'
pool
'
)
__generic_handl
er
(
'
distribution_packages
'
,
socket
,
data
,
distribution_path
,
__send_distribution_packages
)
utils
.
generic_handler_watch
er
(
'
distribution_packages
'
,
socket
,
data
,
distribution_path
,
__send_distribution_packages
)
})
})
socket
.
on
(
'
get_package_files_list
'
,
function
(
data
)
{
socket
.
on
(
'
get_package_files_list
'
,
function
(
data
)
{
if
(
!
utils
.
check_data_package
(
data
))
if
(
!
utils
.
check_data_package
(
data
))
return
return
package_path
=
utils
.
get_package_path
(
data
)
package_path
=
utils
.
get_package_path
(
data
)
__generic_handl
er
(
'
package_files_list
'
,
socket
,
data
,
package_path
,
__send_package_files_list
)
utils
.
generic_handler_watch
er
(
'
package_files_list
'
,
socket
,
data
,
package_path
,
__send_package_files_list
)
})
})
socket
.
on
(
'
get_file
'
,
function
(
data
){
socket
.
on
(
'
get_file
'
,
function
(
data
){
...
...
debomatic-webui/lib/utils.js
View file @
1cb0763d
...
@@ -86,6 +86,11 @@ function __watch_path_onsocket(event_name, socket, data, watch_path, updater) {
...
@@ -86,6 +86,11 @@ function __watch_path_onsocket(event_name, socket, data, watch_path, updater) {
})
})
}
}
function
__generic_handler_watcher
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
{
__watch_path_onsocket
(
event_name
,
socket
,
data
,
config
.
debomatic
.
path
,
callback
)
callback
(
event_name
,
socket
,
data
)
}
utils
=
{
utils
=
{
check_data_distribution
:
function
(
data
)
{
check_data_distribution
:
function
(
data
)
{
return
__check_data_distribution
(
data
)
return
__check_data_distribution
(
data
)
...
@@ -110,7 +115,11 @@ utils = {
...
@@ -110,7 +115,11 @@ utils = {
},
},
watch_path_onsocket
:
function
(
event_name
,
socket
,
data
,
watch_path
,
updater
)
{
watch_path_onsocket
:
function
(
event_name
,
socket
,
data
,
watch_path
,
updater
)
{
return
__watch_path_onsocket
(
event_name
,
socket
,
data
,
watch_path
,
updater
)
return
__watch_path_onsocket
(
event_name
,
socket
,
data
,
watch_path
,
updater
)
},
generic_handler_watcher
:
function
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
{
return
__generic_handler_watcher
(
event_name
,
socket
,
data
,
watch_path
,
callback
);
}
}
}
}
module
.
exports
=
utils
module
.
exports
=
utils
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