Skip to content

Tile to add Ploi.io managed Server & Deployment status to laravel-dashboard

License

Notifications You must be signed in to change notification settings

vannut/laravel-dashboard-ploi-tile

Repository files navigation

Ploi.io Tile

Latest Version on Packagist Total Downloads

This package gives you tiles to display the status of your infrastructure managed with Ploi.io. It can add deployment status from one or multiple sites and the state of your server resources. For the latter you need a subscription which includes server-monitoring.

This tile can be used on the Laravel Dashboard.

Installation

You can install the package via composer:

composer require vannut/laravel-dashboard-ploi-tile

Usage

First obtain a personal access-token with the following permissions: read_servers & read_sites

Change your /config/dashboard.php to have a ploi entry in the dashboard.tiles array:

// ...
'tiles' => [
     // ...
    'ploi' => [
        // Your api token
        'api_token' => 'eyJ0eXAi.....',
        // the server which you want to show
        'servers' => [1234],
        // Sites for which you want to track deployments
        // serverId:siteId
        'sites' => [
            '1234:5678'
        ],
        // optional
        // 'alert_tresholds' => [
        //     'cpu' => 75,
        //     'ram' => 75,
        //     'disk' => 80
        // ],
        // 'deployment_refresh_interval_in_seconds' => 10
        // 'resources_refresh_interval_in_seconds' => 60
    ],
]

In app\Console\Kernel.php you need to schedule the commands below to run every x minutes. Off course only add the command(s) you need for your dashboard.

protected function schedule(Schedule $schedule)
{
    $schedule->command(Vannut\PloiTile\FetchDeploymentDataFromApiCommand::class)->everyMinute();
    // $schedule->command(Vannut\PloiTile\FetchResourcesDataFromApiCommand::class)->everyMinute(); not yet implemented
}

Components

In your dashboard you will have the following tiles at your disposal

<x-dashboard>
    <livewire:ploi-resources-tile position="a1:a6" />
    <livewire:ploi-deployments-tile position="b1:b6" />
    <livewire:ploi-single-deployment-tile
        position="c1"
        id="1234:5678"
        />
</x-dashboard>

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email security@vannut.nl instead of using the issue tracker.

Credits

License

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

About

Tile to add Ploi.io managed Server & Deployment status to laravel-dashboard

Topics

Resources

License

Stars

Watchers

Forks