Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
faa429b9
Commit
faa429b9
authored
Nov 08, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use PVE::Tools::dump_logfile
parent
f006100b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
25 deletions
+1
-25
Nodes.pm
PVE/API2/Nodes.pm
+1
-25
No files found.
PVE/API2/Nodes.pm
View file @
faa429b9
...
...
@@ -450,35 +450,11 @@ __PACKAGE__->register_method({
code
=>
sub
{
my
(
$param
)
=
@_
;
my
$lines
=
[]
;
my
$rpcenv
=
PVE::RPCEnvironment::
get
();
my
$user
=
$rpcenv
->
get_user
();
my
$node
=
$param
->
{
node
};
my
$fh
=
IO::
File
->
new
("
/var/log/syslog
",
"
r
");
die
"
unable to open file - $!
"
if
!
$fh
;
my
$start
=
$param
->
{
start
}
||
0
;
my
$limit
=
$param
->
{
limit
}
||
50
;
my
$count
=
0
;
my
$line
;
while
(
defined
(
$line
=
<
$fh
>
))
{
next
if
$count
++
<
$start
;
next
if
$limit
<=
0
;
chomp
$line
;
push
@$lines
,
{
n
=>
$count
,
t
=>
$line
};
$limit
--
;
}
close
(
$fh
);
# HACK: ExtJS store.guaranteeRange() does not like empty array
# so we add a line
if
(
!
$count
)
{
$count
++
;
push
@$lines
,
{
n
=>
$count
,
t
=>
"
no content
"};
}
my
(
$count
,
$lines
)
=
PVE::Tools::
dump_logfile
("
/var/log/syslog
",
$param
->
{
start
},
$param
->
{
limit
});
$rpcenv
->
set_result_count
(
$count
);
...
...
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