Permalink
Browse files

view dns in racklist

  • Loading branch information...
root
root committed Mar 30, 2012
1 parent ed2a607 commit c435fed6522cfe9b54c971fa12dfd329c198b275
Showing with 12 additions and 1 deletion.
  1. +12 −1 php/viewrack.php
View
@@ -105,6 +105,7 @@
//echo "<pre>"; print_r($rackrow); echo "<p>";
+
echo "<h1>Rack $id - {$rack['model']} {$rack['label']}</h1>";
?>
@@ -118,10 +119,20 @@
function printitemcell($rr,$depth) {
global $rackrow,$items,$scriptname,$_GET;
+ $dns=$items[$rackrow[$rr][$depth]]['dnsname'];
+ $label=$items[$rackrow[$rr][$depth]]['label'];
+ $dr=explode(".",$dns); if(count($dr)) $dr=$dr[0];
+
+ $mixlabel=" ";
+ if (strlen($label)) $mixlabel="$label";
+ if (strlen($dr))
+ $mixlabel.=" DNS:$dr";
+
+
return "<a href='$scriptname?action=edititem&amp;id={$rackrow[$rr][$depth]}'>".
$items[$rackrow[$rr][$depth]]['agtitle']." ".
$items[$rackrow[$rr][$depth]]['model']." ".
- $items[$rackrow[$rr][$depth]]['label'].
+ $mixlabel.
" [ID:".$items[$rackrow[$rr][$depth]]['id']."]".
"</a>";
}

0 comments on commit c435fed

Please sign in to comment.