feat: implement code quality dashboard with architecture violation tracking

Implement comprehensive code quality dashboard (Phase 2-4) to track and manage
architecture violations found by the validation script.

Backend Implementation:
- Add JSON output support to validate_architecture.py script
- Create CodeQualityService with scan management, violation tracking, and statistics
- Implement REST API endpoints for code quality management:
  * POST /admin/code-quality/scan - trigger new architecture scan
  * GET /admin/code-quality/scans - list scan history
  * GET /admin/code-quality/violations - list violations with filtering/pagination
  * GET /admin/code-quality/violations/{id} - get violation details
  * POST /admin/code-quality/violations/{id}/assign - assign to developer
  * POST /admin/code-quality/violations/{id}/resolve - mark as resolved
  * POST /admin/code-quality/violations/{id}/ignore - mark as ignored
  * POST /admin/code-quality/violations/{id}/comments - add comments
  * GET /admin/code-quality/stats - dashboard statistics
- Fix architecture_scan model imports to use app.core.database

Frontend Implementation:
- Create code quality dashboard page (code-quality-dashboard.html)
  * Summary cards for total violations, errors, warnings, health score
  * Status breakdown (open, assigned, resolved, ignored)
  * Trend visualization for last 7 scans
  * Top violating files list
  * Violations by rule and module
  * Quick action links
- Create violations list page (code-quality-violations.html)
  * Filterable table by severity, status, rule ID, file path
  * Pagination support
  * Violation detail view links
- Add Alpine.js components (code-quality-dashboard.js, code-quality-violations.js)
  * Dashboard state management and scan triggering
  * Violations list with filtering and pagination
  * API integration with authentication
- Add "Code Quality" navigation link in admin sidebar (Developer Tools section)

Routes:
- GET /admin/code-quality - dashboard page
- GET /admin/code-quality/violations - violations list
- GET /admin/code-quality/violations/{id} - violation details

Features:
- Real-time scan execution from UI
- Technical debt score calculation (0-100 scale)
- Violation workflow: open → assigned → resolved/ignored
- Trend tracking across multiple scans
- File and module-level insights
- Assignment system with priorities and due dates
- Collaborative comments on violations

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-28 09:40:14 +01:00
parent 74bf2367f8
commit 9db0da25ec
11 changed files with 1854 additions and 4 deletions

View File

@@ -0,0 +1,300 @@
{# app/templates/admin/code-quality-dashboard.html #}
{% extends "admin/base.html" %}
{% block title %}Code Quality Dashboard{% endblock %}
{% block alpine_data %}codeQualityDashboard(){% endblock %}
{% block extra_scripts %}
<script src="/static/admin/js/code-quality-dashboard.js"></script>
{% endblock %}
{% block content %}
<!-- Page Header with Actions -->
<div class="flex items-center justify-between my-6">
<div>
<h2 class="text-2xl font-semibold text-gray-700 dark:text-gray-200">
Code Quality Dashboard
</h2>
<p class="text-sm text-gray-600 dark:text-gray-400 mt-1">
Architecture validation and technical debt tracking
</p>
</div>
<div class="flex space-x-3">
<button
@click="refresh()"
:disabled="loading"
class="flex items-center px-4 py-2 text-sm font-medium leading-5 text-gray-700 dark:text-gray-300 transition-colors duration-150 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:shadow-outline-gray disabled:opacity-50 disabled:cursor-not-allowed"
>
<span x-show="!loading" x-html="$icon('refresh', 'w-4 h-4 mr-2')"></span>
<span x-show="loading" x-html="$icon('spinner', 'w-4 h-4 mr-2')"></span>
<span>Refresh</span>
</button>
<button
@click="runScan()"
:disabled="scanning"
class="flex items-center px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple disabled:opacity-50 disabled:cursor-not-allowed"
>
<span x-show="!scanning" x-html="$icon('search', 'w-4 h-4 mr-2')"></span>
<span x-show="scanning" x-html="$icon('spinner', 'w-4 h-4 mr-2')"></span>
<span x-text="scanning ? 'Scanning...' : 'Run Scan'"></span>
</button>
</div>
</div>
<!-- Loading State -->
<div x-show="loading" class="text-center py-12">
<span x-html="$icon('spinner', 'inline w-8 h-8 text-purple-600')"></span>
<p class="mt-2 text-gray-600 dark:text-gray-400">Loading dashboard...</p>
</div>
<!-- Error State -->
<div x-show="error && !loading" class="mb-6 p-4 bg-red-100 border border-red-400 text-red-700 rounded-lg flex items-start">
<span x-html="$icon('exclamation', 'w-5 h-5 mr-3 mt-0.5 flex-shrink-0')"></span>
<div>
<p class="font-semibold">Error loading dashboard</p>
<p class="text-sm" x-text="error"></p>
</div>
</div>
<!-- Success Message -->
<div x-show="successMessage" x-transition class="mb-6 p-4 bg-green-100 border border-green-400 text-green-700 rounded-lg flex items-start">
<span x-html="$icon('check-circle', 'w-5 h-5 mr-3 mt-0.5 flex-shrink-0')"></span>
<div>
<p class="font-semibold" x-text="successMessage"></p>
</div>
</div>
<!-- Dashboard Content -->
<div x-show="!loading && !error">
<!-- Stats Cards -->
<div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4">
<!-- Card: Total Violations -->
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<div class="p-3 mr-4 text-red-500 bg-red-100 rounded-full dark:text-red-100 dark:bg-red-500">
<span x-html="$icon('exclamation', 'w-5 h-5')"></span>
</div>
<div>
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
Total Violations
</p>
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.total_violations">
0
</p>
</div>
</div>
<!-- Card: Errors -->
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500">
<span x-html="$icon('alert', 'w-5 h-5')"></span>
</div>
<div>
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
Errors
</p>
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.errors">
0
</p>
</div>
</div>
<!-- Card: Warnings -->
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<div class="p-3 mr-4 text-yellow-500 bg-yellow-100 rounded-full dark:text-yellow-100 dark:bg-yellow-500">
<span x-html="$icon('info', 'w-5 h-5')"></span>
</div>
<div>
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
Warnings
</p>
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.warnings">
0
</p>
</div>
</div>
<!-- Card: Technical Debt Score -->
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<div class="p-3 mr-4 rounded-full"
:class="{
'text-green-500 bg-green-100 dark:text-green-100 dark:bg-green-500': stats.technical_debt_score >= 80,
'text-yellow-500 bg-yellow-100 dark:text-yellow-100 dark:bg-yellow-500': stats.technical_debt_score >= 50 && stats.technical_debt_score < 80,
'text-red-500 bg-red-100 dark:text-red-100 dark:bg-red-500': stats.technical_debt_score < 50
}">
<span x-html="$icon('chart', 'w-5 h-5')"></span>
</div>
<div>
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
Health Score
</p>
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.technical_debt_score + '/100'">
0/100
</p>
</div>
</div>
</div>
<!-- Status Cards -->
<div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4">
<!-- Open -->
<div class="p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<p class="text-sm font-medium text-gray-600 dark:text-gray-400 mb-1">Open</p>
<p class="text-2xl font-semibold text-gray-700 dark:text-gray-200" x-text="stats.open">0</p>
</div>
<!-- Assigned -->
<div class="p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<p class="text-sm font-medium text-gray-600 dark:text-gray-400 mb-1">Assigned</p>
<p class="text-2xl font-semibold text-gray-700 dark:text-gray-200" x-text="stats.assigned">0</p>
</div>
<!-- Resolved -->
<div class="p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<p class="text-sm font-medium text-gray-600 dark:text-gray-400 mb-1">Resolved</p>
<p class="text-2xl font-semibold text-green-600 dark:text-green-400" x-text="stats.resolved">0</p>
</div>
<!-- Ignored -->
<div class="p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<p class="text-sm font-medium text-gray-600 dark:text-gray-400 mb-1">Ignored</p>
<p class="text-2xl font-semibold text-gray-700 dark:text-gray-200" x-text="stats.ignored">0</p>
</div>
</div>
<!-- Trend Chart and Top Files -->
<div class="grid gap-6 mb-8 md:grid-cols-2">
<!-- Trend Chart -->
<div class="p-6 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<h4 class="mb-4 text-lg font-semibold text-gray-700 dark:text-gray-200">
Violation Trends (Last 7 Scans)
</h4>
<div class="h-64 flex items-center justify-center text-gray-500 dark:text-gray-400">
<template x-if="stats.trend && stats.trend.length > 0">
<div class="w-full">
<template x-for="(scan, idx) in stats.trend" :key="idx">
<div class="mb-2">
<div class="flex justify-between text-sm mb-1">
<span x-text="new Date(scan.timestamp).toLocaleDateString()"></span>
<span x-text="scan.violations"></span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2">
<div class="bg-purple-600 h-2 rounded-full"
:style="'width: ' + Math.min(100, (scan.violations / Math.max(...stats.trend.map(s => s.violations)) * 100)) + '%'">
</div>
</div>
</div>
</template>
</div>
</template>
<template x-if="!stats.trend || stats.trend.length === 0">
<p>No scan history available</p>
</template>
</div>
</div>
<!-- Top Violating Files -->
<div class="p-6 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<h4 class="mb-4 text-lg font-semibold text-gray-700 dark:text-gray-200">
Top Violating Files
</h4>
<div class="space-y-3">
<template x-if="stats.top_files && stats.top_files.length > 0">
<template x-for="(file, idx) in stats.top_files.slice(0, 10)" :key="idx">
<div class="flex justify-between items-center">
<div class="flex-1 min-w-0">
<p class="text-sm font-medium text-gray-700 dark:text-gray-300 truncate" x-text="file.file"></p>
</div>
<span class="ml-2 px-2 py-1 text-xs font-semibold rounded-full"
:class="{
'bg-red-100 text-red-800': file.count >= 10,
'bg-yellow-100 text-yellow-800': file.count >= 5 && file.count < 10,
'bg-blue-100 text-blue-800': file.count < 5
}"
x-text="file.count">
</span>
</div>
</template>
</template>
<template x-if="!stats.top_files || stats.top_files.length === 0">
<p class="text-sm text-gray-500 dark:text-gray-400">No violations found</p>
</template>
</div>
</div>
</div>
<!-- Violations by Rule and Module -->
<div class="grid gap-6 mb-8 md:grid-cols-2">
<!-- By Rule -->
<div class="p-6 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<h4 class="mb-4 text-lg font-semibold text-gray-700 dark:text-gray-200">
Top Rules Violated
</h4>
<div class="space-y-2">
<template x-if="stats.by_rule && Object.keys(stats.by_rule).length > 0">
<template x-for="[rule_id, count] in Object.entries(stats.by_rule)" :key="rule_id">
<div class="flex justify-between items-center text-sm">
<span class="text-gray-700 dark:text-gray-300" x-text="rule_id"></span>
<span class="font-semibold text-gray-900 dark:text-gray-100" x-text="count"></span>
</div>
</template>
</template>
<template x-if="!stats.by_rule || Object.keys(stats.by_rule).length === 0">
<p class="text-sm text-gray-500 dark:text-gray-400">No violations found</p>
</template>
</div>
</div>
<!-- By Module -->
<div class="p-6 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<h4 class="mb-4 text-lg font-semibold text-gray-700 dark:text-gray-200">
Violations by Module
</h4>
<div class="space-y-2">
<template x-if="stats.by_module && Object.keys(stats.by_module).length > 0">
<template x-for="[module, count] in Object.entries(stats.by_module)" :key="module">
<div class="flex justify-between items-center text-sm">
<span class="text-gray-700 dark:text-gray-300" x-text="module"></span>
<span class="font-semibold text-gray-900 dark:text-gray-100" x-text="count"></span>
</div>
</template>
</template>
<template x-if="!stats.by_module || Object.keys(stats.by_module).length === 0">
<p class="text-sm text-gray-500 dark:text-gray-400">No violations found</p>
</template>
</div>
</div>
</div>
<!-- Quick Actions -->
<div class="mb-8">
<div class="p-6 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<h4 class="mb-4 text-lg font-semibold text-gray-700 dark:text-gray-200">
Quick Actions
</h4>
<div class="flex flex-wrap gap-3">
<a href="/admin/code-quality/violations"
class="flex items-center px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
<span x-html="$icon('list', 'w-4 h-4 mr-2')"></span>
View All Violations
</a>
<a href="/admin/code-quality/violations?status=open"
class="flex items-center px-4 py-2 text-sm font-medium leading-5 text-gray-700 dark:text-gray-300 transition-colors duration-150 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:shadow-outline-gray">
<span x-html="$icon('folder-open', 'w-4 h-4 mr-2')"></span>
Open Violations
</a>
<a href="/admin/code-quality/violations?severity=error"
class="flex items-center px-4 py-2 text-sm font-medium leading-5 text-gray-700 dark:text-gray-300 transition-colors duration-150 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:shadow-outline-gray">
<span x-html="$icon('alert', 'w-4 h-4 mr-2')"></span>
Errors Only
</a>
</div>
</div>
</div>
<!-- Last Scan Info -->
<div x-show="stats.last_scan" class="text-sm text-gray-600 dark:text-gray-400 text-center">
Last scan: <span x-text="stats.last_scan ? new Date(stats.last_scan).toLocaleString() : 'Never'"></span>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,227 @@
{# app/templates/admin/code-quality-violations.html #}
{% extends "admin/base.html" %}
{% block title %}Violations List{% endblock %}
{% block alpine_data %}codeQualityViolations(){% endblock %}
{% block extra_scripts %}
<script src="/static/admin/js/code-quality-violations.js"></script>
{% endblock %}
{% block content %}
<!-- Page Header -->
<div class="flex items-center justify-between my-6">
<div>
<h2 class="text-2xl font-semibold text-gray-700 dark:text-gray-200">
Architecture Violations
</h2>
<p class="text-sm text-gray-600 dark:text-gray-400 mt-1">
Review and manage code quality violations
</p>
</div>
<a href="/admin/code-quality"
class="flex items-center px-4 py-2 text-sm font-medium leading-5 text-gray-700 dark:text-gray-300 transition-colors duration-150 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:shadow-outline-gray">
<span x-html="$icon('arrow-left', 'w-4 h-4 mr-2')"></span>
Back to Dashboard
</a>
</div>
<!-- Loading State -->
<div x-show="loading" class="text-center py-12">
<span x-html="$icon('spinner', 'inline w-8 h-8 text-purple-600')"></span>
<p class="mt-2 text-gray-600 dark:text-gray-400">Loading violations...</p>
</div>
<!-- Error State -->
<div x-show="error && !loading" class="mb-6 p-4 bg-red-100 border border-red-400 text-red-700 rounded-lg flex items-start">
<span x-html="$icon('exclamation', 'w-5 h-5 mr-3 mt-0.5 flex-shrink-0')"></span>
<div>
<p class="font-semibold">Error loading violations</p>
<p class="text-sm" x-text="error"></p>
</div>
</div>
<!-- Content -->
<div x-show="!loading">
<!-- Filters -->
<div class="mb-6 p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<h3 class="mb-4 text-lg font-semibold text-gray-700 dark:text-gray-200">Filters</h3>
<div class="grid gap-4 md:grid-cols-4">
<!-- Severity Filter -->
<div>
<label class="block text-sm font-medium text-gray-700 dark:text-gray-400 mb-2">
Severity
</label>
<select x-model="filters.severity"
@change="applyFilters()"
class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-select rounded-md">
<option value="">All</option>
<option value="error">Error</option>
<option value="warning">Warning</option>
</select>
</div>
<!-- Status Filter -->
<div>
<label class="block text-sm font-medium text-gray-700 dark:text-gray-400 mb-2">
Status
</label>
<select x-model="filters.status"
@change="applyFilters()"
class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-select rounded-md">
<option value="">All</option>
<option value="open">Open</option>
<option value="assigned">Assigned</option>
<option value="resolved">Resolved</option>
<option value="ignored">Ignored</option>
</select>
</div>
<!-- Rule ID Filter -->
<div>
<label class="block text-sm font-medium text-gray-700 dark:text-gray-400 mb-2">
Rule ID
</label>
<input x-model="filters.rule_id"
@input.debounce.500ms="applyFilters()"
type="text"
placeholder="e.g. API-001"
class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input rounded-md">
</div>
<!-- File Path Filter -->
<div>
<label class="block text-sm font-medium text-gray-700 dark:text-gray-400 mb-2">
File Path
</label>
<input x-model="filters.file_path"
@input.debounce.500ms="applyFilters()"
type="text"
placeholder="e.g. app/api"
class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input rounded-md">
</div>
</div>
</div>
<!-- Violations Table -->
<div class="w-full overflow-hidden rounded-lg shadow-xs">
<div class="w-full overflow-x-auto">
<table class="w-full whitespace-no-wrap">
<thead>
<tr class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800">
<th class="px-4 py-3">Rule</th>
<th class="px-4 py-3">Severity</th>
<th class="px-4 py-3">File</th>
<th class="px-4 py-3">Line</th>
<th class="px-4 py-3">Message</th>
<th class="px-4 py-3">Status</th>
<th class="px-4 py-3">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800">
<template x-if="violations.length === 0">
<tr>
<td colspan="7" class="px-4 py-8 text-center text-gray-500 dark:text-gray-400">
No violations found
</td>
</tr>
</template>
<template x-for="violation in violations" :key="violation.id">
<tr class="text-gray-700 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-700">
<!-- Rule ID -->
<td class="px-4 py-3">
<div class="flex items-center text-sm">
<div>
<p class="font-semibold" x-text="violation.rule_id"></p>
</div>
</div>
</td>
<!-- Severity Badge -->
<td class="px-4 py-3 text-xs">
<span class="px-2 py-1 font-semibold leading-tight rounded-full"
:class="{
'text-red-700 bg-red-100 dark:bg-red-700 dark:text-red-100': violation.severity === 'error',
'text-yellow-700 bg-yellow-100 dark:text-yellow-100 dark:bg-yellow-700': violation.severity === 'warning'
}"
x-text="violation.severity">
</span>
</td>
<!-- File Path -->
<td class="px-4 py-3 text-sm">
<p class="truncate max-w-xs" :title="violation.file_path" x-text="violation.file_path"></p>
</td>
<!-- Line Number -->
<td class="px-4 py-3 text-sm">
<p x-text="violation.line_number"></p>
</td>
<!-- Message -->
<td class="px-4 py-3 text-sm">
<p class="truncate max-w-md" :title="violation.message" x-text="violation.message"></p>
</td>
<!-- Status Badge -->
<td class="px-4 py-3 text-xs">
<span class="px-2 py-1 font-semibold leading-tight rounded-full"
:class="{
'text-gray-700 bg-gray-100 dark:text-gray-100 dark:bg-gray-700': violation.status === 'open',
'text-blue-700 bg-blue-100 dark:text-blue-100 dark:bg-blue-700': violation.status === 'assigned',
'text-green-700 bg-green-100 dark:text-green-100 dark:bg-green-700': violation.status === 'resolved',
'text-orange-700 bg-orange-100 dark:text-orange-100 dark:bg-orange-700': violation.status === 'ignored'
}"
x-text="violation.status">
</span>
</td>
<!-- Actions -->
<td class="px-4 py-3">
<div class="flex items-center space-x-2">
<a :href="'/admin/code-quality/violations/' + violation.id"
class="flex items-center justify-center p-2 text-purple-600 rounded-lg hover:bg-purple-50 dark:text-purple-400 dark:hover:bg-gray-700 focus:outline-none transition-colors"
title="View Details">
<span x-html="$icon('eye', 'w-5 h-5')"></span>
</a>
</div>
</td>
</tr>
</template>
</tbody>
</table>
</div>
</div>
<!-- Pagination -->
<div class="mt-6 px-4 py-3 bg-white border-t border-gray-200 dark:border-gray-700 dark:bg-gray-800 rounded-b-lg">
<div class="flex items-center justify-between">
<div class="flex items-center">
<span class="text-sm text-gray-700 dark:text-gray-400">
Showing
<span class="font-semibold" x-text="violations.length"></span>
of
<span class="font-semibold" x-text="pagination.total"></span>
results
</span>
</div>
<div class="flex items-center space-x-2">
<button @click="previousPage()"
:disabled="pagination.page === 1"
class="px-3 py-1 text-sm font-medium leading-5 text-gray-700 dark:text-gray-300 transition-colors duration-150 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed">
<span x-html="$icon('arrow-left', 'w-4 h-4')"></span>
</button>
<span class="text-sm text-gray-700 dark:text-gray-400">
Page <span x-text="pagination.page"></span> of <span x-text="pagination.total_pages"></span>
</span>
<button @click="nextPage()"
:disabled="pagination.page === pagination.total_pages"
class="px-3 py-1 text-sm font-medium leading-5 text-gray-700 dark:text-gray-300 transition-colors duration-150 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed">
<span x-html="$icon('arrow-right', 'w-4 h-4')"></span>
</button>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -125,6 +125,17 @@
<span class="ml-4">Testing Hub</span>
</a>
</li>
<!-- Code Quality -->
<li class="relative px-6 py-3">
<span x-show="currentPage === 'code-quality'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
:class="currentPage === 'code-quality' ? 'text-gray-800 dark:text-gray-100' : ''"
href="/admin/code-quality">
<span x-html="$icon('shield-check')"></span>
<span class="ml-4">Code Quality</span>
</a>
</li>
</ul>
<!-- Settings Section -->
@@ -290,6 +301,17 @@
<span class="ml-4">Testing Hub</span>
</a>
</li>
<!-- Code Quality -->
<li class="relative px-6 py-3">
<span x-show="currentPage === 'code-quality'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
:class="currentPage === 'code-quality' ? 'text-gray-800 dark:text-gray-100' : ''"
href="/admin/code-quality">
<span x-html="$icon('shield-check')"></span>
<span class="ml-4">Code Quality</span>
</a>
</li>
</ul>
<!-- Settings Section -->