From 7e6951a4f0d103ea0d4c3ef7636b174f2c19578b Mon Sep 17 00:00:00 2001 From: Xiaoguang Sun Date: Mon, 29 Apr 2024 00:04:39 +0000 Subject: [PATCH] Fix mismatch of suppliers and clients in dashboard Signed-off-by: Xiaoguang Sun --- Dockerfile | 23 ++++++++++------------- app/Http/Controllers/HomeController.php | 5 +++++ resources/views/dashboard.blade.php | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5a087a84..1e21738c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,11 @@ FROM php:8.2-fpm +WORKDIR /app +COPY . . + # Install system dependencies -RUN apt-get update && apt-get install -y \ +RUN --mount=type=secret,id=env,target=/app/.env \ + sed -i 's/deb.debian.org/mirrors.volces.com/g' /etc/apt/sources.list.d/debian.sources && apt-get update && apt-get install -y \ git \ curl \ libpng-dev \ @@ -18,16 +22,9 @@ RUN apt-get update && apt-get install -y \ && docker-php-ext-install bcmath \ && docker-php-ext-install gd \ && docker-php-ext-install zip \ - && docker-php-source delete - -# Clear cache -RUN apt-get clean && rm -rf /var/lib/apt/lists/* - -RUN curl -sS https://getcomposer.org/installer | php -- \ - --install-dir=/usr/local/bin --filename=composer - -WORKDIR /app -COPY . . + && docker-php-source delete \ + && apt-get clean && rm -rf /var/lib/apt/lists/* \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && npm config set registry http://registry.npmmirror.com && npm ci && composer install --optimize-autoloader --no-dev && php artisan view:cache && npm run production && php artisan storage:link -RUN npm ci -RUN composer install +ENTRYPOINT php artisan serve --host=0.0.0.0 --port 8000 diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 145e3014..27b8697e 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -14,6 +14,7 @@ use Illuminate\Support\Facades\Auth; use App\Models\Admin\EstimatedBudgets; use App\Models\Methods\MethodsServices; +use Illuminate\Support\Facades\Log; class HomeController extends Controller { @@ -42,6 +43,10 @@ public function index() return $data; }, []); + $data_str = var_export($data, true); + + Log::info("data = {$data_str}"); + $Announcement = Announcements::latest()->first(); //Estimated Budgets data for chart diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 7cc37886..6b07cb3b 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -22,7 +22,7 @@
-
-