Some more minor GUI improvements

master
Thomas Hooge 1 year ago
parent 6ebaea2d45
commit f0992b4b64
  1. 28
      index.php
  2. 1
      lang/de.php
  3. 1
      lang/en.php
  4. 1
      location.php
  5. 6
      node.php
  6. 34
      tpl/index.tpl
  7. 4
      tpl/location.tpl
  8. 6
      tpl/node.tpl

@ -14,29 +14,45 @@ include("header.php");
// Statistics
// asset
$sth = $dbh->query("SELECT COUNT(asset_id) AS asset_counter FROM asset");
$sth = $dbh->query("SELECT COUNT(asset_id) FROM asset");
$smarty->assign("asset_counter", $sth->fetchColumn());
// assetclass
$sth = $dbh->query("SELECT COUNT(assetclass_id) AS asset_counter FROM assetclass");
$smarty->assign("assetclass_counter", $sth->fetchColumn());
// assetclassgroup
$sth = $dbh->query("SELECT COUNT(assetclassgroup_id) FROM assetclassgroup");
$smarty->assign("assetclassgroup_counter", $sth->fetchColumn());
// location
$sth = $dbh->query("SELECT COUNT(location_id) AS location_counter FROM location");
$sth = $dbh->query("SELECT COUNT(location_id) FROM location");
$smarty->assign("location_counter", $sth->fetchColumn());
// node
$sth = $dbh->query("SELECT COUNT(node_id) AS node_counter FROM node");
$sth = $dbh->query("SELECT COUNT(node_id) FROM node");
$smarty->assign("node_counter", $sth->fetchColumn());
// subnet
$sth = $dbh->query("SELECT COUNT(subnet_id) AS subnet_counter FROM subnet");
$sth = $dbh->query("SELECT COUNT(subnet_id) FROM subnet");
$smarty->assign("subnet_counter", $sth->fetchColumn());
// nat
$sth = $dbh->query("SELECT COUNT(nat_id) FROM nat");
$smarty->assign("nat_counter", $sth->fetchColumn());
// vlan
$sth = $dbh->query("SELECT COUNT(vlan_id) AS vlan_counter FROM vlan");
$sth = $dbh->query("SELECT COUNT(vlan_id) FROM vlan");
$smarty->assign("vlan_counter", $sth->fetchColumn());
// zone
$sth = $dbh->query("SELECT COUNT(zone_id) AS zone_counter FROM zone");
$sth = $dbh->query("SELECT COUNT(zone_id) FROM zone");
$smarty->assign("zone_counter", $sth->fetchColumn());
// cable
$sth = $dbh->query("SELECT COUNT(cable_id) FROM cable");
$smarty->assign("cable_counter", $sth->fetchColumn());
$smarty->display("index.tpl");
include("footer.php");

@ -99,6 +99,7 @@ $lang = array(
'lang_location_edit' => 'Standort ändern',
'lang_location_info' => 'Standortinfo',
'lang_location_name' => 'Standortname',
'lang_location_hierarchy' => 'Standorthierarchie',
'lang_location_parent' => 'Übergeordneter Standort',
'lang_sublocation_add' => 'Unterstandort hinzufügen',
'lang_location_none' => 'Es sind keine Standorte vorhanden',

@ -99,6 +99,7 @@ $lang = array(
'lang_location_edit' => 'Modify location',
'lang_location_info' => 'Location info',
'lang_location_name' => 'Location name',
'lang_location_hierarchy' => 'Location hierarchy',
'lang_location_parent' => 'Parent',
'lang_sublocation_add' => 'Add Sub-location',
'lang_location_none' => 'There are no locations defined',

@ -16,6 +16,7 @@ $sql = "SELECT location_id AS id, location_name AS value, location_parent AS par
ORDER BY location_parent, location_sort, location_name";
$sth = $dbh->query($sql);
$locations = $sth->fetchAll();
$smarty->assign('location_count', count($locations));
// function for recursion
function build_tree($parent_id, $level) {

@ -34,9 +34,11 @@ if(isset($_GET['subnet_id'])) {
// create sql with optional filter
$where = join(' AND ', $w);
$sql = "SELECT a.asset_id, a.asset_info,
$sql = "SELECT a.asset_id,
CONCAT(LEFT(a.asset_info,30), IF(CHAR_LENGTH(a.asset_info)>30,'...','')) AS asset_info,
REPLACE(a.asset_name, ' ', ' ') AS asset_name,
n.node_id, n.node_ip
n.node_id, n.node_ip,
CONCAT(LEFT(n.node_info,30), IF(CHAR_LENGTH(n.node_info)>30,'...','')) AS node_info
FROM node AS n LEFT JOIN asset AS a USING (asset_id)";
if ($where) {
$sql .= ' WHERE ' . $where;

@ -18,6 +18,22 @@
<a href="asset.php">{$asset_counter}</a>
</td>
</tr>
<tr>
<td class="label">
{$lang_assetclasses}
</td>
<td class="value">
<a href="assetclass.php">{$assetclass_counter}</a>
</td>
</tr>
<tr>
<td class="label">
{$lang_assetclassgroups}
</td>
<td class="value">
<a href="assetclassgroup.php">{$assetclassgroup_counter}</a>
</td>
</tr>
<tr>
<td class="label">
{$lang_locations}
@ -34,6 +50,14 @@
<a href="node.php">{$node_counter}</a>
</td>
</tr>
<tr>
<td class="label">
{$lang_nat_rules}
</td>
<td class="value">
<a href="nat.php">{$nat_counter}</a>
</td>
</tr>
<tr>
<td class="label">
{$lang_subnets}
@ -58,4 +82,14 @@
<a href="zone.php">{$zone_counter}</a>
</td>
</tr>
{if $suser_admin}
<tr>
<td class="label">
{$lang_cables}
</td>
<td class="value">
<a href="cable.php">{$cable_counter}</a>
</td>
</tr>
{/if}
</table>

@ -2,7 +2,7 @@
<tr>
<td class="header">
<img class="icon" src="images/building.png" alt="" />
{$lang_locations} ({$locations|@count})
{$lang_locations} ({$location_count})
</td>
<td align="right">
{if $suser_add || $suser_admin}
@ -16,7 +16,7 @@
<table class="info">
<tr>
<td class="header">
{$lang_location_name}
{$lang_location_hierarchy}
</td>
</tr>
<tr>

@ -16,6 +16,9 @@
<td class="header">
{$lang_ip}
</td>
<td class="header">
{$lang_node_info}
</td>
<td class="header">
{$lang_asset_name}
</td>
@ -28,6 +31,9 @@
<td class="label">
<a href="nodeview.php?node_id={$node.node_id}">{if $node.node_ip}{$node.node_ip}{else}(leer){/if}</a>
</td>
<td class="value">
{$node.node_info}
</td>
<td class="value">
<a href="assetview.php?asset_id={$node.asset_id}">{$node.asset_name}</a>
</td>