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
90bc7ff5
Commit
90bc7ff5
authored
Jun 23, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to socket.io v1.x
parent
acfabe9c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
44 deletions
+36
-44
debomatic-webui/debomatic-webui
debomatic-webui/debomatic-webui
+1
-1
debomatic-webui/lib/config.js
debomatic-webui/lib/config.js
+0
-3
debomatic-webui/lib/utils.js
debomatic-webui/lib/utils.js
+34
-39
debomatic-webui/package.json
debomatic-webui/package.json
+1
-1
No files found.
debomatic-webui/debomatic-webui
View file @
90bc7ff5
...
@@ -19,7 +19,7 @@ var http = require('http'),
...
@@ -19,7 +19,7 @@ var http = require('http'),
var app = module.exports = express(),
var app = module.exports = express(),
server = http.createServer(app),
server = http.createServer(app),
io = require('socket.io')
.listen(server, config.socket
),
io = require('socket.io')
(server
),
env = process.env.NODE_ENV || 'development';
env = process.env.NODE_ENV || 'development';
if ('development' == env) {
if ('development' == env) {
...
...
debomatic-webui/lib/config.js
View file @
90bc7ff5
...
@@ -17,9 +17,6 @@ var config = {};
...
@@ -17,9 +17,6 @@ var config = {};
config
.
host
=
'
localhost
'
;
config
.
host
=
'
localhost
'
;
config
.
port
=
3000
;
config
.
port
=
3000
;
config
.
socket
=
{};
config
.
socket
.
log
=
false
;
config
.
debomatic
=
{};
config
.
debomatic
=
{};
config
.
debomatic
.
path
=
'
/srv/debomatic-amd64
'
;
config
.
debomatic
.
path
=
'
/srv/debomatic-amd64
'
;
config
.
debomatic
.
jsonfile
=
'
/var/log/debomatic-json.log
'
;
config
.
debomatic
.
jsonfile
=
'
/var/log/debomatic-json.log
'
;
...
...
debomatic-webui/lib/utils.js
View file @
90bc7ff5
...
@@ -75,46 +75,41 @@ function __get_files_list(dir, onlyDirectories, callback) {
...
@@ -75,46 +75,41 @@ function __get_files_list(dir, onlyDirectories, callback) {
}
}
function
__watch_path_onsocket
(
event_name
,
socket
,
data
,
watch_path
,
updater
)
{
function
__watch_path_onsocket
(
event_name
,
socket
,
data
,
watch_path
,
updater
)
{
socket
.
get
(
'
watchers
'
,
function
(
err
,
socket_watchers
)
{
var
socket_watchers
=
socket
.
watchers
||
{};
if
(
!
socket_watchers
)
{
try
{
// init socket watchers
var
watcher
=
socket_watchers
[
event_name
];
socket_watchers
=
{};
if
(
watcher
)
}
watcher
.
close
();
try
{
var
watcher
=
socket_watchers
[
event_name
];
fs
.
stat
(
watch_path
,
function
(
err
,
stats
)
{
if
(
watcher
)
if
(
err
)
{
watcher
.
close
();
__errors_handler
(
'
__watch_path_onsocket:fs.stat
'
,
err
,
socket
);
return
;
fs
.
stat
(
watch_path
,
function
(
err
,
stats
)
{
}
if
(
err
)
{
if
(
stats
.
isDirectory
())
{
__errors_handler
(
'
__watch_path_onsocket:fs.stat
'
,
err
,
socket
);
watcher
=
fs
.
watch
(
watch_path
,
{
return
;
persistent
:
true
}
},
function
(
event
,
fileName
)
{
if
(
stats
.
isDirectory
())
{
if
(
event
==
'
rename
'
)
watcher
=
fs
.
watch
(
watch_path
,
{
persistent
:
true
},
function
(
event
,
fileName
)
{
if
(
event
==
'
rename
'
)
updater
(
event_name
,
socket
,
data
);
});
}
else
if
(
stats
.
isFile
())
{
watcher
=
new
Tail
(
watch_path
);
watcher
.
on
(
'
line
'
,
function
(
new_content
,
tailInfo
)
{
data
.
file
.
new_content
=
new_content
+
'
\n
'
;
updater
(
event_name
,
socket
,
data
);
updater
(
event_name
,
socket
,
data
);
});
});
watcher
.
on
(
'
error
'
,
function
(
msg
)
{
}
else
if
(
stats
.
isFile
())
{
socket
.
emit
(
config
.
events
.
error
,
msg
);
watcher
=
new
Tail
(
watch_path
);
});
watcher
.
on
(
'
line
'
,
function
(
new_content
,
tailInfo
)
{
}
data
.
file
.
new_content
=
new_content
+
'
\n
'
;
socket_watchers
[
event_name
]
=
watcher
;
updater
(
event_name
,
socket
,
data
);
socket
.
set
(
'
watchers
'
,
socket_watchers
);
});
});
watcher
.
on
(
'
error
'
,
function
(
msg
)
{
}
catch
(
err
)
{
socket
.
emit
(
config
.
events
.
error
,
msg
);
__errors_handler
(
'
__watch_path_onsocket <-
'
+
arguments
.
callee
.
caller
.
name
,
err
,
socket
);
});
return
;
}
}
socket_watchers
[
event_name
]
=
watcher
;
});
socket
.
watchers
=
socket_watchers
;
});
}
catch
(
err
)
{
__errors_handler
(
'
__watch_path_onsocket <-
'
+
arguments
.
callee
.
caller
.
name
,
err
,
socket
);
return
;
}
}
}
function
__generic_handler_watcher
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
{
function
__generic_handler_watcher
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
{
...
...
debomatic-webui/package.json
View file @
90bc7ff5
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
"serve-static"
:
"*"
,
"serve-static"
:
"*"
,
"errorhandler "
:
"*"
,
"errorhandler "
:
"*"
,
"ejs"
:
">= 0.0.1"
,
"ejs"
:
">= 0.0.1"
,
"socket.io"
:
"
0
.*"
,
"socket.io"
:
"
1
.*"
,
"tail"
:
"*"
"tail"
:
"*"
},
},
"scripts"
:
{
"scripts"
:
{
...
...
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