mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Enable menu translation (#10298)
And better translation support for sensors, not complete
This commit is contained in:
@@ -617,7 +617,7 @@ class Sensor implements DiscoveryModule, PollerModule
|
||||
foreach ($sensors as $sensor) {
|
||||
$sensor_value = $data[$sensor['sensor_id']];
|
||||
|
||||
echo " {$sensor['sensor_descr']}: $sensor_value {$types[$sensor['sensor_class']]['unit']}\n";
|
||||
echo " {$sensor['sensor_descr']}: $sensor_value " . __('sensors.' . $sensor['sensor_class'] . '.unit') . PHP_EOL;
|
||||
|
||||
// update rrd and database
|
||||
$rrd_name = array(
|
||||
|
@@ -129,125 +129,68 @@ class WirelessSensor extends Sensor
|
||||
*/
|
||||
public static function getTypes($valid = false, $device_id = null)
|
||||
{
|
||||
// Add new types here
|
||||
// Add new types here translations/descriptions/units in resources/lang/<lang>/wireless.php
|
||||
// FIXME I'm really bad with icons, someone please help!
|
||||
static $types = array(
|
||||
'ap-count' => array(
|
||||
'short' => 'APs',
|
||||
'long' => 'AP Count',
|
||||
'unit' => '',
|
||||
static $types = [
|
||||
'ap-count' => [
|
||||
'icon' => 'wifi',
|
||||
),
|
||||
'clients' => array(
|
||||
'short' => 'Clients',
|
||||
'long' => 'Client Count',
|
||||
'unit' => '',
|
||||
],
|
||||
'clients' => [
|
||||
'icon' => 'tablet',
|
||||
),
|
||||
'quality' => array(
|
||||
'short' => 'Quality',
|
||||
'long' => 'Quality',
|
||||
'unit' => '%',
|
||||
],
|
||||
'quality' => [
|
||||
'icon' => 'feed',
|
||||
),
|
||||
'capacity' => array(
|
||||
'short' => 'Capacity',
|
||||
'long' => 'Capacity',
|
||||
'unit' => '%',
|
||||
],
|
||||
'capacity' => [
|
||||
'icon' => 'feed',
|
||||
),
|
||||
'utilization' => array(
|
||||
'short' => 'Utilization',
|
||||
'long' => 'utilization',
|
||||
'unit' => '%',
|
||||
],
|
||||
'utilization' => [
|
||||
'icon' => 'percent',
|
||||
),
|
||||
'rate' => array(
|
||||
'short' => 'Rate',
|
||||
'long' => 'TX/RX Rate',
|
||||
'unit' => 'bps',
|
||||
],
|
||||
'rate' => [
|
||||
'icon' => 'tachometer',
|
||||
),
|
||||
'ccq' => array(
|
||||
'short' => 'CCQ',
|
||||
'long' => 'Client Connection Quality',
|
||||
'unit' => '%',
|
||||
],
|
||||
'ccq' => [
|
||||
'icon' => 'wifi',
|
||||
),
|
||||
'snr' => array(
|
||||
'short' => 'SNR',
|
||||
'long' => 'Signal-to-Noise Ratio',
|
||||
'unit' => 'dB',
|
||||
],
|
||||
'snr' => [
|
||||
'icon' => 'signal',
|
||||
),
|
||||
'ssr' => array(
|
||||
'short' => 'SSR',
|
||||
'long' => 'Signal Strength Ratio',
|
||||
'unit' => 'dB',
|
||||
],
|
||||
'ssr' => [
|
||||
'icon' => 'signal',
|
||||
),
|
||||
'mse' => array(
|
||||
'short' => 'MSE',
|
||||
'long' => 'Mean Square Error',
|
||||
'unit' => 'dB',
|
||||
],
|
||||
'mse' => [
|
||||
'icon' => 'signal',
|
||||
),
|
||||
'xpi' => array(
|
||||
'short' => 'XPI',
|
||||
'long' => 'Cross Polar Interference',
|
||||
'unit' => 'dB',
|
||||
],
|
||||
'xpi' => [
|
||||
'icon' => 'signal',
|
||||
),
|
||||
'rssi' => array(
|
||||
'short' => 'RSSI',
|
||||
'long' => 'Received Signal Strength Indicator',
|
||||
'unit' => 'dBm',
|
||||
],
|
||||
'rssi' => [
|
||||
'icon' => 'signal',
|
||||
),
|
||||
'power' => array(
|
||||
'short' => 'Power/Signal',
|
||||
'long' => 'TX/RX Power or Signal',
|
||||
'unit' => 'dBm',
|
||||
],
|
||||
'power' => [
|
||||
'icon' => 'bolt',
|
||||
),
|
||||
'noise-floor' => array(
|
||||
'short' => 'Noise Floor',
|
||||
'long' => 'Noise Floor',
|
||||
'unit' => 'dBm/Hz',
|
||||
],
|
||||
'noise-floor' => [
|
||||
'icon' => 'signal',
|
||||
),
|
||||
'errors' => array(
|
||||
'short' => 'Errors',
|
||||
'long' => 'Errors',
|
||||
'unit' => '',
|
||||
],
|
||||
'errors' => [
|
||||
'icon' => 'exclamation-triangle',
|
||||
'type' => 'counter',
|
||||
),
|
||||
'error-ratio' => array(
|
||||
'short' => 'Error Ratio',
|
||||
'long' => 'Bit/Packet Error Ratio',
|
||||
'unit' => '%',
|
||||
],
|
||||
'error-ratio' => [
|
||||
'icon' => 'exclamation-triangle',
|
||||
),
|
||||
'error-rate' => array(
|
||||
'short' => 'BER',
|
||||
'long' => 'Bit Error Rate',
|
||||
'unit' => 'bps',
|
||||
],
|
||||
'error-rate' => [
|
||||
'icon' => 'exclamation-triangle',
|
||||
),
|
||||
'frequency' => array(
|
||||
'short' => 'Frequency',
|
||||
'long' => 'Frequency',
|
||||
'unit' => 'MHz',
|
||||
],
|
||||
'frequency' => [
|
||||
'icon' => 'line-chart',
|
||||
),
|
||||
'distance' => array(
|
||||
'short' => 'Distance',
|
||||
'long' => 'Distance',
|
||||
'unit' => 'km',
|
||||
],
|
||||
'distance' => [
|
||||
'icon' => 'space-shuttle',
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
||||
if ($valid) {
|
||||
$sql = 'SELECT `sensor_class` FROM `wireless_sensors`';
|
||||
|
Reference in New Issue
Block a user