{{-- MCP-behörigheter in Admin, Drift (admin.mcp.grants, McpAdminController@index, superadmin only; DESIGN.md Page patterns 2; #2957 slice 15, card #3102). Expects $grants (the 100 newest McpAccessGrant). Same columns as before, folded into five; "Återkalla" (approved and not revoked, as before) opens a native dialog that posts to admin.mcp.grants.revoke. The status is the stored word, as before; only the pill colour is new. --}} @extends('layouts.nuhet') @section('_pageTitle', __('mcp.nh.title')) @section('page') @include('partials.nh-admin-back')

{{ __('mcp.nh.title') }}

{{ __('mcp.nh.lead') }}

@php $pageRows = \App\Support\TablePagination::rows($grants); $nhPills = ['approved' => 'done', 'pending' => 'planned', 'denied' => 'stopped', 'revoked' => 'stopped']; $nhRevocable = $grants->filter(fn ($grant) => $grant->status === 'approved' && is_null($grant->revoked_at)); @endphp @if ($grants->isEmpty()) {{ __('mcp.nh.emptyText') }} @else @foreach ($pageRows as $grant) @endforeach
{{ __('mcp.nh.grant') }} {{ __('mcp.nh.status') }} {{ __('mcp.nh.approvedBy') }} {{ __('mcp.nh.times') }} {{ __('mcp.nh.columnActions') }}
{{ $grant->request_id }} {{ __('mcp.nh.scopes') }}: {{ implode(', ', $grant->scope_list) }} {{ $grant->status }} {{ optional($grant->approvedBy)->fullName() }} {{ __('mcp.nh.expires') }}: {{ \App\Support\DisplayDate::timestamp($grant->expires_at) }} {{ __('mcp.nh.lastUsed') }}: {{ \App\Support\DisplayDate::timestamp($grant->last_used_at) }} @if ($nhRevocable->contains($grant)) {{ __('mcp.nh.revoke') }} @endif
{{ __('mcp.nh.count', ['count' => $grants->count()]) }}
@foreach ($nhRevocable as $grant)

{{ __('mcp.nh.revokeTitle') }}

{{ __('mcp.nh.revokeText', ['id' => $grant->request_id]) }}

@csrf
@endforeach @endif @endsection