< Summary

Information
Class: AspNetCoreGeneratedDocument.Areas_Studio2_Views_AiAssistant_Index
Assembly: OzonOrdersWeb
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Studio2/Views/AiAssistant/Index.cshtml
Line coverage
0%
Covered lines: 0
Uncovered lines: 25
Coverable lines: 25
Total lines: 204
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 48
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ExecuteAsync()0%1980440%
<ExecuteAsync()0%2040%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Studio2/Views/AiAssistant/Index.cshtml

#LineLine coverage
 1@{
 02    ViewData["Title"] = "AI Ассистент — Стас";
 03    Layout = "~/Views/Shared/_Layout.cshtml";
 04    var streamUrl        = Url.Action("Chat", "AiAssistant", new { area = "Studio2" })!.Replace("/Chat", "/Stream");
 05    var chatUrl          = Url.Action("Chat",           "AiAssistant", new { area = "Studio2" });
 06    var prepareUrl       = Url.Action("Prepare",        "AiAssistant", new { area = "Studio2" });
 07    var openOrdersUrl     = Url.Action("OpenOrders",          "AiAssistant", new { area = "Studio2" });
 08    var orderHistoryUrl   = Url.Action("GetOrderHistory",     "OrderHistory", new { area = "Studio2" });
 09    var orderFilterUrl    = Url.Action("OrderFilter",         "AiAssistant", new { area = "Studio2" });
 010    var executeActionUrl  = Url.Action("ExecuteAction",       "AiAssistant", new { area = "Studio2" });
 011    var suppliersUrl      = Url.Action("Suppliers",           "AiAssistant", new { area = "Studio2" });
 012    var contractsUrl      = Url.Action("Contracts",           "AiAssistant", new { area = "Studio2" });
 013    var buildFilterUrl    = Url.Action("BuildOrdersFilterUrl","AiAssistant", new { area = "Studio2" });
 014    var exportExcelUrl    = Url.Action("ExportSearchExcel",   "AiAssistant", new { area = "Studio2" });
 15    const string defaultOpenRouterModel = "qwen/qwen3.8-27b:free";
 16}
 17
 18<link rel="stylesheet" href="~/css/Studio2/Orders/productImageCell.css" asp-append-version="true" />
 19<link rel="stylesheet" href="~/css/Studio2/AiAssistant/ai-assistant.css" asp-append-version="true" />
 20<link rel="stylesheet" href="~/css/Studio2/AiAssistant/ai-assistant-enrichment.css" asp-append-version="true" />
 21
 22<div class="ai-app" id="aiApp">
 23
 24    <!-- Main chat area -->
 25    <div class="ai-main" id="aiMain">
 26        <div class="ai-chat-toolbar">
 27            <div class="ai-chat-brand"><i class="fas fa-robot"></i><span>Стас</span></div>
 28            <div class="ai-chat-toolbar-controls">
 29                <label class="ai-model-label" for="aiAgentModeSelect"><i class="fas fa-bolt me-1"></i>Действия</label>
 30                <select id="aiAgentModeSelect" class="ai-model-select custom-select-init">
 31                    <option value="confirm">Подтверждать</option>
 32                    <option value="auto">Авто</option>
 33                </select>
 34                <label class="ai-model-label" for="aiModelSelect"><i class="fas fa-microchip me-1"></i>Модель</label>
 35                <select id="aiModelSelect" class="ai-model-select">
 36                    <option value="qwen/qwen3.8-27b:free">Qwen3.8 27B</option>
 37                    <option value="nvidia/nemotron-3-ultra-550b-a55b:free">NVIDIA Nemotron 3 Ultra</option>
 38                    <option value="nvidia/nemotron-3-super-120b-a12b:free">NVIDIA Nemotron 3 Super</option>
 39                    <option value="nvidia/nemotron-3.5-lightning:free">NVIDIA Nemotron 3.5 Lightning</option>
 40                    <option value="google/gemma-4-31b-it:free">Google Gemma 4 31B</option>
 41                    <option value="google/gemma-4-26b-a4b-it:free">Google Gemma 4 26B</option>
 42                    <option value="z-ai/glm-5.2:free">Z.ai GLM 5.2</option>
 43                    <option value="poolside/laguna-s-2.1:free">Poolside Laguna S 2.1</option>
 44                    <option value="poolside/laguna-xs-2.1:free">Poolside Laguna XS 2.1</option>
 45                    <option value="dots-studio/dots-3-note-preview:free">Dots 3 Note Preview</option>
 46                    <option value="nex-agi/nex-n2.5-pro:free">Nex N2.5 Pro</option>
 47                    <option value="nex-agi/nex-n2.5-mini:free">Nex N2.5 Mini</option>
 48                    <option value="inclusionai/ling-3.0-flash-vl:free">Ling 3.0 Flash VL</option>
 49                    <option value="liquid/lfm-2.5-2.6b:free">Liquid LFM2.5 2.6B</option>
 50                    <option value="thinkingmachines/inkling:free">Thinking Machines Inkling</option>
 51                    <option value="cohere/north-mini-code:free">Cohere North Mini Code</option>
 52                    <option value="openrouter/free">Автовыбор OpenRouter</option>
 53                </select>
 54                <div class="ai-token-counter" id="aiTokenCounter" style="display:none" title="Токены за текущий чат: вхо
 55                    <i class="fas fa-coins me-1"></i><span class="ai-tok-prompt">0</span><span class="ai-tok-arrow"> → <
 56                </div>
 57                <label class="ai-sound-toggle" title="Звук при завершении агентов"><input type="checkbox" id="aiSoundTog
 58                <button type="button" class="ai-clear-chat-btn" id="aiNewChatBtn"><i class="fas fa-rotate-left"></i>Очис
 59            </div>
 60        </div>
 61
 62        <div class="ai-chat-window" id="aiChatWindow">
 63            <!-- Welcome screen -->
 64            <div class="ai-welcome-screen" id="aiWelcomeScreen">
 65                <div class="ai-welcome-hero">
 66                    <div class="ai-welcome-avatar">
 67                        <i class="fas fa-robot"></i>
 68                    </div>
 69                    <h2 class="ai-welcome-title">Привет, я Стас</h2>
 70                    <p class="ai-welcome-sub">Ваш AI-аналитик заказов Ozon. Задайте вопрос или выберите сценарий ниже.</
 71                </div>
 72                <div class="ai-welcome-cards">
 73                    <button class="ai-welcome-card" data-msg="Покажи просроченные заказы">
 74                        <div class="ai-welcome-card-icon"><i class="fas fa-clock"></i></div>
 75                        <div class="ai-welcome-card-text">
 76                            <strong>Просрочки</strong>
 77                            <span>Заказы с истёкшим дедлайном отгрузки</span>
 78                        </div>
 79                    </button>
 80                    <button class="ai-welcome-card" data-msg="Сводка заказов по статусам">
 81                        <div class="ai-welcome-card-icon"><i class="fas fa-chart-bar"></i></div>
 82                        <div class="ai-welcome-card-text">
 83                            <strong>Сводка</strong>
 84                            <span>Распределение заказов по статусам</span>
 85                        </div>
 86                    </button>
 87                    <button class="ai-welcome-card" data-msg="Заказы с невыгодной ценой">
 88                        <div class="ai-welcome-card-icon"><i class="fas fa-arrow-trend-down"></i></div>
 89                        <div class="ai-welcome-card-text">
 90                            <strong>Убыточные</strong>
 91                            <span>Заказы где MinProfit &lt; 0</span>
 92                        </div>
 93                    </button>
 94                    <button class="ai-welcome-card" data-msg="Кто и что менял в заказах сегодня">
 95                        <div class="ai-welcome-card-icon"><i class="fas fa-user-clock"></i></div>
 96                        <div class="ai-welcome-card-text">
 97                            <strong>Активность</strong>
 98                            <span>Изменения в заказах за сегодня</span>
 99                        </div>
 100                    </button>
 101                </div>
 102
 103                <div class="ai-welcome-section-label">
 104                    <i class="fas fa-bolt me-1"></i>Транзакции — что можно провести
 105                </div>
 106                <div class="ai-welcome-cards ai-tx-cards">
 107                    <button class="ai-welcome-card ai-tx-card" data-msg="Провести транзакцию «Заказан поставщику»">
 108                        <div class="ai-welcome-card-icon" style="background:#eff6ff;color:#2563eb"><i class="fas fa-cart
 109                        <div class="ai-welcome-card-text">
 110                            <strong style="color:#2563eb">Заказан поставщику</strong>
 111                            <span>Создать заказ у поставщика</span>
 112                        </div>
 113                    </button>
 114                    <button class="ai-welcome-card ai-tx-card" data-msg="Провести транзакцию «Заказан реализатору»">
 115                        <div class="ai-welcome-card-icon" style="background:#ecfeff;color:#0891b2"><i class="fas fa-hand
 116                        <div class="ai-welcome-card-text">
 117                            <strong style="color:#0891b2">Заказан реализатору</strong>
 118                            <span>Передать на реализацию</span>
 119                        </div>
 120                    </button>
 121                    <button class="ai-welcome-card ai-tx-card" data-msg="Провести транзакцию «Отгружен поставщиком»">
 122                        <div class="ai-welcome-card-icon" style="background:#fff7ed;color:#c2410c"><i class="fas fa-box-
 123                        <div class="ai-welcome-card-text">
 124                            <strong style="color:#c2410c">Отгружен поставщиком</strong>
 125                            <span>Поставщик отгрузил · <em>1С: приходная накладная</em></span>
 126                        </div>
 127                    </button>
 128                    <button class="ai-welcome-card ai-tx-card" data-msg="Провести транзакцию «Отгружен реализатором»">
 129                        <div class="ai-welcome-card-icon" style="background:#f5f3ff;color:#7c3aed"><i class="fas fa-truc
 130                        <div class="ai-welcome-card-text">
 131                            <strong style="color:#7c3aed">Отгружен реализатором</strong>
 132                            <span>Реализатор отправил · <em>1С: перемещение</em></span>
 133                        </div>
 134                    </button>
 135                    <button class="ai-welcome-card ai-tx-card" data-msg="Провести транзакцию «Принят на складе»">
 136                        <div class="ai-welcome-card-icon" style="background:#f0fdf4;color:#15803d"><i class="fas fa-ware
 137                        <div class="ai-welcome-card-text">
 138                            <strong style="color:#15803d">Принят на складе</strong>
 139                            <span>Товар поступил на склад</span>
 140                        </div>
 141                    </button>
 142                    <button class="ai-welcome-card ai-tx-card" data-msg="Провести транзакцию «Отгружен комиссионеру»">
 143                        <div class="ai-welcome-card-icon" style="background:#fdf4ff;color:#a21caf"><i class="fas fa-stor
 144                        <div class="ai-welcome-card-text">
 145                            <strong style="color:#a21caf">Отгружен комиссионеру</strong>
 146                            <span>Отгрузка на склад Ozon · <em>1С: перемещение</em></span>
 147                        </div>
 148                    </button>
 149                </div>
 150            </div>
 151        </div>
 152
 153        <!-- Suggestions strip -->
 154        <div class="ai-suggestions-bar" id="aiSuggestionsBar">
 155            <button type="button" class="ai-suggestion-chip" data-msg="Найди заказы за сегодня"><i class="fas fa-calenda
 156            <button type="button" class="ai-suggestion-chip" data-msg="Покажи просроченные заказы"><i class="fas fa-cloc
 157            <button type="button" class="ai-suggestion-chip" data-msg="Заказы с невыгодной ценой"><i class="fas fa-excla
 158            <button type="button" class="ai-suggestion-chip" data-msg="Сколько заказов отменено сегодня"><i class="fas f
 159            <button type="button" class="ai-suggestion-chip" data-msg="Заказы без поставщика"><i class="fas fa-user-time
 160            <button type="button" class="ai-suggestion-chip" data-msg="Найди актуальные заказы которые нужно обработать"
 161            <button type="button" class="ai-suggestion-chip" data-msg="Что скажешь по товару 09146=FEB — остатки и цены 
 162        </div>
 163
 164        <!-- Input bar -->
 165        <div class="ai-input-wrap">
 166            <div class="ai-input-bar" id="aiInputBar">
 167                <textarea id="aiChatInput" placeholder="Спросите про заказы…"
 168                          maxlength="2000" rows="1" autocomplete="off"></textarea>
 169                <button type="button" class="ai-voice-btn" id="aiVoiceBtn" title="Голосовой ввод" style="display:none">
 170                    <i class="fas fa-microphone"></i>
 171                </button>
 172                <button type="button" class="ai-send-btn" id="aiSendBtn" title="Отправить (Enter)">
 173                    <i class="fas fa-arrow-up"></i>
 174                </button>
 175            </div>
 176            <div class="ai-input-hint">Enter — отправить · Shift+Enter — перенос</div>
 177        </div>
 178
 179    </div>
 180</div>
 181
 182@section Scripts {
 183<script src="~/js/Studio2/ai-assistant-enrichment.js" asp-append-version="true"></script>
 184<script src="~/js/Studio2/ai-assistant-chat.js" asp-append-version="true"></script>
 185<script>
 186$(function () {
 187    AiAssistantChat.init({
 0188        streamUrl:        '@streamUrl',
 0189        chatUrl:          '@chatUrl',
 0190        prepareUrl:       '@prepareUrl',
 0191        openOrdersUrl:    '@openOrdersUrl',
 0192        orderHistoryUrl:  '@orderHistoryUrl',
 0193        orderFilterUrl:   '@orderFilterUrl',
 194        ordersIndexUrl:   '/Orders/Index',
 0195        executeActionUrl: '@executeActionUrl',
 0196        suppliersUrl:     '@suppliersUrl',
 0197        contractsUrl:     '@contractsUrl',
 0198        buildFilterUrl:   '@buildFilterUrl',
 0199        exportExcelUrl:   '@exportExcelUrl',
 0200        defaultModel:     '@defaultOpenRouterModel'
 201    });
 202});
 203</script>
 204}

Methods/Properties

ExecuteAsync()
<ExecuteAsync()