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
0813b08b
Commit
0813b08b
authored
Jun 23, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'github/master' into portable
parents
8876785a
90bc7ff5
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
103 additions
and
86 deletions
+103
-86
.jshintrc
.jshintrc
+0
-7
debomatic-webui/debomatic-webui
debomatic-webui/debomatic-webui
+22
-18
debomatic-webui/lib/config.js
debomatic-webui/lib/config.js
+0
-3
debomatic-webui/lib/parser.js
debomatic-webui/lib/parser.js
+2
-1
debomatic-webui/lib/utils.js
debomatic-webui/lib/utils.js
+34
-39
debomatic-webui/package.json
debomatic-webui/package.json
+1
-1
debomatic-webui/public/javascripts/.jshintrc
debomatic-webui/public/javascripts/.jshintrc
+9
-0
debomatic-webui/public/javascripts/main.js
debomatic-webui/public/javascripts/main.js
+7
-1
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+21
-13
debomatic-webui/public/javascripts/page_generic.js
debomatic-webui/public/javascripts/page_generic.js
+2
-0
debomatic-webui/public/javascripts/preferences.js
debomatic-webui/public/javascripts/preferences.js
+2
-0
debomatic-webui/public/stylesheets/style.css
debomatic-webui/public/stylesheets/style.css
+2
-2
debomatic-webui/views/distribution.ejs
debomatic-webui/views/distribution.ejs
+1
-1
No files found.
.jshintrc
View file @
0813b08b
{
"globals": {
"$": false,
"console": false,
"config": false,
"Utils": false,
"debug_socket": false
},
"globalstrict": true,
"browser": true,
"node": true
...
...
debomatic-webui/debomatic-webui
View file @
0813b08b
...
...
@@ -6,50 +6,54 @@
* Module dependencies.
*/
var express = require('express'),
var http = require('http'),
express = require('express'),
serve_static = require('serve-static'),
serve_index = require('serve-index'),
errorhandler = require('errorhandler'),
routes = require('./routes'),
config = require('./lib/config.js'),
utils = require('./lib/utils.js'),
http = require('http'),
app = module.exports = express(),
Client = require('./lib/client.js'),
Broadcaster = require('./lib/broadcaster.js');
var app = module.exports = express(),
server = http.createServer(app),
io = require('socket.io')(server),
env = process.env.NODE_ENV || 'development';
// serve dsc files as octet-stream
serve_static.mime.define({
'application/octet-stream': ['dsc']
});
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(serve_static(__dirname + '/public'));
app.use(config.routes.debomatic, serve_index(config.debomatic.path));
app.use(config.routes.debomatic, serve_static(config.debomatic.path));
var env = process.env.NODE_ENV || 'development';
if ('development' == env) {
app.use(errorhandler({
dumpExceptions: true,
showStack: true
}));
} else if ('
development
' == env) {
} else if ('
production
' == env) {
app.use(errorhandler());
}
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
// Routes
app.get('/', routes.index);
// distibution page
app.get(config.routes.distribution, routes.distribution);
// parefernces page
if (config.routes.preferences)
app.get(config.routes.preferences, routes.preferences);
// commands page
if (config.routes.commands)
app.get(config.routes.commands, routes.commands);
// debomatic static page
app.use(config.routes.debomatic, serve_index(config.debomatic.path));
app.use(config.routes.debomatic, serve_static(config.debomatic.path));
// serve stylesheet-javascript
app.use(serve_static(__dirname + '/public'));
var server = http.createServer(app),
io = require('socket.io').listen(server, config.socket);
// serve dsc files as octet-stream
serve_static.mime.define({
'application/octet-stream': ['dsc']
});
// Listening
server.listen(config.port, config.host, null, function (err) {
...
...
debomatic-webui/lib/config.js
View file @
0813b08b
...
...
@@ -17,9 +17,6 @@ var config = {};
config
.
host
=
'
localhost
'
;
config
.
port
=
3000
;
config
.
socket
=
{};
config
.
socket
.
log
=
false
;
config
.
debomatic
=
{};
config
.
debomatic
.
path
=
'
/srv/debomatic-amd64
'
;
config
.
debomatic
.
jsonfile
=
'
/var/log/debomatic-json.log
'
;
...
...
debomatic-webui/lib/parser.js
View file @
0813b08b
/*jshint multistr: true */
'
use strict
'
;
function
Parser
()
{
...
...
@@ -35,4 +36,4 @@ Usage: %s [-c config]\n\
});
}
module
.
exports
=
Parser
module
.
exports
=
Parser
;
debomatic-webui/lib/utils.js
View file @
0813b08b
...
...
@@ -75,11 +75,7 @@ function __get_files_list(dir, onlyDirectories, callback) {
}
function
__watch_path_onsocket
(
event_name
,
socket
,
data
,
watch_path
,
updater
)
{
socket
.
get
(
'
watchers
'
,
function
(
err
,
socket_watchers
)
{
if
(
!
socket_watchers
)
{
// init socket watchers
socket_watchers
=
{};
}
var
socket_watchers
=
socket
.
watchers
||
{};
try
{
var
watcher
=
socket_watchers
[
event_name
];
if
(
watcher
)
...
...
@@ -108,13 +104,12 @@ function __watch_path_onsocket(event_name, socket, data, watch_path, updater) {
});
}
socket_watchers
[
event_name
]
=
watcher
;
socket
.
set
(
'
watchers
'
,
socket_watchers
)
;
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
)
{
...
...
debomatic-webui/package.json
View file @
0813b08b
...
...
@@ -8,7 +8,7 @@
"serve-static"
:
"*"
,
"errorhandler "
:
"*"
,
"ejs"
:
">= 0.0.1"
,
"socket.io"
:
"
0
.*"
,
"socket.io"
:
"
1
.*"
,
"tail"
:
"*"
},
"scripts"
:
{
...
...
debomatic-webui/public/javascripts/.jshintrc
0 → 100644
View file @
0813b08b
{
"globals": {
"$": false,
"console": false,
"config": false
},
"globalstrict": true,
"browser": true
}
debomatic-webui/public/javascripts/main.js
View file @
0813b08b
// main client javascript
/* global io: false */
/* global Preferences: false */
/* global Page_Generic: false */
/* global Page_Distrubion: false */
'
use strict
'
;
var
preferences
=
new
Preferences
();
...
...
@@ -23,7 +29,7 @@ if (window.location.pathname == '/') {
label
=
config
.
debomatic
.
admin
.
name
;
real_email
=
'
<a href="mailto:
'
+
real_email
+
subject
+
'
">
'
+
label
+
'
</a>
'
;
$
(
this
).
html
(
real_email
);
})
})
;
}
var
socket
=
io
.
connect
(
'
/
'
);
...
...
debomatic-webui/public/javascripts/page_distribution.js
View file @
0813b08b
'
use strict
'
;
/* global
debug
: false */
/* global
Utils
: false */
/* global page_generic: false */
/* global debug: false */
/* global debug_socket: false */
// function to get all files in on click
// event comes from HTML
...
...
@@ -177,9 +180,11 @@ function Page_Distrubion(socket) {
$
(
'
#packages .search .text
'
).
val
(
name
);
$
(
'
#packages .search .text
'
).
keyup
();
});
$
(
'
#packages .search
'
).
show
();
packages
.
select
();
}
else
{
$
(
'
#packages ul
'
).
append
(
'
<li class="text-muted">No packages yet</li>
'
);
$
(
'
#packages .search
'
).
hide
();
$
(
'
#packages ul
'
).
append
(
'
<li class="disabled"><a>No packages yet</a></li>
'
);
}
packages
.
show
();
sticky
.
updateOffset
();
...
...
@@ -356,7 +361,7 @@ function Page_Distrubion(socket) {
var
file
=
{
set
:
function
(
socket_data
)
{
var
new_content
=
Utils
.
escape_html
(
socket_data
.
file
.
content
);
var
file_content
=
$
(
'
#file
pre
'
);
var
file_content
=
$
(
'
#file
.content
'
);
view
.
file
=
Utils
.
clone
(
socket_data
.
file
);
file_content
.
html
(
new_content
);
file_content
.
show
();
...
...
@@ -364,11 +369,11 @@ function Page_Distrubion(socket) {
file_content
.
scrollTop
(
file_content
[
0
].
scrollHeight
);
},
clean
:
function
()
{
$
(
'
#file
pre
'
).
html
(
''
);
$
(
'
#file
.content
'
).
html
(
''
);
$
(
'
#file
'
).
hide
();
},
append
:
function
(
new_content
)
{
var
file_content
=
$
(
'
#file
pre
'
);
var
file_content
=
$
(
'
#file
.content
'
);
new_content
=
Utils
.
escape_html
(
new_content
);
if
(
!
current_file_in_preview
)
{
file_content
.
append
(
new_content
);
...
...
@@ -402,7 +407,7 @@ function Page_Distrubion(socket) {
query_data
.
file
.
content
=
null
;
query_data
.
file
.
force
=
force
;
// get a feedback to user while downloading file
$
(
'
#file
pre
'
).
html
(
'
Downloading file, please wait a while ...
'
);
$
(
'
#file
.content
'
).
html
(
'
Downloading file, please wait a while ...
'
);
$
(
'
#file
'
).
show
();
debug_socket
(
'
emit
'
,
_e
.
file
,
query_data
);
socket
.
emit
(
_e
.
file
,
query_data
);
...
...
@@ -414,9 +419,9 @@ function Page_Distrubion(socket) {
}
debug
(
2
,
"
file set preview
"
,
preview
);
current_file_in_preview
=
preview
;
var
file
=
$
(
'
#file
pre
'
);
var
file
=
$
(
'
#file
.content
'
);
if
(
preview
)
{
$
(
'
#file
pre
'
).
addClass
(
'
preview
'
);
$
(
'
#file
.content
'
).
addClass
(
'
preview
'
);
var
height
=
(
config
.
file
.
num_lines
)
*
parseInt
(
file
.
css
(
'
line-height
'
).
replace
(
/
[^
-
\d\.]
/g
,
''
))
+
parseInt
(
file
.
css
(
'
padding-top
'
).
replace
(
/
[^
-
\d\.]
/g
,
''
))
+
...
...
@@ -585,9 +590,9 @@ function Page_Distrubion(socket) {
$
(
'
#sticky-package
'
).
addClass
(
'
on-top
'
);
}
if
(
!
config
.
preferences
.
file_background
)
{
$
(
'
#file
pre
'
).
addClass
(
'
no-background
'
);
$
(
'
#file
.content
'
).
addClass
(
'
no-background
'
);
}
$
(
'
#file
pre
'
).
css
(
'
font-size
'
,
config
.
preferences
.
file_fontsize
);
$
(
'
#file
.content
'
).
css
(
'
font-size
'
,
config
.
preferences
.
file_fontsize
);
};
var
select
=
function
()
{
...
...
@@ -652,6 +657,12 @@ function Page_Distrubion(socket) {
this
.
start
=
function
()
{
socket
.
on
(
'
connect
'
,
function
()
{
if
(
!
__check_hash_makes_sense
())
return
;
populate
();
});
socket
.
on
(
config
.
events
.
error
,
function
(
socket_error
)
{
debug_socket
(
'
received
'
,
config
.
events
.
error
,
socket_error
);
error
.
set
(
socket_error
);
...
...
@@ -710,9 +721,6 @@ function Page_Distrubion(socket) {
debug
(
1
,
'
changing view
'
,
'
old:
'
,
old_view
,
'
new:
'
,
view
);
});
if
(
!
__check_hash_makes_sense
())
return
;
populate
();
// Init sticky-package back_on_top on click
$
(
'
#sticky-package
'
).
on
(
'
click
'
,
function
()
{
...
...
debomatic-webui/public/javascripts/page_generic.js
View file @
0813b08b
/* global Utils: false */
/* global debug_socket: false */
'
use strict
'
;
function
Page_Generic
()
{
...
...
debomatic-webui/public/javascripts/preferences.js
View file @
0813b08b
/* global debug: false */
/* global page_generic: false */
'
use strict
'
;
function
Preferences
()
{
...
...
debomatic-webui/public/stylesheets/style.css
View file @
0813b08b
...
...
@@ -166,7 +166,7 @@ footer .info {
line-height
:
35px
;
}
#file
pre
{
#file
.content
{
white-space
:
pre-wrap
;
word-break
:
break-word
;
}
...
...
@@ -186,7 +186,7 @@ footer .info {
font-size
:
75%
;
}
#file
pre
.preview
{
#file
.preview
{
overflow
:
hidden
;
}
...
...
debomatic-webui/views/distribution.ejs
View file @
0813b08b
...
...
@@ -71,7 +71,7 @@
<div id="welcome"></div>
<div id="file">
<div class="datestamp"></div>
<pre></pre>
<pre
class="content"
></pre>
<div id="fileOffset"></div>
</div>
</section>
...
...
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