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
bfcd9086
Commit
bfcd9086
authored
Mar 24, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into portable
parents
b608c3e7
eda15528
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
10 deletions
+59
-10
debomatic-webui/lib/broadcaster.js
debomatic-webui/lib/broadcaster.js
+6
-2
debomatic-webui/lib/tail.js
debomatic-webui/lib/tail.js
+36
-0
debomatic-webui/lib/utils.js
debomatic-webui/lib/utils.js
+8
-4
debomatic-webui/package.json
debomatic-webui/package.json
+1
-1
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+7
-3
debomatic-webui/views/distribution.ejs
debomatic-webui/views/distribution.ejs
+1
-0
No files found.
debomatic-webui/lib/broadcaster.js
View file @
bfcd9086
var
config
=
require
(
'
./config.js
'
)
var
config
=
require
(
'
./config.js
'
)
,
fs
=
require
(
'
fs
'
)
,
fs
=
require
(
'
fs
'
)
,
tail
=
require
(
'
tailfd
'
).
tail
,
Tail
=
require
(
'
./tail.js
'
)
// watcher on build_status
// watcher on build_status
function
__watch_build_status
(
socket
,
status
)
{
function
__watch_build_status
(
socket
,
status
)
{
tail
(
config
.
debomatic
.
jsonfile
,
function
(
new_content
)
{
var
watcher
=
new
Tail
(
config
.
debomatic
.
jsonfile
)
watcher
.
on
(
'
line
'
,
function
(
new_content
)
{
var
data
=
null
var
data
=
null
try
{
try
{
data
=
JSON
.
parse
(
new_content
)
data
=
JSON
.
parse
(
new_content
)
...
@@ -45,6 +46,9 @@ function __watch_build_status (socket, status) {
...
@@ -45,6 +46,9 @@ function __watch_build_status (socket, status) {
socket
.
emit
(
config
.
events
.
broadcast
.
status_update
,
data
)
socket
.
emit
(
config
.
events
.
broadcast
.
status_update
,
data
)
}
}
})
})
watcher
.
on
(
'
error
'
,
function
(
msg
)
{
socket
.
emit
(
config
.
events
.
error
,
msg
)
})
}
}
// watcher on new distributions
// watcher on new distributions
...
...
debomatic-webui/lib/tail.js
0 → 100644
View file @
bfcd9086
var
fs
=
require
(
'
fs
'
)
,
Tail
=
require
(
'
tail
'
).
Tail
Tail
.
prototype
.
watchEvent
=
function
(
e
)
{
var
_this
=
this
;
if
(
e
===
'
change
'
)
{
return
fs
.
stat
(
this
.
filename
,
function
(
err
,
stats
)
{
if
(
err
)
{
_this
.
emit
(
'
error
'
,
err
);
}
if
(
stats
.
size
<
_this
.
pos
)
{
_this
.
pos
=
stats
.
size
;
}
if
(
stats
.
size
>
_this
.
pos
)
{
_this
.
queue
.
push
({
start
:
_this
.
pos
,
end
:
stats
.
size
});
_this
.
pos
=
stats
.
size
;
if
(
_this
.
queue
.
length
===
1
)
{
return
_this
.
internalDispatcher
.
emit
(
"
next
"
);
}
}
});
}
else
if
(
e
===
'
rename
'
)
{
this
.
unwatch
();
_this
.
emit
(
'
error
'
,
"
File
"
+
this
.
filename
+
"
deleted.
"
);
}
};
Tail
.
prototype
.
close
=
function
()
{
this
.
unwatch
()
}
module
.
exports
=
Tail
\ No newline at end of file
debomatic-webui/lib/utils.js
View file @
bfcd9086
var
path
=
require
(
'
path
'
)
var
path
=
require
(
'
path
'
)
,
fs
=
require
(
'
fs
'
)
,
fs
=
require
(
'
fs
'
)
,
tail
=
require
(
'
tailfd
'
).
tail
,
config
=
require
(
'
./config.js
'
)
,
config
=
require
(
'
./config.js
'
)
,
Tail
=
require
(
'
./tail.js
'
)
function
__errors_handler
(
from
,
err
,
socket
)
{
function
__errors_handler
(
from
,
err
,
socket
)
{
if
(
!
socket
)
if
(
!
socket
)
...
@@ -93,11 +93,15 @@ function __watch_path_onsocket(event_name, socket, data, watch_path, updater) {
...
@@ -93,11 +93,15 @@ function __watch_path_onsocket(event_name, socket, data, watch_path, updater) {
updater
(
event_name
,
socket
,
data
)
updater
(
event_name
,
socket
,
data
)
})
})
}
}
else
{
else
if
(
stats
.
isFile
())
{
watcher
=
tail
(
watch_path
,
function
(
new_content
,
tailInfo
)
{
watcher
=
new
Tail
(
watch_path
)
watcher
.
on
(
'
line
'
,
function
(
new_content
,
tailInfo
)
{
data
.
file
.
new_content
=
new_content
+
'
\n
'
data
.
file
.
new_content
=
new_content
+
'
\n
'
updater
(
event_name
,
socket
,
data
)
updater
(
event_name
,
socket
,
data
)
});
});
watcher
.
on
(
'
error
'
,
function
(
msg
)
{
socket
.
emit
(
config
.
events
.
error
,
msg
);
});
}
}
socket_watchers
[
event_name
]
=
watcher
socket_watchers
[
event_name
]
=
watcher
socket
.
set
(
"
watchers
"
,
socket_watchers
)
socket
.
set
(
"
watchers
"
,
socket_watchers
)
...
@@ -110,8 +114,8 @@ function __watch_path_onsocket(event_name, socket, data, watch_path, updater) {
...
@@ -110,8 +114,8 @@ function __watch_path_onsocket(event_name, socket, data, watch_path, updater) {
}
}
function
__generic_handler_watcher
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
{
function
__generic_handler_watcher
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
{
__watch_path_onsocket
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
callback
(
event_name
,
socket
,
data
)
callback
(
event_name
,
socket
,
data
)
__watch_path_onsocket
(
event_name
,
socket
,
data
,
watch_path
,
callback
)
}
}
function
__send_distributions
(
socket
)
{
function
__send_distributions
(
socket
)
{
...
...
debomatic-webui/package.json
View file @
bfcd9086
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
"express"
:
"3.4.8"
"express"
:
"3.4.8"
,
"ejs"
:
">= 0.0.1"
,
"ejs"
:
">= 0.0.1"
,
"socket.io"
:
"*"
,
"socket.io"
:
"*"
,
"tail
fd
"
:
"*"
,
"tail"
:
"*"
}
}
,
"scripts"
:
{
,
"scripts"
:
{
"install"
:
"bash scripts/install.sh"
"install"
:
"bash scripts/install.sh"
...
...
debomatic-webui/public/javascripts/page_distribution.js
View file @
bfcd9086
...
@@ -257,7 +257,8 @@ function Page_Distrubion(socket)
...
@@ -257,7 +257,8 @@ function Page_Distrubion(socket)
var
file_height
=
$
(
"
#fileOffset
"
).
offset
().
top
var
file_height
=
$
(
"
#fileOffset
"
).
offset
().
top
var
footerOffset
=
$
(
"
footer
"
).
offset
().
top
var
footerOffset
=
$
(
"
footer
"
).
offset
().
top
if
(
file_height
>
footerOffset
)
{
if
(
file_height
>
footerOffset
)
{
$
(
'
html
'
).
animate
({
scrollTop
:
file_height
},
0
);
debug
(
2
,
'
scoll down on new content
'
)
$
(
'
html,body
'
).
animate
({
scrollTop
:
file_height
},
0
);
}
}
}
}
},
},
...
@@ -268,6 +269,9 @@ function Page_Distrubion(socket)
...
@@ -268,6 +269,9 @@ function Page_Distrubion(socket)
query_data
.
package
=
view
.
package
query_data
.
package
=
view
.
package
query_data
.
file
=
view
.
file
query_data
.
file
=
view
.
file
query_data
.
file
.
content
=
null
query_data
.
file
.
content
=
null
// get a feedback to user while downloading file
$
(
"
#file pre
"
).
html
(
"
Downloading file, please wait a while ...
"
)
$
(
"
#file
"
).
show
()
debug_socket
(
"
emit
"
,
_e
.
file
.
get
,
query_data
)
debug_socket
(
"
emit
"
,
_e
.
file
.
get
,
query_data
)
socket
.
emit
(
_e
.
file
.
get
,
query_data
)
socket
.
emit
(
_e
.
file
.
get
,
query_data
)
}
}
...
@@ -559,7 +563,7 @@ function Page_Distrubion(socket)
...
@@ -559,7 +563,7 @@ function Page_Distrubion(socket)
view
.
package
.
status
=
view
.
packages
[
view
.
package
.
orig_name
].
status
view
.
package
.
status
=
view
.
packages
[
view
.
package
.
orig_name
].
status
view
.
file
=
Utils
.
clone
(
new_view
.
file
)
view
.
file
=
Utils
.
clone
(
new_view
.
file
)
update
.
page
(
old_view
)
update
.
page
(
old_view
)
$
(
'
html
'
).
animate
({
scrollTop
:
0
},
0
);
$
(
'
html
,body
'
).
animate
({
scrollTop
:
0
},
0
);
debug
(
1
,
"
changing view
"
,
"
old:
"
,
old_view
,
"
new:
"
,
new_view
)
debug
(
1
,
"
changing view
"
,
"
old:
"
,
old_view
,
"
new:
"
,
new_view
)
});
});
...
@@ -569,7 +573,7 @@ function Page_Distrubion(socket)
...
@@ -569,7 +573,7 @@ function Page_Distrubion(socket)
// Init sticky-package back_on_top on click
// Init sticky-package back_on_top on click
$
(
"
#sticky-package
"
).
on
(
"
click
"
,
function
(){
$
(
"
#sticky-package
"
).
on
(
"
click
"
,
function
(){
$
(
'
html
'
).
animate
({
scrollTop
:
0
},
100
);
$
(
'
html
,body
'
).
animate
({
scrollTop
:
0
},
100
);
})
})
// WORKAROUND:
// WORKAROUND:
...
...
debomatic-webui/views/distribution.ejs
View file @
bfcd9086
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</aside>
</aside>
<section id="main" class="col-md-9">
<section id="main" class="col-md-9">
...
...
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