| | | 1 | | @model OzonDomains.Models.EmailAttachmentProcessingResult |
| | | 2 | | |
| | | 3 | | @{ |
| | 0 | 4 | | ViewData["Title"] = "Детали обработки вложения"; |
| | 0 | 5 | | var statusLabel = Model.Status switch |
| | 0 | 6 | | { |
| | 0 | 7 | | OzonDomains.Models.EmailAttachmentProcessingStatus.Uploaded => ("Обработан", "success"), |
| | 0 | 8 | | OzonDomains.Models.EmailAttachmentProcessingStatus.OrdersImported => ("Заказы импортированы напрямую", "primary" |
| | 0 | 9 | | OzonDomains.Models.EmailAttachmentProcessingStatus.RejectedByRule => ("Отклонён правилом", "secondary"), |
| | 0 | 10 | | OzonDomains.Models.EmailAttachmentProcessingStatus.Duplicate => ("Дубликат", "info"), |
| | 0 | 11 | | OzonDomains.Models.EmailAttachmentProcessingStatus.Failed => ("Ошибка", "danger"), |
| | 0 | 12 | | _ => ("Ожидание", "light") |
| | 0 | 13 | | }; |
| | | 14 | | } |
| | | 15 | | |
| | | 16 | | <link rel="stylesheet" href="~/css/Studio2/EmailRouting/email-routing-results-index.css" asp-append-version="true"/> |
| | | 17 | | |
| | 0 | 18 | | @await Html.PartialAsync("_BsxGridShell") |
| | | 19 | | |
| | | 20 | | <div class="container-fluid err-page py-3 bsx-surface"> |
| | | 21 | | <div class="app-section-hero app-section-hero--import d-flex flex-wrap justify-content-between align-items-start gap |
| | | 22 | | <div> |
| | | 23 | | <h1><i class="bi bi-file-earmark-text text-primary me-2"></i>Детали обработки вложения</h1> |
| | | 24 | | <div class="subtitle">Письмо, вложение и итог выполнения правила импорта</div> |
| | | 25 | | <div class="app-section-hero__quick-links"> |
| | | 26 | | <a asp-action="Index"><i class="bi bi-list-check"></i>Результаты импорта</a> |
| | | 27 | | <a asp-area="Studio2" asp-controller="EmailRoutingRules" asp-action="Index"><i class="bi bi-funnel"></i> |
| | | 28 | | </div> |
| | | 29 | | </div> |
| | | 30 | | <div class="err-hero-actions"> |
| | | 31 | | <a asp-action="Index" class="btn btn-outline-secondary btn-sm"><i class="bi bi-arrow-left"></i> Назад</a> |
| | 0 | 32 | | <span class="badge bg-@statusLabel.Item2 fs-6">@statusLabel.Item1</span> |
| | | 33 | | </div> |
| | | 34 | | </div> |
| | | 35 | | |
| | | 36 | | <div class="row g-4"> |
| | | 37 | | |
| | | 38 | | <!-- Письмо --> |
| | | 39 | | <div class="col-md-6"> |
| | | 40 | | <div class="card er-module-card h-100"> |
| | | 41 | | <div class="card-header fw-semibold"> |
| | | 42 | | <i class="bi bi-envelope text-primary"></i> Источник: письмо |
| | | 43 | | </div> |
| | | 44 | | <div class="card-body"> |
| | | 45 | | <dl class="row mb-0"> |
| | | 46 | | <dt class="col-sm-4 text-muted small">Отправитель</dt> |
| | 0 | 47 | | <dd class="col-sm-8 small font-monospace">@(Model.EmailMessage?.SenderEmail ?? "—")</dd> |
| | | 48 | | |
| | | 49 | | <dt class="col-sm-4 text-muted small">Тема</dt> |
| | 0 | 50 | | <dd class="col-sm-8 small">@(Model.EmailMessage?.Subject ?? "—")</dd> |
| | | 51 | | |
| | | 52 | | <dt class="col-sm-4 text-muted small">Получено</dt> |
| | | 53 | | <dd class="col-sm-8 small"> |
| | 0 | 54 | | @(Model.EmailMessage?.ReceivedAtUtc.HasValue == true |
| | 0 | 55 | | ? Model.EmailMessage.ReceivedAtUtc.Value.ToLocalTime().ToString("dd.MM.yyyy HH:mm") |
| | 0 | 56 | | : "—") |
| | | 57 | | </dd> |
| | | 58 | | |
| | | 59 | | <dt class="col-sm-4 text-muted small">Статус письма</dt> |
| | | 60 | | <dd class="col-sm-8 small"> |
| | 0 | 61 | | @(Model.EmailMessage?.ProcessingStatus.ToString() ?? "—") |
| | | 62 | | </dd> |
| | | 63 | | </dl> |
| | 0 | 64 | | @if (!string.IsNullOrWhiteSpace(Model.EmailMessage?.BodyText)) |
| | | 65 | | { |
| | | 66 | | <hr/> |
| | | 67 | | <div class="small text-muted mb-1">Текст письма (первые 500 символов):</div> |
| | 0 | 68 | | <pre class="small rounded p-2 err-pre">@Model.EmailMessage.BodyText.Substring(0, Math.Min(500, M |
| | | 69 | | } |
| | | 70 | | </div> |
| | | 71 | | </div> |
| | | 72 | | </div> |
| | | 73 | | |
| | | 74 | | <!-- Вложение --> |
| | | 75 | | <div class="col-md-6"> |
| | | 76 | | <div class="card er-module-card h-100"> |
| | | 77 | | <div class="card-header fw-semibold"> |
| | | 78 | | <i class="bi bi-paperclip text-primary"></i> Вложение |
| | | 79 | | </div> |
| | | 80 | | <div class="card-body"> |
| | | 81 | | <dl class="row mb-0"> |
| | | 82 | | <dt class="col-sm-4 text-muted small">Имя файла</dt> |
| | 0 | 83 | | <dd class="col-sm-8 small">@(Model.Attachment?.FileName ?? "—")</dd> |
| | | 84 | | |
| | | 85 | | <dt class="col-sm-4 text-muted small">Расширение</dt> |
| | 0 | 86 | | <dd class="col-sm-8 small font-monospace">@(Model.Attachment?.Extension ?? "—")</dd> |
| | | 87 | | |
| | | 88 | | <dt class="col-sm-4 text-muted small">Размер</dt> |
| | | 89 | | <dd class="col-sm-8 small"> |
| | 0 | 90 | | @if (Model.Attachment?.FileSizeBytes > 0) |
| | | 91 | | { |
| | 0 | 92 | | var kb = Model.Attachment.FileSizeBytes / 1024.0; |
| | 0 | 93 | | @(kb >= 1024 |
| | 0 | 94 | | ? $"{kb / 1024:F2} МБ" |
| | 0 | 95 | | : $"{kb:F1} КБ") |
| | | 96 | | } |
| | | 97 | | else |
| | | 98 | | { |
| | | 99 | | <text>—</text> |
| | | 100 | | } |
| | | 101 | | </dd> |
| | | 102 | | |
| | | 103 | | <dt class="col-sm-4 text-muted small">SHA256</dt> |
| | 0 | 104 | | <dd class="col-sm-8 small font-monospace text-truncate" data-app-tooltip="@Model.Attachment?.Sha |
| | 0 | 105 | | @(Model.Attachment?.Sha256Hash?.Substring(0, Math.Min(16, Model.Attachment.Sha256Hash?.Lengt |
| | | 106 | | </dd> |
| | | 107 | | </dl> |
| | | 108 | | </div> |
| | | 109 | | </div> |
| | | 110 | | </div> |
| | | 111 | | |
| | | 112 | | <!-- Результат обработки --> |
| | | 113 | | <div class="col-12"> |
| | | 114 | | <div class="card er-module-card"> |
| | | 115 | | <div class="card-header fw-semibold"> |
| | | 116 | | <i class="bi bi-check2-circle text-success"></i> Результат импорта |
| | | 117 | | </div> |
| | | 118 | | <div class="card-body row g-3"> |
| | | 119 | | <div class="col-md-4"> |
| | | 120 | | <div class="small text-muted mb-1">Применённое правило</div> |
| | 0 | 121 | | @if (Model.Rule != null) |
| | | 122 | | { |
| | 0 | 123 | | <a asp-controller="EmailRoutingRules" asp-action="Edit" asp-route-id="@Model.Rule.Id" |
| | 0 | 124 | | class="fw-semibold">@Model.Rule.Name</a> |
| | | 125 | | } |
| | | 126 | | else |
| | | 127 | | { |
| | | 128 | | <span class="text-muted">—</span> |
| | | 129 | | } |
| | | 130 | | </div> |
| | | 131 | | <div class="col-md-4"> |
| | | 132 | | <div class="small text-muted mb-1">Дата обработки</div> |
| | 0 | 133 | | <span>@Model.CreatedAt.ToLocalTime().ToString("dd.MM.yyyy HH:mm:ss")</span> |
| | | 134 | | </div> |
| | | 135 | | <div class="col-md-4"> |
| | | 136 | | <div class="small text-muted mb-1">Вложение</div> |
| | 0 | 137 | | <span class="font-monospace small">@(Model.Attachment?.FileName ?? Model.DropboxFileName ?? "—") |
| | | 138 | | </div> |
| | | 139 | | |
| | 0 | 140 | | @if (!string.IsNullOrWhiteSpace(Model.Reason)) |
| | | 141 | | { |
| | | 142 | | <div class="col-12"> |
| | | 143 | | <div class="small text-muted mb-1">Причина / комментарий</div> |
| | 0 | 144 | | <div class="alert alert-secondary small py-2 mb-0">@Model.Reason</div> |
| | | 145 | | </div> |
| | | 146 | | } |
| | | 147 | | |
| | 0 | 148 | | @if (!string.IsNullOrWhiteSpace(Model.Error)) |
| | | 149 | | { |
| | | 150 | | <div class="col-12"> |
| | | 151 | | <div class="small text-muted mb-1">Ошибка</div> |
| | 0 | 152 | | <div class="alert alert-danger small py-2 mb-0 font-monospace">@Model.Error</div> |
| | | 153 | | </div> |
| | | 154 | | } |
| | | 155 | | </div> |
| | | 156 | | </div> |
| | | 157 | | </div> |
| | | 158 | | </div> |
| | | 159 | | </div> |