File tree Expand file tree Collapse file tree 3 files changed +43
-4
lines changed
Expand file tree Collapse file tree 3 files changed +43
-4
lines changed Original file line number Diff line number Diff line change 66use Icinga \Module \Vspheredb \Data \Anonymizer ;
77use Icinga \Module \Vspheredb \DbObject \HostSystem ;
88use Icinga \Module \Vspheredb \Format ;
9+ use Icinga \Module \Vspheredb \Web \Widget \MacAddress ;
910use Icinga \Module \Vspheredb \Web \Widget \SubTitle ;
1011use ipl \Html \Html ;
1112
@@ -59,11 +60,12 @@ protected function formatSimple($row)
5960 );
6061 }
6162 return Html::sprintf (
62- '%s (%s: %s), %s%s ' ,
63+ '%s (%s: %s), %s%s%s ' ,
6364 Html::tag ('strong ' , $ row ->device ),
6465 $ this ->translate ('driver ' ),
6566 $ row ->driver ,
66- isset ($ row ->mac_address ) ? Anonymizer::shuffleString ($ row ->mac_address ) . ', ' : '' ,
67+ isset ($ row ->mac_address ) ? MacAddress::showBinary (Anonymizer::shuffleString ($ row ->mac_address )) : '' ,
68+ isset ($ row ->mac_address ) ? ', ' : '' ,
6769 $ speedInfo
6870 );
6971 }
Original file line number Diff line number Diff line change 77use Icinga \Module \Vspheredb \DbObject \VirtualMachine ;
88use Icinga \Module \Vspheredb \PerformanceData \IcingaRrd \RrdImg ;
99use Icinga \Module \Vspheredb \Web \Widget \GrafanaVmPanel ;
10+ use Icinga \Module \Vspheredb \Web \Widget \MacAddress ;
1011use Icinga \Module \Vspheredb \Web \Widget \SubTitle ;
1112use ipl \Html \Html ;
1213
@@ -107,10 +108,11 @@ protected function formatSimple($row)
107108 $ mainIpInfo = '' ;
108109 $ aIpInfo = '' ;
109110 }
111+
110112 return Html::sprintf (
111113 '%s (%s)%s %s%s%s %s ' ,
112114 Html::tag ('strong ' , $ row ->label ),
113- $ row ->mac_address ,
115+ MacAddress:: showBinary ( $ row ->mac_address ) ,
114116 Html::tag ('br ' ),
115117 $ mainIpInfo ,
116118 $ aIpInfo ,
@@ -124,7 +126,8 @@ protected function formatMultiLine($row)
124126 return [
125127 Html::tag ('strong ' , $ row ->label ),
126128 Html::tag ('br ' ),
127- $ this ->translate ('MAC Address ' ) . ': ' . $ row ->mac_address ,
129+ $ this ->translate ('MAC Address ' ) . ': ' ,
130+ MacAddress::showBinary ($ row ->mac_address ),
128131 Html::tag ('br ' ),
129132 $ this ->linkToPortGroup ($ row )
130133 ];
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Icinga \Module \Vspheredb \Web \Widget ;
4+
5+ use Icinga \Module \Imedge \Web \PublicWidget \MacAddress as MacAddressWidget ;
6+
7+ class MacAddress
8+ {
9+ public static function show ($ value )
10+ {
11+ if ($ value === null ) {
12+ return null ;
13+ }
14+
15+ if (class_exists (MacAddressWidget::class)) {
16+ return MacAddressWidget::show ($ value );
17+ }
18+
19+ return $ value ;
20+ }
21+
22+ public static function showBinary ($ value )
23+ {
24+ if ($ value === null ) {
25+ return null ;
26+ }
27+
28+ if (class_exists (MacAddressWidget::class)) {
29+ return MacAddressWidget::showBinary ($ value );
30+ }
31+
32+ return $ value ;
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments