Compare commits
18 commits
backoffice
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad38d3b475 | ||
|
|
2053cae132 | ||
|
|
cdb4437be8 | ||
|
|
24104e836e | ||
|
|
14b8e8d569 | ||
|
|
12d14f8b7e | ||
|
|
85fb716340 | ||
|
|
ba64378f79 | ||
|
|
06c2493a76 | ||
|
|
59c5dbdae7 | ||
|
|
04e96131ad | ||
|
|
bc931e691c | ||
|
|
fa24157e68 | ||
|
|
993317cdef | ||
|
|
d7b7b14644 | ||
|
|
db99aa9588 | ||
|
|
19959a5bc0 | ||
|
|
61c8000cab |
11 changed files with 77 additions and 59 deletions
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.git
|
||||
*.md
|
||||
|
|
@ -18,7 +18,7 @@ DB_PASSWORD=
|
|||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=sync
|
||||
QUEUE_CONNECTION=database
|
||||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=120
|
||||
|
||||
|
|
@ -32,7 +32,10 @@ MAIL_FROM_ADDRESS="hello@example.com"
|
|||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
FACEBOOK_GRAPH_ACCESS_TOKEN=""
|
||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_IGHASHTAGID=
|
||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_HASHTAGID=
|
||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_USERID=
|
||||
# The amount of media to acquire
|
||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_NBMEDIA=
|
||||
|
||||
# Sentry
|
||||
SENTRY_LARAVEL_DSN=
|
||||
|
|
|
|||
|
|
@ -11,14 +11,9 @@ include:
|
|||
- project: 'ldc-web/shared-ci'
|
||||
ref: 'main'
|
||||
file: 'test/test.yml'
|
||||
- project: 'ldc-web/shared-ci'
|
||||
ref: 'main'
|
||||
file: 'deploy/deploy.yml'
|
||||
|
||||
|
||||
stages:
|
||||
- lint
|
||||
- security
|
||||
- build
|
||||
- test
|
||||
- deploy
|
||||
|
|
|
|||
7
Dockerfile
Normal file
7
Dockerfile
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
FROM registry.s-web.fr/ldc-web/projets/ldc-web-images-docker/ldcweb-production-8.2:latest
|
||||
COPY --chown=www-data:www-data . /app/srcs
|
||||
COPY --chown=www-data:www-data ./public/build /app/srcs/public/build
|
||||
COPY --chown=www-data:www-data ./vendor /app/srcs/vendor
|
||||
USER root
|
||||
RUN chmod -R 755 /app/srcs/storage
|
||||
USER www-data
|
||||
11
README.md
11
README.md
|
|
@ -12,15 +12,12 @@ php artisan migrate
|
|||
.env
|
||||
```
|
||||
FACEBOOK_GRAPH_ACCESS_TOKEN=""
|
||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_IGHASHTAGID=
|
||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_HASHTAGID=
|
||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_USERID=
|
||||
# The amount of media to acquire
|
||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_NBMEDIA=
|
||||
```
|
||||
|
||||
Commande :
|
||||
```
|
||||
php artisan insta:get-top-medias
|
||||
```
|
||||
cette commande appelle le Job : InstaGetTopMediasJob
|
||||
|
||||
### TODO:
|
||||
- Permettre la recherche d'un hashtag et d'utiliser son id pour topMediaList
|
||||
- Refresh le token en automatique si detection expired
|
||||
|
|
@ -40,6 +40,9 @@ class Handler extends ExceptionHandler
|
|||
public function register()
|
||||
{
|
||||
$this->reportable(function (Throwable $e) {
|
||||
if (app()->bound('sentry')) {
|
||||
app('sentry')->captureException($e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,9 +41,7 @@ class TopMediaController extends Controller
|
|||
);
|
||||
} //end if
|
||||
|
||||
$this->sortQuery($topMediaList);
|
||||
$searchFields = trans('Id Instagram, Participant, Lien');
|
||||
$topMediaList->orderBy('updated_at', 'DESC');
|
||||
$topMediaList = $topMediaList->paginate();
|
||||
|
||||
return \view('bo.pages.top-media.index', \compact('topMediaList', 'searchFields', 'ranking'));
|
||||
|
|
|
|||
|
|
@ -3,17 +3,16 @@
|
|||
namespace App\Http\Controllers\Fo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* Redirect to BO
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function index(): View
|
||||
public function index(): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
return view('fo.pages.home');
|
||||
return \redirect()->route('bo.dashboard');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,6 +126,22 @@ return [
|
|||
'emergency' => [
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
],
|
||||
|
||||
'stdout' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => StreamHandler::class,
|
||||
'formatter' => env('LOG_STDOUT_FORMATTER'),
|
||||
'with' => [
|
||||
'stream' => 'php://stdout',
|
||||
],
|
||||
],
|
||||
|
||||
'k8s' => [
|
||||
'driver' => 'stack',
|
||||
'channels' => ['daily', 'stdout'],
|
||||
'ignore_exceptions' => false,
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
User-agent: *
|
||||
Disallow:
|
||||
Disallow: /
|
||||
|
|
|
|||
|
|
@ -2,48 +2,46 @@
|
|||
<table class="table fix-action">
|
||||
<thead>
|
||||
@php
|
||||
$cols = [
|
||||
'id' => __('Classement'),
|
||||
'username' => __('Participant'),
|
||||
'timestamp' => __('Date de création du post')];
|
||||
$routeName = request()->route()->getName();
|
||||
$rst = !is_null(request()->rst) || !Session::has("$routeName.sorted");
|
||||
$noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way"));
|
||||
$noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way"));
|
||||
$cols = [
|
||||
'id' => __('Classement'),
|
||||
'username' => __('Participant'),
|
||||
'timestamp' => __('Date de création du post')];
|
||||
$routeName = request()->route()->getName();
|
||||
$rst = !is_null(request()->rst) || !Session::has("$routeName.sorted");
|
||||
$noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way"));
|
||||
$noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way"));
|
||||
@endphp
|
||||
@include('modules.table-col-sorter', [
|
||||
'cols' => $cols,
|
||||
'ignore' => ['total', 'timeslot_date', 'shop'],
|
||||
'mobileHide' => ['shop'],
|
||||
])
|
||||
<th>Classement</th>
|
||||
<th>Participant</th>
|
||||
<th>Date de création du post</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ($topMediaList->count())
|
||||
@foreach ($topMediaList as $topMediaModel)
|
||||
<tr>
|
||||
<td>
|
||||
<strong class="fs-{{ $ranking->get($topMediaModel->insta_id) + 1 }}">#{{ $ranking->get($topMediaModel->insta_id) + 1 }}</strong>
|
||||
</td>
|
||||
<td>{{ $topMediaModel->username }}</td>
|
||||
<td>
|
||||
{{ $topMediaModel->timestamp->isoFormat('LLLL') }}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ $topMediaModel->permalink }}" title="{{ __('Voir le media sur instagram') }}" target="_blank" data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-arrow-up-right-from-square"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@foreach ($topMediaList as $topMediaModel)
|
||||
<tr>
|
||||
<td>
|
||||
<strong class="fs-{{ $ranking->get($topMediaModel->insta_id) + 1 }}">#{{ $ranking->get($topMediaModel->insta_id) + 1 }}</strong>
|
||||
</td>
|
||||
<td>{{ $topMediaModel->username }}</td>
|
||||
<td>
|
||||
{{ $topMediaModel->timestamp->isoFormat('LLLL') }}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ $topMediaModel->permalink }}" title="{{ __('Voir le media sur instagram') }}" target="_blank" data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-arrow-up-right-from-square"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="11" class="text-center">
|
||||
<span
|
||||
class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.insta_media')]) }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="11" class="text-center">
|
||||
<span class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.insta_media')]) }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Add table
Reference in a new issue