Skip to content

Commit 10985b2

Browse files
authored
Enhanced argus (#776)
* Default files Commit * update * Fix white space * fix whitespace
1 parent ab5c91f commit 10985b2

File tree

5 files changed

+79
-0
lines changed

5 files changed

+79
-0
lines changed

Argus/Argus.php

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace App\SupportedApps\Argus;
4+
5+
class Argus extends \App\SupportedApps implements \App\EnhancedApps
6+
{
7+
public $config;
8+
9+
//protected $login_first = true; // Uncomment if api requests need to be authed first
10+
//protected $method = 'POST'; // Uncomment if requests to the API should be set by POST
11+
12+
public function __construct()
13+
{
14+
//$this->jar = new \GuzzleHttp\Cookie\CookieJar; // Uncomment if cookies need to be set
15+
}
16+
17+
public function test()
18+
{
19+
$test = parent::appTest($this->url(endpoint: "/healthcheck"));
20+
echo $test->status;
21+
}
22+
23+
public function livestats()
24+
{
25+
$status = 'inactive';
26+
$res = parent::execute($this->url('status'));
27+
$details = json_decode($res->getBody());
28+
29+
$data = [];
30+
return parent::getLiveStats($status, $data);
31+
}
32+
public function url($endpoint)
33+
{
34+
$api_url = parent::normaliseurl($this->config->url) . "/api/v1" . $endpoint;
35+
return $api_url;
36+
}
37+
}

Argus/app.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"appid": "80fd108a3d7a5a3c4e2cd0c4da36c943099e006e",
3+
"name": "Argus",
4+
"website": "https://github.com/release-argus/Argus",
5+
"license": "Apache License 2.0",
6+
"description": "Argus is a lightweight monitor to notify of new software releases via Gotify/Slack/other messages and/or WebHooks.",
7+
"enhanced": true,
8+
"tile_background": "dark",
9+
"icon": "argus.png"
10+
}

Argus/argus.png

9.02 KB
Loading

Argus/config.blade.php

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<h2>{{ __('app.apps.config') }} ({{ __('app.optional') }}) @include('items.enable')</h2>
2+
<div class="items">
3+
<div class="input">
4+
<label>{{ strtoupper(__('app.url')) }}</label>
5+
{!! Form::text('config[override_url]', null, array('placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control')) !!}
6+
</div>
7+
<!-- <div class="input">
8+
<label>{{ __('app.apps.username') }}</label>
9+
{!! Form::text('config[username]', null, array('placeholder' => __('app.apps.username'), 'data-config' => 'username', 'class' => 'form-control config-item')) !!}
10+
</div>
11+
<div class="input">
12+
<label>{{ __('app.apps.password') }}</label>
13+
{!! Form::input('password', 'config[password]', '', ['placeholder' => __('app.apps.password'), 'data-config' => 'password', 'class' => 'form-control config-item']) !!}
14+
</div> -->
15+
<div class="input">
16+
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
17+
</div>
18+
</div>

Argus/livestats.blade.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<ul class="livestats">
2+
<li>
3+
<span class="title">Services</span>
4+
<strong>{!! $services !!}</strong>
5+
</li>
6+
<li>
7+
<span class="title">Updates Available</span>
8+
<strong>{!! $updatesavailable !!}</strong>
9+
</li>
10+
<li>
11+
<span class="title">Updates Skipped</span>
12+
<strong>{!! $updatesskipped !!}</strong>
13+
</li>
14+
</ul>

0 commit comments

Comments
 (0)