ajout heimdall
This commit is contained in:
45
heimdall/config/www/SupportedApps/Tautulli/Tautulli.php
Executable file
45
heimdall/config/www/SupportedApps/Tautulli/Tautulli.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php namespace App\SupportedApps\Tautulli;
|
||||
|
||||
class Tautulli extends \App\SupportedApps implements \App\EnhancedApps {
|
||||
|
||||
public $config;
|
||||
|
||||
//protected $login_first = true; // Uncomment if api requests need to be authed first
|
||||
//protected $method = 'POST'; // Uncomment if requests to the API should be set by POST
|
||||
|
||||
function __construct() {
|
||||
//$this->jar = new \GuzzleHttp\Cookie\CookieJar; // Uncomment if cookies need to be set
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
$test = parent::appTest($this->url('arnold'));
|
||||
if($test->code === 200) {
|
||||
$data = json_decode($test->response);
|
||||
if(isset($data->error) && !empty($data->error)) {
|
||||
$test->status = 'Failed: '.$data->error;
|
||||
}
|
||||
}
|
||||
|
||||
echo $test->status;
|
||||
}
|
||||
|
||||
public function livestats()
|
||||
{
|
||||
$status = 'inactive';
|
||||
$res = parent::execute($this->url('get_activity'));
|
||||
$details = json_decode($res->getBody());
|
||||
|
||||
$data['stream_count'] = $details->response->data->stream_count ?? 0;
|
||||
|
||||
return parent::getLiveStats($status, $data);
|
||||
|
||||
}
|
||||
public function url($endpoint)
|
||||
{
|
||||
$apikey = $this->config->apikey;
|
||||
$api_url = parent::normaliseurl($this->config->url).'api/v2?apikey='.$apikey.'&cmd='.$endpoint;
|
||||
|
||||
return $api_url;
|
||||
}
|
||||
}
|
||||
10
heimdall/config/www/SupportedApps/Tautulli/app.json
Executable file
10
heimdall/config/www/SupportedApps/Tautulli/app.json
Executable file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"appid": "93ce76191583a25ac33c1918c5ad0b8a5f260451",
|
||||
"name": "Tautulli",
|
||||
"website": "https://tautulli.com/",
|
||||
"license": "GNU General Public License v3.0 only",
|
||||
"description": "A python based web application for monitoring, analytics and notifications for Plex Media Server.",
|
||||
"enhanced": true,
|
||||
"tile_background": "light",
|
||||
"icon": "tautulli.png"
|
||||
}
|
||||
15
heimdall/config/www/SupportedApps/Tautulli/config.blade.php
Executable file
15
heimdall/config/www/SupportedApps/Tautulli/config.blade.php
Executable file
@@ -0,0 +1,15 @@
|
||||
<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">
|
||||
<label>{{ __('app.apps.apikey') }}</label>
|
||||
{!! Form::text('config[apikey]', (isset($item) ? $item->getconfig()->apikey : null), array('placeholder' => __('app.apps.apikey'), 'data-config' => 'apikey', 'class' => 'form-control config-item')) !!}
|
||||
</div>
|
||||
<div class="input">
|
||||
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
6
heimdall/config/www/SupportedApps/Tautulli/livestats.blade.php
Executable file
6
heimdall/config/www/SupportedApps/Tautulli/livestats.blade.php
Executable file
@@ -0,0 +1,6 @@
|
||||
<ul class="livestats">
|
||||
<li>
|
||||
<span class="title">Stream Count</span>
|
||||
<strong>{!! $stream_count !!}</strong>
|
||||
</li>
|
||||
</ul>
|
||||
BIN
heimdall/config/www/SupportedApps/Tautulli/tautulli.png
Executable file
BIN
heimdall/config/www/SupportedApps/Tautulli/tautulli.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
Reference in New Issue
Block a user