ajout heimdall
This commit is contained in:
61
heimdall/config/www/SupportedApps/Jellyseerr/Jellyseerr.php
Executable file
61
heimdall/config/www/SupportedApps/Jellyseerr/Jellyseerr.php
Executable file
@@ -0,0 +1,61 @@
|
||||
<?php namespace App\SupportedApps\Jellyseerr;
|
||||
|
||||
class Jellyseerr 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()
|
||||
{
|
||||
$this->attrs["headers"] = [
|
||||
"accept" => "application/json",
|
||||
"X-Api-Key" => $this->config->apikey,
|
||||
];
|
||||
|
||||
$test = parent::appTest($this->url("auth/me"), $this->attrs);
|
||||
|
||||
echo $test->status;
|
||||
}
|
||||
|
||||
public function livestats()
|
||||
{
|
||||
$status = "inactive";
|
||||
$data = [];
|
||||
$this->attrs["headers"] = [
|
||||
"accept" => "application/json",
|
||||
"X-Api-Key" => $this->config->apikey,
|
||||
];
|
||||
|
||||
$pendingRequestsCount = json_decode(
|
||||
parent::execute($this->url("request/count"), $this->attrs)->getBody()
|
||||
);
|
||||
|
||||
$pendingIssueCount = json_decode(
|
||||
parent::execute($this->url("issue/count"), $this->attrs)->getBody()
|
||||
);
|
||||
|
||||
if ($pendingRequestsCount || $pendingIssueCount)
|
||||
{
|
||||
$data["requests"] = $pendingRequestsCount->pending ?? 0;
|
||||
$data["issues"] = $pendingIssueCount->open ?? 0;
|
||||
}
|
||||
|
||||
return parent::getLiveStats($status, $data);
|
||||
}
|
||||
|
||||
public function url($endpoint)
|
||||
{
|
||||
$api_url =
|
||||
parent::normaliseurl($this->config->url) .
|
||||
"api/v1/" .
|
||||
$endpoint;
|
||||
|
||||
return $api_url;
|
||||
}
|
||||
}
|
||||
10
heimdall/config/www/SupportedApps/Jellyseerr/app.json
Executable file
10
heimdall/config/www/SupportedApps/Jellyseerr/app.json
Executable file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"appid": "0628c8d1a4868d6e6b994ae43a091f4e142ce642",
|
||||
"name": "Jellyseerr",
|
||||
"website": "https://github.com/Fallenbagel/jellyseerr",
|
||||
"license": "MIT License",
|
||||
"description": "Jellyseerr is a free and open source software application for managing requests for your media library. It is a a fork of Overseerr built to bring support for Jellyfin & Emby media servers!",
|
||||
"enhanced": true,
|
||||
"tile_background": "dark",
|
||||
"icon": "jellyseerr.png"
|
||||
}
|
||||
14
heimdall/config/www/SupportedApps/Jellyseerr/config.blade.php
Executable file
14
heimdall/config/www/SupportedApps/Jellyseerr/config.blade.php
Executable file
@@ -0,0 +1,14 @@
|
||||
<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, ['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, ['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>
|
||||
10
heimdall/config/www/SupportedApps/Jellyseerr/livestats.blade.php
Executable file
10
heimdall/config/www/SupportedApps/Jellyseerr/livestats.blade.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<ul class="livestats">
|
||||
<li>
|
||||
<span class="title">Requests</span>
|
||||
<strong>{!! $requests !!}</strong>
|
||||
</li>
|
||||
<li>
|
||||
<span class="title">Issues</span>
|
||||
<strong>{!! $issues !!}</strong>
|
||||
</li>
|
||||
</ul>
|
||||
Reference in New Issue
Block a user