diff options
Diffstat (limited to 'web/api/public')
-rwxr-xr-x | web/api/public/distro-tree | 8 | ||||
-rwxr-xr-x | web/api/public/switches | 7 |
2 files changed, 5 insertions, 10 deletions
diff --git a/web/api/public/distro-tree b/web/api/public/distro-tree index cff35ec..49ce607 100755 --- a/web/api/public/distro-tree +++ b/web/api/public/distro-tree @@ -10,16 +10,18 @@ use strict; use warnings; use Data::Dumper; -$nms::web::cc{'max-age'} = "20"; +$nms::web::cc{'max-age'} = "5"; +$nms::web::cc{'stale-while-revalidate'} = "30"; my $q2 = $nms::web::dbh->prepare('select sysname,distro_phy_port,distro_name from switches where placement is not null and distro_name is not null and distro_phy_port is not null and deleted = false'); $q2->execute(); while (my $ref = $q2->fetchrow_hashref()) { my $sysname = $ref->{'sysname'}; - my $phy = $ref->{'distro_phy_port'}; my $distro = $ref->{'distro_name'}; - $nms::web::json{'distro-tree'}{$distro}{$phy} = $sysname; + my $phy = $ref->{'distro_phy_port'}; + $nms::web::json{'distro-tree-phy'}{$distro}{$phy} = $sysname; + $nms::web::json{'distro-tree-sys'}{$distro}{$sysname} = $phy; } finalize_output(); diff --git a/web/api/public/switches b/web/api/public/switches index 8e7f333..9bb63d8 100755 --- a/web/api/public/switches +++ b/web/api/public/switches @@ -29,11 +29,4 @@ while (my $ref = $q2->fetchrow_hashref()) { $nms::web::json{'switches'}{$ref->{'sysname'}}{'tags'} = $data; } -my $q4 = $nms::web::dbh->prepare('select linknet, (select sysname from switches where switch = switch1) as sysname1, (select sysname from switches where switch = switch2) as sysname2 from linknets'); - -$q4->execute(); -while (my $ref = $q4->fetchrow_hashref()) { - $nms::web::json{'linknets'}{$ref->{'linknet'}} = $ref; -} - finalize_output(); |