Skip to content

Commit ceb3abe

Browse files
L8SElaf
andauthored
Update Availability Map widget to not use Service state_name variable (librenms#17716)
* Fix : inconsistent label in getServiceLabel * Update AvailabilityMapController.php --------- Co-authored-by: Neil Lathwood <gh+n@laf.io>
1 parent 105923b commit ceb3abe

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/Http/Controllers/Widgets/AvailabilityMapController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ private function getServices(): array
164164
'status' => $service->service_status,
165165
'link' => Url::deviceUrl($service->device),
166166
'tooltip' => $this->getServiceTooltip($service),
167-
'label' => $this->getServiceLabel($service, $state_name),
167+
'label' => $this->getServiceLabel($service),
168168
'labelClass' => $class,
169169
];
170170
}
@@ -210,13 +210,13 @@ private function getDeviceLabel(Device $device, string $state_name): string
210210
}
211211
}
212212

213-
private function getServiceLabel(Service $service, string $state_name): string
213+
private function getServiceLabel(Service $service): string
214214
{
215215
if ($this->getSettings()['color_only_select'] == 1) {
216216
return '';
217217
}
218218

219-
return $service->service_type . ' - ' . __($state_name);
219+
return empty($service->service_name) ? $service->service_type : $service->service_name;
220220
}
221221

222222
private function getDeviceTooltip(Device $device, string $state_name): string

0 commit comments

Comments
 (0)