Skip to content

Commit

Permalink
Create the 'FaqSentinel' and 'FaqAdversaryMeter' components.
Browse files Browse the repository at this point in the history
  • Loading branch information
csavelief committed Oct 13, 2024
1 parent 9896161 commit 0d68eaa
Show file tree
Hide file tree
Showing 10 changed files with 245 additions and 152 deletions.
53 changes: 53 additions & 0 deletions app/View/Components/BigNumber.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

namespace App\View\Components;

use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Number;
use Illuminate\View\Component;

class BigNumber extends Component
{
public string $number;
public string $title;
public string $color;
public string $icon;

public function __construct(int $number, string $title, string $icon, string $color)
{
$this->number = Number::format($number, locale: 'sv'); // 1 000 000
$this->title = $title;
$this->color = $color;
$this->icon = $this->icon($icon);
}

public function render(): View|Closure|string
{
return view('components.big-number');
}

private function icon(string $icon): string
{
// SVG from https://tabler.io/icons
if ($icon === 'ip') {
return '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M20.972 11.291a9 9 0 1 0 -8.322 9.686" /><path d="M3.6 9h16.8" /><path d="M3.6 15h8.9" /><path d="M11.5 3a17 17 0 0 0 0 18" /><path d="M12.5 3a16.986 16.986 0 0 1 2.578 9.018" /><path d="M21.121 20.121a3 3 0 1 0 -4.242 0c.418 .419 1.125 1.045 2.121 1.879c1.051 -.89 1.759 -1.516 2.121 -1.879z" /><path d="M19 18v.01" /></svg>';
}
if ($icon === 'dns') {
return '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M19.5 7a9 9 0 0 0 -7.5 -4a8.991 8.991 0 0 0 -7.484 4" /><path d="M11.5 3a16.989 16.989 0 0 0 -1.826 4" /><path d="M12.5 3a16.989 16.989 0 0 1 1.828 4" /><path d="M19.5 17a9 9 0 0 1 -7.5 4a8.991 8.991 0 0 1 -7.484 -4" /><path d="M11.5 21a16.989 16.989 0 0 1 -1.826 -4" /><path d="M12.5 21a16.989 16.989 0 0 0 1.828 -4" /><path d="M2 10l1 4l1.5 -4l1.5 4l1 -4" /><path d="M17 10l1 4l1.5 -4l1.5 4l1 -4" /><path d="M9.5 10l1 4l1.5 -4l1.5 4l1 -4" /></svg>';
}
if ($icon === 'server') {
return '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z" /><path d="M3 12m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z" /><path d="M7 8l0 .01" /><path d="M7 16l0 .01" /></svg>';
}
if ($icon === 'vulnerability') {
return '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /><path d="M12 9v4" /><path d="M12 16v.01" /></svg>';
}
if ($icon === 'metric') {
return '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 12h4.5l1.5 -6l4 12l2 -9l1.5 3h4.5" /></svg>';
}
if ($icon === 'event') {
return '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 16l6 -7l5 5l5 -6" /><path d="M15 14m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M10 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M4 16m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M20 8m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /></svg>';
}
return '';
}
}
20 changes: 20 additions & 0 deletions app/View/Components/FaqAdversaryMeter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\View\Components;

use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;

class FaqAdversaryMeter extends Component
{
public function __construct()
{
//
}

public function render(): View|Closure|string
{
return view('components.faq-adversary-meter');
}
}
20 changes: 20 additions & 0 deletions app/View/Components/FaqSentinel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\View\Components;

use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;

class FaqSentinel extends Component
{
public function __construct()
{
//
}

public function render(): View|Closure|string
{
return view('components.faq-sentinel');
}
}
5 changes: 4 additions & 1 deletion resources/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,8 @@
"Attackers": "Attaquants",
"Reports & Alerts": "Rapports & Alertes",
"IP Blacklist": "IP à blacklister",
"Service Provider Delegation": "Délégation"
"Service Provider Delegation": "Délégation",
"Agents Deployed": "Agents déployés",
"AdversaryMeter protects your external perimeter": "AdversaryMeter protège votre périmètre externe",
"Sentinel protects your internal perimeter": "Sentinel protège votre périmètre interne"
}
20 changes: 20 additions & 0 deletions resources/views/components/big-number.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class="card">
<div class="card-body p-3">
<div class="row align-items-center">
<div class="col-auto">
<div class="d-flex align-content-center" style="background-color:{{ $color }} !important;">
<span class="bg-primary text-white avatar" style="background-color:{{ $color }} !important;">
{!! $icon !!}
</div>
</div>
<div class="col">
<div class="font-weight-medium">
<b>{{ $number }}</b>
</div>
<div style="opacity:.55">
{{ $title }}
</div>
</div>
</div>
</div>
</div>
24 changes: 24 additions & 0 deletions resources/views/components/faq-adversary-meter.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div class="card">
<div class="card-body">
<h6 class="card-title">{{ __('AdversaryMeter protects your external perimeter') }}</h6>
<div class="row">
<div class="col">
AdversaryMeter est votre garde du corps numérique. <b>Il veille sur vos serveurs exposés sur Internet</b> en
détectant les vulnérabilités avant que des acteurs malveillants ne les exploitent.
</div>
</div>
<div class="row mt-2">
<div class="col">
Pour configurer AdversaryMeter, cliquez <a
href="{{ App\Modules\AdversaryMeter\Helpers\AdversaryMeter::redirectUrl() }}" target="_blank">ici</a>.
</div>
</div>
<div class="row mt-2">
<div class="col">
Pour accéder à la documentation détaillée, cliquez <a
href="https://computablefacts.notion.site/AdversaryMeter-a30527edc0554ea8aabf7cb7d0137258?pvs=4"
target="_blank">ici</a>.
</div>
</div>
</div>
</div>
22 changes: 22 additions & 0 deletions resources/views/components/faq-sentinel.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div class="card">
<div class="card-body">
<h6 class="card-title">{{ __('Sentinel protects your internal perimeter') }}</h6>
<div class="row">
<div class="col">
Sentinel est votre vigile numérique. <b>Il surveille en continu l'état de vos serveurs</b>, remontant
rapidement toute anomalie ou non-conformité afin de prévenir les risques avant qu'ils ne deviennent des
menaces réelles.
</div>
</div>
<div class="row mt-2">
<div class="col">
Pour configurer Sentinel, connectez-vous en <i>root</i> au serveur que vous souhaitez surveiller et exécutez
cette ligne de commande :
<br><br>
<pre style="margin-bottom:0">
curl -s "{{ app_url() }}/setup/script?api_token={{ Auth::user()->sentinelApiToken() }}&server_ip=$(curl -s ipinfo.io | jq -r '.ip')" | bash
</pre>
</div>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion resources/views/components/monitor-asset.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="card">
<div class="card-body">
<h5 class="card-title">{{ __('Excited to get started ?') }}</h5>
<h6 class="card-title">{{ __('Excited to get started ?') }}</h6>
<div class="card-text mb-3">
{{ __('Enter a domain name or an IP address belonging to you below :') }}
</div>
Expand Down
Loading

0 comments on commit 0d68eaa

Please sign in to comment.