Skip to content

Commit

Permalink
Enhanced argus (#776)
Browse files Browse the repository at this point in the history
* Default files Commit

* update

* Fix white space

* fix whitespace
  • Loading branch information
PedroBuffon authored Sep 22, 2024
1 parent ab5c91f commit 10985b2
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Argus/Argus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace App\SupportedApps\Argus;

class Argus 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

public function __construct()
{
//$this->jar = new \GuzzleHttp\Cookie\CookieJar; // Uncomment if cookies need to be set
}

public function test()
{
$test = parent::appTest($this->url(endpoint: "/healthcheck"));
echo $test->status;
}

public function livestats()
{
$status = 'inactive';
$res = parent::execute($this->url('status'));
$details = json_decode($res->getBody());

$data = [];
return parent::getLiveStats($status, $data);
}
public function url($endpoint)
{
$api_url = parent::normaliseurl($this->config->url) . "/api/v1" . $endpoint;
return $api_url;
}
}
10 changes: 10 additions & 0 deletions Argus/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"appid": "80fd108a3d7a5a3c4e2cd0c4da36c943099e006e",
"name": "Argus",
"website": "https://github.com/release-argus/Argus",
"license": "Apache License 2.0",
"description": "Argus is a lightweight monitor to notify of new software releases via Gotify/Slack/other messages and/or WebHooks.",
"enhanced": true,
"tile_background": "dark",
"icon": "argus.png"
}
Binary file added Argus/argus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Argus/config.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<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::input('password', 'config[password]', '', ['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>
14 changes: 14 additions & 0 deletions Argus/livestats.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<ul class="livestats">
<li>
<span class="title">Services</span>
<strong>{!! $services !!}</strong>
</li>
<li>
<span class="title">Updates Available</span>
<strong>{!! $updatesavailable !!}</strong>
</li>
<li>
<span class="title">Updates Skipped</span>
<strong>{!! $updatesskipped !!}</strong>
</li>
</ul>

0 comments on commit 10985b2

Please sign in to comment.