initial commit
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
@using Indotalent.Features.Root
|
||||
@using System.Security.Claims
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<base href="/" />
|
||||
<link rel="icon" type="image/png" href="favico.png" />
|
||||
<ResourcePreloader />
|
||||
<link rel="stylesheet" href="@Assets["Indotalent.styles.css"]" />
|
||||
<ImportMap />
|
||||
<HeadOutlet @rendermode="InteractiveServer" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;450;500;600;700;800&display=swap" rel="stylesheet" />
|
||||
<link href="@Assets["_content/MudBlazor/MudBlazor.min.css"]" rel="stylesheet" />
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.7/dist/chart.umd.min.js"></script>
|
||||
<script>
|
||||
tailwind.config = {
|
||||
theme: {
|
||||
extend: {
|
||||
fontFamily: { 'poppins': ['Poppins', 'sans-serif'] }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body style="font-family: 'Poppins', sans-serif;">
|
||||
<Routes @rendermode="new InteractiveServerRenderMode(prerender: false)" />
|
||||
<ReconnectModal />
|
||||
<script src="@Assets["_framework/blazor.web.js"]"></script>
|
||||
<script src="@Assets["_content/MudBlazor/MudBlazor.min.js"]"></script>
|
||||
<SsoFirebase/>
|
||||
<SsoKeycloak/>
|
||||
<script>
|
||||
window.initCharts = function(ml,ms,mp,sl,sd,sc,al,ad,ac) {
|
||||
var g='#94a3b8';
|
||||
var c1=document.getElementById('plChart');
|
||||
if(c1){ml=ml&&ml.length?ml:['Jan','Feb','Mar','Apr','May','Jun'];ms=ms&&ms.length?ms:new Array(ml.length).fill(0);mp=mp&&mp.length?mp:new Array(ml.length).fill(0);
|
||||
new Chart(c1,{type:'bar',data:{labels:ml,datasets:[{label:'SO',data:ms,backgroundColor:'#06b6d4',borderRadius:4,barPercentage:.4},{label:'PO',data:mp,backgroundColor:'#10b981',borderRadius:4,barPercentage:.4}]},options:{responsive:true,maintainAspectRatio:false,plugins:{legend:{display:false}},scales:{y:{beginAtZero:true,grid:{color:'#f1f5f9'},ticks:{color:g,font:{size:10}}},x:{grid:{display:false},ticks:{color:g,font:{size:9}}}}}});}
|
||||
var c2=document.getElementById('expenseChart');
|
||||
if(c2){sl=sl&&sl.length?sl:['GR','DO','SCRP','ADJ'];sd=sd&&sd.length?sd:new Array(sl.length).fill(10);sc=sc&&sc.length?sc:new Array(sl.length).fill('#06b6d4');
|
||||
new Chart(c2,{type:'doughnut',data:{labels:sl,datasets:[{data:sd,backgroundColor:sc,borderWidth:0}]},options:{responsive:true,maintainAspectRatio:false,cutout:'72%',plugins:{legend:{display:false}}}});}
|
||||
var c3=document.getElementById('cashflowChart');
|
||||
if(c3){al=al&&al.length?al:['In','Out','SKU'];ad=ad&&ad.length?ad:new Array(al.length).fill(10);ac=ac&&ac.length?ac:new Array(al.length).fill('#06b6d4');
|
||||
new Chart(c3,{type:'bar',data:{labels:al,datasets:[{label:'Qty',data:ad,backgroundColor:ac,borderRadius:4,barPercentage:.5}]},options:{responsive:true,maintainAspectRatio:false,plugins:{legend:{display:false}},scales:{y:{beginAtZero:true,grid:{color:'#f1f5f9'},ticks:{color:g,font:{size:10}}},x:{grid:{display:false},ticks:{color:g,font:{size:9}}}}}});}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,2 @@
|
||||
@inherits LayoutComponentBase
|
||||
@Body
|
||||
@@ -0,0 +1,59 @@
|
||||
@page "/Error"
|
||||
@layout MainLayout
|
||||
@using System.Diagnostics
|
||||
@using Microsoft.AspNetCore.Mvc
|
||||
@attribute [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
|
||||
<PageTitle>Error - Something Went Wrong</PageTitle>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.Medium" Class="d-flex align-center justify-center" Style="height: calc(100vh - 64px);">
|
||||
|
||||
<div class="text-center">
|
||||
|
||||
<MudIcon Icon="@Icons.Material.Filled.Error"
|
||||
Size="Size.Large"
|
||||
Color="Color.Error"
|
||||
Class="mb-6" Style="font-size: 120px;" />
|
||||
|
||||
<MudText Typo="Typo.h3" Class="mb-4 text-error">An Error Occurred</MudText>
|
||||
|
||||
<MudText Typo="Typo.body1" Class="mb-6 text-muted">
|
||||
Sorry, an error occurred while processing your request.<br />
|
||||
Our team has been notified and is working to resolve the issue.
|
||||
</MudText>
|
||||
|
||||
@if (ShowRequestId)
|
||||
{
|
||||
<MudPaper Elevation="1" Class="pa-4 mb-6 d-inline-block">
|
||||
<MudText Typo="Typo.subtitle2" Class="mb-2">
|
||||
<strong>Request ID:</strong> <code>@RequestId</code>
|
||||
</MudText>
|
||||
<MudText Typo="Typo.caption" Class="text-muted">
|
||||
Please provide this ID when contacting support to help us track the issue.
|
||||
</MudText>
|
||||
</MudPaper>
|
||||
}
|
||||
|
||||
<MudButton Variant="Variant.Filled"
|
||||
Color="Color.Primary"
|
||||
Size="Size.Large"
|
||||
Href="/"
|
||||
StartIcon="@Icons.Material.Filled.Home">
|
||||
Back to Home
|
||||
</MudButton>
|
||||
|
||||
</div>
|
||||
|
||||
</MudContainer>
|
||||
|
||||
@code {
|
||||
[CascadingParameter] private HttpContext? HttpContext { get; set; }
|
||||
|
||||
private string? RequestId { get; set; }
|
||||
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,603 @@
|
||||
@page "/home"
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Indotalent.Infrastructure.Authorization.Identity
|
||||
@using Indotalent.Features.Root.Home.Cqrs
|
||||
@using Indotalent.Features.Root.Home
|
||||
@attribute [Authorize(Roles = $"{ApplicationRoles.Admin},{ApplicationRoles.Member}")]
|
||||
@inject HomeService HomeService
|
||||
@inject IJSRuntime JS
|
||||
|
||||
<PageTitle>WMS Dashboard</PageTitle>
|
||||
|
||||
<div style="font-family: 'Poppins', sans-serif;">
|
||||
<div class="p-4 md:p-6 space-y-6">
|
||||
|
||||
@* HEADER *@
|
||||
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3" style="outline:none;">
|
||||
<div>
|
||||
<h1 class="text-2xl md:text-3xl font-bold text-gray-900" style="outline:none;">WMS Dashboard</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* ROW 1: 12-col KPI layout *@
|
||||
<div class="grid grid-cols-1 lg:grid-cols-12 gap-4">
|
||||
@* Key Metrics Card *@
|
||||
<div class="lg:col-span-5 row-span-2 bg-white rounded-xl border border-gray-100 p-6 flex flex-col justify-between" style="animation: fadeInUp .5s ease forwards; animation-delay: .1s;">
|
||||
<div>
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div>
|
||||
<p class="text-xs text-gray-500 font-semibold uppercase tracking-wide">WMS Overview</p>
|
||||
<h3 class="text-lg font-bold text-gray-900 mt-0.5">Key Metrics</h3>
|
||||
</div>
|
||||
<div class="w-10 h-10 rounded-xl flex items-center justify-center shrink-0" style="background:#eef2ff;">
|
||||
<svg class="w-5 h-5 text-indigo-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-3 mt-2">
|
||||
<div class="p-3 rounded-lg" style="background:#f8fafc;">
|
||||
<p class="text-xs text-gray-500">Stock on Hand</p>
|
||||
<p class="text-lg font-bold text-gray-900">@_data.FormattedStock</p>
|
||||
</div>
|
||||
<div class="p-3 rounded-lg" style="background:#f8fafc;">
|
||||
<p class="text-xs text-gray-500">Inventory Value</p>
|
||||
<p class="text-lg font-bold text-gray-900">@_data.FormattedInvValue</p>
|
||||
</div>
|
||||
<div class="p-3 rounded-lg" style="background:#f8fafc;">
|
||||
<p class="text-xs text-gray-500">MTD Inbound</p>
|
||||
<p class="text-lg font-bold text-gray-900">@_data.FormattedMonthlyIn</p>
|
||||
</div>
|
||||
<div class="p-3 rounded-lg" style="background:#f8fafc;">
|
||||
<p class="text-xs text-gray-500">MTD Outbound</p>
|
||||
<p class="text-lg font-bold text-gray-900">@_data.FormattedMonthlyOut</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 pt-4 border-t border-gray-100 flex items-center justify-between text-xs text-gray-400">
|
||||
<span>SKUs: <b class="text-gray-700">@_data.TotalSku.ToString("N0")</b></span>
|
||||
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold" style="background:#eef2ff;color:#4f46e5;">FY @DateTime.Now.Year</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* 8 Small KPI Cards (row 1, cols 6-12) *@
|
||||
<div class="lg:col-span-7 grid grid-cols-2 lg:grid-cols-4 gap-3" style="animation: fadeInUp .5s ease forwards; animation-delay: .2s;">
|
||||
<div class="kpi-card-sm kpi-b1">
|
||||
<div class="flex items-start justify-between">
|
||||
<div><p class="kpi-label">Total GR</p><p class="kpi-value">@_data.GrCount</p></div>
|
||||
<div class="kpi-icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"/></svg></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="kpi-card-sm kpi-b2">
|
||||
<div class="flex items-start justify-between">
|
||||
<div><p class="kpi-label">Total DO</p><p class="kpi-value">@_data.DoCount</p></div>
|
||||
<div class="kpi-icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/></svg></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="kpi-card-sm kpi-b3">
|
||||
<div class="flex items-start justify-between">
|
||||
<div><p class="kpi-label">Stock Acc</p><p class="kpi-value">@_data.StockAccuracy%</p></div>
|
||||
<div class="kpi-icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/></svg></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="kpi-card-sm kpi-b4">
|
||||
<div class="flex items-start justify-between">
|
||||
<div><p class="kpi-label">Order Fulfill</p><p class="kpi-value">@_data.OrderFulfillmentRate%</p></div>
|
||||
<div class="kpi-icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"/></svg></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lg:col-span-7 lg:col-start-6 grid grid-cols-2 lg:grid-cols-4 gap-3" style="animation: fadeInUp .5s ease forwards; animation-delay: .3s;">
|
||||
<div class="kpi-card-sm kpi-b5">
|
||||
<div class="flex items-start justify-between">
|
||||
<div><p class="kpi-label">Scrapping</p><p class="kpi-value">@_data.ScrapCount</p></div>
|
||||
<div class="kpi-icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/></svg></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="kpi-card-sm kpi-b6">
|
||||
<div class="flex items-start justify-between">
|
||||
<div><p class="kpi-label">Adjustments</p><p class="kpi-value">@_data.AdjustmentCount</p></div>
|
||||
<div class="kpi-icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"/></svg></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="kpi-card-sm kpi-b7">
|
||||
<div class="flex items-start justify-between">
|
||||
<div><p class="kpi-label">Pending IN</p><p class="kpi-value">@_data.PendingInbound</p></div>
|
||||
<div class="kpi-icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"/></svg></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="kpi-card-sm kpi-b8">
|
||||
<div class="flex items-start justify-between">
|
||||
<div><p class="kpi-label">Pending OUT</p><p class="kpi-value">@_data.PendingOutbound</p></div>
|
||||
<div class="kpi-icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/></svg></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Metrics Matrix *@
|
||||
<div class="bg-white rounded-xl border border-gray-100 p-5" style="animation: fadeInUp .5s ease forwards; animation-delay: .2s;">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div><h3 class="font-bold text-gray-900">WMS Metrics Matrix</h3><p class="text-xs text-gray-400 mt-0.5">Key indicators across warehouse operations</p></div>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 md:grid-cols-5 gap-2">
|
||||
@{
|
||||
var mmItems = new[] {
|
||||
new { Title = "Total GR", Sub = _data.GrCount.ToString(), ColorClass = "mm-c1" },
|
||||
new { Title = "Total DO", Sub = _data.DoCount.ToString(), ColorClass = "mm-c2" },
|
||||
new { Title = "Stock on Hand", Sub = _data.FormattedStock, ColorClass = "mm-c3" },
|
||||
new { Title = "Inventory Value", Sub = _data.FormattedInvValue, ColorClass = "mm-c4" },
|
||||
new { Title = "MTD Inbound", Sub = _data.FormattedMonthlyIn, ColorClass = "mm-c5" },
|
||||
new { Title = "MTD Outbound", Sub = _data.FormattedMonthlyOut, ColorClass = "mm-c6" },
|
||||
new { Title = "Accuracy", Sub = $"{_data.StockAccuracy}%", ColorClass = "mm-c7" },
|
||||
new { Title = "Fulfillment", Sub = $"{_data.OrderFulfillmentRate}%", ColorClass = "mm-c8" },
|
||||
new { Title = "Pending IN", Sub = _data.PendingInbound.ToString(), ColorClass = "mm-c9" },
|
||||
new { Title = "Pending OUT", Sub = _data.PendingOutbound.ToString(), ColorClass = "mm-c10" },
|
||||
new { Title = "Scrapping", Sub = _data.ScrapCount.ToString(), ColorClass = "mm-c11" },
|
||||
new { Title = "Adjustments", Sub = _data.AdjustmentCount.ToString(), ColorClass = "mm-c12" },
|
||||
new { Title = "SKUs", Sub = _data.TotalSku.ToString("N0"), ColorClass = "mm-c13" },
|
||||
new { Title = "Warehouses", Sub = _data.WarehouseCount.ToString(), ColorClass = "mm-c14" },
|
||||
new { Title = "Transfers", Sub = _data.TransferCount.ToString(), ColorClass = "mm-c15" },
|
||||
new { Title = "StockCounts", Sub = _data.StockCountCount.ToString(), ColorClass = "mm-c16" },
|
||||
new { Title = "MTD Tx", Sub = _data.MonthlyTransactionCount.ToString("N0"), ColorClass = "mm-c17" },
|
||||
new { Title = "Yearly IN", Sub = ((decimal)_data.YearlyInboundQty).ToString("N0"), ColorClass = "mm-c18" },
|
||||
new { Title = "Yearly OUT", Sub = ((decimal)_data.YearlyOutboundQty).ToString("N0"), ColorClass = "mm-c19" },
|
||||
new { Title = "Inv Value", Sub = _data.FormattedInvValue, ColorClass = "mm-c20" }
|
||||
};
|
||||
}
|
||||
@foreach (var item in mmItems)
|
||||
{
|
||||
<div class="mm-cell">
|
||||
<div class="mm-icon @item.ColorClass">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
|
||||
</div>
|
||||
<div><p class="mm-title">@item.Title</p><p class="mm-sub">@item.Sub</p></div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* ROW 2: Stock Movement Trend + Module Breakdown *@
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-4">
|
||||
<div class="lg:col-span-2 bg-white rounded-xl border border-gray-100 p-5" style="animation: fadeInUp .5s ease forwards; animation-delay: .2s;">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div><h3 class="font-bold text-gray-900">Stock Movement Trend</h3><p class="text-xs text-gray-400 mt-0.5">Monthly inbound vs outbound</p></div>
|
||||
<div class="flex items-center gap-3 text-xs">
|
||||
<span class="flex items-center gap-1"><span class="w-3 h-3 rounded-sm" style="background:#06b6d4;"></span> Inbound</span>
|
||||
<span class="flex items-center gap-1"><span class="w-3 h-3 rounded-sm" style="background:#10b981;"></span> Outbound</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chart-container" style="height:260px;"><canvas id="plChart"></canvas></div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl border border-gray-100 p-5" style="animation: fadeInUp .5s ease forwards; animation-delay: .3s;">
|
||||
<h3 class="font-bold text-gray-900 mb-1">Module Breakdown</h3>
|
||||
<p class="text-xs text-gray-400 mb-3">By transaction count</p>
|
||||
<div class="flex justify-center"><div class="chart-container" style="height:170px;width:170px;"><canvas id="expenseChart"></canvas></div></div>
|
||||
<div class="grid grid-cols-2 gap-1 mt-3 text-xs">
|
||||
@if (_data.ModuleBreakdown.Any())
|
||||
{
|
||||
var mbTotal = _data.ModuleBreakdown.Sum(x => x.Count);
|
||||
@foreach (var mb in _data.ModuleBreakdown)
|
||||
{
|
||||
var pct = mbTotal > 0 ? Math.Round((double)mb.Count / mbTotal * 100) : 0;
|
||||
<div class="flex items-center gap-1">
|
||||
<span class="w-2 h-2 rounded-full" style="background:@mb.Color"></span> @mb.Label <span class="font-semibold ml-auto">@pct%</span>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="flex items-center gap-1"><span class="w-2 h-2 rounded-full" style="background:#06b6d4"></span> GR <span class="font-semibold ml-auto">0%</span></div>
|
||||
<div class="flex items-center gap-1"><span class="w-2 h-2 rounded-full" style="background:#10b981"></span> DO <span class="font-semibold ml-auto">0%</span></div>
|
||||
<div class="flex items-center gap-1"><span class="w-2 h-2 rounded-full" style="background:#6366f1"></span> ADJ <span class="font-semibold ml-auto">0%</span></div>
|
||||
<div class="flex items-center gap-1"><span class="w-2 h-2 rounded-full" style="background:#dc2626"></span> SCRP <span class="font-semibold ml-auto">0%</span></div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* ROW 3: Warehouse Summary + Module Breakdown Detail + Yearly Movement *@
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div class="bg-white rounded-xl border border-gray-100 p-5" style="animation: fadeInUp .5s ease forwards; animation-delay: .3s;">
|
||||
<h3 class="font-bold text-gray-900 mb-1">Warehouse Summary</h3>
|
||||
<p class="text-xs text-gray-400 mb-3">As of @DateTime.Now.ToString("MMMM dd, yyyy")</p>
|
||||
<div class="space-y-2.5">
|
||||
@if (_data.PipelineSummary.Any())
|
||||
{
|
||||
@foreach (var ps in _data.PipelineSummary)
|
||||
{
|
||||
<div class="flex items-center gap-3 p-2.5 rounded-lg" style="background:#f8fafc;">
|
||||
<div class="gi @ps.IconColorClass">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/></svg>
|
||||
</div>
|
||||
<div class="flex-1"><p class="text-xs text-gray-500">@ps.Label</p><p class="text-sm font-bold text-gray-900">@ps.Value</p></div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<div class="flex items-center justify-between text-xs pt-2 border-t border-gray-100">
|
||||
<span>Accuracy</span><span class="font-semibold text-gray-900">@_data.StockAccuracy%</span>
|
||||
<span>SKUs</span><span class="font-semibold text-gray-900">@_data.TotalSku.ToString("N0")</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl border border-gray-100 p-5" style="animation: fadeInUp .5s ease forwards; animation-delay: .4s;">
|
||||
<h3 class="font-bold text-gray-900 mb-1">Module Detail</h3>
|
||||
<p class="text-xs text-gray-400 mb-3">By transaction count</p>
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
@foreach (var mb in _data.ModuleBreakdown)
|
||||
{
|
||||
<div class="flex items-center gap-2 p-2 rounded-lg" style="background:#f8fafc;">
|
||||
<div class="w-6 h-6 rounded flex items-center justify-center shrink-0" style="background:@mb.Color">
|
||||
<span class="text-white text-xs font-bold">@(mb.Label?.Length > 3 ? mb.Label[..3] : mb.Label)</span>
|
||||
</div>
|
||||
<div class="min-w-0"><p class="text-xs text-gray-500 truncate">@mb.Label</p><p class="text-sm font-bold" style="color:@mb.Color">@mb.Count</p></div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="mt-2 flex justify-between text-xs">
|
||||
<span>Total: <b>@_data.ModuleBreakdown.Sum(x => x.Count)</b></span>
|
||||
<span>Modules: <b>@_data.ModuleBreakdown.Count</b></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl border border-gray-100 p-5" style="animation: fadeInUp .5s ease forwards; animation-delay: .5s;">
|
||||
<h3 class="font-bold text-gray-900 mb-1">Yearly Movement</h3>
|
||||
<p class="text-xs text-gray-400 mb-3">@DateTime.Now.Year summary</p>
|
||||
<div class="chart-container" style="height:220px;"><canvas id="cashflowChart"></canvas></div>
|
||||
<div class="grid grid-cols-3 gap-1 mt-3 text-xs text-center">
|
||||
@foreach (var ym in _data.YearlyMovement)
|
||||
{
|
||||
<div><span class="font-bold" style="color:@ym.Color">@ym.Qty.ToString("N0")</span><p class="text-gray-400">@ym.Category</p></div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* ROW 4: Recent Transactions + WMS Activity *@
|
||||
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4">
|
||||
<div class="bg-white rounded-xl border border-gray-100 p-5" style="animation: fadeInUp .5s ease forwards; animation-delay: .4s;">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div><h3 class="font-bold text-gray-900">Recent Transactions</h3><p class="text-xs text-gray-400 mt-0.5">Latest movements</p></div>
|
||||
</div>
|
||||
<div class="grid-wrap">
|
||||
<table class="grid-table">
|
||||
<thead><tr><th>Date</th><th>Tx#</th><th>Product</th><th>Qty</th><th>Module</th></tr></thead>
|
||||
<tbody>
|
||||
@if (_data.RecentTransactions.Any())
|
||||
{
|
||||
@foreach (var d in _data.RecentTransactions)
|
||||
{
|
||||
<tr>
|
||||
<td class="text-xs">@(d.Date?.ToString("MMM dd") ?? "-")</td>
|
||||
<td class="font-mono text-xs">@d.Number</td>
|
||||
<td class="text-xs">@d.Description</td>
|
||||
<td class="font-mono text-xs">@d.Quantity.ToString("N0")</td>
|
||||
<td><span class="chip @(d.Module == "GR" ? "chip-cyan" : d.Module == "DO" ? "chip-green" : "chip-indigo")">@d.Module</span></td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr><td colspan="5" class="text-xs text-center text-gray-400 py-4">No recent transactions available</td></tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="mt-3 flex justify-between text-xs">
|
||||
<span>MTD Tx: <b class="text-indigo-600">@_data.MonthlyTransactionCount.ToString("N0")</b></span>
|
||||
<span>Pending: <b>@(_data.PendingInbound + _data.PendingOutbound)</b></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl border border-gray-100 p-5" style="animation: fadeInUp .5s ease forwards; animation-delay: .5s;">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div><h3 class="font-bold text-gray-900">WMS Activity</h3><p class="text-xs text-gray-400 mt-0.5">Real-time updates</p></div>
|
||||
<span class="flex items-center gap-1.5 text-xs"><span class="w-2 h-2 rounded-full bg-indigo-400" style="animation: pulse 2s infinite;"></span> <span class="text-indigo-600 font-medium">Live</span></span>
|
||||
</div>
|
||||
<div class="activity-feed divide-y divide-gray-100 pr-1">
|
||||
@if (_data.ActivityFeeds.Any())
|
||||
{
|
||||
@foreach (var af in _data.ActivityFeeds)
|
||||
{
|
||||
<div class="flex gap-3 p-2 rounded-lg hover:bg-gray-50 transition">
|
||||
<div class="min-w-0 flex-1"><p class="text-sm text-gray-700"><b>@af.Title</b></p><p class="text-xs text-gray-400 mt-0.5">@af.Detail</p><p class="text-xs text-gray-400">@af.TimeAgo</p></div>
|
||||
<span class="chip @af.ChipColor self-start">@af.ChipLabel</span>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="flex gap-3 p-2"><p class="text-xs text-gray-400">No recent activity</p></div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* ROW 5: Conversion Metrics + Top Products + Warehouse KPIs *@
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div class="bg-white rounded-xl border border-gray-100 p-5" style="animation: fadeInUp .5s ease forwards; animation-delay: .4s;">
|
||||
<h3 class="font-bold text-gray-900 mb-1">Conversion Metrics</h3>
|
||||
<p class="text-xs text-gray-400 mb-3">@DateTime.Now.Year Performance</p>
|
||||
<div class="space-y-2.5">
|
||||
@foreach (var cm in _data.ConversionMetrics)
|
||||
{
|
||||
<div class="p-3 rounded-lg" style="background:#f8fafc;">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="gi" style="background:@cm.BarColor">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex justify-between items-center">
|
||||
<p class="text-xs text-gray-500 font-semibold">@cm.Label</p>
|
||||
<span class="text-xs font-semibold">@cm.Current / @cm.Target</span>
|
||||
</div>
|
||||
<div class="mt-2 progress-bar"><div class="fill" style="width:@($"{cm.PctValue}%");background:@cm.BarColor;"></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="mt-3 pt-3 border-t border-gray-100 flex justify-between text-xs">
|
||||
<span>Accuracy: <b class="text-green-600">@_data.StockAccuracy%</b></span>
|
||||
<span class="text-indigo-600">@(_data.StockAccuracy >= 95 ? "On Track" : "Improving")</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl border border-gray-100 p-5" style="animation: fadeInUp .5s ease forwards; animation-delay: .5s;">
|
||||
<h3 class="font-bold text-gray-900 mb-1">Top Products</h3>
|
||||
<p class="text-xs text-gray-400 mb-3">By movement volume</p>
|
||||
<div class="space-y-2.5">
|
||||
@if (_data.TopProducts.Any())
|
||||
{
|
||||
var tpColors = new[] { "#f97316", "#f59e0b", "#6366f1", "#8b5cf6", "#06b6d4" };
|
||||
@for (int i = 0; i < Math.Min(_data.TopProducts.Count, 5); i++)
|
||||
{
|
||||
var p = _data.TopProducts[i];
|
||||
<div class="flex items-center gap-3 p-2.5 rounded-lg" style="background:#f8fafc;">
|
||||
<div class="gi" style="background:@(tpColors[i % tpColors.Length])">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"/></svg>
|
||||
</div>
|
||||
<div class="flex-1"><p class="text-xs text-gray-500">@p.ProductName</p><p class="text-sm font-bold text-gray-900">@p.TotalMovement.ToString("N0")</p></div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<p class="text-xs text-gray-400">No product data available</p>
|
||||
}
|
||||
</div>
|
||||
<div class="mt-2 flex justify-between text-xs"><span>SKUs: <b>@_data.TotalSku.ToString("N0")</b></span><span>Value: <b>@_data.FormattedInvValue</b></span></div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl border border-gray-100 p-5" style="animation: fadeInUp .5s ease forwards; animation-delay: .6s;">
|
||||
<h3 class="font-bold text-gray-900 mb-1">Warehouse KPIs</h3>
|
||||
<p class="text-xs text-gray-400 mb-3">Per warehouse summary</p>
|
||||
<div class="space-y-2.5">
|
||||
@if (_data.WarehouseKpis.Any())
|
||||
{
|
||||
@foreach (var wk in _data.WarehouseKpis)
|
||||
{
|
||||
<div class="flex items-center gap-3 p-2.5 rounded-lg" style="background:#f8fafc;">
|
||||
<div class="gi" style="background:@wk.Color">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/></svg>
|
||||
</div>
|
||||
<div class="flex-1"><p class="text-xs text-gray-500">@wk.WarehouseName</p><p class="text-xs text-gray-400">@wk.SkuCount SKUs</p></div>
|
||||
<div class="text-right"><span class="chip chip-blue">@((decimal)wk.StockQty)</span></div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="flex items-center gap-3 p-2.5 rounded-lg" style="background:#f8fafc;">
|
||||
<div class="gi gc1"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/></svg></div>
|
||||
<div class="flex-1"><p class="text-xs text-gray-500">No warehouse data</p></div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private DashboardWmsResponse _data = new();
|
||||
private bool _isLoading = true;
|
||||
private bool _chartsInitialized = false;
|
||||
private bool _dataReady = false;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_isLoading = true;
|
||||
try
|
||||
{
|
||||
var res = await HomeService.GetWmsDashboardStatsAsync();
|
||||
if (res?.IsSuccess == true && res.Value != null)
|
||||
{
|
||||
_data = res.Value;
|
||||
_dataReady = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (_dataReady && !_chartsInitialized)
|
||||
{
|
||||
_chartsInitialized = true;
|
||||
await InitCharts();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task InitCharts()
|
||||
{
|
||||
// Chart 1: Stock Movement Trend (Inbound vs Outbound)
|
||||
var movementLabels = _data.StockMovementTrend.Any()
|
||||
? _data.StockMovementTrend.Select(x => x.Label ?? "").ToArray()
|
||||
: new[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun" };
|
||||
var inboundData = _data.StockMovementTrend.Any()
|
||||
? _data.StockMovementTrend.Select(x => x.InQty).ToArray()
|
||||
: new double[6];
|
||||
var outboundData = _data.StockMovementTrend.Any()
|
||||
? _data.StockMovementTrend.Select(x => x.OutQty).ToArray()
|
||||
: new double[6];
|
||||
|
||||
// Chart 2: Module Breakdown doughnut
|
||||
var moduleLabels = _data.ModuleBreakdown.Any()
|
||||
? _data.ModuleBreakdown.Select(x => x.Label ?? "").ToArray()
|
||||
: new[] { "GR", "DO", "ADJ", "SCRP" };
|
||||
var moduleData = _data.ModuleBreakdown.Any()
|
||||
? _data.ModuleBreakdown.Select(x => (double)x.Count).Cast<object>().ToArray()
|
||||
: new object[] { 10, 10, 10, 10 };
|
||||
var moduleColors = _data.ModuleBreakdown.Any()
|
||||
? _data.ModuleBreakdown.Select(x => x.Color ?? "#06b6d4").ToArray()
|
||||
: new[] { "#06b6d4", "#10b981", "#6366f1", "#dc2626" };
|
||||
|
||||
// Chart 3: Yearly Movement bar
|
||||
var yearlyLabels = _data.YearlyMovement.Any()
|
||||
? _data.YearlyMovement.Select(x => x.Category ?? "").ToArray()
|
||||
: new[] { "Inbound", "Outbound", "Net" };
|
||||
var yearlyData = _data.YearlyMovement.Any()
|
||||
? _data.YearlyMovement.Select(x => x.Qty).ToArray()
|
||||
: new double[] { 0, 0, 0 };
|
||||
var yearlyColors = _data.YearlyMovement.Any()
|
||||
? _data.YearlyMovement.Select(x => x.Color ?? "#6366f1").ToArray()
|
||||
: new[] { "#10b981", "#e11d48", "#6366f1" };
|
||||
|
||||
await JS.InvokeVoidAsync("initWmsDashboardCharts",
|
||||
movementLabels, inboundData, outboundData,
|
||||
moduleLabels, moduleData, moduleColors,
|
||||
yearlyLabels, yearlyData, yearlyColors);
|
||||
}
|
||||
}
|
||||
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
|
||||
@@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
|
||||
@@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
|
||||
|
||||
.chart-container { position: relative; width: 100%; }
|
||||
.progress-bar { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
|
||||
.progress-bar .fill { height: 100%; border-radius: 999px; transition: width .8s ease; }
|
||||
|
||||
.grid-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #64748b; padding: 10px 12px; text-align: left; border-bottom: 1px solid #e2e8f0; }
|
||||
.grid-table td { padding: 10px 12px; font-size: 13px; color: #334155; border-bottom: 1px solid #f1f5f9; }
|
||||
.grid-table tr:hover td { background: #f8fafc; }
|
||||
.grid-table { width: 100%; border-collapse: collapse; }
|
||||
.grid-wrap { max-height: 340px; overflow-y: auto; scrollbar-width: thin; }
|
||||
.grid-wrap::-webkit-scrollbar { width: 4px; }
|
||||
.grid-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
|
||||
|
||||
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 10px; font-weight: 600; color: #fff; }
|
||||
.chip-blue { background: #2563eb; }
|
||||
.chip-green { background: #10b981; }
|
||||
.chip-amber { background: #f59e0b; }
|
||||
.chip-red { background: #e11d48; }
|
||||
.chip-indigo { background: #6366f1; }
|
||||
.chip-purple { background: #8b5cf6; }
|
||||
.chip-cyan { background: #06b6d4; }
|
||||
.chip-orange { background: #f97316; }
|
||||
|
||||
.activity-feed { max-height: 320px; overflow-y: auto; scrollbar-width: thin; }
|
||||
.activity-feed::-webkit-scrollbar { width: 4px; }
|
||||
.activity-feed::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
|
||||
|
||||
.kpi-card-sm { border-radius: 14px; padding: 18px; color: #fff; position: relative; overflow: hidden; min-height: 110px; display: flex; flex-direction: column; justify-content: space-between; }
|
||||
.kpi-card-sm::after { content: ''; position: absolute; top: -30%; right: -20%; width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,.07); pointer-events: none; }
|
||||
.kpi-card-sm .kpi-label { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; opacity: .75; }
|
||||
.kpi-card-sm .kpi-value { font-size: 20px; font-weight: 800; line-height: 1.1; margin-top: 2px; }
|
||||
.kpi-card-sm .kpi-icon { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.15); flex-shrink: 0; }
|
||||
.kpi-card-sm .kpi-icon svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 2; }
|
||||
.kpi-b1 { background: #06b6d4; } .kpi-b2 { background: #10b981; } .kpi-b3 { background: #6366f1; } .kpi-b4 { background: #8b5cf6; }
|
||||
.kpi-b5 { background: #f59e0b; } .kpi-b6 { background: #dc2626; } .kpi-b7 { background: #f97316; } .kpi-b8 { background: #14b8a6; }
|
||||
|
||||
.mm-cell { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 10px; transition: background .2s; }
|
||||
.mm-cell:hover { background: #f8fafc; }
|
||||
.mm-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
|
||||
.mm-icon svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 2; }
|
||||
.mm-title { font-size: 12px; font-weight: 600; color: #334155; line-height: 1.2; }
|
||||
.mm-sub { font-size: 10px; color: #94a3b8; margin-top: 1px; }
|
||||
.mm-c1 { background: #06b6d4; } .mm-c2 { background: #10b981; } .mm-c3 { background: #6366f1; } .mm-c4 { background: #8b5cf6; }
|
||||
.mm-c5 { background: #f59e0b; } .mm-c6 { background: #dc2626; } .mm-c7 { background: #f97316; } .mm-c8 { background: #14b8a6; }
|
||||
.mm-c9 { background: #2563eb; } .mm-c10 { background: #e11d48; } .mm-c11 { background: #db2777; } .mm-c12 { background: #7c3aed; }
|
||||
.mm-c13 { background: #059669; } .mm-c14 { background: #d97706; } .mm-c15 { background: #0891b2; } .mm-c16 { background: #0284c7; }
|
||||
.mm-c17 { background: #65a30d; } .mm-c18 { background: #9333ea; } .mm-c19 { background: #ea580c; } .mm-c20 { background: #0d9488; }
|
||||
|
||||
.gi { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
|
||||
.gi svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 2; }
|
||||
.gc1 { background: #06b6d4; } .gc2 { background: #10b981; } .gc3 { background: #6366f1; } .gc4 { background: #8b5cf6; }
|
||||
.gc5 { background: #f59e0b; } .gc6 { background: #dc2626; } .gc7 { background: #f97316; } .gc8 { background: #14b8a6; }
|
||||
.gc9 { background: #2563eb; } .gc10 { background: #e11d48; } .gc11 { background: #0891b2; }
|
||||
</style>
|
||||
|
||||
@* Chart initialization script *@
|
||||
<script suppress-error="BL9992">
|
||||
window.initWmsDashboardCharts = function(movementLabels, inboundData, outboundData, moduleLabels, moduleData, moduleColors, yearlyLabels, yearlyData, yearlyColors) {
|
||||
var grayText = '#94a3b8';
|
||||
|
||||
// Chart 1: Stock Movement Trend
|
||||
var ctx1 = document.getElementById('plChart');
|
||||
if (ctx1) {
|
||||
new Chart(ctx1, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: movementLabels,
|
||||
datasets: [
|
||||
{ label: 'Inbound', data: inboundData, backgroundColor: '#06b6d4', borderRadius: 4, barPercentage: 0.4 },
|
||||
{ label: 'Outbound', data: outboundData, backgroundColor: '#10b981', borderRadius: 4, barPercentage: 0.4 }
|
||||
]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: { legend: { display: false } },
|
||||
scales: {
|
||||
y: { beginAtZero: true, grid: { color: '#f1f5f9' }, ticks: { color: grayText, font: { size: 10 } } },
|
||||
x: { grid: { display: false }, ticks: { color: grayText, font: { size: 9 } } }
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Chart 2: Module Breakdown Doughnut
|
||||
var ctx2 = document.getElementById('expenseChart');
|
||||
if (ctx2) {
|
||||
new Chart(ctx2, {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
labels: moduleLabels,
|
||||
datasets: [{ data: moduleData, backgroundColor: moduleColors, borderWidth: 0 }]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
cutout: '72%',
|
||||
plugins: { legend: { display: false } }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Chart 3: Yearly Movement
|
||||
var ctx3 = document.getElementById('cashflowChart');
|
||||
if (ctx3) {
|
||||
new Chart(ctx3, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: yearlyLabels,
|
||||
datasets: [{ label: 'Movement', data: yearlyData, backgroundColor: yearlyColors, borderRadius: 4, barPercentage: 0.5 }]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: { legend: { display: false } },
|
||||
scales: {
|
||||
y: { beginAtZero: true, grid: { color: '#f1f5f9' }, ticks: { color: grayText, font: { size: 10 } } },
|
||||
x: { grid: { display: false }, ticks: { color: grayText, font: { size: 9 } } }
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,481 @@
|
||||
using Indotalent.Infrastructure.Database;
|
||||
using Indotalent.Data.Entities;
|
||||
using Indotalent.Data.Enums;
|
||||
using MediatR;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Indotalent.Features.Root.Home.Cqrs;
|
||||
|
||||
// Chart data
|
||||
public class ChartDataPoint
|
||||
{
|
||||
public string? Label { get; set; }
|
||||
public double SalesAmount { get; set; }
|
||||
public double PurchaseAmount { get; set; }
|
||||
}
|
||||
|
||||
// WMS-specific DTOs
|
||||
public class WarehouseKpiDto
|
||||
{
|
||||
public string? WarehouseName { get; set; }
|
||||
public double StockQty { get; set; }
|
||||
public int SkuCount { get; set; }
|
||||
public decimal InventoryValue { get; set; }
|
||||
public string? Color { get; set; }
|
||||
}
|
||||
|
||||
public class WmsModuleBreakdownDto
|
||||
{
|
||||
public string? Label { get; set; }
|
||||
public int Count { get; set; }
|
||||
public double Quantity { get; set; }
|
||||
public string? Color { get; set; }
|
||||
}
|
||||
|
||||
public class WmsPipelineSummaryDto
|
||||
{
|
||||
public string? Label { get; set; }
|
||||
public string? Value { get; set; }
|
||||
public string? IconColorClass { get; set; }
|
||||
}
|
||||
|
||||
public class WmsConversionMetricDto
|
||||
{
|
||||
public string? Label { get; set; }
|
||||
public double Current { get; set; }
|
||||
public double Target { get; set; }
|
||||
public double PctValue { get; set; }
|
||||
public string? BarColor { get; set; }
|
||||
}
|
||||
|
||||
public class WmsRecentTransactionDto
|
||||
{
|
||||
public string? Number { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public string? Module { get; set; }
|
||||
public double Quantity { get; set; }
|
||||
public string? Type { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public DateTimeOffset? Date { get; set; }
|
||||
}
|
||||
|
||||
public class WmsActivityFeedDto
|
||||
{
|
||||
public string? Title { get; set; }
|
||||
public string? Detail { get; set; }
|
||||
public string? TimeAgo { get; set; }
|
||||
public string? ChipLabel { get; set; }
|
||||
public string? ChipColor { get; set; }
|
||||
public string? AvatarBg { get; set; }
|
||||
public string? AvatarText { get; set; }
|
||||
}
|
||||
|
||||
public class WmsStockMovementPointDto
|
||||
{
|
||||
public string? Label { get; set; }
|
||||
public double InQty { get; set; }
|
||||
public double OutQty { get; set; }
|
||||
}
|
||||
|
||||
public class WmsYearlyMovementDto
|
||||
{
|
||||
public string? Category { get; set; }
|
||||
public double Qty { get; set; }
|
||||
public string? Color { get; set; }
|
||||
}
|
||||
|
||||
public class WmsTopProductDto
|
||||
{
|
||||
public string? ProductName { get; set; }
|
||||
public double TotalMovement { get; set; }
|
||||
public string? Color { get; set; }
|
||||
}
|
||||
|
||||
public class DashboardWmsResponse
|
||||
{
|
||||
// Core KPIs
|
||||
public double TotalStockQty { get; set; }
|
||||
public decimal InventoryValue { get; set; }
|
||||
public int TotalSku { get; set; }
|
||||
public int WarehouseCount { get; set; }
|
||||
public double StockAccuracy { get; set; }
|
||||
public double OrderFulfillmentRate { get; set; }
|
||||
|
||||
// Monthly movement
|
||||
public double MonthlyInboundQty { get; set; }
|
||||
public double MonthlyOutboundQty { get; set; }
|
||||
public int MonthlyTransactionCount { get; set; }
|
||||
|
||||
// Yearly
|
||||
public double YearlyInboundQty { get; set; }
|
||||
public double YearlyOutboundQty { get; set; }
|
||||
|
||||
// Counts
|
||||
public int PendingInbound { get; set; }
|
||||
public int PendingOutbound { get; set; }
|
||||
public int ScrapCount { get; set; }
|
||||
public int AdjustmentCount { get; set; }
|
||||
public int GrCount { get; set; }
|
||||
public int DoCount { get; set; }
|
||||
public int TransferCount { get; set; }
|
||||
public int StockCountCount { get; set; }
|
||||
|
||||
// Collections
|
||||
public List<WarehouseKpiDto> WarehouseKpis { get; set; } = new();
|
||||
public List<WmsModuleBreakdownDto> ModuleBreakdown { get; set; } = new();
|
||||
public List<WmsPipelineSummaryDto> PipelineSummary { get; set; } = new();
|
||||
public List<WmsConversionMetricDto> ConversionMetrics { get; set; } = new();
|
||||
public List<WmsRecentTransactionDto> RecentTransactions { get; set; } = new();
|
||||
public List<WmsActivityFeedDto> ActivityFeeds { get; set; } = new();
|
||||
public List<ChartDataPoint> RevenueTrend { get; set; } = new();
|
||||
public List<WmsStockMovementPointDto> StockMovementTrend { get; set; } = new();
|
||||
public List<WmsYearlyMovementDto> YearlyMovement { get; set; } = new();
|
||||
public List<WmsTopProductDto> TopProducts { get; set; } = new();
|
||||
|
||||
// Formatted
|
||||
public string FormattedStock => FormatNumber((decimal)TotalStockQty);
|
||||
public string FormattedInvValue => FormatNumber(InventoryValue);
|
||||
public string FormattedMonthlyIn => FormatNumber((decimal)MonthlyInboundQty);
|
||||
public string FormattedMonthlyOut => FormatNumber((decimal)MonthlyOutboundQty);
|
||||
|
||||
private static string FormatNumber(decimal v)
|
||||
{
|
||||
if (v >= 1_000_000) return (v / 1_000_000m).ToString("F2") + "M";
|
||||
if (v >= 1_000) return (v / 1_000m).ToString("F1") + "K";
|
||||
return v.ToString("N0");
|
||||
}
|
||||
}
|
||||
|
||||
public record GetWmsDashboardQuery() : IRequest<DashboardWmsResponse>;
|
||||
|
||||
public class DashboardHandler : IRequestHandler<GetWmsDashboardQuery, DashboardWmsResponse>
|
||||
{
|
||||
private readonly AppDbContext _context;
|
||||
|
||||
public DashboardHandler(AppDbContext context) => _context = context;
|
||||
|
||||
public async Task<DashboardWmsResponse> Handle(GetWmsDashboardQuery request, CancellationToken ct)
|
||||
{
|
||||
var today = DateTime.Today;
|
||||
var monthStart = new DateTime(today.Year, today.Month, 1);
|
||||
var yearStart = new DateTime(today.Year, 1, 1);
|
||||
|
||||
// 1. Top 1000 recent confirmed inventory transactions (with product & warehouse)
|
||||
var topTxs = await _context.InventoryTransaction
|
||||
.AsNoTracking()
|
||||
.Where(x => x.ProductId != null && x.WarehouseId != null && x.Status == InventoryTransactionStatus.Confirmed)
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Take(1000)
|
||||
.Select(x => new
|
||||
{
|
||||
x.ModuleCode,
|
||||
x.ModuleNumber,
|
||||
x.ModuleName,
|
||||
x.MovementDate,
|
||||
x.Movement,
|
||||
x.TransType,
|
||||
x.Stock,
|
||||
x.CreatedAt,
|
||||
ProductId = x.ProductId!,
|
||||
ProductName = x.Product!.Name,
|
||||
ProductNumber = x.Product!.AutoNumber,
|
||||
UnitPrice = x.Product!.UnitPrice ?? 0,
|
||||
WarehouseId = x.WarehouseId!,
|
||||
WarehouseName = x.Warehouse!.Name
|
||||
})
|
||||
.ToListAsync(ct);
|
||||
|
||||
// Fallback: if table is empty, use count-based metrics from entity tables
|
||||
var grCount = await _context.GoodsReceive.AsNoTracking().CountAsync(ct);
|
||||
var doCount = await _context.DeliveryOrder.AsNoTracking().CountAsync(ct);
|
||||
var scrapCount = await _context.Scrapping.AsNoTracking().CountAsync(ct);
|
||||
var adjCount = await _context.PositiveAdjustment.AsNoTracking().CountAsync(ct)
|
||||
+ await _context.NegativeAdjustment.AsNoTracking().CountAsync(ct);
|
||||
var transferCount = await _context.TransferIn.AsNoTracking().CountAsync(ct);
|
||||
var stockCountCount = await _context.StockCount.AsNoTracking().CountAsync(ct);
|
||||
var pendingIn = await _context.GoodsReceive.AsNoTracking().CountAsync(x => x.Status == GoodsReceiveStatus.Draft, ct);
|
||||
var pendingOut = await _context.DeliveryOrder.AsNoTracking().CountAsync(x => x.Status == DeliveryOrderStatus.Draft, ct);
|
||||
|
||||
// 2. Aggregate from top transactions
|
||||
var totalStockQty = topTxs.Sum(x => x.Stock ?? 0);
|
||||
var totalSku = topTxs.Select(x => x.ProductId).Distinct().Count();
|
||||
var warehouseCount = topTxs.Select(x => x.WarehouseId).Distinct().Count();
|
||||
var inventoryValue = topTxs.Sum(x => (decimal)(x.Stock ?? 0) * x.UnitPrice);
|
||||
|
||||
// ModuleCode uses SHORT codes: GR, DO, ADJ+, ADJ-, COUNT, SCRP, TO-IN, TO-OUT, SRN, PRN
|
||||
var inboundModules = new HashSet<string> { "GR", "ADJ+", "TO-IN", "PRN" };
|
||||
var outboundModules = new HashSet<string> { "DO", "ADJ-", "TO-OUT", "SCRP", "SRN" };
|
||||
|
||||
bool IsInbound(string? mc) => mc != null && inboundModules.Contains(mc);
|
||||
bool IsOutbound(string? mc) => mc != null && outboundModules.Contains(mc);
|
||||
|
||||
var monthlyInbound = topTxs
|
||||
.Where(x => x.MovementDate >= monthStart && IsInbound(x.ModuleCode))
|
||||
.Sum(x => Math.Abs(x.Movement ?? 0));
|
||||
var monthlyOutbound = topTxs
|
||||
.Where(x => x.MovementDate >= monthStart && IsOutbound(x.ModuleCode))
|
||||
.Sum(x => Math.Abs(x.Movement ?? 0));
|
||||
var monthlyTxCount = topTxs.Count(x => x.MovementDate >= monthStart);
|
||||
|
||||
var yearlyInbound = topTxs
|
||||
.Where(x => x.MovementDate >= yearStart && IsInbound(x.ModuleCode))
|
||||
.Sum(x => Math.Abs(x.Movement ?? 0));
|
||||
var yearlyOutbound = topTxs
|
||||
.Where(x => x.MovementDate >= yearStart && IsOutbound(x.ModuleCode))
|
||||
.Sum(x => Math.Abs(x.Movement ?? 0));
|
||||
|
||||
// 3. Stock Accuracy from StockCount transactions (ModuleCode = "COUNT")
|
||||
var countTxs = topTxs.Where(x => x.ModuleCode == "COUNT").ToList();
|
||||
var stockAccuracy = 100.0;
|
||||
if (countTxs.Any())
|
||||
{
|
||||
var totalSys = countTxs.Sum(x => x.Stock ?? 0);
|
||||
var totalDelta = countTxs.Sum(x => Math.Abs((x.Movement ?? 0) - (x.Stock ?? 0)));
|
||||
stockAccuracy = totalSys > 0 ? Math.Max(0, Math.Round(100 - (totalDelta / totalSys * 100), 1)) : 100;
|
||||
}
|
||||
|
||||
// 4. Order Fulfillment
|
||||
var totalDo = await _context.DeliveryOrder.AsNoTracking().CountAsync(x => x.Status != DeliveryOrderStatus.Draft, ct);
|
||||
var doConfirmed = await _context.DeliveryOrder.AsNoTracking().CountAsync(x => x.Status == DeliveryOrderStatus.Confirmed, ct);
|
||||
var fulfPct = totalDo > 0 ? Math.Round((double)doConfirmed / totalDo * 100, 1) : 0;
|
||||
|
||||
// 5. Warehouse KPIs (group by warehouse from top txs)
|
||||
var whColors = new[] { "#2563eb", "#10b981", "#f59e0b", "#8b5cf6", "#ec4899", "#06b6d4" };
|
||||
var warehouseKpis = topTxs
|
||||
.GroupBy(x => new { x.WarehouseId, x.WarehouseName })
|
||||
.Select((g, i) => new WarehouseKpiDto
|
||||
{
|
||||
WarehouseName = g.Key.WarehouseName ?? "Unknown",
|
||||
StockQty = g.Sum(x => x.Stock ?? 0),
|
||||
SkuCount = g.Select(x => x.ProductId).Distinct().Count(),
|
||||
InventoryValue = g.Sum(x => (decimal)(x.Stock ?? 0) * x.UnitPrice),
|
||||
Color = whColors[i % whColors.Length]
|
||||
})
|
||||
.OrderByDescending(x => x.StockQty)
|
||||
.ToList();
|
||||
|
||||
// 6. Module breakdown (by count) — ModuleCode uses SHORT codes
|
||||
var moduleColors = new Dictionary<string, string>
|
||||
{
|
||||
["GR"] = "#06b6d4", ["DO"] = "#10b981",
|
||||
["ADJ+"] = "#6366f1", ["ADJ-"] = "#ef4444",
|
||||
["COUNT"] = "#f59e0b", ["SCRP"] = "#dc2626",
|
||||
["TO-IN"] = "#8b5cf6", ["TO-OUT"] = "#f43f5e",
|
||||
["PRN"] = "#0891b2", ["SRN"] = "#ea580c"
|
||||
};
|
||||
|
||||
var moduleBreakdown = topTxs
|
||||
.GroupBy(x => x.ModuleCode ?? "Other")
|
||||
.Select(g => new WmsModuleBreakdownDto
|
||||
{
|
||||
Label = g.Key,
|
||||
Count = g.Count(),
|
||||
Quantity = g.Sum(x => Math.Abs(x.Movement ?? 0)),
|
||||
Color = moduleColors.TryGetValue(g.Key, out var c) ? c : "#94a3b8"
|
||||
})
|
||||
.OrderByDescending(x => x.Count)
|
||||
.ToList();
|
||||
|
||||
if (!moduleBreakdown.Any())
|
||||
{
|
||||
moduleBreakdown = new List<WmsModuleBreakdownDto>
|
||||
{
|
||||
new() { Label = "GR", Count = grCount, Color = "#06b6d4" },
|
||||
new() { Label = "DO", Count = doCount, Color = "#10b981" },
|
||||
new() { Label = "ADJ", Count = adjCount, Color = "#6366f1" },
|
||||
new() { Label = "SCRP", Count = scrapCount, Color = "#dc2626" },
|
||||
new() { Label = "TO", Count = transferCount, Color = "#8b5cf6" }
|
||||
};
|
||||
}
|
||||
|
||||
// 7. Pipeline Summary
|
||||
var pipelineSummary = new List<WmsPipelineSummaryDto>
|
||||
{
|
||||
new() { Label = "Total Stock Qty", Value = FormattedSingle((decimal)totalStockQty), IconColorClass = "gc1" },
|
||||
new() { Label = "Inventory Value", Value = FormattedSingle(inventoryValue), IconColorClass = "gc2" },
|
||||
new() { Label = "Active SKUs", Value = totalSku.ToString("N0"), IconColorClass = "gc3" },
|
||||
new() { Label = "Warehouses", Value = warehouseCount.ToString(), IconColorClass = "gc4" }
|
||||
};
|
||||
|
||||
// 8. Conversion Metrics
|
||||
var conversionMetrics = new List<WmsConversionMetricDto>
|
||||
{
|
||||
new() { Label = "GR→Stock", Current = grCount, Target = Math.Max(grCount, 1), PctValue = grCount > 0 ? 100 : 0, BarColor = "#06b6d4" },
|
||||
new() { Label = "DO Fulfilled", Current = doConfirmed, Target = Math.Max(totalDo, 1), PctValue = fulfPct, BarColor = "#10b981" },
|
||||
new() { Label = "Stock Accuracy", Current = stockAccuracy, Target = 100, PctValue = stockAccuracy, BarColor = "#6366f1" },
|
||||
new() { Label = "Pending Clear", Current = totalDo - pendingOut, Target = Math.Max(totalDo, 1), PctValue = totalDo > 0 ? (double)(totalDo - pendingOut) / totalDo * 100 : 0, BarColor = "#f59e0b" }
|
||||
};
|
||||
|
||||
// 9. Recent Transactions (top 5 from our top-1000 set)
|
||||
var recentTransactions = topTxs
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Take(5)
|
||||
.Select(x => new WmsRecentTransactionDto
|
||||
{
|
||||
Number = x.ModuleNumber,
|
||||
Description = x.ProductName ?? "?",
|
||||
Module = x.ModuleCode,
|
||||
Quantity = Math.Abs(x.Movement ?? 0),
|
||||
Type = x.TransType?.ToString() ?? "-",
|
||||
Status = "Confirmed",
|
||||
Date = x.CreatedAt
|
||||
}).ToList();
|
||||
|
||||
// 10. Activity Feed (from top transactions, most recent 4) — filter to key module types
|
||||
var activityModules = new[] { "GR", "DO", "SCRP", "TO-IN", "COUNT" };
|
||||
var avatarColors = new[] { "#06b6d4", "#10b981", "#dc2626", "#8b5cf6", "#6366f1" };
|
||||
var activityFeeds = topTxs
|
||||
.Where(x => x.ModuleCode != null && activityModules.Contains(x.ModuleCode))
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Take(4)
|
||||
.Select((x, i) =>
|
||||
{
|
||||
var pn = x.ProductName ?? "?";
|
||||
var mc = x.ModuleCode ?? "?";
|
||||
var timeAgo = x.CreatedAt.HasValue
|
||||
? (DateTimeOffset.UtcNow - x.CreatedAt.Value).TotalMinutes < 60
|
||||
? $"{(int)(DateTimeOffset.UtcNow - x.CreatedAt.Value).TotalMinutes}m ago"
|
||||
: (DateTimeOffset.UtcNow - x.CreatedAt.Value).TotalHours < 24
|
||||
? $"{(int)(DateTimeOffset.UtcNow - x.CreatedAt.Value).TotalHours}h ago"
|
||||
: $"{(int)(DateTimeOffset.UtcNow - x.CreatedAt.Value).TotalDays}d ago"
|
||||
: "";
|
||||
return new WmsActivityFeedDto
|
||||
{
|
||||
Title = $"{mc} — {pn}",
|
||||
Detail = $"Qty: {Math.Abs(x.Movement ?? 0):N0} · {x.WarehouseName}",
|
||||
TimeAgo = timeAgo,
|
||||
ChipLabel = mc,
|
||||
ChipColor = i % 2 == 0 ? "chip-cyan" : "chip-amber",
|
||||
AvatarBg = avatarColors[i % avatarColors.Length],
|
||||
AvatarText = mc
|
||||
};
|
||||
}).ToList();
|
||||
|
||||
// 11. Stock Movement Trend (last 6 months from top transactions)
|
||||
var monthNames = new[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
|
||||
var last6Months = Enumerable.Range(0, 6)
|
||||
.Select(i => today.AddMonths(-5 + i))
|
||||
.Select(d => new { d.Year, d.Month })
|
||||
.ToList();
|
||||
|
||||
var stockMovementTrend = last6Months.Select(m =>
|
||||
{
|
||||
var inQty = topTxs
|
||||
.Where(x => x.MovementDate.HasValue
|
||||
&& x.MovementDate.Value.Year == m.Year
|
||||
&& x.MovementDate.Value.Month == m.Month
|
||||
&& IsInbound(x.ModuleCode))
|
||||
.Sum(x => Math.Abs(x.Movement ?? 0));
|
||||
var outQty = topTxs
|
||||
.Where(x => x.MovementDate.HasValue
|
||||
&& x.MovementDate.Value.Year == m.Year
|
||||
&& x.MovementDate.Value.Month == m.Month
|
||||
&& IsOutbound(x.ModuleCode))
|
||||
.Sum(x => Math.Abs(x.Movement ?? 0));
|
||||
return new WmsStockMovementPointDto
|
||||
{
|
||||
Label = monthNames[m.Month - 1],
|
||||
InQty = inQty,
|
||||
OutQty = outQty
|
||||
};
|
||||
}).ToList();
|
||||
|
||||
// 12. SO vs PO revenue trend (from SalesOrder/PurchaseOrder tables, as in CRM)
|
||||
var soMonths = await _context.SalesOrder.AsNoTracking()
|
||||
.Where(x => x.OrderDate != null)
|
||||
.Select(x => x.OrderDate!.Value)
|
||||
.ToListAsync(ct);
|
||||
var poMonths = await _context.PurchaseOrder.AsNoTracking()
|
||||
.Where(x => x.OrderDate != null)
|
||||
.Select(x => x.OrderDate!.Value)
|
||||
.ToListAsync(ct);
|
||||
var allDates = soMonths.Concat(poMonths)
|
||||
.Select(d => new { d.Year, d.Month })
|
||||
.Distinct()
|
||||
.OrderByDescending(x => x.Year).ThenByDescending(x => x.Month)
|
||||
.Take(6)
|
||||
.Reverse()
|
||||
.ToList();
|
||||
|
||||
var revenueTrend = new List<ChartDataPoint>();
|
||||
foreach (var ym in allDates)
|
||||
{
|
||||
var ms = new DateTime(ym.Year, ym.Month, 1);
|
||||
var me = ms.AddMonths(1);
|
||||
var sa = await _context.SalesOrder.AsNoTracking()
|
||||
.Where(x => x.OrderDate >= ms && x.OrderDate < me)
|
||||
.SumAsync(x => (double?)x.AfterTaxAmount ?? 0, ct);
|
||||
var pa = await _context.PurchaseOrder.AsNoTracking()
|
||||
.Where(x => x.OrderDate >= ms && x.OrderDate < me)
|
||||
.SumAsync(x => (double?)x.AfterTaxAmount ?? 0, ct);
|
||||
revenueTrend.Add(new ChartDataPoint
|
||||
{
|
||||
Label = monthNames[ym.Month - 1],
|
||||
SalesAmount = Math.Round(sa / 1000.0, 1),
|
||||
PurchaseAmount = Math.Round(pa / 1000.0, 1)
|
||||
});
|
||||
}
|
||||
|
||||
// 13. Yearly Movement summary
|
||||
var yearlyMovement = new List<WmsYearlyMovementDto>
|
||||
{
|
||||
new() { Category = "Inbound", Qty = yearlyInbound, Color = "#10b981" },
|
||||
new() { Category = "Outbound", Qty = yearlyOutbound, Color = "#e11d48" },
|
||||
new() { Category = "Net", Qty = yearlyInbound - yearlyOutbound, Color = "#6366f1" }
|
||||
};
|
||||
|
||||
// 14. Top Products by total movement volume
|
||||
var topProducts = topTxs
|
||||
.GroupBy(x => x.ProductName ?? "?")
|
||||
.Select(g => new { Name = g.Key, Total = g.Sum(x => Math.Abs(x.Movement ?? 0)) })
|
||||
.OrderByDescending(x => x.Total)
|
||||
.Take(5)
|
||||
.Select((x, i) => new WmsTopProductDto
|
||||
{
|
||||
ProductName = x.Name,
|
||||
TotalMovement = x.Total,
|
||||
Color = whColors[i % whColors.Length]
|
||||
})
|
||||
.ToList();
|
||||
|
||||
return new DashboardWmsResponse
|
||||
{
|
||||
TotalStockQty = totalStockQty,
|
||||
InventoryValue = inventoryValue,
|
||||
TotalSku = totalSku,
|
||||
WarehouseCount = warehouseCount,
|
||||
StockAccuracy = stockAccuracy,
|
||||
OrderFulfillmentRate = fulfPct,
|
||||
MonthlyInboundQty = monthlyInbound,
|
||||
MonthlyOutboundQty = monthlyOutbound,
|
||||
MonthlyTransactionCount = monthlyTxCount,
|
||||
YearlyInboundQty = yearlyInbound,
|
||||
YearlyOutboundQty = yearlyOutbound,
|
||||
PendingInbound = pendingIn,
|
||||
PendingOutbound = pendingOut,
|
||||
ScrapCount = scrapCount,
|
||||
AdjustmentCount = adjCount,
|
||||
GrCount = grCount,
|
||||
DoCount = doCount,
|
||||
TransferCount = transferCount,
|
||||
StockCountCount = stockCountCount,
|
||||
WarehouseKpis = warehouseKpis,
|
||||
ModuleBreakdown = moduleBreakdown,
|
||||
PipelineSummary = pipelineSummary,
|
||||
ConversionMetrics = conversionMetrics,
|
||||
RecentTransactions = recentTransactions,
|
||||
ActivityFeeds = activityFeeds,
|
||||
RevenueTrend = revenueTrend,
|
||||
StockMovementTrend = stockMovementTrend,
|
||||
YearlyMovement = yearlyMovement,
|
||||
TopProducts = topProducts
|
||||
};
|
||||
}
|
||||
|
||||
private static string FormattedSingle(decimal v)
|
||||
{
|
||||
if (v >= 1_000_000) return (v / 1_000_000m).ToString("F2") + "M";
|
||||
if (v >= 1_000) return (v / 1_000m).ToString("F1") + "K";
|
||||
return v.ToString("N0");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Indotalent.ConfigBackEnd.Extensions;
|
||||
using Indotalent.Features.Root.Home.Cqrs;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
|
||||
namespace Indotalent.Features.Root.Home;
|
||||
|
||||
public static class HomeEndpoint
|
||||
{
|
||||
public static void MapHomeEndpoints(this IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.MapGroup("/dashboard").WithTags("Dashboard")
|
||||
.RequireAuthorization(policy => policy.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme)
|
||||
.RequireAuthenticatedUser());
|
||||
|
||||
group.MapGet("/wms-stats", async (IMediator mediator) =>
|
||||
{
|
||||
var result = await mediator.Send(new GetWmsDashboardQuery());
|
||||
return result.ToApiResponse("WMS Dashboard data retrieved successfully");
|
||||
})
|
||||
.WithName("GetWmsDashboardStats");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Indotalent.ConfigBackEnd.Interfaces;
|
||||
using Indotalent.ConfigFrontEnd.Common;
|
||||
using Indotalent.Features.Root.Home.Cqrs;
|
||||
using Indotalent.Infrastructure.Authentication.Identity;
|
||||
using Indotalent.Shared.Models;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
using RestSharp;
|
||||
|
||||
namespace Indotalent.Features.Root.Home;
|
||||
|
||||
public class HomeService : BaseService
|
||||
{
|
||||
private readonly RestClient _client;
|
||||
|
||||
public HomeService(IHttpClientFactory clientFactory, NavigationManager nav, ISnackbar snackbar, ICurrentUserService currentUserService, TokenProvider tokenProvider)
|
||||
: base(clientFactory, nav, snackbar, currentUserService, tokenProvider)
|
||||
{
|
||||
_client = new RestClient(nav.BaseUri);
|
||||
}
|
||||
|
||||
public async Task<ApiResponse<DashboardWmsResponse>?> GetWmsDashboardStatsAsync()
|
||||
{
|
||||
var request = new RestRequest("api/dashboard/wms-stats", Method.Get);
|
||||
request.AddHeader("Accept", "application/json");
|
||||
return await ExecuteWithResponseAsync<DashboardWmsResponse>(_client, request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
@using Indotalent.ConfigBackEnd.Extensions
|
||||
@using Indotalent.ConfigBackEnd.Interfaces
|
||||
@using Indotalent.Infrastructure.Authentication
|
||||
@using Indotalent.Infrastructure.Authorization.Identity
|
||||
@using Indotalent.Shared.Consts
|
||||
@using Microsoft.AspNetCore.Components.Authorization
|
||||
@inherits LayoutComponentBase
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject ICurrentUserService CurrentUserService
|
||||
|
||||
<MudThemeProvider />
|
||||
<MudDialogProvider />
|
||||
<MudSnackbarProvider />
|
||||
<MudPopoverProvider />
|
||||
|
||||
<MudLayout>
|
||||
<AuthorizeView>
|
||||
<MudAppBar Elevation="1">
|
||||
<MudSpacer />
|
||||
<MudMenu Icon="@Icons.Material.Filled.MoreVert" Color="Color.Inherit" Edge="Edge.End" Dense="true"
|
||||
ActivationEvent="@MouseEvent.LeftClick" AnchorOrigin="Origin.BottomCenter" TransformOrigin="Origin.TopCenter">
|
||||
<MudMenuItem OnClick="GoToProfile">Profile</MudMenuItem>
|
||||
<MudMenuItem OnClick="Logout" Color="Color.Error">Logout</MudMenuItem>
|
||||
</MudMenu>
|
||||
</MudAppBar>
|
||||
|
||||
<MudDrawer @bind-Open="_drawerOpen"
|
||||
Elevation="0"
|
||||
Variant="@DrawerVariant.Mini"
|
||||
OpenMiniOnHover="false"
|
||||
MiniWidth="80px"
|
||||
Width="280px"
|
||||
Class="v6-drawer">
|
||||
|
||||
<MudIconButton Icon="@(_drawerOpen? Icons.Material.Rounded.ChevronLeft : Icons.Material.Rounded.ChevronRight)"
|
||||
OnClick="@DrawerToggle"
|
||||
Class="v6-toggle-btn"
|
||||
Size="Size.Small" />
|
||||
|
||||
<MudDrawerHeader Class="pa-6 mb-2">
|
||||
<div class="d-flex align-center">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Apps" Size="Size.Medium" Color="Color.Primary" />
|
||||
@if (_drawerOpen)
|
||||
{
|
||||
<MudText Typo="Typo.h5" Class="ml-3" Style="font-weight:900">@GlobalConsts.AppInitial</MudText>
|
||||
}
|
||||
</div>
|
||||
</MudDrawerHeader>
|
||||
|
||||
<MudNavMenu Class="v6-nav">
|
||||
<AuthorizeView Roles="@($"{ApplicationRoles.Admin},{ApplicationRoles.Member}")" Context="commonAuth">
|
||||
<Authorized>
|
||||
<MudNavLink Href="/home" Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.Home">@(_drawerOpen ? "Home" : "")</MudNavLink>
|
||||
<MudNavLink Href="/profile" Icon="@Icons.Material.Filled.AccountCircle">@(_drawerOpen ? "Profile" : "")</MudNavLink>
|
||||
<MudNavLink Href="/thirdparty" Icon="@Icons.Material.Filled.Groups">@(_drawerOpen ? "Third Party" : "")</MudNavLink>
|
||||
<MudNavLink Href="/sales" Icon="@Icons.Material.Filled.MonetizationOn">@(_drawerOpen ? "Sales" : "")</MudNavLink>
|
||||
<MudNavLink Href="/purchase" Icon="@Icons.Material.Filled.ShoppingCart">@(_drawerOpen ? "Purchase" : "")</MudNavLink>
|
||||
<MudNavLink Href="/inventory" Icon="@Icons.Material.Filled.Inventory2">@(_drawerOpen ? "Inventory" : "")</MudNavLink>
|
||||
<MudNavLink Href="/utilities" Icon="@Icons.Material.Filled.Build">@(_drawerOpen ? "Utilities" : "")</MudNavLink>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
|
||||
<AuthorizeView Roles="@ApplicationRoles.Admin" Context="adminAuth">
|
||||
<Authorized>
|
||||
<MudNavLink Href="/serilogs" Icon="@Icons.Material.Filled.HistoryEdu">@(_drawerOpen ? "System Logs" : "")</MudNavLink>
|
||||
<MudNavLink Href="/setting" Icon="@Icons.Material.Filled.Settings">@(_drawerOpen ? "App Settings" : "")</MudNavLink>
|
||||
<MudNavLink Href="/appsettings/json" Icon="@Icons.Material.Filled.SettingsEthernet">@(_drawerOpen ? "System Settings" : "")</MudNavLink>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
</MudNavMenu>
|
||||
|
||||
<div class="v6-footer d-flex align-center @(_drawerOpen ? "" : "justify-center")">
|
||||
<MudBadge Color="Color.Success" Overlap="true" Dot="true" Bordered="true" Placement="Placement.BottomRight">
|
||||
<MudAvatar Color="Color.Warning" Size="Size.Medium">@CurrentUserService.FullName.ToInitial()</MudAvatar>
|
||||
</MudBadge>
|
||||
@if (_drawerOpen)
|
||||
{
|
||||
<div class="ml-3">
|
||||
<MudText Typo="Typo.caption" Style="font-weight:700; display: block; color: #1e293b;">@CurrentUserService.FullName</MudText>
|
||||
<MudText Typo="Typo.caption" Style="color: #64748b; font-size: 10px;">Online</MudText>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</MudDrawer>
|
||||
</AuthorizeView>
|
||||
|
||||
<MudMainContent Style="background-color: #f1f5f9;">
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pa-3 md-pa-6 lg-pa-8 pt-3 pb-12">
|
||||
@Body
|
||||
</MudContainer>
|
||||
</MudMainContent>
|
||||
</MudLayout>
|
||||
|
||||
<script>
|
||||
function downloadFile(fileName, contentType, base64String) {
|
||||
const link = document.createElement('a');
|
||||
link.download = fileName;
|
||||
link.href = `data:${contentType};base64,${base64String}`;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
</script>
|
||||
|
||||
@code {
|
||||
private bool _drawerOpen = true;
|
||||
|
||||
private void DrawerToggle() => _drawerOpen = !_drawerOpen;
|
||||
private void GoToProfile() => NavigationManager.NavigateTo("/profile");
|
||||
private void Logout() => NavigationManager.NavigateTo("/account/logout");
|
||||
}
|
||||
|
||||
<style>
|
||||
.mud-input-control:has(.mud-input-adornment-start) {
|
||||
margin-top: 0 !important;
|
||||
height: 35px !important;
|
||||
}
|
||||
|
||||
.mud-input-control:has(.mud-input-adornment-start) .mud-input-outlined-border {
|
||||
height: 35px !important;
|
||||
}
|
||||
|
||||
.mud-input-control:has(.mud-input-adornment-start) input {
|
||||
padding-top: 0px !important;
|
||||
padding-bottom: 0px !important;
|
||||
height: 30px !important;
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
.mud-input-control:has(.mud-input-adornment-start) .mud-input-adornment {
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
height: 35px !important;
|
||||
}
|
||||
|
||||
div:has(> .mud-input-control:has(.mud-input-adornment-start)) > .mud-button-root {
|
||||
height: 35px !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.mud-input-outlined-border {
|
||||
border-radius: 4px !important;
|
||||
}
|
||||
|
||||
.custom-select-dense .mud-input-control {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
.custom-select-dense .mud-input-slot {
|
||||
padding-top: 4px !important;
|
||||
padding-bottom: 4px !important;
|
||||
padding-left: 8px !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.mud-drawer.v6-drawer {
|
||||
overflow: visible !important;
|
||||
z-index: 1350 !important;
|
||||
background-color: #f8fafc !important;
|
||||
border-right: 1px solid var(--mud-palette-divider) !important;
|
||||
transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.v6-drawer .mud-drawer-content {
|
||||
overflow-y: auto !important;
|
||||
overflow-x: hidden !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.v6-toggle-btn {
|
||||
position: absolute !important;
|
||||
right: -16px !important;
|
||||
top: 18px !important;
|
||||
z-index: 1400 !important;
|
||||
background-color: white !important;
|
||||
border: 1px solid var(--mud-palette-divider) !important;
|
||||
width: 32px !important;
|
||||
height: 32px !important;
|
||||
min-width: 32px !important;
|
||||
border-radius: 50% !important;
|
||||
box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
.v6-nav .mud-nav-link {
|
||||
border-radius: 12px;
|
||||
margin: 4px 12px;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.v6-nav .mud-nav-link.active {
|
||||
background-color: white !important;
|
||||
color: var(--mud-palette-primary) !important;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.v6-nav .mud-nav-link.active .mud-nav-link-icon {
|
||||
color: var(--mud-palette-primary) !important;
|
||||
}
|
||||
|
||||
.v6-footer {
|
||||
margin-top: auto;
|
||||
padding: 16px;
|
||||
border-top: 1px solid #FFEDD5;
|
||||
background-color: #FFF7ED;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.mud-badge-dot {
|
||||
border: 2px solid white !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
#blazor-error-ui {
|
||||
color-scheme: light only;
|
||||
background: lightyellow;
|
||||
bottom: 0;
|
||||
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
|
||||
box-sizing: border-box;
|
||||
display: none;
|
||||
left: 0;
|
||||
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#blazor-error-ui .dismiss {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
top: 0.5rem;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
@page "/not-found"
|
||||
@using Microsoft.AspNetCore.Mvc
|
||||
@layout MainLayout
|
||||
@attribute [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.Medium" Class="d-flex align-center justify-center" Style="height: calc(100vh - 64px);">
|
||||
|
||||
<div class="text-center">
|
||||
|
||||
<MudIcon Icon="@Icons.Material.Filled.ErrorOutline"
|
||||
Size="Size.Large"
|
||||
Color="Color.Error"
|
||||
Class="mb-6" Style="font-size: 120px;" />
|
||||
|
||||
<MudText Typo="Typo.h3" Class="mb-4">Page Not Found (404)</MudText>
|
||||
|
||||
<MudText Typo="Typo.body1" Class="mb-6 text-muted">
|
||||
Sorry, the page you are looking for is unavailable or has been moved.
|
||||
<br />
|
||||
Please double-check the URL or return to the home page.
|
||||
</MudText>
|
||||
|
||||
<MudButton Variant="Variant.Filled"
|
||||
Color="Color.Primary"
|
||||
Size="Size.Large"
|
||||
Href="/"
|
||||
StartIcon="@Icons.Material.Filled.Home">
|
||||
Back to Home
|
||||
</MudButton>
|
||||
|
||||
</div>
|
||||
|
||||
</MudContainer>
|
||||
@@ -0,0 +1,346 @@
|
||||
@page "/"
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>WMS - Smart Warehouse Management System</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.13.0/dist/cdn.min.js"></script>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;450;500;600;700;800&display=swap" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
html { scroll-behavior: smooth; }
|
||||
body { font-family: "Poppins", sans-serif; background: #ffffff; color: #1e293b; }
|
||||
[x-cloak] { display: none !important; }
|
||||
.nav-link { position: relative; color: #64748b; font-size: 0.875rem; font-weight: 500; transition: color 0.2s; cursor: pointer; text-decoration: none; }
|
||||
.nav-link:hover { color: #f55b14; }
|
||||
.nav-link.active { color: #f55b14; font-weight: 600; }
|
||||
.nav-link.active::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px; background: #f87a3d; border-radius: 1px; }
|
||||
.btn-primary { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.75rem; background: #f55b14; color: #fff; font-size: 0.875rem; font-weight: 600; border-radius: 0.5rem; transition: all 0.2s; cursor: pointer; border: none; text-decoration: none; }
|
||||
.btn-primary:hover { background: #d9480f; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,91,20,0.25); }
|
||||
.btn-outline { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.75rem; background: transparent; color: #f55b14; font-size: 0.875rem; font-weight: 600; border-radius: 0.5rem; border: 1.5px solid #fcc4a0; transition: all 0.2s; cursor: pointer; text-decoration: none; }
|
||||
.btn-outline:hover { border-color: #f87a3d; background: #fff3ed; }
|
||||
.tech-card { padding: 1.5rem; background: #ffffff; border: 1px solid #f1f5f9; border-radius: 0.75rem; transition: all 0.25s; cursor: default; }
|
||||
.tech-card:hover { border-color: #fcc4a0; box-shadow: 0 4px 16px rgba(245,91,20,0.06); transform: translateY(-2px); }
|
||||
.tech-card .ico { width: 2.5rem; height: 2.5rem; display: flex; align-items: center; justify-content: center; border-radius: 0.5rem; background: #fff3ed; color: #f87a3d; margin-bottom: 0.75rem; }
|
||||
.tech-card .ico svg { width: 1.25rem; height: 1.25rem; }
|
||||
.feature-icon { width: 3rem; height: 3rem; display: flex; align-items: center; justify-content: center; border-radius: 0.75rem; background: #fff3ed; color: #f87a3d; flex-shrink: 0; }
|
||||
.feature-icon svg { width: 1.5rem; height: 1.5rem; }
|
||||
.footer-link { color: #94a3b8; font-size: 0.8125rem; transition: color 0.2s; cursor: pointer; text-decoration: none; }
|
||||
.footer-link:hover { color: #ffffff; }
|
||||
.gradient-text { background: linear-gradient(135deg, #f55b14 0%, #f7945a 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
|
||||
.hero-badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 1rem; background: #fff3ed; border: 1px solid #fcc4a0; border-radius: 9999px; font-size: 0.8125rem; color: #f55b14; font-weight: 500; }
|
||||
#fab-top { position: fixed; bottom: 2rem; right: 2rem; z-index: 100; width: 3rem; height: 3rem; display: flex; align-items: center; justify-content: center; background: #f55b14; color: #fff; border: none; border-radius: 9999px; cursor: pointer; box-shadow: 0 4px 12px rgba(245,91,20,0.3); transition: all 0.25s; opacity: 0; visibility: hidden; transform: translateY(10px); }
|
||||
#fab-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
|
||||
#fab-top:hover { background: #d9480f; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(245,91,20,0.35); }
|
||||
#fab-top svg { width: 1.25rem; height: 1.25rem; }
|
||||
</style>
|
||||
</head>
|
||||
<body x-data="{ atTop: true, activeSection: 'home' }" x-init="initScrollSpy(); window.addEventListener('scroll', () => { atTop = window.scrollY < 300; })">
|
||||
|
||||
<!-- ===== STYLE 2: White menu, orange active state with orange text + orange bg block ===== -->
|
||||
|
||||
<!-- NAV -->
|
||||
<nav class="sticky top-0 z-50 bg-white/95 backdrop-blur border-b border-orange-50" x-data="{ mobileOpen: false }">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="flex items-center justify-between h-16">
|
||||
<div class="flex items-center gap-10">
|
||||
<a class="flex items-center gap-2 text-orange-600 font-bold text-lg no-underline" href="#">
|
||||
<svg class="w-7 h-7 text-orange-500" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="8.5" y="14" width="7" height="7" rx="1"/></svg>
|
||||
<span>WMS</span>
|
||||
</a>
|
||||
<div class="hidden md:flex items-center gap-1">
|
||||
<a class="nav-link active px-3 py-1.5 rounded-md bg-orange-50" href="#home">Overview</a>
|
||||
<a class="nav-link px-3 py-1.5 rounded-md" href="#tech">Features</a>
|
||||
<a class="nav-link px-3 py-1.5 rounded-md" href="#arch">Why WMS?</a>
|
||||
<a class="nav-link px-3 py-1.5 rounded-md" href="#frontend">Tech Stack</a>
|
||||
<a class="nav-link px-3 py-1.5 rounded-md" href="#cta">Demo</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hidden md:flex items-center gap-3">
|
||||
<a class="nav-link" href="/home">Sign In</a>
|
||||
<a class="btn-primary" href="https://indotalent.com" target="_blank">Get Source Code</a>
|
||||
</div>
|
||||
<button class="md:hidden p-2 text-orange-500 hover:text-orange-700" @@click="mobileOpen = !mobileOpen">
|
||||
<svg class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
<div x-show="mobileOpen" x-cloak class="md:hidden pb-4 space-y-2">
|
||||
<a class="block px-3 py-2 text-sm text-orange-600 bg-orange-50 rounded-md font-medium" href="#home">Overview</a>
|
||||
<a class="block px-3 py-2 text-sm text-gray-600 hover:text-orange-600 rounded-md hover:bg-orange-50" href="#tech">Features</a>
|
||||
<a class="block px-3 py-2 text-sm text-gray-600 hover:text-orange-600 rounded-md hover:bg-orange-50" href="#arch">Why WMS?</a>
|
||||
<a class="block px-3 py-2 text-sm text-gray-600 hover:text-orange-600 rounded-md hover:bg-orange-50" href="#frontend">Tech Stack</a>
|
||||
<a class="block px-3 py-2 text-sm text-gray-600 hover:text-orange-600 rounded-md hover:bg-orange-50" href="#cta">Demo</a>
|
||||
<a class="block px-3 py-2 text-sm text-gray-600 hover:text-orange-600 rounded-md hover:bg-orange-50" href="/home">Sign In</a>
|
||||
<a class="btn-primary block text-center mt-2" href="https://indotalent.com" target="_blank">Get Source Code</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- HERO -->
|
||||
<section id="home" class="relative overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-b from-orange-50/30 to-transparent pointer-events-none"></div>
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-20 pb-24 md:pt-28 md:pb-32">
|
||||
<div class="text-center max-w-4xl mx-auto">
|
||||
<div class="hero-badge mx-auto mb-6">
|
||||
<svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z"/></svg>
|
||||
Production-Ready Source Code
|
||||
</div>
|
||||
<h1 class="text-4xl sm:text-5xl md:text-6xl font-extrabold text-gray-900 leading-tight tracking-tight">
|
||||
Smart Warehousing,<br/>
|
||||
<span class="gradient-text">Seamless Inventory Flow</span>
|
||||
</h1>
|
||||
<p class="mt-6 text-lg md:text-xl text-gray-500 max-w-2xl mx-auto leading-relaxed">
|
||||
The ultimate bridge between your business and your customers. A complete, working warehouse management system built with ASP.NET Core Blazor & .NET 10 — stop burning AI tokens piecing together code and start with a battle-tested foundation that runs end-to-end on day one.
|
||||
</p>
|
||||
<div class="mt-10 flex flex-col sm:flex-row items-center justify-center gap-4">
|
||||
<a class="btn-primary text-base px-8 py-3.5" href="/home">
|
||||
Sign In
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 7l5 5m0 0l-5 5m5-5H6"/></svg>
|
||||
</a>
|
||||
<a class="btn-outline text-base px-8 py-3.5" href="https://indotalent.com" target="_blank">
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"/></svg>
|
||||
Get Source Code
|
||||
</a>
|
||||
</div>
|
||||
<div class="mt-16 flex flex-wrap items-center justify-center gap-8 text-sm text-gray-400">
|
||||
<span class="font-medium text-gray-500">Why WMS?</span>
|
||||
<span class="flex items-center gap-1.5"><svg class="w-4 h-4 text-orange-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/></svg> Plug & Play</span>
|
||||
<span class="flex items-center gap-1.5"><svg class="w-4 h-4 text-orange-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"/></svg> End-to-End Working</span>
|
||||
<span class="flex items-center gap-1.5"><svg class="w-4 h-4 text-orange-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"/></svg> Beautiful UI</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- BUSINESS FEATURES -->
|
||||
<section id="tech" class="py-20 md:py-28">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="text-center mb-16">
|
||||
<span class="inline-flex items-center gap-1.5 px-3 py-1 bg-orange-50 text-orange-600 text-xs font-semibold rounded-full border border-orange-200">BUSINESS FEATURES</span>
|
||||
<h2 class="mt-4 text-3xl sm:text-4xl font-bold text-gray-900">Complete Warehouse Operations</h2>
|
||||
<p class="mt-4 text-gray-500 max-w-2xl mx-auto">Every module you need to run a modern warehouse — from sales and purchasing to inventory control and scheduling.</p>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4">
|
||||
<div class="tech-card"><div class="ico"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"/></svg></div><div class="font-semibold text-gray-900 text-sm">Profile</div><div class="text-xs text-gray-400 mt-0.5">Personal & Avatar</div></div>
|
||||
<div class="tech-card"><div class="ico"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z"/></svg></div><div class="font-semibold text-gray-900 text-sm">Third Party</div><div class="text-xs text-gray-400 mt-0.5">Customer & Vendor</div></div>
|
||||
<div class="tech-card"><div class="ico"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg></div><div class="font-semibold text-gray-900 text-sm">Sales</div><div class="text-xs text-gray-400 mt-0.5">Order to Payment</div></div>
|
||||
<div class="tech-card"><div class="ico"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"/></svg></div><div class="font-semibold text-gray-900 text-sm">Purchase</div><div class="text-xs text-gray-400 mt-0.5">Requisition to Bill</div></div>
|
||||
<div class="tech-card"><div class="ico"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"/></svg></div><div class="font-semibold text-gray-900 text-sm">Inventory</div><div class="text-xs text-gray-400 mt-0.5">Stock & Transfer</div></div>
|
||||
<div class="tech-card"><div class="ico"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5m-9-6h.008v.008H12v-.008zM12 15h.008v.008H12V15zm0 2.25h.008v.008H12v-.008zM9.75 15h.008v.008H9.75V15zm0 2.25h.008v.008H9.75v-.008zM7.5 15h.008v.008H7.5V15zm0 2.25h.008v.008H7.5v-.008zm6.75-4.5h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V15zm0 2.25h.008v.008h-.008v-.008zm2.25-4.5h.008v.008H16.5v-.008zm0 2.25h.008v.008H16.5V15z"/></svg></div><div class="font-semibold text-gray-900 text-sm">Scheduling</div><div class="text-xs text-gray-400 mt-0.5">Booking & To-Do</div></div>
|
||||
<div class="tech-card"><div class="ico"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M10.5 6h9.75M10.5 6a1.5 1.5 0 11-3 0m3 0a1.5 1.5 0 10-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-9.75 0h9.75"/></svg></div><div class="font-semibold text-gray-900 text-sm">System Logs</div><div class="text-xs text-gray-400 mt-0.5">DB & File Audit</div></div>
|
||||
<div class="tech-card"><div class="ico"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"/><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/></svg></div><div class="font-semibold text-gray-900 text-sm">App Settings</div><div class="text-xs text-gray-400 mt-0.5">Users & Currency</div></div>
|
||||
<div class="tech-card"><div class="ico"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M11.42 15.17l-1.255 2.51m-1.255-2.51l1.255 2.51m-1.255-2.51a3.003 3.003 0 00-3.509 2.51m3.509-2.51l1.255 2.51m3.764-7.53l-1.254 2.51m-1.255-2.51l1.255 2.51m-1.255-2.51a3.003 3.003 0 00-3.509 2.51m3.509-2.51l1.255 2.51M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg></div><div class="font-semibold text-gray-900 text-sm">System Config</div><div class="text-xs text-gray-400 mt-0.5">Full Inspection</div></div>
|
||||
<div class="tech-card"><div class="ico"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 15a4.5 4.5 0 004.5 4.5H18a3.75 3.75 0 001.332-7.257 3 3 0 00-3.758-3.848 5.25 5.25 0 00-10.233 2.33A4.502 4.502 0 002.25 15z"/></svg></div><div class="font-semibold text-gray-900 text-sm">Multitenant</div><div class="text-xs text-gray-400 mt-0.5">Isolated Data</div></div>
|
||||
<div class="tech-card"><div class="ico"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"/></svg></div><div class="font-semibold text-gray-900 text-sm">Transfer</div><div class="text-xs text-gray-400 mt-0.5">In/Out Orders</div></div>
|
||||
<div class="tech-card"><div class="ico"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"/></svg></div><div class="font-semibold text-gray-900 text-sm">Stock Opname</div><div class="text-xs text-gray-400 mt-0.5">Counting & Adjust</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- WHY WMS / PAIN POINTS SECTION -->
|
||||
<section id="arch" class="py-20 md:py-28 bg-orange-50/30">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="text-center mb-16">
|
||||
<span class="inline-flex items-center gap-1.5 px-3 py-1 bg-orange-50 text-orange-600 text-xs font-semibold rounded-full border border-orange-200">WHY WMS?</span>
|
||||
<h2 class="mt-4 text-3xl sm:text-4xl font-bold text-gray-900">Stop Prompting. Start Shipping.</h2>
|
||||
<p class="mt-4 text-gray-500 max-w-2xl mx-auto">AI can generate code snippets, but building a fully functional, end-to-end warehouse system is a different challenge entirely. WMS solves the real problems behind enterprise software delivery.</p>
|
||||
</div>
|
||||
<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
<div class="p-6 bg-white rounded-xl border border-orange-50 hover:shadow-sm hover:border-orange-200 transition-all">
|
||||
<div class="feature-icon mb-4">
|
||||
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z"/></svg>
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-gray-900">Guaranteed to Run</h3>
|
||||
<p class="mt-2 text-sm text-gray-500 leading-relaxed">No more debugging AI-generated hallucinations. WMS compiles, runs, and deploys on day one. Every feature has been tested and proven in production environments.</p>
|
||||
</div>
|
||||
<div class="p-6 bg-white rounded-xl border border-orange-50 hover:shadow-sm hover:border-orange-200 transition-all">
|
||||
<div class="feature-icon mb-4">
|
||||
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.41a2.25 2.25 0 013.182 0l2.909 2.91m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"/></svg>
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-gray-900">Beautiful by Default</h3>
|
||||
<p class="mt-2 text-sm text-gray-500 leading-relaxed">A real-world showcase of what Blazor + MudBlazor can achieve. Stunning, responsive UI that proves .NET can deliver gorgeous enterprise interfaces — not just functional ones.</p>
|
||||
</div>
|
||||
<div class="p-6 bg-white rounded-xl border border-orange-50 hover:shadow-sm hover:border-orange-200 transition-all">
|
||||
<div class="feature-icon mb-4">
|
||||
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-gray-900">Save Weeks of Development</h3>
|
||||
<p class="mt-2 text-sm text-gray-500 leading-relaxed">Even with AI assistance, building a complete WMS from scratch takes weeks of prompting, fixing, and refactoring. Get the finished product now and focus on what makes your business unique.</p>
|
||||
</div>
|
||||
<div class="p-6 bg-white rounded-xl border border-orange-50 hover:shadow-sm hover:border-orange-200 transition-all">
|
||||
<div class="feature-icon mb-4">
|
||||
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 3v11.25A2.25 2.25 0 006 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0118 16.5h-2.25m-7.5 0h7.5m-7.5 0l-1 3m8.5-3l1 3m0 0l.5 1.5m-.5-1.5h-9.5m0 0l-.5 1.5M9 7.5l3-3 3 3"/></svg>
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-gray-900">Vertical Slice Architecture</h3>
|
||||
<p class="mt-2 text-sm text-gray-500 leading-relaxed">Feature-first organization. Each business capability is an independent slice — commands, queries, handlers, and validation — making the codebase intuitive to navigate and extend.</p>
|
||||
</div>
|
||||
<div class="p-6 bg-white rounded-xl border border-orange-50 hover:shadow-sm hover:border-orange-200 transition-all">
|
||||
<div class="feature-icon mb-4">
|
||||
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"/></svg>
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-gray-900">Single Project Monolith</h3>
|
||||
<p class="mt-2 text-sm text-gray-500 leading-relaxed">No microservice complexity. No multi-project juggling. One solution, one project — open in Visual Studio 2026, hit F5, and you're running. Perfect for teams that value simplicity.</p>
|
||||
</div>
|
||||
<div class="p-6 bg-white rounded-xl border border-orange-50 hover:shadow-sm hover:border-orange-200 transition-all">
|
||||
<div class="feature-icon mb-4">
|
||||
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5"/></svg>
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-gray-900">Clean, Modern C# Codebase</h3>
|
||||
<p class="mt-2 text-sm text-gray-500 leading-relaxed">CQRS with MediatR, LINQ, and best-practice patterns throughout. Learn from production code that follows Microsoft's latest conventions for .NET 10 and ASP.NET Core.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- TECH STACK SECTION -->
|
||||
<section id="frontend" class="py-20 md:py-28">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="grid md:grid-cols-2 gap-12 items-center">
|
||||
<div>
|
||||
<span class="inline-flex items-center gap-1.5 px-3 py-1 bg-orange-50 text-orange-600 text-xs font-semibold rounded-full border border-orange-200">TECH STACK</span>
|
||||
<h2 class="mt-4 text-3xl sm:text-4xl font-bold text-gray-900">Powered by .NET 10 & Blazor</h2>
|
||||
<p class="mt-4 text-gray-500 leading-relaxed">Built on Microsoft's latest stack. Blazor Server for real-time UI, MudBlazor for polished components, and MS SQL for rock-solid data persistence — all in one cohesive solution.</p>
|
||||
<div class="mt-8 space-y-4">
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="w-5 h-5 rounded bg-orange-100 flex items-center justify-center flex-shrink-0 mt-0.5"><svg class="w-3 h-3 text-orange-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="3"><path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"/></svg></div>
|
||||
<div><span class="font-semibold text-gray-900 text-sm">ASP.NET Core 10 & Blazor Server</span><p class="text-xs text-gray-400 mt-0.5">Real-time, component-based web UI with C#</p></div>
|
||||
</div>
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="w-5 h-5 rounded bg-orange-100 flex items-center justify-center flex-shrink-0 mt-0.5"><svg class="w-3 h-3 text-orange-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="3"><path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"/></svg></div>
|
||||
<div><span class="font-semibold text-gray-900 text-sm">MudBlazor 9</span><p class="text-xs text-gray-400 mt-0.5">Material Design component library for Blazor</p></div>
|
||||
</div>
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="w-5 h-5 rounded bg-orange-100 flex items-center justify-center flex-shrink-0 mt-0.5"><svg class="w-3 h-3 text-orange-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="3"><path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"/></svg></div>
|
||||
<div><span class="font-semibold text-gray-900 text-sm">MediatR + CQRS + VSA</span><p class="text-xs text-gray-400 mt-0.5">Clean command/query separation with feature slices</p></div>
|
||||
</div>
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="w-5 h-5 rounded bg-orange-100 flex items-center justify-center flex-shrink-0 mt-0.5"><svg class="w-3 h-3 text-orange-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="3"><path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"/></svg></div>
|
||||
<div><span class="font-semibold text-gray-900 text-sm">MS SQL + EF Core</span><p class="text-xs text-gray-400 mt-0.5">Reliable data layer with full migration support</p></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div class="p-5 bg-orange-50/50 rounded-xl border border-orange-200"><div class="text-2xl font-bold text-orange-600">.NET 10</div><div class="text-xs text-gray-400 mt-1">Runtime</div></div>
|
||||
<div class="p-5 bg-orange-50/50 rounded-xl border border-orange-200"><div class="text-2xl font-bold text-orange-600">Blazor</div><div class="text-xs text-gray-400 mt-1">Web UI</div></div>
|
||||
<div class="p-5 bg-orange-50/50 rounded-xl border border-orange-200"><div class="text-2xl font-bold text-orange-600">MudBlazor</div><div class="text-xs text-gray-400 mt-1">Components</div></div>
|
||||
<div class="p-5 bg-orange-50/50 rounded-xl border border-orange-200"><div class="text-2xl font-bold text-orange-600">MS SQL</div><div class="text-xs text-gray-400 mt-1">Database</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- DEMO SECTION -->
|
||||
<section id="cta" class="py-20 md:py-28 bg-orange-50/30">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="text-center mb-16">
|
||||
<span class="inline-flex items-center gap-1.5 px-3 py-1 bg-orange-50 text-orange-600 text-xs font-semibold rounded-full border border-orange-200">SEE IT IN ACTION</span>
|
||||
<h2 class="mt-4 text-3xl sm:text-4xl font-bold text-gray-900">Try the Live Demo</h2>
|
||||
<p class="mt-4 text-gray-500 max-w-2xl mx-auto">Don't take our word for it. Explore every feature in the live demo — no installation required.</p>
|
||||
</div>
|
||||
<div class="max-w-2xl mx-auto">
|
||||
<div class="p-8 bg-white rounded-xl border border-orange-100 shadow-sm">
|
||||
<div class="text-center mb-6">
|
||||
<div class="feature-icon mx-auto mb-4">
|
||||
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"/></svg>
|
||||
</div>
|
||||
<h3 class="text-xl font-semibold text-gray-900">Demo Credentials</h3>
|
||||
<p class="mt-2 text-sm text-gray-500">Use these credentials to sign in and explore the full application:</p>
|
||||
</div>
|
||||
<div class="space-y-3">
|
||||
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
|
||||
<span class="text-sm text-gray-500">URL</span>
|
||||
<a href="https://blazor-wms.csharpasp.net/" target="_blank" class="text-sm font-medium text-orange-600 hover:text-orange-700">blazor-wms.csharpasp.net</a>
|
||||
</div>
|
||||
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
|
||||
<span class="text-sm text-gray-500">Email</span>
|
||||
<span class="text-sm font-medium text-gray-900">admin@@root.com</span>
|
||||
</div>
|
||||
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
|
||||
<span class="text-sm text-gray-500">Password</span>
|
||||
<span class="text-sm font-medium text-gray-900">123456</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-6 text-center">
|
||||
<a href="https://blazor-wms.csharpasp.net/" target="_blank" class="btn-primary text-base px-8 py-3.5">
|
||||
Open Live Demo
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 7l5 5m0 0l-5 5m5-5H6"/></svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- CTA -->
|
||||
<section class="py-20 md:py-28 bg-orange-600 text-white">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold">Stop Building from Scratch</h2>
|
||||
<p class="mt-4 text-orange-100 max-w-xl mx-auto">AI can generate snippets, but a complete, working application from end to end is a different story. Get WMS source code — fully functional, beautifully designed, and ready to deploy.</p>
|
||||
<div class="mt-8 flex flex-col sm:flex-row items-center justify-center gap-4">
|
||||
<a href="https://blazor-wms.csharpasp.net/" target="_blank" class="inline-flex items-center gap-2 px-6 py-3 bg-white text-orange-600 font-semibold rounded-lg hover:bg-orange-50 transition text-sm">Try Live Demo</a>
|
||||
<a href="https://indotalent.com" target="_blank" class="inline-flex items-center gap-2 px-6 py-3 border-2 border-white/30 text-white font-semibold rounded-lg hover:bg-white/10 transition text-sm">Get Source Code</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- FOOTER -->
|
||||
<footer class="bg-slate-900 border-t border-slate-800">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
|
||||
<div class="grid sm:grid-cols-2 md:grid-cols-4 gap-8">
|
||||
<div>
|
||||
<div class="flex items-center gap-2 text-white font-bold text-lg mb-4">
|
||||
<svg class="w-6 h-6 text-orange-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="8.5" y="14" width="7" height="7" rx="1"/></svg>
|
||||
WMS
|
||||
</div>
|
||||
<p class="text-sm text-gray-500 leading-relaxed">Smart warehousing, seamless inventory flow. The ultimate bridge between your business and your customers.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="text-xs font-semibold text-orange-400 uppercase tracking-wider mb-4">Business Features</h4>
|
||||
<div class="space-y-2"><a class="footer-link block">Sales & Purchasing</a><a class="footer-link block">Inventory Control</a><a class="footer-link block">Third Party Management</a><a class="footer-link block">Booking & Scheduling</a></div>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="text-xs font-semibold text-orange-400 uppercase tracking-wider mb-4">Technical</h4>
|
||||
<div class="space-y-2"><a class="footer-link block">.NET 10 + Blazor</a><a class="footer-link block">MudBlazor 9</a><a class="footer-link block">MS SQL + EF Core</a><a class="footer-link block">VSA + CQRS</a></div>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="text-xs font-semibold text-orange-400 uppercase tracking-wider mb-4">Resources</h4>
|
||||
<div class="space-y-2"><a class="footer-link block" href="https://blazor-wms.csharpasp.net/" target="_blank">Live Demo</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-10 pt-8 border-t border-slate-800 flex flex-col sm:flex-row items-center justify-between gap-4">
|
||||
<p class="text-xs text-gray-600">© 2026 WMS. All rights reserved.</p>
|
||||
<div class="flex gap-4">
|
||||
<a class="text-gray-500 hover:text-gray-300 transition text-xs cursor-pointer">Privacy</a>
|
||||
<a class="text-gray-500 hover:text-gray-300 transition text-xs cursor-pointer">Terms</a>
|
||||
<a class="text-gray-500 hover:text-gray-300 transition text-xs cursor-pointer">Cookies</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- FAB Back to Top -->
|
||||
<button id="fab-top" :class="atTop ? '' : 'show'" @@click="window.scrollTo({top:0,behavior:'smooth'})" aria-label="Back to top">
|
||||
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M5 15l7-7 7 7"/></svg>
|
||||
</button>
|
||||
|
||||
<script>
|
||||
function initScrollSpy() {
|
||||
const observer = new IntersectionObserver(function(entries) {
|
||||
entries.forEach(function(e) {
|
||||
if (e.isIntersecting) {
|
||||
document.querySelectorAll('.nav-link').forEach(function(l) { l.classList.remove('active'); });
|
||||
var el = document.querySelector('.nav-link[href="#'+e.target.id+'"]');
|
||||
if (el) el.classList.add('active');
|
||||
}
|
||||
});
|
||||
}, { rootMargin: '-80px 0px -50% 0px' });
|
||||
document.querySelectorAll('section[id]').forEach(function(s) { observer.observe(s); });
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,258 @@
|
||||
|
||||
|
||||
<dialog id="components-reconnect-modal" data-nosnippet>
|
||||
<div class="components-reconnect-container">
|
||||
<div class="components-rejoining-animation" aria-hidden="true">
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<p class="components-reconnect-first-attempt-visible">
|
||||
Rejoining the server...
|
||||
</p>
|
||||
<p class="components-reconnect-repeated-attempt-visible">
|
||||
Rejoin failed... trying again in <span id="components-seconds-to-next-attempt"></span> seconds.
|
||||
</p>
|
||||
<p class="components-reconnect-failed-visible">
|
||||
Failed to rejoin.<br />Please retry or reload the page.
|
||||
</p>
|
||||
<button id="components-reconnect-button" class="components-reconnect-failed-visible">
|
||||
Retry
|
||||
</button>
|
||||
<p class="components-pause-visible">
|
||||
The session has been paused by the server.
|
||||
</p>
|
||||
<p class="components-resume-failed-visible">
|
||||
Failed to resume the session.<br />Please retry or reload the page.
|
||||
</p>
|
||||
<button id="components-resume-button" class="components-pause-visible components-resume-failed-visible">
|
||||
Resume
|
||||
</button>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<style>
|
||||
.components-reconnect-first-attempt-visible,
|
||||
.components-reconnect-repeated-attempt-visible,
|
||||
.components-reconnect-failed-visible,
|
||||
.components-pause-visible,
|
||||
.components-resume-failed-visible,
|
||||
.components-rejoining-animation {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
|
||||
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
|
||||
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
|
||||
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
|
||||
#components-reconnect-modal.components-reconnect-retrying,
|
||||
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
|
||||
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
|
||||
#components-reconnect-modal.components-reconnect-failed,
|
||||
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
#components-reconnect-modal {
|
||||
background-color: white;
|
||||
width: 20rem;
|
||||
margin: 20vh auto;
|
||||
padding: 2rem;
|
||||
border: 0;
|
||||
border-radius: 0.5rem;
|
||||
box-shadow: 0 3px 6px 2px rgba(0, 0, 0, 0.3);
|
||||
opacity: 0;
|
||||
transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
|
||||
animation: components-reconnect-modal-fadeOutOpacity 0.5s both;
|
||||
|
||||
&[open] {
|
||||
animation: components-reconnect-modal-slideUp 1.5s cubic-bezier(.05, .89, .25, 1.02) 0.3s, components-reconnect-modal-fadeInOpacity 0.5s ease-in-out 0.3s;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
}
|
||||
|
||||
#components-reconnect-modal::backdrop {
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
animation: components-reconnect-modal-fadeInOpacity 0.5s ease-in-out;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@@keyframes components-reconnect-modal-slideUp {
|
||||
0% {
|
||||
transform: translateY(30px) scale(0.95);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@keyframes components-reconnect-modal-fadeInOpacity {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@keyframes components-reconnect-modal-fadeOutOpacity {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.components-reconnect-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
#components-reconnect-modal p {
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#components-reconnect-modal button {
|
||||
border: 0;
|
||||
background-color: #6b9ed2;
|
||||
color: white;
|
||||
padding: 4px 24px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
#components-reconnect-modal button:hover {
|
||||
background-color: #3b6ea2;
|
||||
}
|
||||
|
||||
#components-reconnect-modal button:active {
|
||||
background-color: #6b9ed2;
|
||||
}
|
||||
|
||||
.components-rejoining-animation {
|
||||
position: relative;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.components-rejoining-animation div {
|
||||
position: absolute;
|
||||
border: 3px solid #0087ff;
|
||||
opacity: 1;
|
||||
border-radius: 50%;
|
||||
animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
|
||||
}
|
||||
|
||||
.components-rejoining-animation div:nth-child(2) {
|
||||
animation-delay: -0.5s;
|
||||
}
|
||||
|
||||
@@keyframes components-rejoining-animation {
|
||||
0% {
|
||||
top: 40px;
|
||||
left: 40px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
4.9% {
|
||||
top: 40px;
|
||||
left: 40px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
5% {
|
||||
top: 40px;
|
||||
left: 40px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
100% {
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
// Set up event handlers
|
||||
const reconnectModal = document.getElementById("components-reconnect-modal");
|
||||
reconnectModal.addEventListener("components-reconnect-state-changed", handleReconnectStateChanged);
|
||||
|
||||
const retryButton = document.getElementById("components-reconnect-button");
|
||||
retryButton.addEventListener("click", retry);
|
||||
|
||||
const resumeButton = document.getElementById("components-resume-button");
|
||||
resumeButton.addEventListener("click", resume);
|
||||
|
||||
function handleReconnectStateChanged(event) {
|
||||
if (event.detail.state === "show") {
|
||||
reconnectModal.showModal();
|
||||
} else if (event.detail.state === "hide") {
|
||||
reconnectModal.close();
|
||||
} else if (event.detail.state === "failed") {
|
||||
document.addEventListener("visibilitychange", retryWhenDocumentBecomesVisible);
|
||||
} else if (event.detail.state === "rejected") {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
async function retry() {
|
||||
document.removeEventListener("visibilitychange", retryWhenDocumentBecomesVisible);
|
||||
|
||||
try {
|
||||
// Reconnect will asynchronously return:
|
||||
// - true to mean success
|
||||
// - false to mean we reached the server, but it rejected the connection (e.g., unknown circuit ID)
|
||||
// - exception to mean we didn't reach the server (this can be sync or async)
|
||||
const successful = await Blazor.reconnect();
|
||||
if (!successful) {
|
||||
// We have been able to reach the server, but the circuit is no longer available.
|
||||
// We'll reload the page so the user can continue using the app as quickly as possible.
|
||||
const resumeSuccessful = await Blazor.resumeCircuit();
|
||||
if (!resumeSuccessful) {
|
||||
location.reload();
|
||||
} else {
|
||||
reconnectModal.close();
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
// We got an exception, server is currently unavailable
|
||||
document.addEventListener("visibilitychange", retryWhenDocumentBecomesVisible);
|
||||
}
|
||||
}
|
||||
|
||||
async function resume() {
|
||||
try {
|
||||
const successful = await Blazor.resumeCircuit();
|
||||
if (!successful) {
|
||||
location.reload();
|
||||
}
|
||||
} catch {
|
||||
reconnectModal.classList.replace("components-reconnect-paused", "components-reconnect-resume-failed");
|
||||
}
|
||||
}
|
||||
|
||||
async function retryWhenDocumentBecomesVisible() {
|
||||
if (document.visibilityState === "visible") {
|
||||
await retry();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
@using Indotalent.ConfigBackEnd.Interfaces
|
||||
@using Indotalent.Features.Account.AccessDenied
|
||||
@using Indotalent.Features.Root.NotFound
|
||||
@using Microsoft.AspNetCore.Components.Authorization
|
||||
|
||||
|
||||
<CascadingAuthenticationState>
|
||||
<Router AppAssembly="typeof(Program).Assembly" NotFoundPage="typeof(NotFound.NotFoundPage)">
|
||||
<Found Context="routeData">
|
||||
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(Root.MainLayout)">
|
||||
<NotAuthorized>
|
||||
<RedirectToAccessDenied />
|
||||
</NotAuthorized>
|
||||
<Authorizing>
|
||||
<div class="d-flex align-center justify-center mt-16">
|
||||
<MudProgressCircular Color="Color.Primary" Indeterminate="true" />
|
||||
<MudText Class="ml-3">Memverifikasi identitas...</MudText>
|
||||
</div>
|
||||
</Authorizing>
|
||||
</AuthorizeRouteView>
|
||||
<FocusOnNavigate RouteData="routeData" Selector="h1" />
|
||||
</Found>
|
||||
</Router>
|
||||
</CascadingAuthenticationState>
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
@using MudBlazor
|
||||
|
||||
<MudDialog>
|
||||
<TitleContent>
|
||||
<div class="pa-4" style="background-color: #f44336; margin: -16px -24px 0 -24px;">
|
||||
<div class="d-flex align-center justify-center">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Warning" Style="color: white;" Size="Size.Large" />
|
||||
<MudText Typo="Typo.h6" Style="color: white; font-weight: 800; margin-left: 12px;">Confirm Delete</MudText>
|
||||
</div>
|
||||
</div>
|
||||
</TitleContent>
|
||||
<DialogContent>
|
||||
<div class="pa-4 text-center">
|
||||
<MudText Typo="Typo.body1" Class="mb-2">Are you sure you want to delete <b>@ContentText</b>?</MudText>
|
||||
<MudText Typo="Typo.body2" Color="Color.Error" Style="font-weight: 700;">This action cannot be undone.</MudText>
|
||||
</div>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<div class="d-flex justify-center gap-2 w-100 pb-4">
|
||||
<MudButton OnClick="Cancel"
|
||||
Variant="Variant.Outlined"
|
||||
Disabled="_isDeleting"
|
||||
Style="border: 1px solid #e0e0e0; border-radius: 4px; text-transform: none; font-weight: 700;">Cancel</MudButton>
|
||||
<MudButton Color="Color.Error"
|
||||
Variant="Variant.Filled"
|
||||
OnClick="HandleSubmit"
|
||||
Disabled="_isDeleting"
|
||||
Style="border-radius: 4px; text-transform: none; font-weight: 700;">
|
||||
@if (_isDeleting)
|
||||
{
|
||||
<MudProgressCircular Class="ms-n1" Size="Size.Small" Indeterminate="true" />
|
||||
<MudText Class="ms-2">Deleting...</MudText>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudText>Yes, Delete It</MudText>
|
||||
}
|
||||
</MudButton>
|
||||
</div>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
|
||||
@code {
|
||||
[CascadingParameter] IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
[Parameter] public string ContentText { get; set; } = string.Empty;
|
||||
|
||||
private bool _isDeleting = false;
|
||||
|
||||
private async Task HandleSubmit()
|
||||
{
|
||||
_isDeleting = true;
|
||||
StateHasChanged();
|
||||
await Task.Delay(1000);
|
||||
MudDialog.Close(DialogResult.Ok(true));
|
||||
}
|
||||
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
@using Indotalent.Infrastructure.Authentication.Identity
|
||||
@using Microsoft.Extensions.Options
|
||||
@inject IOptions<IdentitySettingsModel> IdentityOptions
|
||||
|
||||
@if (IdentityOptions.Value.SsoFirebase.IsUsed)
|
||||
{
|
||||
<script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-app-compat.js"></script>
|
||||
<script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-auth-compat.js"></script>
|
||||
<script>
|
||||
const firebaseConfig = {
|
||||
apiKey: "@IdentityOptions.Value.SsoFirebase.ApiKey",
|
||||
authDomain: "@IdentityOptions.Value.SsoFirebase.AuthDomain",
|
||||
projectId: "@IdentityOptions.Value.SsoFirebase.ProjectId",
|
||||
storageBucket: "@IdentityOptions.Value.SsoFirebase.StorageBucket",
|
||||
messagingSenderId: "@IdentityOptions.Value.SsoFirebase.MessagingSenderId",
|
||||
appId: "@IdentityOptions.Value.SsoFirebase.AppId"
|
||||
};
|
||||
|
||||
if (typeof firebase !== 'undefined' && !firebase.apps.length) {
|
||||
firebase.initializeApp(firebaseConfig);
|
||||
}
|
||||
|
||||
async function signInWithGoogle() {
|
||||
if (typeof firebase === 'undefined') return null;
|
||||
const provider = new firebase.auth.GoogleAuthProvider();
|
||||
try {
|
||||
const result = await firebase.auth().signInWithPopup(provider);
|
||||
return { email: result.user.email };
|
||||
} catch (error) {
|
||||
console.error("Firebase Auth Error:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async function firebaseLogout() {
|
||||
if (typeof firebase !== 'undefined') {
|
||||
await firebase.auth().signOut();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
@using System.Net.Http
|
||||
@using System.Net.Http.Json
|
||||
@using Microsoft.AspNetCore.Components.Forms
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||
@using Microsoft.JSInterop
|
||||
@using Indotalent
|
||||
@using Indotalent.Features.Root
|
||||
@using MudBlazor
|
||||
|
||||
@inject NavigationManager NavigationManager
|
||||
Reference in New Issue
Block a user