blob: 4adfb2bbb4959e262e1d2ec0e0d1829c4d33e0fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#! /usr/bin/perl
# vim:ts=8:sw=8
use lib '../../../../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();
|