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
eb375756
Commit
eb375756
authored
Jun 09, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server send last lines of files if filename is in config.web.file.preview
parent
cd4fbbad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
debomatic-webui/lib/client.js
debomatic-webui/lib/client.js
+10
-4
debomatic-webui/lib/config.js
debomatic-webui/lib/config.js
+5
-0
No files found.
debomatic-webui/lib/client.js
View file @
eb375756
...
@@ -106,7 +106,7 @@ function __send_distribution_packages(event_name, socket, data) {
...
@@ -106,7 +106,7 @@ function __send_distribution_packages(event_name, socket, data) {
});
});
}
}
function
__send_file
(
event_name
,
socket
,
data
)
{
function
__send_file
(
event_name
,
socket
,
data
,
last_lines
)
{
var
file_path
=
utils
.
get_file_path
(
data
);
var
file_path
=
utils
.
get_file_path
(
data
);
fs
.
readFile
(
file_path
,
'
utf8
'
,
function
(
err
,
content
)
{
fs
.
readFile
(
file_path
,
'
utf8
'
,
function
(
err
,
content
)
{
if
(
err
)
{
if
(
err
)
{
...
@@ -114,7 +114,10 @@ function __send_file(event_name, socket, data) {
...
@@ -114,7 +114,10 @@ function __send_file(event_name, socket, data) {
return
;
return
;
}
}
data
.
file
.
orig_name
=
file_path
.
split
(
'
/
'
).
pop
();
data
.
file
.
orig_name
=
file_path
.
split
(
'
/
'
).
pop
();
data
.
file
.
content
=
content
;
if
(
last_lines
>
0
)
data
.
file
.
content
=
content
.
split
(
'
\n
'
).
slice
(
-
25
).
join
(
'
\n
'
);
else
data
.
file
.
content
=
content
;
data
.
file
.
path
=
file_path
.
replace
(
config
.
debomatic
.
path
,
config
.
routes
.
debomatic
);
data
.
file
.
path
=
file_path
.
replace
(
config
.
debomatic
.
path
,
config
.
routes
.
debomatic
);
socket
.
emit
(
event_name
,
data
);
socket
.
emit
(
event_name
,
data
);
});
});
...
@@ -126,7 +129,10 @@ function __handler_get_file(socket, data) {
...
@@ -126,7 +129,10 @@ function __handler_get_file(socket, data) {
data
.
file
.
content
=
null
;
data
.
file
.
content
=
null
;
socket
.
emit
(
event_name
,
data
);
socket
.
emit
(
event_name
,
data
);
});
});
__send_file
(
_e
.
file
.
set
,
socket
,
data
);
if
(
config
.
web
.
file
.
preview
.
indexOf
(
data
.
file
.
name
)
>=
0
&&
!
data
.
file
.
force
)
__send_file
(
_e
.
file
.
set
,
socket
,
data
,
config
.
web
.
file
.
num_lines
);
else
__send_file
(
_e
.
file
.
set
,
socket
,
data
);
}
}
function
Client
(
socket
)
{
function
Client
(
socket
)
{
...
@@ -165,7 +171,7 @@ function Client(socket) {
...
@@ -165,7 +171,7 @@ function Client(socket) {
for
(
var
key
in
socket_watchers
)
{
for
(
var
key
in
socket_watchers
)
{
try
{
try
{
socket_watchers
[
key
].
close
();
socket_watchers
[
key
].
close
();
}
catch
(
err
)
{}
}
catch
(
err
or_watch
)
{}
}
}
});
});
});
});
...
...
debomatic-webui/lib/config.js
View file @
eb375756
...
@@ -47,6 +47,11 @@ config.web.debomatic.dput.login = 'debomatic';
...
@@ -47,6 +47,11 @@ config.web.debomatic.dput.login = 'debomatic';
config
.
web
.
debomatic
.
dput
.
method
=
'
scp
'
;
config
.
web
.
debomatic
.
dput
.
method
=
'
scp
'
;
config
.
web
.
debomatic
.
dput
.
unsigned_uploads
=
false
;
config
.
web
.
debomatic
.
dput
.
unsigned_uploads
=
false
;
// list of files get preview
config
.
web
.
file
=
{};
config
.
web
.
file
.
preview
=
[
'
buildlog
'
];
config
.
web
.
file
.
num_lines
=
25
;
// default ui settings
// default ui settings
config
.
web
.
preferences
=
{};
config
.
web
.
preferences
=
{};
config
.
web
.
preferences
.
autoscroll
=
true
;
config
.
web
.
preferences
.
autoscroll
=
true
;
...
...
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