mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 08:44:46 +02:00
log node heart exception to browser console
This commit is contained in:
parent
8a79a17c49
commit
6a8e8b87b4
@ -22,20 +22,23 @@ class NodeSystemInformation extends Component
|
|||||||
$exception = $systemInformation['exception'] ?? null;
|
$exception = $systemInformation['exception'] ?? null;
|
||||||
$version = $systemInformation['version'] ?? null;
|
$version = $systemInformation['version'] ?? null;
|
||||||
|
|
||||||
|
if ($exception) {
|
||||||
|
$this->js('console.error("' . $exception . '");');
|
||||||
|
}
|
||||||
|
|
||||||
$tooltip = $exception ? 'Error connecting to node!<br>Check browser console for details.' : $version;
|
$tooltip = $exception ? 'Error connecting to node!<br>Check browser console for details.' : $version;
|
||||||
|
|
||||||
$icon = 'tabler-heart' . ($exception ? '-off' : 'beat');
|
$icon = 'tabler-heart' . ($exception ? '-off' : 'beat');
|
||||||
$color = $exception ? 'danger' : 'success';
|
$color = $exception ? 'danger' : 'success';
|
||||||
|
|
||||||
// TODO: add exception to browser console
|
|
||||||
return generate_icon_html($icon, attributes: (new ComponentAttributeBag())
|
return generate_icon_html($icon, attributes: (new ComponentAttributeBag())
|
||||||
->merge([
|
->merge([
|
||||||
'x-tooltip' => '{
|
'x-tooltip' => '{
|
||||||
content: "' . $tooltip . '",
|
content: "' . $tooltip . '",
|
||||||
theme: $store.theme,
|
theme: $store.theme,
|
||||||
allowHTML: true,
|
allowHTML: true,
|
||||||
placement: "bottom",
|
placement: "bottom",
|
||||||
}',
|
}',
|
||||||
], escape: false)
|
], escape: false)
|
||||||
->color(IconComponent::class, $color), size: IconSize::Large)
|
->color(IconComponent::class, $color), size: IconSize::Large)
|
||||||
->toHtml();
|
->toHtml();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user