📄 ipinfo.tmpl
字号:
#encoding UTF-8## $Id: IPInfo.tmpl 3809 2007-01-19 14:16:23Z jodal $## Extends the MainTemplate ## Defines the IP information page#### Copyright 2005 Norwegian University of Science and Technology#### This file is part of Network Administration Visualized (NAV)#### NAV is free software; you can redistribute it and/or modify## it under the terms of the GNU General Public License as published by## the Free Software Foundation; either version 2 of the License, or## (at your option) any later version.#### NAV is distributed in the hope that it will be useful,## but WITHOUT ANY WARRANTY; without even the implied warranty of## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the## GNU General Public License for more details.#### You should have received a copy of the GNU General Public License## along with NAV; if not, write to the Free Software## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA###### Authors: Morten Vold <morten.vold@ntnu.no>###extends nav.web.templates.MainTemplate.MainTemplate#attr $path = [("Home", "/"), ("IP Info", None)]## Don't know how to break lines in Cheetah, so this gets ugly long:#attr $sortorder = ('navreg', 'ip', 'dns', 'subnet', 'usage', 'description', 'org', 'opt1', 'opt2', 'opt3', 'arp', 'mac', 'switch', 'module', 'port')#def linked($key, $value) #set $link = '' #if $key == 'navreg' #set $link = '/browse/' + $value #elif $key == 'arp' #set $link = '/machinetracker/?from_ip=' + str($info['ip']) + '&to_ip=&aip=on&days=7&send=Search' #elif $key == 'email' #set $link = 'mailto:' + $value #end if #slurp #if $link<a href="$link">$value</a> #slurp #else$value #slurp #end if#end def#def infotable($table)<table class="infotable">#filter WebSafe <caption>Information about <em>$target</em></caption>#end filter #set $firstkeys = [key for key in $sortorder if key in $table.keys()] #set $lastkeys = [key for key in $table.keys() if key not in $firstkeys] #silent $lastkeys.sort() #set $keys = $firstkeys + $lastkeys #set $evenrow = True #set $rowclass = ['oddrow', 'evenrow'] #for $key in $keys ##if $table[$key] <tr class="$rowclass[$evenrow]"> <th>$info.describe($key)</th> <td>$linked($key, $table[$key])</th> </tr> #set $evenrow = not $evenrow ##end if #end for</table>#end def#block content<div id="ipinfo"><h2>IP Information Center</h2><form action="" method="get"><label for="ipinput">IP Address / DNS name</label>:<br><input id="ipinput" type="text" name="ip" size="30" #if $varExists('target')value="${target, also='"'}" #slurp#end if><input type="submit" value="Show"></form>#if $varExists('target') and $target #if $varExists('invalidIP') and $invalidIP <p>"<em>$target</em>" is not a valid IP address!</p> #elif $varExists('info') and $info $infotable($info) #if $varExists('localsiteinfo') <div id="localsiteinfo">$localsiteinfo<div> #end if #else #filter WebSafe <p>No information available for <em>$target</em>.</p> #end filter #end if#end if</div>#if $varExists('debug') <div style="font-size: small; border: 1px dashed red;"> Debug:<br> <pre>$debug</pre> </div>#end if#end block content#block additionalCSS<link rel="stylesheet" type="text/css" href="/style/ipinfo.css" />#end block additionalCSS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -