tractatus/public/admin/hooks-dashboard.html
TheFlow 8667088c5f feat(admin): Phase 2 - standardize admin UI with unified navbar component
SUMMARY:
Completed Phase 2 of admin UI overhaul: Created unified navbar component
for simple pages, standardized CSS versioning across all pages, and fixed
broken navigation. Pragmatic approach preserves valuable cross-page navigation
while ensuring consistency.

CHANGES - Simple Pages (Unified Navbar Component):
- newsletter-management.html: Replaced custom navbar with component
- hooks-dashboard.html: Replaced custom navbar with component
- audit-analytics.html: Fixed wrong navbar (was using public site component)

CHANGES - Complex Pages (Standardized CSS Only):
- case-moderation.html: Added CSS version v=1759833751
- media-triage.html: Added CSS version v=1759833751
- project-manager.html: Updated CSS version to v=1759833751
- rule-manager.html: Updated CSS version to v=1759833751
(These pages retained custom navbars to preserve cross-page navigation UX)

COMPONENT ENHANCEMENTS:
- navbar-admin.js: Added 'hooks' icon for Framework Hooks Dashboard
- Newsletter management JS: Removed manual admin-name and logout handling

CSS STANDARDIZATION:
Target version: /css/tailwind.css?v=1759833751
- 7 pages now use standardized version (was 3 different versions + missing)

RESULTS:
- All admin pages now have consistent navbar styling
- Simple pages use unified component (3 pages)
- Complex pages use standardized custom navbars (6 pages)
- All pages have correct CSS versioning
- audit-analytics.html fixed (was using wrong component)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 21:51:09 +13:00

180 lines
8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Framework Hooks Dashboard | Tractatus Admin</title>
<link rel="stylesheet" href="/css/tailwind.css?v=1759833751">
<link rel="stylesheet" href="/css/tractatus-theme.min.css">
<script src="/js/admin/auth-check.js"></script>
</head>
<body class="bg-gray-50">
<!-- Navigation -->
<div id="admin-navbar" data-page-title="Framework Hooks Dashboard" data-page-icon="hooks"></div>
<script src="/js/components/navbar-admin.js"></script>
<!-- Main Content -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Header -->
<div class="mb-8">
<h1 class="text-3xl font-bold text-gray-900">Framework Enforcement Metrics</h1>
<p class="mt-2 text-gray-600">Real-time monitoring of Claude Code hook validators and architectural enforcement</p>
</div>
<!-- Quick Stats -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
<!-- Total Executions -->
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-blue-100 rounded-md p-3">
<svg aria-hidden="true" class="h-6 w-6 text-blue-600" 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 class="ml-4">
<p class="text-sm font-medium text-gray-500">Total Hook Executions</p>
<p id="stat-total-executions" class="text-2xl font-semibold text-gray-900">-</p>
</div>
</div>
</div>
<!-- Total Blocks -->
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-red-100 rounded-md p-3">
<svg aria-hidden="true" class="h-6 w-6 text-red-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"/>
</svg>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-500">Operations Blocked</p>
<p id="stat-total-blocks" class="text-2xl font-semibold text-gray-900">-</p>
</div>
</div>
</div>
<!-- Block Rate -->
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-yellow-100 rounded-md p-3">
<svg aria-hidden="true" class="h-6 w-6 text-yellow-600" 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 class="ml-4">
<p class="text-sm font-medium text-gray-500">Block Rate</p>
<p id="stat-block-rate" class="text-2xl font-semibold text-gray-900">-</p>
</div>
</div>
</div>
<!-- Last Updated -->
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-green-100 rounded-md p-3">
<svg aria-hidden="true" class="h-6 w-6 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-500">Last Activity</p>
<p id="stat-last-updated" class="text-sm font-semibold text-gray-900">-</p>
</div>
</div>
</div>
</div>
<!-- Hook Breakdown -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
<!-- Edit Hook Stats -->
<div class="bg-white rounded-lg shadow">
<div class="px-6 py-4 border-b border-gray-200">
<h3 class="text-lg font-medium text-gray-900 flex items-center gap-2">
<svg class="h-5 w-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
</svg>
Edit Hook
</h3>
</div>
<div class="px-6 py-4">
<div class="space-y-4">
<div class="flex justify-between">
<span class="text-sm text-gray-600">Total Executions:</span>
<span id="edit-executions" class="text-sm font-semibold text-gray-900">-</span>
</div>
<div class="flex justify-between">
<span class="text-sm text-gray-600">Blocks:</span>
<span id="edit-blocks" class="text-sm font-semibold text-red-600">-</span>
</div>
<div class="flex justify-between">
<span class="text-sm text-gray-600">Success Rate:</span>
<span id="edit-success-rate" class="text-sm font-semibold text-green-600">-</span>
</div>
</div>
</div>
</div>
<!-- Write Hook Stats -->
<div class="bg-white rounded-lg shadow">
<div class="px-6 py-4 border-b border-gray-200">
<h3 class="text-lg font-medium text-gray-900 flex items-center gap-2">
<svg class="h-5 w-5 text-purple-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
Write Hook
</h3>
</div>
<div class="px-6 py-4">
<div class="space-y-4">
<div class="flex justify-between">
<span class="text-sm text-gray-600">Total Executions:</span>
<span id="write-executions" class="text-sm font-semibold text-gray-900">-</span>
</div>
<div class="flex justify-between">
<span class="text-sm text-gray-600">Blocks:</span>
<span id="write-blocks" class="text-sm font-semibold text-red-600">-</span>
</div>
<div class="flex justify-between">
<span class="text-sm text-gray-600">Success Rate:</span>
<span id="write-success-rate" class="text-sm font-semibold text-green-600">-</span>
</div>
</div>
</div>
</div>
</div>
<!-- Recent Blocks -->
<div class="bg-white rounded-lg shadow mb-8">
<div class="px-6 py-4 border-b border-gray-200">
<h3 class="text-lg font-medium text-gray-900">Recent Blocked Operations</h3>
</div>
<div class="divide-y divide-gray-200">
<div id="recent-blocks" class="px-6 py-4">
<div class="text-center py-8 text-gray-500">No blocked operations</div>
</div>
</div>
</div>
<!-- Recent Activity -->
<div class="bg-white rounded-lg shadow">
<div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center">
<h3 class="text-lg font-medium text-gray-900">Recent Hook Executions</h3>
<button id="refresh-btn" class="text-sm text-blue-600 hover:text-blue-700 font-medium">
Refresh
</button>
</div>
<div class="divide-y divide-gray-200">
<div id="recent-activity" class="px-6 py-4 max-h-96 overflow-y-auto">
<div class="text-center py-8 text-gray-500">Loading activity...</div>
</div>
</div>
</div>
</div>
<script src="/js/admin/hooks-dashboard.js"></script>
</body>
</html>