/laravel-dashboard-pingping-tile

A tile to display the status of PingPing Monitors

Primary LanguagePHPMIT LicenseMIT

A tile to display the status of PingPing Monitors

Screenshot of Dashboard Tile

Latest Version MIT License Offset Earth Larabelles

GitHub Workflow Status StyleCI

Total Downloads Open Collective

This tile can be used on the Laravel Dashboard to display the status of PingPing Monitors.

Installation

You can install the package via composer:

composer require astrotomic/laravel-dashboard-pingping-tile

In the dashboard config file, you must add this configuration in the tiles key. The stations should contain the IDs of the PingPing stations that you want to display on the dashboard.

// in config/dashboard.php

return [
    // ...
    'tiles' => [
        'pingping' => [
            'api_key' => '', // https://pingping.io/account/api
            'monitors' => [
                // IDs can be found in URL https://pingping.io/monitors/[0-9]+
            ],
            'refresh_interval_in_seconds' => 60,
        ],
    ],
];

In app\Console\Kernel.php you should schedule the \Astrotomic\PingPingTile\FetchPingPingMonitorsCommand to run. You can let it run every minute if you want. You could also run it less frequently if fast updates on the dashboard aren't that important for this tile.

// in app/console/Kernel.php

protected function schedule(Schedule $schedule)
{
    // ...
    $schedule->command(\Astrotomic\PingPingTile\FetchPingPingMonitorsCommand::class)->everyMinute();
}

Usage

In your dashboard view you use the livewire:pingping-tile component.

<x-dashboard>
    <livewire:pingping-tile position="a1" />
</x-dashboard>

Customizing the view

If you want to customize the view used to render this tile, run this command:

php artisan vendor:publish --provider="Astrotomic\PingPingTile\PingPingTileServiceProvider" --tag="dashboard-pingping-tile-views"

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details. You could also be interested in CODE OF CONDUCT.

Security

If you discover any security related issues, please check SECURITY for steps to report it.

Credits

License

The MIT License (MIT). Please see License file for more information.

Treeware

You're free to use this package, but if it makes it to your production environment I would highly appreciate you buying the world a tree.

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you contribute to my forest you’ll be creating employment for local families and restoring wildlife habitats.

You can buy trees at offset.earth/treeware

Read more about Treeware at treeware.earth