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
9917f213
Commit
9917f213
authored
Mar 09, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved send_distributions to utils and watch for changes again in index
parent
1cb0763d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
debomatic-webui/index.js
debomatic-webui/index.js
+5
-0
debomatic-webui/lib/client.js
debomatic-webui/lib/client.js
+3
-7
debomatic-webui/lib/utils.js
debomatic-webui/lib/utils.js
+11
-1
No files found.
debomatic-webui/index.js
View file @
9917f213
...
@@ -47,6 +47,11 @@ io.sockets.on('disconnect', function(socket){
...
@@ -47,6 +47,11 @@ io.sockets.on('disconnect', function(socket){
});
});
// watch for new distributions
fs
.
watch
(
config
.
debomatic
.
path
,
{
persistent
:
true
},
function
(
event
,
fileName
)
{
utils
.
send_distributions
(
io
.
sockets
);
});
var
server
=
app
.
listen
(
config
.
port
,
function
(){
var
server
=
app
.
listen
(
config
.
port
,
function
(){
console
.
log
(
"
Express server listening on port %d in %s mode
"
,
app
.
address
().
port
,
app
.
settings
.
env
);
console
.
log
(
"
Express server listening on port %d in %s mode
"
,
app
.
address
().
port
,
app
.
settings
.
env
);
});
});
debomatic-webui/lib/client.js
View file @
9917f213
...
@@ -71,11 +71,7 @@ function __send_file (event_name, socket, data) {
...
@@ -71,11 +71,7 @@ function __send_file (event_name, socket, data) {
});
});
}
}
function
__send_distributions
(
event_name
,
socket
,
data
)
{
utils
.
get_files_list
(
config
.
debomatic
.
path
,
true
,
function
(
distros
){
socket
.
emit
(
event_name
,
distros
);
});
}
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
)
...
@@ -92,8 +88,8 @@ function __handler_file_newcontent(event_name, socket, data) {
...
@@ -92,8 +88,8 @@ function __handler_file_newcontent(event_name, socket, data) {
Client
=
function
(
socket
)
{
Client
=
function
(
socket
)
{
utils
.
generic_handler_watcher
(
'
distributions
'
,
socket
,
null
,
config
.
debomatic
.
path
,
__send_distributions
)
utils
.
send_distributions
(
socket
)
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
...
...
debomatic-webui/lib/utils.js
View file @
9917f213
...
@@ -91,6 +91,12 @@ function __generic_handler_watcher(event_name, socket, data, watch_path, callbac
...
@@ -91,6 +91,12 @@ function __generic_handler_watcher(event_name, socket, data, watch_path, callbac
callback
(
event_name
,
socket
,
data
)
callback
(
event_name
,
socket
,
data
)
}
}
function
__send_distributions
(
event_name
,
socket
)
{
__get_files_list
(
config
.
debomatic
.
path
,
true
,
function
(
distros
){
socket
.
emit
(
event_name
,
distros
);
});
}
utils
=
{
utils
=
{
check_data_distribution
:
function
(
data
)
{
check_data_distribution
:
function
(
data
)
{
return
__check_data_distribution
(
data
)
return
__check_data_distribution
(
data
)
...
@@ -118,8 +124,12 @@ utils = {
...
@@ -118,8 +124,12 @@ utils = {
},
},
generic_handler_watcher
:
function
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
{
generic_handler_watcher
:
function
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
{
return
__generic_handler_watcher
(
event_name
,
socket
,
data
,
watch_path
,
callback
);
return
__generic_handler_watcher
(
event_name
,
socket
,
data
,
watch_path
,
callback
);
},
send_distributions
:
function
(
socket
,
event_name
)
{
if
(
!
event_name
)
event_name
=
'
distributions
'
return
__send_distributions
(
event_name
,
socket
);
}
}
}
}
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