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
|
BROADCAST_DRIVER=log
|
||||||
CACHE_DRIVER=file
|
CACHE_DRIVER=file
|
||||||
FILESYSTEM_DISK=local
|
FILESYSTEM_DISK=local
|
||||||
QUEUE_CONNECTION=sync
|
QUEUE_CONNECTION=database
|
||||||
SESSION_DRIVER=file
|
SESSION_DRIVER=file
|
||||||
SESSION_LIFETIME=120
|
SESSION_LIFETIME=120
|
||||||
|
|
||||||
|
|
@ -32,7 +32,10 @@ MAIL_FROM_ADDRESS="hello@example.com"
|
||||||
MAIL_FROM_NAME="${APP_NAME}"
|
MAIL_FROM_NAME="${APP_NAME}"
|
||||||
|
|
||||||
FACEBOOK_GRAPH_ACCESS_TOKEN=""
|
FACEBOOK_GRAPH_ACCESS_TOKEN=""
|
||||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_IGHASHTAGID=
|
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_HASHTAGID=
|
||||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_USERID=
|
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_USERID=
|
||||||
# The amount of media to acquire
|
# The amount of media to acquire
|
||||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_NBMEDIA=
|
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_NBMEDIA=
|
||||||
|
|
||||||
|
# Sentry
|
||||||
|
SENTRY_LARAVEL_DSN=
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,9 @@ include:
|
||||||
- project: 'ldc-web/shared-ci'
|
- project: 'ldc-web/shared-ci'
|
||||||
ref: 'main'
|
ref: 'main'
|
||||||
file: 'test/test.yml'
|
file: 'test/test.yml'
|
||||||
- project: 'ldc-web/shared-ci'
|
|
||||||
ref: 'main'
|
|
||||||
file: 'deploy/deploy.yml'
|
|
||||||
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- lint
|
- lint
|
||||||
- security
|
- security
|
||||||
- build
|
- build
|
||||||
- test
|
- 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
|
.env
|
||||||
```
|
```
|
||||||
FACEBOOK_GRAPH_ACCESS_TOKEN=""
|
FACEBOOK_GRAPH_ACCESS_TOKEN=""
|
||||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_IGHASHTAGID=
|
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_HASHTAGID=
|
||||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_USERID=
|
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:
|
### TODO:
|
||||||
- Permettre la recherche d'un hashtag et d'utiliser son id pour topMediaList
|
- 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()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->reportable(function (Throwable $e) {
|
$this->reportable(function (Throwable $e) {
|
||||||
|
if (app()->bound('sentry')) {
|
||||||
|
app('sentry')->captureException($e);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,7 @@ class TopMediaController extends Controller
|
||||||
);
|
);
|
||||||
} //end if
|
} //end if
|
||||||
|
|
||||||
$this->sortQuery($topMediaList);
|
|
||||||
$searchFields = trans('Id Instagram, Participant, Lien');
|
$searchFields = trans('Id Instagram, Participant, Lien');
|
||||||
$topMediaList->orderBy('updated_at', 'DESC');
|
|
||||||
$topMediaList = $topMediaList->paginate();
|
$topMediaList = $topMediaList->paginate();
|
||||||
|
|
||||||
return \view('bo.pages.top-media.index', \compact('topMediaList', 'searchFields', 'ranking'));
|
return \view('bo.pages.top-media.index', \compact('topMediaList', 'searchFields', 'ranking'));
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,16 @@
|
||||||
namespace App\Http\Controllers\Fo;
|
namespace App\Http\Controllers\Fo;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Illuminate\Contracts\View\View;
|
|
||||||
|
|
||||||
class HomeController extends Controller
|
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' => [
|
'emergency' => [
|
||||||
'path' => storage_path('logs/laravel.log'),
|
'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: *
|
User-agent: *
|
||||||
Disallow:
|
Disallow: /
|
||||||
|
|
|
||||||
|
|
@ -2,47 +2,45 @@
|
||||||
<table class="table fix-action">
|
<table class="table fix-action">
|
||||||
<thead>
|
<thead>
|
||||||
@php
|
@php
|
||||||
$cols = [
|
$cols = [
|
||||||
'id' => __('Classement'),
|
'id' => __('Classement'),
|
||||||
'username' => __('Participant'),
|
'username' => __('Participant'),
|
||||||
'timestamp' => __('Date de création du post')];
|
'timestamp' => __('Date de création du post')];
|
||||||
$routeName = request()->route()->getName();
|
$routeName = request()->route()->getName();
|
||||||
$rst = !is_null(request()->rst) || !Session::has("$routeName.sorted");
|
$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") !== '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"));
|
$noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way"));
|
||||||
@endphp
|
@endphp
|
||||||
@include('modules.table-col-sorter', [
|
<th>Classement</th>
|
||||||
'cols' => $cols,
|
<th>Participant</th>
|
||||||
'ignore' => ['total', 'timeslot_date', 'shop'],
|
<th>Date de création du post</th>
|
||||||
'mobileHide' => ['shop'],
|
<th></th>
|
||||||
])
|
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@if ($topMediaList->count())
|
@if ($topMediaList->count())
|
||||||
@foreach ($topMediaList as $topMediaModel)
|
@foreach ($topMediaList as $topMediaModel)
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<strong class="fs-{{ $ranking->get($topMediaModel->insta_id) + 1 }}">#{{ $ranking->get($topMediaModel->insta_id) + 1 }}</strong>
|
<strong class="fs-{{ $ranking->get($topMediaModel->insta_id) + 1 }}">#{{ $ranking->get($topMediaModel->insta_id) + 1 }}</strong>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ $topMediaModel->username }}</td>
|
<td>{{ $topMediaModel->username }}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ $topMediaModel->timestamp->isoFormat('LLLL') }}
|
{{ $topMediaModel->timestamp->isoFormat('LLLL') }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ $topMediaModel->permalink }}" title="{{ __('Voir le media sur instagram') }}" target="_blank" data-bs-toggle="tooltip">
|
<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>
|
<i class="fa-solid fa-arrow-up-right-from-square"></i>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
@else
|
@else
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="11" class="text-center">
|
<td colspan="11" class="text-center">
|
||||||
<span
|
<span class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.insta_media')]) }}
|
||||||
class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.insta_media')]) }}
|
</span>
|
||||||
</span>
|
</td>
|
||||||
</td>
|
</tr>
|
||||||
</tr>
|
|
||||||
@endif
|
@endif
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue