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,49 @@
<?php namespace App\SupportedApps\Monica;
class Monica 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('api/contacts'));
echo $test->status;
}
public function livestats()
{
$status = 'inactive';
$res = parent::execute($this->url('api/contacts'), $this->attrs());
$details = json_decode($res->getBody(), True);
$data = [];
if($details) {
$data['contacts'] = $details['meta']['total'] ?? 0;
}
return parent::getLiveStats($status, $data);
}
public function url($endpoint)
{
$api_url = parent::normaliseurl($this->config->url).$endpoint;
return $api_url;
}
public function attrs()
{
$apikey = $this->config->apikey;
$attrs = [
'headers' => ['content-type' => 'application/json', 'Authorization' => 'Bearer '.$apikey]
];
return $attrs;
}
}

View File

@@ -0,0 +1,10 @@
{
"appid": "96d53734fc1bd54d848cd30f98069b90333b1bb3",
"name": "Monica",
"website": "https://www.monicahq.com/",
"license": "GNU Affero General Public License v3.0 only",
"description": "Monica is an open-source web application to organize the interactions with your loved ones. We call it a PRM, or Personal Relationship Management. Think of it as a CRM for your friends or family.",
"enhanced": true,
"tile_background": "light",
"icon": "monica.png"
}

View 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]', 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]', 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>

View File

@@ -0,0 +1,6 @@
<ul class="livestats">
<li>
<span class="title">Contacts</span>
<strong>{!! $contacts !!}</strong>
</li>
</ul>

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB