landrok/webstatus

View on GitHub
app/templates/index.tables.html

Summary

Maintainability
Test Coverage
  <div class="col-sm-9 col-md-7 col-lg-6">

    <!-- System -->
    <h3>System</h3>
    <table class="{$tableClass}">
    <tbody>
    <tr>
      <th width="35%">OS</th>
      <td>{$app->getOs()}</td>
    </tr>
    <tr>
      <th>Kernel</th>
      <td>{$app->getKernel()}</td>
    </tr>
    <tr>
      <th>Up</th>
      <td>{$app->getUp()}</td>
    </tr>
    <tr>
      <th><a href="{$app->getRouteUrl('status', 'uptime')}">Started at</a></th>
      <td>{$app->getStarted()}</td>
    </tr>
    <tr>
      <th><a href="{$app->getRouteUrl('status', 'users')}">Users</th>
      <td>{$app->getUserNum()}</td>
    </tr>
    </table>

    <!-- Usage -->
    <h3><a href="{$app->getRouteUrl('status', 'top')}">Usage</a></h3>
    <table class="{$tableClass}">
    <tbody>
    <tr>
      <th width="35%">
        <a href="{$app->getRouteUrl('status', 'temperature')}">
          CPU Temperature 
          {autoescape="off"}{$app->getStatusLabel($app->getCpuTemperature(), 'temp')}{/autoescape}
        </a>
      </th>
      <td width="20%">{$app->getCpuTemperature()}</td>
      <td></td>
    </tr>
    <tr>
      <th>
        <a href="{$app->getRouteUrl('status', 'top')}">
          CPU Usage
          {autoescape="off"}{$app->getStatusLabel($app->getCpuUsage(), 'cpu')}{/autoescape}
        </a>
      </th>
      <td>{function="round($app->getCpuUsage())"}%</td>
      <td>
        {if="$cpuTrend==-1"}{include="layout.trend.down"}{/if}
        {if="$cpuTrend==1"}{include="layout.trend.up"}{/if}
        {if="$cpuTrend==0"}{include="layout.trend.equal"}{/if}
      </td>
    </tr>
    <tr>
      <th>
        <a href="{$app->getRouteUrl('status', 'memory')}">
          Memory Usage
          {autoescape="off"}{$app->getStatusLabel($app->getMemUsage(), 'mem')}{/autoescape}
        </a>
      </th>
      <td>{$app->getMemUsage()}%</td>
      <td>
        {if="$memTrend==-1"}{include="layout.trend.down"}{/if}
        {if="$memTrend==1"}{include="layout.trend.up"}{/if}
        {if="$memTrend==0"}{include="layout.trend.equal"}{/if}
      </td>
    </tr>
    <tr>
      <th>
        <a href="{$app->getRouteUrl('status', 'memory')}">
          Swap Usage 
          {autoescape="off"}{$app->getStatusLabel($app->getSwapUsage(), 'swap')}{/autoescape}
        </a>
      </th>
      <td>{$app->getSwapUsage()}%</td>
      <td></td>
    </tr>
    <tr>
      <th>
        <a href="{$app->getRouteUrl('status', 'hdd')}">
          Disk Usage
          {autoescape="off"}{$app->getStatusLabel($app->getDiskUsage(), 'disk')}{/autoescape}
        </a>
      </th>
      <td>{$app->getDiskUsage()}%</td>
      <td></td>
    </tr>
    </tbody>
    </table>

    <!-- Processes -->
    <h3><a href="{$app->getRouteUrl('status', 'processes')}">Processes</a></h3>
    {if="count($patterns)"}
    <table class="{$tableClass}"><tbody>
    {loop="$patterns"}
    <tr>
      <th width="35%">
        {$value}
        <span class="label label-{$app->getProcessNum($value) ? 'success' : 'danger'} pull-right">
          {$app->getProcessNum($value) ? 'UP' : 'DOWN'}
        </span>
      </th>
      <td>
        {$app->getProcessNum($value)}
      </td>
    </tr>
    {/loop}
    {/if}
    </tbody>
    </table>

    <!-- Network -->
    <h3>Network</h3>
    <table class="{$tableClass}">
    <tbody>
    <tr>
      <th width="35%"><a href="{$app->getRouteUrl('status', 'interfaces')}">Interfaces</a></th>
      <td>{$app->getIfNum()}</td>
    </tr>
    <tr>
      <th><a href="{$app->getRouteUrl('status', 'ifstat')}">In</a></th>
      <td>{$app->getIn()}kB/s</td>
    </tr>
    <tr>
      <th><a href="{$app->getRouteUrl('status', 'ifstat')}">Out</a></th>
      <td>{$app->getOut()}kB/s</td>
    </tr>
    <tr>
      <th><a href="{$app->getRouteUrl('status', 'tcp-sockets')}">TCP Sockets</a></th>
      <td>{$app->getSocketNum()}</td>
    </tr>
    <tr>
      <th><a href="{$app->getRouteUrl('status', 'servers')}">Listening Servers</a></th>
      <td>{$app->getServerNum()}</td>
    </tr>
    </tbody>
    </table>

  </div>
  
  <div class="clearfix"></div>