ajout heimdall

This commit is contained in:
2025-01-01 11:24:01 +01:00
parent f8be42e486
commit c52f60fca9
1477 changed files with 15692 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
<?php namespace App\SupportedApps\Cabot;
class Cabot extends \App\SupportedApps implements \App\EnhancedApps {
private const ENDPOINT = 'api/services/?format=json';
private const STATUS_PASSING = 'Passing';
private const STATUS_WARNING = 'Warning';
private const STATUS_ERROR = 'Error';
private const STATUS_CRITICAL = 'Critical';
public $config;
public function test()
{
$test = parent::appTest($this->url(self::ENDPOINT));
echo $test->status;
}
public function livestats()
{
$result = parent::execute($this->url(self::ENDPOINT));
$services = json_decode($result->getBody());
$results = [
self::STATUS_PASSING => 0,
self::STATUS_WARNING => 0,
self::STATUS_ERROR => 0,
self::STATUS_CRITICAL => 0,
];
foreach ($services as $service) {
$overallStatus = ucfirst(strtolower($service->overall_status ?? ''));
if (isset($results[$overallStatus])) {
$results[$overallStatus]++;
}
}
if ($results[self::STATUS_CRITICAL] > 0) {
$status = self::STATUS_CRITICAL;
} elseif ($results[self::STATUS_ERROR] > 0) {
$status = self::STATUS_ERROR;
} elseif ($results[self::STATUS_WARNING] > 0) {
$status = self::STATUS_WARNING;
} else {
$status = self::STATUS_PASSING;
}
$data['status_output'] = $status;
$data['count_output'] = $results[$status];
return parent::getLiveStats('inactive', $data);
}
public function url($endpoint)
{
$api_url = parent::normaliseurl($this->config->url).$endpoint;
return $api_url;
}
}

View File

@@ -0,0 +1,10 @@
{
"appid": "36cf09d76e7173b82ef23504aae37c05784b0215",
"name": "Cabot",
"website": "https://cabotapp.com",
"license": "MIT License",
"description": "Self-hosted watchdog for your websites and infrastructure.",
"enhanced": true,
"tile_background": "light",
"icon": "cabot.png"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,10 @@
<h2>{{ __('app.apps.config') }} ({{ __('app.optional') }}) @include('items.enable')</h2>
<div class="items">
<div class="input">
<label>{{ strtoupper(__('app.url')) }}</label>
{!! Form::text('config[override_url]', (isset($item) ? $item->getconfig()->override_url : null), array('placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control')) !!}
</div>
<div class="input">
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
</div>
</div>

View File

@@ -0,0 +1,6 @@
<ul class="livestats">
<li>
<span class="title">Overall Status</span>
<strong>{!! $count_output !!} {!! $status_output !!}</strong>
</li>
</ul>