Merge pull request 'Changed dashboard logic as welcome page in dashboard page' (#488) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

Reviewed-on: #488
This commit was merged in pull request #488.
This commit is contained in:
2026-03-22 04:01:21 +00:00
4 changed files with 336 additions and 168 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Filament\Pages;
use App\Filament\Widgets\CumulativeChart;
use App\Filament\Widgets\ProductionQuantityStat;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
@@ -9,64 +10,117 @@ use Filament\Pages\Dashboard\Concerns\HasFiltersForm;
use Filament\Tables\Filters\SelectFilter;
use Illuminate\Support\Facades\DB;
use App\Models\Plant;
use Filament\Facades\Filament;
use Filament\Forms\Components\DatePicker;
use Filament\Widgets\Widget;
use Illuminate\Support\Facades\Auth;
class Dashboard extends \Filament\Pages\Dashboard
{
use HasFiltersForm;
use HasFiltersForm;
protected static ?string $navigationGroup = 'Production DashBoard';
protected static ?string $navigationIcon = 'heroicon-s-gift';
public function mount(): void
{
session()->forget(['selected_plant']);
$this->filtersForm->fill([
'plant' => null
]);
}
protected static string $view = 'filament.pages.dashboard';
public function filtersForm(Form $form): Form
{
return $form
->statePath('filters') // Store form state in 'filters'
->schema([
Select::make('plant')
->options(Plant::pluck('name', 'id'))
->label('Select Plant')
->reactive()
->afterStateUpdated(function ($state) {
session(['selected_plant' => $state]); // fixed typo
//$this->dispatch('cumulativeChart'); // custom Livewire event
}),
]);
// public function mount(): void
// {
// session()->forget(['selected_plant']);
// session()->forget(['from_date']);
// session()->forget(['to_date']);
// $this->filtersForm->fill([
// 'plant' => null,
// 'from_date' => null,
// 'to_date' => null,
// // 'success_status' => null
// ]);
// }
}
// public function filtersForm(Form $form): Form
// {
// return $form
// ->statePath('filters') // Store form state in 'filters'
// ->schema([
// Select::make('plant')
// ->label('Select Plant')
// ->reactive()
// // ->options(Plant::pluck('name', 'id'))
// ->options(function (callable $get) {
// $userHas = Filament::auth()->user()->plant_id;
// return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
// })
// ->afterStateUpdated(function ($state,callable $set) {
// session(['selected_plant' => $state]); // fixed typo
// //$this->dispatch('cumulativeChart'); // custom Livewire event
// // Reset success_status whenever plant changes
// $set('success_status', null);
// session()->forget('success_status');
// }),
// // Select::make('success_status')
// // ->label('Select Status')
// // ->options([
// // 'Ok' => 'Ok',
// // 'Not Ok' => 'Not Ok',
// // ])
// // ->reactive()
// // ->afterStateUpdated(function ($state) {
// // session(['success_status' => $state]);
// // }),
// DatePicker::make('created_from')
// ->label('Created From')
// ->reactive()
// ->afterStateUpdated(function ($state,callable $set) {
// session(['from_date' => $state]);
// }),
// DatePicker::make('created_to')
// ->label('Created To')
// ->reactive()
// ->afterStateUpdated(function ($state,callable $set) {
// session(['to_date' => $state]);
// }),
// ]);
// }
public static function getNavigationLabel(): string
{
return 'Production Line Count';
}
// public static function getNavigationLabel(): string
// {
// return 'Production Line Count';
// }
// public function getHeading(): string
// {
// return 'Production Line Count';
// }
// public function getWidgets(): array
// {
// $widgets = [];
// if (CumulativeChart::canView()) {
// $widgets[] = CumulativeChart::class;
// }
// return $widgets;
// }
// public static function canAccess(): bool
// {
// return Auth::check() && Auth::user()->can('view production line count dashboard');
// }
public function getHeading(): string
{
return 'Production Line Count';
return '';
}
public function getWidgets(): array
public static function getNavigationLabel(): string
{
$widgets = [];
if (CumulativeChart::canView()) {
$widgets[] = CumulativeChart::class;
}
return $widgets;
}
public static function canAccess(): bool
{
return Auth::check() && Auth::user()->can('view production line count dashboard');
return 'Welcome';
}
}

View File

@@ -1,23 +1,124 @@
<?php
namespace App\Filament\Pages;
use Filament\Pages\Page;
use App\Filament\Widgets\CumulativeChart;
use App\Filament\Widgets\ProductionQuantityStat;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Pages\Dashboard\Concerns\HasFiltersForm;
use Filament\Tables\Filters\SelectFilter;
use Illuminate\Support\Facades\DB;
use App\Models\Plant;
use Filament\Facades\Filament;
use Filament\Forms\Components\DatePicker;
use Filament\Widgets\Widget;
use Illuminate\Support\Facades\Auth;
use Filament\Pages\Page;
use Filament\Forms\Concerns\InteractsWithForms;
class Welcome extends Page
{
protected static ?string $navigationIcon = 'heroicon-s-gift'; // 'heroicon-o-document-text';
protected static string $view = 'filament.pages.welcome';
public function getHeading(): string
protected static ?string $navigationIcon = 'heroicon-o-document-text';
use HasFiltersForm;
use InteractsWithForms;
protected static ?string $navigationGroup = 'Production DashBoard';
protected static ?string $slug = 'production-line-count';
public function mount(): void
{
return '';
session()->forget(['selected_plant']);
// session()->forget(['from_date']);
// session()->forget(['to_date']);
$this->filtersForm->fill([
'plant' => null,
// 'from_date' => null,
// 'to_date' => null,
// 'success_status' => null
]);
}
public function filtersForm(Form $form): Form
{
return $form
->statePath('filters')
->schema([
Select::make('plant')
->label('Select Plant')
->reactive()
// ->options(Plant::pluck('name', 'id'))
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
})
->afterStateUpdated(function ($state,callable $set) {
session(['selected_plant' => $state]);
//$this->dispatch('cumulativeChart'); // custom Livewire event
// Reset success_status whenever plant changes
// $set('success_status', null);
// session()->forget('success_status');
}),
// Select::make('success_status')
// ->label('Select Status')
// ->options([
// 'Ok' => 'Ok',
// 'Not Ok' => 'Not Ok',
// ])
// ->reactive()
// ->afterStateUpdated(function ($state) {
// session(['success_status' => $state]);
// }),
// DatePicker::make('created_from')
// ->label('Created From')
// ->reactive()
// ->afterStateUpdated(function ($state,callable $set) {
// session(['from_date' => $state]);
// }),
// DatePicker::make('created_to')
// ->label('Created To')
// ->reactive()
// ->afterStateUpdated(function ($state,callable $set) {
// session(['to_date' => $state]);
// }),
]);
}
// public static function canAccess(): bool
public static function getNavigationLabel(): string
{
return 'Production Line Count';
}
public function getHeading(): string
{
return 'Production Line Count';
}
// public function getWidgets(): array
// {
// return Auth::check() && Auth::user()->can('view welcome page');
// $widgets = [];
// if (CumulativeChart::canView()) {
// $widgets[] = CumulativeChart::class;
// }
// return $widgets;
// }
public static function canAccess(): bool
{
return Auth::check() && Auth::user()->can('view production line count dashboard');
}
}

View File

@@ -0,0 +1,126 @@
<x-filament-panels::page>
<!-- HEADER -->
<div class="mb-8">
<h1 class="text-4xl font-bold tracking-tight">
CRI Digital Manufacturing IIoT Platform
</h1>
<p class="text-lg text-gray-600 mt-2">
Complete visibility, traceability, and control across your manufacturing operations.
</p>
</div>
<!-- BANNER -->
{{-- <div class="w-full overflow-hidden rounded-2xl shadow mb-10"> --}}
<div class="w-full overflow-hidden rounded-xl shadow">
<img
src="{{ asset('images/iiot-banner.jpg') }}"
alt="CRI Digital Manufacturing IIoT"
class="w-full h-72 object-cover"
>
</div>
<!-- INTRO -->
<div class="max-w-4xl mb-10">
<p class="text-lg text-gray-700 mb-4">
CRI Digital Manufacturing IIoT is built to deliver
<strong>end-to-end traceability, real-time insights, and operational transparency</strong>
across plants, lines, and production processes.
</p>
<p class="text-lg text-gray-700">
The platform ensures <strong>right quality and on-time delivery</strong> by enabling
complete tracking of materials, production orders, and finished goods—helping teams
make faster, data-driven decisions with confidence.
</p>
</div>
<!-- KEY PILLARS -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-10">
<div class="bg-white rounded-xl border p-6 shadow-sm">
<h3 class="text-lg font-semibold mb-2">🔍 Traceability</h3>
<p class="text-gray-600">
Track materials, batches, and serials from input to dispatch.
</p>
</div>
<div class="bg-white rounded-xl border p-6 shadow-sm">
<h3 class="text-lg font-semibold mb-2"> Quality Assurance</h3>
<p class="text-gray-600">
Validate process data and ensure first-time-right production.
</p>
</div>
<div class="bg-white rounded-xl border p-6 shadow-sm">
<h3 class="text-lg font-semibold mb-2"> On-Time Delivery</h3>
<p class="text-gray-600">
Identify delays early and meet production commitments.
</p>
</div>
<div class="bg-white rounded-xl border p-6 shadow-sm">
<h3 class="text-lg font-semibold mb-2">📊 Real-Time Insights</h3>
<p class="text-gray-600">
Monitor performance and take quick corrective actions.
</p>
</div>
</div>
<!-- SUPPORT -->
<div class="bg-white rounded-xl border p-6 shadow-sm">
<h2 class="text-2xl font-semibold mb-3">24×7 Support</h2>
<p class="text-gray-700 mb-2">
Our dedicated IIoT support team is available round-the-clock to ensure
uninterrupted operations and quick issue resolution.
</p>
<p class="text-lg font-medium text-gray-900">
📞 Support Landline: <span class="font-semibold">0422 711 7179</span>
</p>
{{-- <p class="text-lg font-medium text-gray-900">
📞 Technical Support Contact: <span class="font-semibold">9952468104 / 9100832269</span>
</p> --}}
</div>
{{-- <div class="bg-white rounded-xl border p-6 shadow-sm">
<h2 class="text-2xl font-semibold mb-4">24×7 Support</h2>
<p class="text-lg text-gray-700 mb-4">
Our support structure is designed to ensure quick resolution based on the type
of issue whether it is on-site, application-related, or infrastructure-related.
</p>
<div class="space-y-3">
<p class="text-lg font-medium text-gray-900">
🏭 <strong>Plant & On-Site Support</strong> <br>
<span class="text-gray-700">
For plant visits, industry-level issues, and on-ground validation
</span><br>
📞 <span class="font-semibold">8925899458 / 8925899459</span>
</p>
<p class="text-lg font-medium text-gray-900">
💻 <strong>Application & Logic Support</strong> <br>
<span class="text-gray-700">
For website errors, logic issues, and application-level problems
</span><br>
📞 <span class="font-semibold">9952468104 / 9100832269</span>
</p>
</div>
</div> --}}
<!-- TEAM -->
{{-- <div class="bg-white rounded-xl border p-6 shadow-sm">
<h2 class="text-2xl font-semibold mb-4">IIOT Team Members</h2>
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 text-gray-700">
<div class="flex items-center gap-2">👤 Jothikumar</div>
<div class="flex items-center gap-2">👤 Jeithef Shibu</div>
<div class="flex items-center gap-2">👤 Dhanabalan</div>
<div class="flex items-center gap-2">👤 Ranjith</div>
<div class="flex items-center gap-2">👤 Srimathy</div>
<div class="flex items-center gap-2">👤 Gokul</div>
</div>
</div> --}}
</x-filament-panels::page>

View File

@@ -1,126 +1,13 @@
<x-filament-panels::page>
<!-- HEADER -->
<div class="mb-8">
<h1 class="text-4xl font-bold tracking-tight">
CRI Digital Manufacturing IIoT Platform
</h1>
<p class="text-lg text-gray-600 mt-2">
Complete visibility, traceability, and control across your manufacturing operations.
</p>
</div>
<!-- BANNER -->
{{-- <div class="w-full overflow-hidden rounded-2xl shadow mb-10"> --}}
<div class="w-full overflow-hidden rounded-xl shadow">
<img
src="{{ asset('images/iiot-banner.jpg') }}"
alt="CRI Digital Manufacturing IIoT"
class="w-full h-72 object-cover"
>
</div>
<!-- INTRO -->
<div class="max-w-4xl mb-10">
<p class="text-lg text-gray-700 mb-4">
CRI Digital Manufacturing IIoT is built to deliver
<strong>end-to-end traceability, real-time insights, and operational transparency</strong>
across plants, lines, and production processes.
</p>
<p class="text-lg text-gray-700">
The platform ensures <strong>right quality and on-time delivery</strong> by enabling
complete tracking of materials, production orders, and finished goods—helping teams
make faster, data-driven decisions with confidence.
</p>
</div>
<!-- KEY PILLARS -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-10">
<div class="bg-white rounded-xl border p-6 shadow-sm">
<h3 class="text-lg font-semibold mb-2">🔍 Traceability</h3>
<p class="text-gray-600">
Track materials, batches, and serials from input to dispatch.
</p>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2 sm:gap-4 md:gap-4 p-2 md:p-4 items-start">
{{-- Filters form --}}
<div class="space-y-4 w-full max-w-full col-span-1">
{{ $this->filtersForm($this->form) }}
</div>
<div class="bg-white rounded-xl border p-6 shadow-sm">
<h3 class="text-lg font-semibold mb-2"> Quality Assurance</h3>
<p class="text-gray-600">
Validate process data and ensure first-time-right production.
</p>
</div>
<div class="bg-white rounded-xl border p-6 shadow-sm">
<h3 class="text-lg font-semibold mb-2"> On-Time Delivery</h3>
<p class="text-gray-600">
Identify delays early and meet production commitments.
</p>
</div>
<div class="bg-white rounded-xl border p-6 shadow-sm">
<h3 class="text-lg font-semibold mb-2">📊 Real-Time Insights</h3>
<p class="text-gray-600">
Monitor performance and take quick corrective actions.
</p>
{{-- Stat widget --}}
<div class="w-full max-w-full col-span-1 sm:col-span-1 lg:col-span-2">
@livewire(\App\Filament\Widgets\CumulativeChart::class)
</div>
</div>
<!-- SUPPORT -->
<div class="bg-white rounded-xl border p-6 shadow-sm">
<h2 class="text-2xl font-semibold mb-3">24×7 Support</h2>
<p class="text-gray-700 mb-2">
Our dedicated IIoT support team is available round-the-clock to ensure
uninterrupted operations and quick issue resolution.
</p>
<p class="text-lg font-medium text-gray-900">
📞 Support Landline: <span class="font-semibold">0422 711 7179</span>
</p>
{{-- <p class="text-lg font-medium text-gray-900">
📞 Technical Support Contact: <span class="font-semibold">9952468104 / 9100832269</span>
</p> --}}
</div>
{{-- <div class="bg-white rounded-xl border p-6 shadow-sm">
<h2 class="text-2xl font-semibold mb-4">24×7 Support</h2>
<p class="text-lg text-gray-700 mb-4">
Our support structure is designed to ensure quick resolution based on the type
of issue whether it is on-site, application-related, or infrastructure-related.
</p>
<div class="space-y-3">
<p class="text-lg font-medium text-gray-900">
🏭 <strong>Plant & On-Site Support</strong> <br>
<span class="text-gray-700">
For plant visits, industry-level issues, and on-ground validation
</span><br>
📞 <span class="font-semibold">8925899458 / 8925899459</span>
</p>
<p class="text-lg font-medium text-gray-900">
💻 <strong>Application & Logic Support</strong> <br>
<span class="text-gray-700">
For website errors, logic issues, and application-level problems
</span><br>
📞 <span class="font-semibold">9952468104 / 9100832269</span>
</p>
</div>
</div> --}}
<!-- TEAM -->
{{-- <div class="bg-white rounded-xl border p-6 shadow-sm">
<h2 class="text-2xl font-semibold mb-4">IIOT Team Members</h2>
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 text-gray-700">
<div class="flex items-center gap-2">👤 Jothikumar</div>
<div class="flex items-center gap-2">👤 Jeithef Shibu</div>
<div class="flex items-center gap-2">👤 Dhanabalan</div>
<div class="flex items-center gap-2">👤 Ranjith</div>
<div class="flex items-center gap-2">👤 Srimathy</div>
<div class="flex items-center gap-2">👤 Gokul</div>
</div>
</div> --}}
</x-filament-panels::page>