aboutsummaryrefslogtreecommitdiffstats
path: root/web/api/read
diff options
context:
space:
mode:
Diffstat (limited to 'web/api/read')
-rwxr-xr-xweb/api/read/comments15
-rwxr-xr-xweb/api/read/oplog2
2 files changed, 1 insertions, 16 deletions
diff --git a/web/api/read/comments b/web/api/read/comments
deleted file mode 100755
index d7c8cdb..0000000
--- a/web/api/read/comments
+++ /dev/null
@@ -1,15 +0,0 @@
-#! /usr/bin/perl
-# vim:ts=8:sw=8
-
-use lib '/opt/gondul/include';
-use nms::web;
-use strict;
-use warnings;
-
-my $query = $nms::web::dbh->prepare('select sysname,extract(epoch from date_trunc(\'second\',time)) as time,state,username,id,comment from switch_comments natural join switches where state != \'delete\' order by time desc');
-$query->execute();
-while (my $ref = $query->fetchrow_hashref()) {
- push @{$nms::web::json{'comments'}{$ref->{'sysname'}}{'comments'}},$ref;
-}
-
-nms::web::finalize_output();
diff --git a/web/api/read/oplog b/web/api/read/oplog
index d56890a..92511bb 100755
--- a/web/api/read/oplog
+++ b/web/api/read/oplog
@@ -6,7 +6,7 @@ use nms::web;
use strict;
use warnings;
-my $query = $nms::web::dbh->prepare('select id,time as timestamp,extract(hour from time) as h, extract(minute from time) as m,systems,username,log from oplog order by id desc;');
+my $query = $nms::web::dbh->prepare('select id,date_trunc(\'second\',time) as timestamp,extract(hour from time) as h, extract(minute from time) as m,systems,username,log from oplog order by id desc;');
$query->execute();
while (my $ref = $query->fetchrow_hashref()) {
my %meh;