ajout heimdall
This commit is contained in:
50
heimdall/config/www/SupportedApps/Heimdall/Heimdall.php
Executable file
50
heimdall/config/www/SupportedApps/Heimdall/Heimdall.php
Executable file
@@ -0,0 +1,50 @@
|
||||
<?php namespace App\SupportedApps\Heimdall;
|
||||
|
||||
class Heimdall extends \App\SupportedApps implements \App\EnhancedApps
|
||||
{
|
||||
|
||||
public $config;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
$test = parent::appTest($this->url('health'));
|
||||
echo $test->status;
|
||||
}
|
||||
|
||||
public function livestats()
|
||||
{
|
||||
$status = 'inactive';
|
||||
$res = parent::execute($this->url('health'));
|
||||
|
||||
if ($res->getStatusCode() > 299) {
|
||||
$data = [
|
||||
'error' => true,
|
||||
'statusCode' => $res->getStatusCode(),
|
||||
'items' => 0,
|
||||
'users' => 0,
|
||||
];
|
||||
return parent::getLiveStats($status, $data);
|
||||
}
|
||||
|
||||
$details = json_decode($res->getBody());
|
||||
|
||||
$data = [
|
||||
'error' => false,
|
||||
'statusCode' => $res->getStatusCode(),
|
||||
'items' => $details->items,
|
||||
'users' => $details->users,
|
||||
];
|
||||
|
||||
return parent::getLiveStats($status, $data);
|
||||
}
|
||||
|
||||
public function url($endpoint)
|
||||
{
|
||||
$api_url = parent::normaliseurl($this->config->url) . $endpoint;
|
||||
return $api_url;
|
||||
}
|
||||
}
|
||||
10
heimdall/config/www/SupportedApps/Heimdall/app.json
Executable file
10
heimdall/config/www/SupportedApps/Heimdall/app.json
Executable file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"appid": "b2005b3bb19b3916425998c0edd72b97667ec1fc",
|
||||
"name": "Heimdall",
|
||||
"website": "https://heimdall.site/",
|
||||
"license": "MIT License",
|
||||
"description": "As the name suggests Heimdall Application Dashboard is a dashboard for all your web applications. It doesn't need to be limited to applications though, you can add links to anything you like.\r\nHeimdall is an elegant solution to organise all your web applications. It’s dedicated to this purpose so you won’t lose your links in a sea of bookmarks.\r\nWhy not use it as your browser start page? It even has the ability to include a search bar using either Google, Bing or DuckDuckGo.",
|
||||
"enhanced": true,
|
||||
"tile_background": "dark",
|
||||
"icon": "heimdall.png"
|
||||
}
|
||||
11
heimdall/config/www/SupportedApps/Heimdall/config.blade.php
Executable file
11
heimdall/config/www/SupportedApps/Heimdall/config.blade.php
Executable file
@@ -0,0 +1,11 @@
|
||||
<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]', 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>
|
||||
|
||||
17
heimdall/config/www/SupportedApps/Heimdall/livestats.blade.php
Executable file
17
heimdall/config/www/SupportedApps/Heimdall/livestats.blade.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<ul class="livestats">
|
||||
@if($error === true)
|
||||
<li>
|
||||
<span class="title">Error</span>
|
||||
<strong>{!! $statusCode !!}</strong>
|
||||
</li>
|
||||
@else
|
||||
<li>
|
||||
<span class="title">Users</span>
|
||||
<strong>{!! $users !!}</strong>
|
||||
</li>
|
||||
<li>
|
||||
<span class="title">Items</span>
|
||||
<strong>{!! $items !!}</strong>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
Reference in New Issue
Block a user