add violation details page layout
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
'use client'
|
||||
|
||||
import { useParams } from 'next/navigation'
|
||||
import ViolationPageTitle from '@/app/ui/violations/file-page/violation-page-title';
|
||||
import ViolationPageViolationInfo from '@/app/ui/violations/file-page/violation-page-violation-info';
|
||||
import ViolationPpageFileStatistic from '@/app/ui/violations/file-page/violation-page-file-statistic';
|
||||
import ViolationPageFileInfo from '@/app/ui/violations/file-page/violation-page-file-info';
|
||||
import ViolationPageActions from '@/app/ui/violations/file-page/violation-page-actions';
|
||||
import ViolationPageViolationsList from '@/app/ui/violations/file-page/violation-page-violations-list';
|
||||
import ViolationPageNote from '@/app/ui/violations/file-page/violation-page-note';
|
||||
|
||||
/* violation-details */
|
||||
export default function Page() {
|
||||
const params = useParams()
|
||||
const id = params.id
|
||||
|
||||
return (
|
||||
<div
|
||||
className="violation-details"
|
||||
>
|
||||
<ViolationPageTitle />
|
||||
<div
|
||||
className="grid grid-cols-[2fr_1fr] gap-3"
|
||||
>
|
||||
<div>
|
||||
<ViolationPageViolationInfo />
|
||||
<ViolationPageViolationsList />
|
||||
<ViolationPageNote />
|
||||
</div>
|
||||
<div>
|
||||
<ViolationPpageFileStatistic />
|
||||
<ViolationPageFileInfo />
|
||||
<ViolationPageActions />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -4138,3 +4138,346 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.violation-details {
|
||||
.page-title-color-frame {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
|
||||
.violation-page-icon {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 40px;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
backdrop-filter: blur(10px);
|
||||
border: 2px solid rgba(255, 255, 255, 0.3);
|
||||
overflow: hidden;
|
||||
|
||||
.icon {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.violation-page-info {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 2px solid #f1f5f9;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid #f8fafc;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
color: #64748b;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
color: #1e293b;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.violation-source {
|
||||
margin-top: 15px;
|
||||
|
||||
&-title {
|
||||
font-size: 14px;
|
||||
color: #64748b;
|
||||
margin-bottom: 8px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.url-display {
|
||||
background: #f8fafc;
|
||||
padding: 12px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e2e8f0;
|
||||
margin-top: 10px;
|
||||
word-break: break-all;
|
||||
|
||||
.url-link {
|
||||
color: #6366f1;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.notes-section {
|
||||
background: #f8fafc;
|
||||
padding: 15px;
|
||||
border-radius: 12px;
|
||||
margin-top: 15px;
|
||||
border: 1px solid #e2e8f0;
|
||||
text-align: left;
|
||||
|
||||
.notes-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
margin-bottom: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.notes-content {
|
||||
font-size: 13px;
|
||||
color: #475569;
|
||||
line-height: 1.6;
|
||||
white-space: pre-line;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
text-align: left;
|
||||
word-wrap: break-word;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.stats-mini-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 15px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.stat-mini-card {
|
||||
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
|
||||
padding: 15px;
|
||||
border-radius: 12px;
|
||||
text-align: center;
|
||||
border: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.stat-mini-value {
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
color: #1e293b;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.stat-mini-label {
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
}
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.btn-action {
|
||||
flex: 1;
|
||||
min-width: 150px;
|
||||
padding: 12px 20px;
|
||||
border-radius: 12px;
|
||||
font-weight: 600;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.btn-warning {
|
||||
background: linear-gradient(135deg, #f59e0b, #d97706);
|
||||
color: white;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
.btn-success {
|
||||
background: linear-gradient(135deg, #10b981, #059669);
|
||||
color: white;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: linear-gradient(135deg, #64748b, #475569);
|
||||
color: white;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 20px rgba(100, 116, 139, 0.4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-small {
|
||||
padding: 6px 12px;
|
||||
border-radius: 8px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.btn-primary-small {
|
||||
background: linear-gradient(135deg, #6366f1, #8b5cf6);
|
||||
color: white;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
.btn-secondary-small {
|
||||
background: #f1f5f9;
|
||||
color: #64748b;
|
||||
|
||||
&:hover {
|
||||
background: #e2e8f0;
|
||||
}
|
||||
}
|
||||
|
||||
.sources-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
|
||||
.source-card {
|
||||
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
|
||||
border-radius: 12px;
|
||||
padding: 15px;
|
||||
border: 1px solid #e2e8f0;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
|
||||
border-color: #cbd5e1;
|
||||
}
|
||||
}
|
||||
|
||||
.source-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.source-url {
|
||||
color: #6366f1;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
text-decoration: none;
|
||||
word-break: break-all;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.source-status {
|
||||
padding: 4px 10px;
|
||||
border-radius: 6px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
margin-left: 10px;
|
||||
|
||||
&.new {
|
||||
background: #fef2f2;
|
||||
color: #dc2626;
|
||||
}
|
||||
}
|
||||
|
||||
.source-meta {
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
margin-bottom: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.source-actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.pagination {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
|
||||
&__item {
|
||||
padding: 8px 12px;
|
||||
border-radius: 8px;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
background: white;
|
||||
color: #374151;
|
||||
border: 2px solid #e5e7eb;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
&--active {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
border: 2px solid #667eea;
|
||||
|
||||
&:hover {
|
||||
border-color: #667eea;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.note-form {
|
||||
margin-top: 0;
|
||||
border: none;
|
||||
padding: 0;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.note-textarea {
|
||||
width: 100%;
|
||||
min-height: 80px;
|
||||
padding: 12px;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
font-family: inherit;
|
||||
resize: vertical;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: #6366f1;
|
||||
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,6 +64,16 @@ export function IconEye() {
|
||||
)
|
||||
}
|
||||
|
||||
export function IconEyeDashed() {
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" className="icon">
|
||||
<g fill="none" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1">
|
||||
<path d="M10.585 10.587a2 2 0 0 0 2.829 2.828" /><path d="M16.681 16.673A8.7 8.7 0 0 1 12 18q-5.4 0-9-6q1.908-3.18 4.32-4.674m2.86-1.146A9 9 0 0 1 12 6q5.4 0 9 6q-1 1.665-2.138 2.87M3 3l18 18" />
|
||||
</g>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
export function IconDoubleArrowRight() {
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" className="icon"><path fill="currentColor" d="M6.41 6L5 7.41L9.58 12L5 16.59L6.41 18l6-6z" /><path fill="currentColor" d="m13 6l-1.41 1.41L16.17 12l-4.58 4.59L13 18l6-6z" /></svg>
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
export default function ViolationPageActions() {
|
||||
return (
|
||||
<div
|
||||
className="block-wrapper"
|
||||
>
|
||||
<div className="card-header">
|
||||
<h3 className="card-title">
|
||||
Действия
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div className="action-buttons">
|
||||
<div>
|
||||
<button type="button" className="btn-action btn-warning">
|
||||
Взять в работу
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="button" className="btn-action btn-success">
|
||||
Отметить решенным
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="button" className="btn-action btn-secondary">
|
||||
Ложное срабатывание
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
export default function ViolationPageFileInfo() {
|
||||
return (
|
||||
<div
|
||||
className="block-wrapper"
|
||||
>
|
||||
<div className="content-card">
|
||||
<div className="card-header">
|
||||
<h3 className="card-title">
|
||||
📄 Информация о файле
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div className="info-row">
|
||||
<span className="info-label">Тип файла</span>
|
||||
<span className="info-value">fileType</span>
|
||||
</div>
|
||||
<div className="info-row">
|
||||
<span className="info-label">Размер</span>
|
||||
<span className="info-value">0 КБ</span>
|
||||
</div>
|
||||
<div className="info-row">
|
||||
<span className="info-label">Загружен</span>
|
||||
<span className="info-value">0</span>
|
||||
</div>
|
||||
<div className="info-row">
|
||||
<span className="info-label">Водяной знак</span>
|
||||
<span className="info-value">
|
||||
Применен
|
||||
</span>
|
||||
</div>
|
||||
<div className="info-row">
|
||||
<span className="info-label">Уровень защиты</span>
|
||||
<span className="info-value">
|
||||
Максимальный
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
export default function ViolationPpageFileStatistic() {
|
||||
return (
|
||||
<div
|
||||
className="block-wrapper"
|
||||
>
|
||||
<div className="card-header">
|
||||
<h3 className="card-title">
|
||||
Статистика по файлу
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div className="stats-mini-grid">
|
||||
<div className="stat-mini-card">
|
||||
<div
|
||||
className="stat-mini-value"
|
||||
style={{'color': '#dc2626'}}
|
||||
>
|
||||
0
|
||||
</div>
|
||||
<div className="stat-mini-label">Новых</div>
|
||||
</div>
|
||||
<div className="stat-mini-card">
|
||||
<div
|
||||
className="stat-mini-value"
|
||||
style={{'color': '#d97706'}}
|
||||
>
|
||||
0
|
||||
</div>
|
||||
<div className="stat-mini-label">В работе</div>
|
||||
</div>
|
||||
<div className="stat-mini-card">
|
||||
<div
|
||||
className="stat-mini-value"
|
||||
style={{'color': '#059669'}}
|
||||
>
|
||||
0
|
||||
</div>
|
||||
<div className="stat-mini-label">Решено</div>
|
||||
</div>
|
||||
<div className="stat-mini-card">
|
||||
<div
|
||||
className="stat-mini-value"
|
||||
style={{'color': '#6366f1'}}
|
||||
>
|
||||
0
|
||||
</div>
|
||||
<div className="stat-mini-label">Всего</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
export default function ViolationPageNote() {
|
||||
return (
|
||||
<div
|
||||
className="block-wrapper"
|
||||
>
|
||||
|
||||
<div className="card-header">
|
||||
<h3 className="card-title">
|
||||
✏️ Добавить заметку
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div className="note-form">
|
||||
<form method="POST">
|
||||
<input type="hidden" name="action" value="add_note" />
|
||||
<textarea name="note" className="note-textarea" placeholder="Добавить заметку к этому нарушению..." ></textarea>
|
||||
<button type="submit" className="btn-small btn-primary-small">
|
||||
💾 Сохранить заметку
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { useParams } from 'next/navigation'
|
||||
import { IconEyeDashed } from '@/app/ui/icons/icons';
|
||||
|
||||
export default function ViolationPageTitle() {
|
||||
const t = useTranslations('Global');
|
||||
const params = useParams()
|
||||
const id = params.id
|
||||
|
||||
return (
|
||||
<div className="page-title-color-frame violation-page">
|
||||
<div
|
||||
className="violation-page-icon"
|
||||
>
|
||||
<IconEyeDashed />
|
||||
</div>
|
||||
<div>
|
||||
<h1>
|
||||
file id: {id}
|
||||
</h1>
|
||||
<div
|
||||
className="violation-page-info"
|
||||
>
|
||||
<span>
|
||||
fileType
|
||||
</span>
|
||||
|
||||
<span>
|
||||
fileSize
|
||||
</span>
|
||||
|
||||
<span>
|
||||
fileViolationDate
|
||||
</span>
|
||||
|
||||
<span>
|
||||
fileViolationType
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
export default function ViolationPageViolationInfo() {
|
||||
return (
|
||||
<div
|
||||
className="block-wrapper"
|
||||
>
|
||||
<div className="card-header">
|
||||
<h3 className="card-title">
|
||||
Информация о нарушении
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div className="info-row">
|
||||
<span className="info-label">Тип нарушения</span>
|
||||
<span className="info-value">Неавторизованное использование</span>
|
||||
</div>
|
||||
|
||||
<div className="info-row">
|
||||
<span className="info-label">Дата обнаружения</span>
|
||||
<span className="info-value">28.02.2026 07:48</span>
|
||||
</div>
|
||||
|
||||
<div className="info-row">
|
||||
<span className="info-label">Уверенность</span>
|
||||
<span className="info-value">85%</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="violation-source"
|
||||
>
|
||||
<div
|
||||
className="violation-source-title"
|
||||
>
|
||||
Источник нарушения:
|
||||
</div>
|
||||
<div className="url-display">
|
||||
<a href="#" target="_blank" className="url-link">
|
||||
url
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="notes-section">
|
||||
<div className="notes-title">📝 Заметки:</div>
|
||||
<div className="notes-content">
|
||||
<span>Заметок пока нет. Вы можете добавить первую заметку ниже.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
export default function ViolationPageViolationsList() {
|
||||
return (
|
||||
<div
|
||||
className="block-wrapper"
|
||||
>
|
||||
<div className="card-header">
|
||||
<h3 className="card-title">
|
||||
Все нарушения этого файла
|
||||
</h3>
|
||||
<span>
|
||||
Всего: 0 | Страница 0 из 0
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* это нужно будет сделать отдельным компонентом */}
|
||||
<div
|
||||
className="sources-list"
|
||||
>
|
||||
<div className="source-card">
|
||||
<div className="source-header">
|
||||
<a href="#" target="_blank" className="source-url">
|
||||
artdraw.org
|
||||
</a>
|
||||
<span className="source-status new">
|
||||
Новое
|
||||
</span>
|
||||
</div>
|
||||
<div className="source-meta">
|
||||
<span>28.02.2026 07:48</span>
|
||||
<span>Неавторизованное использование</span>
|
||||
<span>85%</span>
|
||||
</div>
|
||||
<div className="source-actions">
|
||||
<a href="violation-details.php?id=7244" className="btn-small btn-primary-small">
|
||||
Посмотреть
|
||||
</a>
|
||||
<a href="#" target="_blank" className="btn-small btn-secondary-small">
|
||||
Открыть
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="pagination">
|
||||
<span className="pagination__item pagination__item--active">1</span>
|
||||
<a href="?id=7245&related_page=2" className="pagination__item">2</a>
|
||||
<a href="?id=7245&related_page=3" className="pagination__item">3</a>
|
||||
<a href="?id=7245&related_page=2" className="pagination__item pagination__item--next">Следующая</a>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user