@extends('layouts.app') @section('title', 'Smart Workflow Engine') @push('styles') @endpush @section('content') @php $actionsHtml = '
'.csrf_field().'
'.csrf_field().'
'.csrf_field().'
'; @endphp @include('components.page-header', [ 'title' => 'Workflow Intelligence', 'description' => 'Real-time automation monitoring, capacity planning, and predictive delay analysis.', 'breadcrumbs' => ['Home' => route('admin.dashboard'), 'Workflow' => '#'], 'actions' => $actionsHtml, 'stats' => [ ['label' => 'Active Rules', 'value' => count($rules), 'icon' => 'bi-gear-fill', 'color' => 'var(--accent-green)'], ['label' => 'Delayed Tasks', 'value' => count($predictions), 'icon' => 'bi-exclamation-octagon-fill', 'color' => 'var(--danger-color)'], ['label' => 'Smart Queue', 'value' => count($queueTasks), 'icon' => 'bi-list-stars', 'color' => 'var(--warning-color)'], ['label' => 'Availability', 'value' => '84%', 'icon' => 'bi-pie-chart-fill', 'color' => 'var(--info-color)'] ] ])

Automation Rules Engine

@csrf
@forelse($rules as $rule)
{{ $rule->name }}
{{ str_replace('_', ' ', $rule->rule_type) }}
{{ $rule->is_active ? 'Active' : 'Inactive' }}
@empty

No active rules configured

@endforelse

Real-time Capacity Planning

@forelse($capacity as $row) @empty @endforelse
Engineer Availability Allocated
{{ substr($row->user?->name ?? 'D', 0, 1) }}
{{ $row->user?->name }}
{{ $row->availability_score }}% AVAILABLE
{{ $row->allocated_minutes }}m

No developer capacity data

Intelligence: Risk Forecast

@forelse($predictions as $p)
{{ $p->task?->title ?? 'Unknown Task' }} {{ $p->risk_level }} ({{ $p->score }})

{{ $p->reason }}

@empty

System analysis: No critical delays predicted

@endforelse

Smart Recommendations

@forelse($recommendations as $r)
{{ ucfirst(str_replace('_',' ',$r->recommendation_type)) }} CONFIDENCE {{ $r->confidence_score }}%

{{ $r->message }}

Task: {{ $r->task?->title ?? 'N/A' }}
@if(!$r->is_applied)
@csrf
@else Applied @endif
@empty

Awaiting new system optimizations

@endforelse

Intelligence: Smart Priority Queue

AUTO-SORTED BY ALGORITHM
@forelse($queueTasks as $t) @empty @endforelse
Task Identification Priority Matrix Automation Score
{{ $t->title }}
ID: #TSK-{{ $t->id }}
@php $priority = strtolower($t->priority); $badgeClass = match($priority) { 'critical' => 'badge-critical', 'high' => 'badge-high', 'medium' => 'badge-medium', default => 'badge-low' }; @endphp {{ ucfirst($t->priority) }}
{{ $t->automation_priority_score }} PTS

Smart Queue is empty

@endsection