ajout heimdall
This commit is contained in:
39
heimdall/config/www/SupportedApps/Miniflux/Miniflux.php
Executable file
39
heimdall/config/www/SupportedApps/Miniflux/Miniflux.php
Executable file
@@ -0,0 +1,39 @@
|
||||
<?php namespace App\SupportedApps\Miniflux;
|
||||
|
||||
class Miniflux extends \App\SupportedApps implements \App\EnhancedApps {
|
||||
private const ENDPOINT = 'v1/entries?status=unread';
|
||||
|
||||
public $config;
|
||||
public $attrs = [];
|
||||
|
||||
function __construct() {
|
||||
}
|
||||
|
||||
private function setClientOptions() {
|
||||
if ($this->config->username != '' || $this->config->password != '') {
|
||||
$this->attrs = ['auth'=> [$this->config->username, $this->config->password]];
|
||||
}
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
$this->setClientOptions();
|
||||
$test = parent::appTest($this->url(self::ENDPOINT), $this->attrs);
|
||||
echo $test->status;
|
||||
}
|
||||
|
||||
public function livestats()
|
||||
{
|
||||
$this->setClientOptions();
|
||||
$res = parent::execute($this->url(self::ENDPOINT), $this->attrs);
|
||||
$details = json_decode($res->getBody());
|
||||
|
||||
$data['count_unread'] = $details->total;
|
||||
return parent::getLiveStats('inactive', $data);
|
||||
}
|
||||
|
||||
public function url($endpoint)
|
||||
{
|
||||
return parent::normaliseurl($this->config->url).$endpoint;
|
||||
}
|
||||
}
|
||||
10
heimdall/config/www/SupportedApps/Miniflux/app.json
Executable file
10
heimdall/config/www/SupportedApps/Miniflux/app.json
Executable file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"appid": "f1a89a23921939fc4ea89777cf9c7d6c08679fde",
|
||||
"name": "Miniflux",
|
||||
"website": "https://miniflux.app/",
|
||||
"license": "Apache License 2.0",
|
||||
"description": "Miniflux is a lightweight RSS feed reader app.",
|
||||
"enhanced": true,
|
||||
"tile_background": "dark",
|
||||
"icon": "miniflux.png"
|
||||
}
|
||||
19
heimdall/config/www/SupportedApps/Miniflux/config.blade.php
Executable file
19
heimdall/config/www/SupportedApps/Miniflux/config.blade.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<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">
|
||||
<label>{{ __('app.apps.username') }}</label>
|
||||
{!! Form::text('config[username]', null, array('placeholder' => __('app.apps.username'), 'data-config' => 'username', 'class' => 'form-control config-item')) !!}
|
||||
</div>
|
||||
<div class="input">
|
||||
<label>{{ __('app.apps.password') }}</label>
|
||||
{!! Form::password('config[password]', array('placeholder' => __('app.apps.password'), 'data-config' => 'password', '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/Miniflux/livestats.blade.php
Executable file
6
heimdall/config/www/SupportedApps/Miniflux/livestats.blade.php
Executable file
@@ -0,0 +1,6 @@
|
||||
<ul class="livestats">
|
||||
<li>
|
||||
<span class="title">Unread entries</span>
|
||||
<strong>{!! $count_unread !!}</strong>
|
||||
</li>
|
||||
</ul>
|
||||
BIN
heimdall/config/www/SupportedApps/Miniflux/miniflux.png
Executable file
BIN
heimdall/config/www/SupportedApps/Miniflux/miniflux.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Reference in New Issue
Block a user