Compare commits
21 commits
master
...
backoffice
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99cc669a79 | ||
|
|
b0e95ab875 | ||
|
|
76b8e23bb8 | ||
|
|
163b159330 | ||
|
|
b388e496c4 | ||
|
|
696c7dad3c | ||
|
|
6f03353040 | ||
|
|
1727b832f1 | ||
|
|
9843463dcc | ||
|
|
ad5d0f8adb | ||
|
|
84fc5cc617 | ||
|
|
323c91e842 | ||
|
|
745602c647 | ||
|
|
ab725fa9b1 | ||
|
|
81a4ffec24 | ||
|
|
39be89f10f | ||
|
|
87ec0d7f6f | ||
|
|
fa6cc38aa1 | ||
|
|
d0b7b40568 | ||
|
|
88922caa29 | ||
|
|
552fc442f8 |
11 changed files with 59 additions and 77 deletions
|
|
@ -1,2 +0,0 @@
|
||||||
.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=database
|
QUEUE_CONNECTION=sync
|
||||||
SESSION_DRIVER=file
|
SESSION_DRIVER=file
|
||||||
SESSION_LIFETIME=120
|
SESSION_LIFETIME=120
|
||||||
|
|
||||||
|
|
@ -32,10 +32,7 @@ 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_HASHTAGID=
|
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_IGHASHTAGID=
|
||||||
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,9 +11,14 @@ 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
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
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,12 +12,15 @@ php artisan migrate
|
||||||
.env
|
.env
|
||||||
```
|
```
|
||||||
FACEBOOK_GRAPH_ACCESS_TOKEN=""
|
FACEBOOK_GRAPH_ACCESS_TOKEN=""
|
||||||
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_HASHTAGID=
|
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_IGHASHTAGID=
|
||||||
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,9 +40,6 @@ 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,7 +41,9 @@ 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,16 +3,17 @@
|
||||||
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
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Redirect to BO
|
* Display a listing of the resource.
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
* @return \Illuminate\Contracts\View\View
|
||||||
*/
|
*/
|
||||||
public function index(): \Illuminate\Http\RedirectResponse
|
public function index(): View
|
||||||
{
|
{
|
||||||
return \redirect()->route('bo.dashboard');
|
return view('fo.pages.home');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,22 +126,6 @@ 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,46 +2,48 @@
|
||||||
<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
|
||||||
<th>Classement</th>
|
@include('modules.table-col-sorter', [
|
||||||
<th>Participant</th>
|
'cols' => $cols,
|
||||||
<th>Date de création du post</th>
|
'ignore' => ['total', 'timeslot_date', 'shop'],
|
||||||
<th></th>
|
'mobileHide' => ['shop'],
|
||||||
|
])
|
||||||
</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 class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.insta_media')]) }}
|
<span
|
||||||
</span>
|
class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.insta_media')]) }}
|
||||||
</td>
|
</span>
|
||||||
</tr>
|
</td>
|
||||||
|
</tr>
|
||||||
@endif
|
@endif
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue