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
c0ef55d7
Commit
c0ef55d7
authored
Jun 12, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into portable
parents
9005a739
608897a5
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
202 additions
and
27 deletions
+202
-27
History.md
History.md
+37
-0
debomatic-webui/debomatic-webui
debomatic-webui/debomatic-webui
+1
-0
debomatic-webui/lib/broadcaster.js
debomatic-webui/lib/broadcaster.js
+17
-0
debomatic-webui/lib/client.js
debomatic-webui/lib/client.js
+9
-1
debomatic-webui/lib/config.js
debomatic-webui/lib/config.js
+8
-1
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+16
-16
debomatic-webui/public/javascripts/page_generic.js
debomatic-webui/public/javascripts/page_generic.js
+25
-7
debomatic-webui/public/stylesheets/style.css
debomatic-webui/public/stylesheets/style.css
+4
-0
debomatic-webui/views/footer.ejs
debomatic-webui/views/footer.ejs
+4
-2
proxy/node_modules/http-proxy/node_modules/eventemitter3/benchmarks/run/hundereds.js
...xy/node_modules/eventemitter3/benchmarks/run/hundereds.js
+81
-0
No files found.
History.md
0 → 100644
View file @
c0ef55d7
# 0.4.0 (2014-06-12)
*
[new] always show only max_lines in preview, also when new_content is recevied
*
[new] get debomatic real status by reading pidfile in /var/run directory
*
[new] add History file
# 0.3.0 (2014-06-09)
*
[new] files can have a preview
# 0.2.4 (2014-06-09)
*
[fix] bugs relative to jshint validation
# 0.2.3 (2014-06-06)
*
[new] get all sources in one click
*
[fix] code valdiatation via jshint
# 0.2.2 (2014-06-04)
*
[fix] upgrade to express 4.x
# 0.2.1 (2014-04-13)
*
[fix] some style bugs
# 0.2.0 (2014-04-08)
*
[new] get all debs in one click
*
[new] enaled glossy theme by default
*
[new] window with has a rationale title
*
[new] improved welcome messages
*
[new] upgrade to express 3.x
*
[new] handle with debomatic pre_chroot and post_chroot hooks
*
[new] add options -c and -h to cli script
*
[fix] back on tail module instead of tailfd
*
[fix] sticky bar
*
[fix] serve js and css with a version number
*
[fix] add new content to file using append() - reduce cpu usage
*
[fix] many other bugs fix
# 0.1.0 (2014-04-07)
*
Initial release
debomatic-webui/debomatic-webui
View file @
c0ef55d7
...
...
@@ -72,6 +72,7 @@ server.listen(config.port, config.host, null, function (err) {
client.start();
if (status.length > 0)
client.send_status(status);
client.send_status_debomatic();
});
console.log('Debomatic-webui listening on %s:%d in %s mode', server.address().address, server.address().port, app.settings.env);
...
...
debomatic-webui/lib/broadcaster.js
View file @
c0ef55d7
...
...
@@ -63,12 +63,29 @@ function __watch_distributions(socket) {
});
}
function
__watch_pidfile
(
socket
)
{
fs
.
watchFile
(
config
.
debomatic
.
pidfile
,
{
persistent
:
false
,
interval
:
1007
},
function
(
curr
,
prev
)
{
var
status_debomatic
=
{
"
running
"
:
curr
.
ino
!==
0
// if === 0 means pidfile does not exists
};
try
{
socket
.
emit
(
socket
.
emit
(
config
.
events
.
broadcast
.
status_debomatic
,
status_debomatic
));
}
catch
(
err
)
{}
});
}
function
Broadcaster
(
sockets
,
status
)
{
__watch_status
(
sockets
,
status
);
__watch_distributions
(
sockets
);
__watch_pidfile
(
sockets
);
return
{
};
...
...
debomatic-webui/lib/client.js
View file @
c0ef55d7
...
...
@@ -115,7 +115,7 @@ function __send_file(event_name, socket, data, last_lines) {
}
data
.
file
.
orig_name
=
file_path
.
split
(
'
/
'
).
pop
();
if
(
last_lines
>
0
)
data
.
file
.
content
=
content
.
split
(
'
\n
'
).
slice
(
-
25
).
join
(
'
\n
'
);
data
.
file
.
content
=
content
.
split
(
'
\n
'
).
slice
(
-
last_lines
).
join
(
'
\n
'
);
else
data
.
file
.
content
=
content
;
data
.
file
.
path
=
file_path
.
replace
(
config
.
debomatic
.
path
,
config
.
routes
.
debomatic
);
...
...
@@ -181,6 +181,14 @@ function Client(socket) {
this
.
send_status
=
function
(
status
)
{
socket
.
emit
(
_e
.
status
,
status
);
};
this
.
send_status_debomatic
=
function
()
{
fs
.
exists
(
config
.
debomatic
.
pidfile
,
function
(
exists
)
{
socket
.
emit
(
config
.
events
.
broadcast
.
status_debomatic
,
{
'
running
'
:
exists
});
});
};
}
module
.
exports
=
Client
;
debomatic-webui/lib/config.js
View file @
c0ef55d7
...
...
@@ -67,7 +67,7 @@ config.web.preferences.debug = 0; // debug level - 0 means disabled
// DO NOT TOUCH these ones
config
.
version
=
'
0.
3.1
'
;
config
.
version
=
'
0.
4.0
'
;
// A simple function to quickly have
// get and set strings for client events
...
...
@@ -78,11 +78,18 @@ function _event_get_set(event_name) {
};
}
config
.
debomatic
.
pidfile
=
"
/var/run/debomatic-
"
+
require
(
'
crypto
'
)
.
createHash
(
'
sha256
'
)
.
update
(
config
.
debomatic
.
path
)
.
digest
(
'
hex
'
);
config
.
events
=
{};
config
.
events
.
error
=
'
error
'
;
config
.
events
.
broadcast
=
{};
config
.
events
.
broadcast
.
distributions
=
'
distributions
'
;
config
.
events
.
broadcast
.
status_update
=
'
status_update
'
;
config
.
events
.
broadcast
.
status_debomatic
=
'
status_debomatic
'
;
config
.
events
.
client
=
{};
config
.
events
.
client
.
distribution_packages
=
_event_get_set
(
'
distribution_packages
'
);
...
...
debomatic-webui/public/javascripts/page_distribution.js
View file @
c0ef55d7
'
use strict
'
;
/* global debug: false */
/* global page_generic: false */
// function to get all files in on click
// event comes from HTML
function
download_all
(
div_id
)
{
...
...
@@ -65,7 +68,7 @@ function Page_Distrubion(socket) {
var
_e
=
config
.
events
.
client
;
var
view
=
Utils
.
from_hash_to_view
();
var
sidebarOffset
=
0
;
var
new_lines
=
[]
;
var
current_file_in_preview
=
false
;
function
__check_hash_makes_sense
()
{
if
(
window
.
location
.
hash
.
indexOf
(
'
..
'
)
>=
0
)
{
...
...
@@ -100,6 +103,7 @@ function Page_Distrubion(socket) {
label
+=
'
<a class="btn btn-link btn-lg" title="Download" href="
'
+
view
.
file
.
path
+
'
">
'
+
'
<span class="glyphicon glyphicon-download-alt"></span></a>
'
;
if
(
config
.
file
.
preview
.
indexOf
(
view
.
file
.
name
)
>=
0
)
{
current_file_in_preview
=
true
;
var
view_all
=
$
(
'
<a id="get-whole-file" class="btn btn-link btn-lg" title="View the whole file"></a>
'
);
view_all
.
html
(
'
<span class="glyphicon glyphicon-eye-open"></span>
'
);
label
+=
view_all
.
get
(
0
).
outerHTML
;
...
...
@@ -230,7 +234,7 @@ function Page_Distrubion(socket) {
// update html
socket_data
.
package
.
sources
.
forEach
(
function
(
f
)
{
$
(
'
#sources ul
'
).
append
(
'
<li><a title="
'
+
f
.
orig_name
+
'
" href="
'
+
f
.
path
+
'
">
'
+
f
.
name
+
'
</a></li>
'
);
})
})
;
$
(
'
#sources
'
).
show
();
}
files
.
show
();
...
...
@@ -284,7 +288,15 @@ function Page_Distrubion(socket) {
},
append
:
function
(
new_content
)
{
var
content
=
$
(
'
#file pre
'
);
if
(
!
current_file_in_preview
)
{
content
.
append
(
new_content
);
}
else
{
// always show only config.file.num_lines lines in preview
content
=
content
.
html
().
replace
(
/
\n
$/
,
''
).
split
(
'
\n
'
);
content
=
content
.
concat
(
new_content
.
replace
(
/
\n
$/
,
''
).
split
(
'
\n
'
));
content
=
content
.
slice
(
-
config
.
file
.
num_lines
).
join
(
'
\n
'
);
$
(
'
#file pre
'
).
html
(
content
);
}
if
(
config
.
preferences
.
autoscroll
)
{
// scroll down if file is covering footer
...
...
@@ -571,7 +583,7 @@ function Page_Distrubion(socket) {
socket
.
on
(
_e
.
file_newcontent
,
function
(
socket_data
)
{
debug_socket
(
'
received
'
,
_e
.
file_newcontent
,
socket_data
);
new_lines
.
push
(
socket_data
.
file
.
new_content
);
file
.
append
(
socket_data
.
file
.
new_content
);
});
$
(
window
).
on
(
'
hashchange
'
,
function
()
{
...
...
@@ -609,18 +621,6 @@ function Page_Distrubion(socket) {
// events. Sleep a while and call stiky.reset()
setTimeout
(
sticky
.
reset
,
500
);
// WORKAROUND:
// On incoming hundred of lines browser goes crazy.
// Append lines every 200 mills.
function
watch_for_new_lines
()
{
if
(
new_lines
.
length
>
0
)
{
file
.
append
(
new_lines
.
join
(
''
));
new_lines
=
[];
}
setTimeout
(
watch_for_new_lines
,
200
);
}
watch_for_new_lines
();
// Update html according with preferences
preferences
();
...
...
debomatic-webui/public/javascripts/page_generic.js
View file @
c0ef55d7
...
...
@@ -2,6 +2,7 @@
function
Page_Generic
()
{
var
_e
=
config
.
events
;
var
status_debomatic
=
{};
function
__get_status_html_id
(
status_data
)
{
var
result
=
'
status-
'
+
status_data
.
status
+
'
-
'
+
status_data
.
distribution
;
...
...
@@ -73,12 +74,22 @@ function Page_Generic() {
var
status
=
{
set
:
function
(
data_status
)
{
if
(
!
data_status
)
{
if
(
status_debomatic
.
running
)
{
$
(
'
#status .idle
'
).
show
();
$
(
'
#status .norunning
'
).
hide
();
}
else
{
$
(
'
#status .idle
'
).
hide
();
$
(
'
#status .norunning
'
).
show
();
}
}
else
{
$
(
'
#status ul
'
).
html
(
''
);
if
(
data_status
.
length
>
0
)
{
data_status
.
forEach
(
function
(
s
)
{
status
.
append
(
s
);
});
}
}
},
append
:
function
(
status_data
)
{
$
(
'
#status .idle
'
).
hide
();
...
...
@@ -107,8 +118,9 @@ function Page_Generic() {
// and show idle label if necessary.
setTimeout
(
function
()
{
li
.
remove
();
if
(
$
(
'
#status li
'
).
length
===
0
)
$
(
'
#status .idle
'
).
show
();
if
(
$
(
'
#status li
'
).
length
===
0
)
{
status
.
set
();
}
},
config
.
status
.
delay
.
remove
+
2000
);
// more delay on remove html
},
config
.
status
.
delay
.
remove
);
}
else
if
(
!
status_data
.
hasOwnProperty
(
'
success
'
))
{
...
...
@@ -159,6 +171,12 @@ function Page_Generic() {
status
.
update
(
package_status
);
});
socket
.
on
(
_e
.
broadcast
.
status_debomatic
,
function
(
socket_status_debomatic
)
{
debug_socket
(
'
received
'
,
_e
.
broadcast
.
status_debomatic
,
socket_status_debomatic
);
status_debomatic
=
socket_status_debomatic
;
status
.
set
();
});
socket
.
on
(
_e
.
error
,
function
(
error
)
{
console
.
error
(
'
socket >
'
+
error
);
});
...
...
debomatic-webui/public/stylesheets/style.css
View file @
c0ef55d7
...
...
@@ -116,6 +116,10 @@ footer {
margin-right
:
10px
;
}
#status
.debomatic
{
display
:
none
;
}
#status
.packages
{
display
:
inline
;
}
...
...
debomatic-webui/views/footer.ejs
View file @
c0ef55d7
...
...
@@ -5,7 +5,9 @@
Fork me on <a href="https://github.com/LeoIannacone/debomatic-webui">github</a>
</small>
<div id="status" class="clearfix">
<span class="label label-default">status:</span> <span class="idle text-muted">Idle</span>
<span class="label label-default">status:</span>
<span class="debomatic idle text-muted">Idle</span>
<span class="debomatic norunning text-danger">Not running</span>
<ul class="packages list-inline"></ul>
</div>
</footer>
...
...
proxy/node_modules/http-proxy/node_modules/eventemitter3/benchmarks/run/hundereds.js
0 → 100644
View file @
c0ef55d7
'
use strict
'
;
/**
* Benchmark related modules.
*/
var
benchmark
=
require
(
'
benchmark
'
)
,
microtime
=
require
(
'
microtime
'
);
/**
* Logger
*/
var
logger
=
new
(
require
(
'
devnull
'
))({
timestamp
:
false
,
namespacing
:
0
});
/**
* Preparation code.
*/
var
EventEmitter2
=
require
(
'
eventemitter2
'
).
EventEmitter2
,
EventEmitter3
=
require
(
'
../../
'
).
EventEmitter
,
EventEmitter1
=
require
(
'
events
'
).
EventEmitter
;
function
foo
()
{
if
(
arguments
.
length
>
100
)
console
.
log
(
'
damn
'
);
return
1
;
}
/**
* Instances.
*/
var
ee2
=
new
EventEmitter2
()
,
ee3
=
new
EventEmitter3
()
,
ee1
=
new
EventEmitter1
()
,
j
,
i
;
for
(
i
=
0
;
i
<
10
;
i
++
)
{
for
(
j
=
0
;
j
<
10
;
j
++
)
{
ee1
.
on
(
'
event:
'
+
i
,
foo
);
}
}
for
(
i
=
0
;
i
<
10
;
i
++
)
{
for
(
j
=
0
;
j
<
10
;
j
++
)
{
ee2
.
on
(
'
event:
'
+
i
,
foo
);
}
}
for
(
i
=
0
;
i
<
10
;
i
++
)
{
for
(
j
=
0
;
j
<
10
;
j
++
)
{
ee3
.
on
(
'
event:
'
+
i
,
foo
);
}
}
(
new
benchmark
.
Suite
()
).
add
(
'
EventEmitter 1
'
,
function
test1
()
{
for
(
i
=
0
;
i
<
10
;
i
++
)
{
ee1
.
emit
(
'
event:
'
+
i
);
}
}).
add
(
'
EventEmitter 2
'
,
function
test2
()
{
for
(
i
=
0
;
i
<
10
;
i
++
)
{
ee2
.
emit
(
'
event:
'
+
i
);
}
}).
add
(
'
EventEmitter 3
'
,
function
test2
()
{
for
(
i
=
0
;
i
<
10
;
i
++
)
{
ee3
.
emit
(
'
event:
'
+
i
);
}
}).
on
(
'
cycle
'
,
function
cycle
(
e
)
{
var
details
=
e
.
target
;
logger
.
log
(
'
Finished benchmarking: "%s"
'
,
details
.
name
);
logger
.
metric
(
'
Count (%d), Cycles (%d), Elapsed (%d), Hz (%d)
'
,
details
.
count
,
details
.
cycles
,
details
.
times
.
elapsed
,
details
.
hz
);
}).
on
(
'
complete
'
,
function
completed
()
{
logger
.
info
(
'
Benchmark: "%s" is was the fastest.
'
,
this
.
filter
(
'
fastest
'
).
pluck
(
'
name
'
)
);
}).
run
();
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