⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sortedstatstemplate.tmpl

📁 监控大型网络的软件。能够自动发现拓扑结构
💻 TMPL
字号:
#encoding UTF-8#extends nav.web.templates.MainTemplate#import re#def additionalCSS$default_table_CSS()#end def#def content<h2>Statistics</h2><ul>    <li><a href="/cricket/">Cricket</a> - Traffic statistics from router    interfaces and switch ports, CPU utilization, memory usage and more</li></ul><h3>Ranked Statistics</h3><form action="" method="get"><table class="vertitable">    <tr>        <th>Choose view</th>        <td><select name="view">#set $sectionslist = $config.sections()$sectionslist.sort()#for $s in $sectionslist    #if $s == 'ss_general'        #continue    #end if    ## If we have a view, mark it as selected, else don't bother.    #if $view == $s            <option value="$s" selected>$config.get($s, 'name')</option>    #else            <option value="$s">$config.get($s, 'name')</option>    #end if#end for        </select></td>    </tr>    <tr>        <th>Timeframe</th>        <td><select name="fromtime">#for $t in $fromtimes.keys()    #if $fromtime == $t            <option value="$t" selected="selected">$fromtimes[$t]</option>    #else            <option value="$t">$fromtimes[$t]</option>    #end if#end for        </select></td>    </tr>    <tr>        <th>Rows</th>        <td><input type="text" name="numrows" value="$numrows" size="3" /></td>    </tr>    <tr>        <th>Live</th>#if $forcedview == '1'        <td><input type="checkbox" name="forcedview" value="1" checked="checked" /></td>#else        <td><input type="checkbox" name="forcedview" value="1" /></td>#end if    </tr>    <tr>        <th></th>        <td><button type="submit" name="normalview">View</button></td>    </tr></table></form>#if $showArr<table class="listtable">    <caption>        Ranked Statistics for $config.get($view, 'name')<br />        <span class="subtitle">$fromtimes[$fromtime]</span>    </caption>    <thead>        <tr>            <th>Rank</th>            <th>Target</th>            <th>Value</th>            <th>Unit</th>        </tr>    </thead>## Walk the sortedkeys and print the values#set $counter = 1    <tbody>#for $line in $sortedKeys    ## Find target to use when making link.    #if $linkview        #set $target = $re.search("cricket-data(/.*)", $line).groups()[0]    #end if    ## Format the values.    #set $output = $re.sub(".*/([^\/]+/[^\/]+)$","\\1", $line)    #set value = "%.2f" %($showArr[$line])    <tr class="$rowcycler">        <td>$counter</td>        <td>    ## If we got a linkview from the config-file, add a link    #if $linkview            <a href='/cricket/?target=$target;view=$linkview'>$output</a>    #else            $output    #end if        </td>        <td align="right">$value</td>        <td>$units</td>    </tr>    #set $counter += 1    #if $counter > int($numrows)        #break    #end if#end for    </tbody>#if $exetime != 0    <tbody class="footer">        <tr>            <th colspan="0">                Got data in $exetime seconds ($footer)            </th>        </tr>    </tbody>#end if</table>#end if#end def

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -