local-triage 0.0.0-stage → 0.10.0-dev.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +90 -2
- package/THIRD-PARTY-NOTICES.md +48 -0
- package/app/__init__.py +3 -0
- package/app/affiliation.py +137 -0
- package/app/ask.py +300 -0
- package/app/build_info.py +98 -0
- package/app/capec.py +168 -0
- package/app/capec_view.py +27 -0
- package/app/codecmp.py +59 -0
- package/app/config.py +411 -0
- package/app/context.py +1451 -0
- package/app/cvss.py +357 -0
- package/app/db.py +6234 -0
- package/app/defect.py +670 -0
- package/app/defect_check.py +323 -0
- package/app/defect_drafts.py +612 -0
- package/app/defect_dto.py +149 -0
- package/app/defect_fields.py +248 -0
- package/app/defect_form.py +124 -0
- package/app/defect_links.py +107 -0
- package/app/defect_local_text.py +103 -0
- package/app/defect_references.py +164 -0
- package/app/defect_where.py +147 -0
- package/app/ecosystem.py +51 -0
- package/app/executors.py +660 -0
- package/app/feeds.py +1231 -0
- package/app/guard.py +164 -0
- package/app/hub_block_builder.py +200 -0
- package/app/hub_block_version.py +220 -0
- package/app/hub_defects.py +4469 -0
- package/app/hub_effects.py +421 -0
- package/app/hub_entity_versions.py +108 -0
- package/app/hub_import.py +2054 -0
- package/app/hub_onboarding.py +114 -0
- package/app/hub_ops.py +330 -0
- package/app/hub_pull.py +1195 -0
- package/app/hub_state.py +255 -0
- package/app/hub_status.py +237 -0
- package/app/hub_sync.py +619 -0
- package/app/hub_sync_api.py +241 -0
- package/app/hub_sync_compare.py +1054 -0
- package/app/hub_sync_contract.py +75 -0
- package/app/hub_template_model.py +74 -0
- package/app/hub_text_scale.py +159 -0
- package/app/journal.py +250 -0
- package/app/llm.py +850 -0
- package/app/llm_chat.py +596 -0
- package/app/llm_http.py +319 -0
- package/app/llm_messages.py +401 -0
- package/app/llm_net.py +764 -0
- package/app/llm_ollama.py +571 -0
- package/app/lockfile.py +505 -0
- package/app/logsafe.py +54 -0
- package/app/main.py +367 -0
- package/app/mask_display.py +132 -0
- package/app/masking.py +814 -0
- package/app/metrics.py +194 -0
- package/app/model_traffic.py +519 -0
- package/app/models.py +483 -0
- package/app/navigation.py +121 -0
- package/app/osv.py +279 -0
- package/app/package_identity.py +189 -0
- package/app/package_transition.py +824 -0
- package/app/profile_gate.py +71 -0
- package/app/prompts.py +1108 -0
- package/app/provider_keys.py +189 -0
- package/app/providers.py +511 -0
- package/app/routes/__init__.py +10 -0
- package/app/routes/api.py +153 -0
- package/app/routes/capec.py +186 -0
- package/app/routes/common.py +407 -0
- package/app/routes/components.py +1499 -0
- package/app/routes/cwe.py +168 -0
- package/app/routes/decision_selected.py +153 -0
- package/app/routes/defect_add.py +223 -0
- package/app/routes/defect_card_routes.py +363 -0
- package/app/routes/defect_selected.py +342 -0
- package/app/routes/feeds.py +155 -0
- package/app/routes/findings.py +2736 -0
- package/app/routes/hub.py +402 -0
- package/app/routes/hub_bulk.py +288 -0
- package/app/routes/hub_defect_routes.py +1945 -0
- package/app/routes/hub_status_routes.py +1132 -0
- package/app/routes/hub_sync_routes.py +463 -0
- package/app/routes/journal.py +132 -0
- package/app/routes/projects.py +1601 -0
- package/app/routes/providers.py +336 -0
- package/app/routes/references.py +26 -0
- package/app/routes/runs.py +219 -0
- package/app/routes/sca.py +2722 -0
- package/app/routes/settings.py +163 -0
- package/app/run_errors.py +151 -0
- package/app/sca.py +1662 -0
- package/app/sca_contract.py +1289 -0
- package/app/sca_research.py +1089 -0
- package/app/sca_research_net.py +1007 -0
- package/app/sca_text.py +965 -0
- package/app/serve.py +70 -0
- package/app/settings_store.py +262 -0
- package/app/static/app.css +2802 -0
- package/app/static/app.js +3772 -0
- package/app/static/capec-license.txt +9 -0
- package/app/static/favicon.svg +1 -0
- package/app/static/fonts/Golos-Text_DemiBold.woff2 +0 -0
- package/app/static/fonts/Golos-Text_Regular.woff2 +0 -0
- package/app/static/fonts/OFL.txt +90 -0
- package/app/static/navigation.js +234 -0
- package/app/static/observability.js +121 -0
- package/app/static/theme.js +49 -0
- package/app/storage/__init__.py +16 -0
- package/app/storage/local_state.py +246 -0
- package/app/storage/migrate.py +110 -0
- package/app/storage/migrations/postgresql/0001_baseline.sql +896 -0
- package/app/storage/migrations/postgresql/0002_feeds_and_secrets.sql +55 -0
- package/app/storage/migrations/postgresql/0003_project_mask_display.sql +5 -0
- package/app/storage/migrations/postgresql/0004_package_identity.sql +36 -0
- package/app/storage/postgresql.py +573 -0
- package/app/storage/schema.py +619 -0
- package/app/storage/sql.py +57 -0
- package/app/storage/tools.py +254 -0
- package/app/telemetry.py +307 -0
- package/app/templates/base.html +91 -0
- package/app/templates/capec/context.html +3 -0
- package/app/templates/capec/detail.html +27 -0
- package/app/templates/capec/index.html +128 -0
- package/app/templates/components/_archive.html +11 -0
- package/app/templates/components/archived.html +19 -0
- package/app/templates/components/batch.html +35 -0
- package/app/templates/components/detail.html +332 -0
- package/app/templates/components/index.html +338 -0
- package/app/templates/components/research_preview.html +80 -0
- package/app/templates/components/research_run.html +54 -0
- package/app/templates/cwe/bdu.html +56 -0
- package/app/templates/cwe/detail.html +233 -0
- package/app/templates/cwe/index.html +97 -0
- package/app/templates/error.html +8 -0
- package/app/templates/feeds/index.html +65 -0
- package/app/templates/findings/card.html +639 -0
- package/app/templates/findings/decision_selected.html +41 -0
- package/app/templates/findings/defect_add.html +46 -0
- package/app/templates/findings/defect_selected.html +47 -0
- package/app/templates/findings/list.html +153 -0
- package/app/templates/findings/send_selected.html +53 -0
- package/app/templates/findings/trace.html +72 -0
- package/app/templates/journal/detail.html +19 -0
- package/app/templates/journal/index.html +19 -0
- package/app/templates/macros.html +440 -0
- package/app/templates/navigation-fields.html +1 -0
- package/app/templates/navigation.html +11 -0
- package/app/templates/projects/_identity_summary.html +42 -0
- package/app/templates/projects/defect_card.html +153 -0
- package/app/templates/projects/defect_create_preview.html +17 -0
- package/app/templates/projects/defect_fields_diff.html +6 -0
- package/app/templates/projects/defect_fields_form.html +40 -0
- package/app/templates/projects/defect_references.html +17 -0
- package/app/templates/projects/defect_sync_preview.html +28 -0
- package/app/templates/projects/defect_update_actions.html +6 -0
- package/app/templates/projects/defect_update_preview.html +24 -0
- package/app/templates/projects/defects.html +126 -0
- package/app/templates/projects/delete.html +31 -0
- package/app/templates/projects/external.html +61 -0
- package/app/templates/projects/folders.html +64 -0
- package/app/templates/projects/hub_accepted.html +10 -0
- package/app/templates/projects/hub_assignment.html +50 -0
- package/app/templates/projects/hub_pending.html +20 -0
- package/app/templates/projects/hub_pending_list.html +17 -0
- package/app/templates/projects/hub_state_note.html +23 -0
- package/app/templates/projects/hub_step_note.html +5 -0
- package/app/templates/projects/hub_sync.html +105 -0
- package/app/templates/projects/hub_sync_confirm.html +32 -0
- package/app/templates/projects/hub_sync_worker.html +5 -0
- package/app/templates/projects/hub_text_rules.html +64 -0
- package/app/templates/projects/identity_report.html +74 -0
- package/app/templates/projects/list.html +90 -0
- package/app/templates/projects/project.html +433 -0
- package/app/templates/reference-missing.html +14 -0
- package/app/templates/runs/run.html +166 -0
- package/app/templates/sca/card.html +476 -0
- package/app/templates/sca/index.html +321 -0
- package/app/templates/settings/hub_url.html +31 -0
- package/app/templates/settings/index.html +216 -0
- package/app/templates/settings/provider.html +229 -0
- package/app/templates/settings/providers.html +37 -0
- package/app/templates/worklists.html +52 -0
- package/app/textsafe.py +117 -0
- package/app/timing.py +245 -0
- package/app/triage.py +1743 -0
- package/app/view.py +430 -0
- package/app/worklists.py +204 -0
- package/examples/demo/demo-hub-report-v2.xlsx +0 -0
- package/examples/demo/demo-hub-report.xlsx +0 -0
- package/examples/demo/repos/billing-core/pom.xml +30 -0
- package/examples/demo/repos/billing-core/src/main/java/org/example/billing/Invoice.java +9 -0
- package/examples/demo/repos/billing-core/src/main/java/org/example/billing/InvoiceRepository.java +51 -0
- package/examples/demo/repos/billing-core/src/main/java/org/example/billing/InvoiceStatus.java +11 -0
- package/examples/demo/repos/billing-core/src/main/java/org/example/billing/config/DatabaseSettings.java +18 -0
- package/examples/demo/repos/billing-core/src/main/java/org/example/billing/payment/PaymentTokenService.java +35 -0
- package/examples/demo/repos/billing-core/src/main/java/org/example/billing/web/InvoiceExportController.java +57 -0
- package/examples/demo/repos/catalog-api/catalog_api/__init__.py +1 -0
- package/examples/demo/repos/catalog-api/catalog_api/products.py +24 -0
- package/examples/demo/repos/catalog-api/catalog_api/tasks.py +24 -0
- package/examples/demo/repos/catalog-api/catalog_api/views.py +17 -0
- package/examples/demo/repos/catalog-api/requirements.txt +3 -0
- package/npm/build.json +5 -0
- package/npm/cli.js +346 -0
- package/npm/files.manifest +224 -0
- package/npm/lib/binding.js +64 -0
- package/npm/lib/cluster.js +330 -0
- package/npm/lib/env.js +88 -0
- package/npm/lib/fsx.js +125 -0
- package/npm/lib/http.js +53 -0
- package/npm/lib/metrics.js +73 -0
- package/npm/lib/paths.js +150 -0
- package/npm/lib/pg.js +351 -0
- package/npm/lib/proc.js +101 -0
- package/npm/lib/python.js +133 -0
- package/npm/lib/stand.js +46 -0
- package/npm/lib/supervisor.js +1141 -0
- package/npm/lib/version.js +21 -0
- package/npm/requirements.txt +476 -0
- package/npm-shrinkwrap.json +111 -0
- package/package.json +37 -4
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
{% block title %}Прогон №{{ run.id }} · {{ project.name }} · Локальный триаж{% endblock %}
|
|
3
|
+
{% block page %}run{% endblock %}
|
|
4
|
+
{% block wide %} wrap-wide{% endblock %}
|
|
5
|
+
{% block subnav %}{% from "macros.html" import project_tabs %}{{ project_tabs(project, counts.total, review_stats.sca, "overview", counts.defects) }}{% endblock %}
|
|
6
|
+
{% block crumbs %}<a href="/">Проекты</a><span aria-hidden="true"> / </span><a class="crumb-project" href="/projects/{{ project.id }}">{{ project.name }}</a><span aria-hidden="true"> / </span><span aria-current="page">Прогон №{{ run.id }}</span>{% endblock %}
|
|
7
|
+
{% block content %}
|
|
8
|
+
{% from "macros.html" import verdict_badge, icon, collector_warning %}
|
|
9
|
+
{% set s = status %}
|
|
10
|
+
{% set m = s.metrics %}
|
|
11
|
+
{% set r = s.run %}
|
|
12
|
+
<div id="run" data-events="/runs/{{ run.id }}/events">
|
|
13
|
+
<div class="page-head">
|
|
14
|
+
<h1>Прогон №{{ run.id }} <span id="run-state" class="state state-{{ r.state }}">{{ r.state_label }}</span></h1>
|
|
15
|
+
<p class="muted dot-list" title="Версия промпта {{ r.prompt_version }}"><span>модель <span class="mono">{{ r.model }}</span></span>{% if executor %}<span id="run-executor">профиль: {{ executor }}</span>{% endif %}<span>охват: {{ SCOPE_LABELS.get(r.scope, r.scope) }}</span><span>находок {{ r.total }}</span>{% if r.fresh %}<span>заново, без готовых вердиктов</span>{% endif %}</p>
|
|
16
|
+
{% if excluded is none %}<p class="small muted" id="run-excluded">Исправленные и закрытые в Hub: сведений нет.</p>
|
|
17
|
+
{% elif excluded %}<p class="small muted" id="run-excluded">Исправлено в Hub – {{ excluded.fixed }}, закрыто решением – {{ excluded.closed }}: не разбиралось.</p>{% endif %}
|
|
18
|
+
{% if summary and summary.total %}<p class="small" id="run-summary" data-final="{{ 1 if run_final else 0 }}">Итог прогона ({{ summary.new }} новых ответов модели, {{ summary.cached }} готовых): истинных – {{ summary.verdicts.get('true_positive', 0) }}, ложных – {{ summary.verdicts.get('false_positive', 0) }}, неясно – {{ summary.verdicts.get('uncertain', 0) }}{% if summary.verdicts.get('uncertain') %}, из них без кода в клоне – {{ summary.uncertain_no_code }} (по текущим срезам){% endif %}. Hub и модель разошлись – {{ summary.hub_model_diff }} (по текущему состоянию Hub).</p>
|
|
19
|
+
{% elif not run_final %}<p class="small" id="run-summary" data-final="0" hidden></p>{% endif %}
|
|
20
|
+
<p class="actions run-review-actions">
|
|
21
|
+
<a class="btn btn-ghost" id="review-findings" href="{% if first_unreviewed %}/projects/{{ project.id }}/findings/{{ first_unreviewed }}{% else %}/projects/{{ project.id }}/findings?kind=SAST{% endif %}">Разбирать находки</a>
|
|
22
|
+
<a class="btn btn-ghost" href="/projects/{{ project.id }}/findings?kind=SAST">К находкам</a>
|
|
23
|
+
</p>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<section class="panel" aria-label="Ход прогона">
|
|
27
|
+
<p id="conn-lost" class="callout callout-warn" role="status" hidden>Нет связи с приложением: данные на странице могут быть устаревшими. Переподключение…</p>
|
|
28
|
+
<div class="run-progress">
|
|
29
|
+
<div class="progress-line">
|
|
30
|
+
<progress id="run-progress" max="{{ r.total or 1 }}" value="{{ r.done }}" aria-label="Обработано находок"></progress>
|
|
31
|
+
<strong id="progress-pct">{{ s.progress|round|int }}%</strong>
|
|
32
|
+
</div>
|
|
33
|
+
<p class="eta"><span class="muted small">Осталось</span> <strong id="eta">{% if s.eta_s is not none %}~{{ s.eta_s|duration }}{% elif r.state in ("done", "stopped", "error") %}–{% elif r.state == "paused" %}на паузе{% else %}оценка после трёх ответов{% endif %}</strong></p>
|
|
34
|
+
</div>
|
|
35
|
+
<p id="progress-text" aria-live="polite">Обработано {{ r.done }} из {{ r.total }}{% if s.new_verdicts %} · новых вердиктов {{ s.new_verdicts }}{% endif %}{% if r.cached %} · готовых {{ r.cached }}{% endif %}{% if r.skipped %} · пропущено {{ r.skipped }}{% endif %}{% if r.failed %} · ошибок {{ r.failed }}{% endif %}</p>
|
|
36
|
+
<dl class="facts facts-inline">
|
|
37
|
+
<div><dt>Длительность</dt><dd id="elapsed">{{ s.elapsed_s|duration }}</dd></div>
|
|
38
|
+
<div><dt>В среднем на находку</dt><dd id="avg-call">{{ s.avg_call_s|duration }}</dd></div>
|
|
39
|
+
</dl>
|
|
40
|
+
<p id="current" class="current"{% if not s.current %} hidden{% endif %}>Сейчас: <a id="current-link" class="mono" href="{{ s.current.url if s.current and s.current.url else '#' }}">{{ s.current.hub_id if s.current else "" }}</a> <span id="current-phase" class="muted">{{ s.current.phase_label if s.current else "" }}</span></p>
|
|
41
|
+
<p id="control-note" class="muted"{% if not s.control %} hidden{% endif %}>{% if s.control == "stop" %}Остановка после текущей находки…{% else %}Пауза после текущей находки…{% endif %}</p>
|
|
42
|
+
<p id="run-notice" class="callout callout-warn" role="status"{% if not r.notice %} hidden{% endif %}>{{ r.notice }}</p>
|
|
43
|
+
<p id="journal-warning" class="callout callout-warn" role="status"{% if not s.journal_warning %} hidden{% endif %}>{{ s.journal_warning }}</p>
|
|
44
|
+
<p id="slow-model" class="callout {{ 'callout-warn' if s.slow_model and s.slow_model.warning else 'callout-info' }}" role="status"{% if not s.slow_model %} hidden{% endif %}>{{ s.slow_model.text if s.slow_model else "" }}</p>
|
|
45
|
+
<div class="actions run-actions" id="run-actions" data-state="{{ r.state }}">
|
|
46
|
+
<form method="post" action="/runs/{{ run.id }}/pause" class="act act-pause"><button type="submit" class="btn">Пауза</button></form>
|
|
47
|
+
<form method="post" action="/runs/{{ run.id }}/resume" class="act act-resume"><button type="submit" class="btn">Продолжить</button></form>
|
|
48
|
+
<form method="post" action="/runs/{{ run.id }}/stop" class="act act-stop" data-confirm="Остановить прогон?">
|
|
49
|
+
<button type="submit" class="btn btn-danger">Стоп</button></form>
|
|
50
|
+
<a class="btn btn-ghost act act-new" href="/projects/{{ project.id }}#step3">Новый прогон</a>
|
|
51
|
+
</div>
|
|
52
|
+
</section>
|
|
53
|
+
|
|
54
|
+
{% set e = s.errors %}
|
|
55
|
+
<section class="panel run-errors" id="run-errors" aria-labelledby="errors-title"{% if not e.total %} hidden{% endif %}>
|
|
56
|
+
<div class="panel-head">
|
|
57
|
+
<h2 id="errors-title">Ошибки: <span id="errors-total">{{ e.total }}</span></h2>
|
|
58
|
+
<p class="hint" id="errors-breakdown">{% for g in e.groups if g.count %}{{ g.label }}: {{ g.count }}{% if not loop.last %} · {% endif %}{% endfor %}</p>
|
|
59
|
+
</div>
|
|
60
|
+
<details class="run-errors-details">
|
|
61
|
+
<summary>Показать находки с ошибкой</summary>
|
|
62
|
+
<div id="errors-groups">
|
|
63
|
+
{% for g in e.groups if g.count %}
|
|
64
|
+
<section class="error-group" data-error-group="{{ g.key }}">
|
|
65
|
+
<h3>{{ g.label }} <span class="muted">· {{ g.count }}</span></h3>
|
|
66
|
+
<p class="hint">{{ g.hint }}</p>
|
|
67
|
+
<ul class="error-list">
|
|
68
|
+
{% for item in g.rows %}
|
|
69
|
+
<li class="error-item">
|
|
70
|
+
{% if item.url %}<a class="mono" href="{{ item.url }}">{{ item.hub_id }}</a>{% else %}<span class="mono">{{ item.hub_id }}</span>{% endif %}
|
|
71
|
+
{% if item.rule %}<span class="muted small"> · {{ item.rule }}</span>{% endif %}
|
|
72
|
+
<span class="error-reason"> – {{ item.reason }}</span>
|
|
73
|
+
<details class="error-detail"><summary>Подробности</summary><p class="small mono">{{ item.detail }}</p></details>
|
|
74
|
+
</li>
|
|
75
|
+
{% endfor %}
|
|
76
|
+
</ul>
|
|
77
|
+
</section>
|
|
78
|
+
{% endfor %}
|
|
79
|
+
</div>
|
|
80
|
+
</details>
|
|
81
|
+
<form method="post" action="/runs/{{ run.id }}/retry-errors" id="retry-errors" class="actions"
|
|
82
|
+
data-confirm="Запустить новый прогон по находкам с ошибкой ({{ e.retryable }})? Прежний прогон останется в истории; если он на паузе, он будет остановлен."
|
|
83
|
+
{% if r.state not in ("done", "stopped", "error", "paused") or not (e.retryable or e.unknown) %}hidden{% endif %}>
|
|
84
|
+
<label class="check" id="retry-unknown"{% if not e.unknown %} hidden{% endif %}><input type="checkbox" name="include_unknown" value="1"> включая «результат неизвестен» (<span id="retry-unknown-count">{{ e.unknown }}</span>) – запрос по ним мог быть оплачен, повтор – новый платный запрос</label>
|
|
85
|
+
<button type="submit" class="btn" id="retry-errors-button">Повторить ошибочные ({{ e.retryable }})</button>
|
|
86
|
+
<span class="muted small" id="retry-errors-note">{{ e.note }}</span>
|
|
87
|
+
</form>
|
|
88
|
+
<p class="hint">Повтор идёт по сохранённым срезам кода той же моделью и без готовых вердиктов: клоны для него не нужны.</p>
|
|
89
|
+
</section>
|
|
90
|
+
|
|
91
|
+
{# сборщик метрик компьютера не работает – о модели на этом компьютере (у сервера в сети этих метрик нет) #}
|
|
92
|
+
{% if s.remote_executor %}
|
|
93
|
+
{# модель у провайдера: видеокарты и памяти этого компьютера прогон не занимает; без сборщика не уходят внешние
|
|
94
|
+
запросы – предупреждение о нём здесь про это (при упавшем сборщике прогон встаёт на паузу) #}
|
|
95
|
+
{% if run.execution_id and (s.remote_where or "").startswith("у внешнего") %}{{ collector_warning(collector, "external", external_on, hidden=not (collector.state in ("stale", "missing")), id="collector-warning-external") }}{% endif %}
|
|
96
|
+
<section class="tiles" aria-label="Скорость ответа модели">
|
|
97
|
+
<div class="tile tile-wide"><div class="tile-label">Где работает модель</div><div class="tile-value tile-value-text">{{ s.remote_where }}</div><div class="tile-sub">Видеокарта и память этого компьютера к прогону не относятся – их метрики здесь не показываются.</div></div>
|
|
98
|
+
<div class="tile">
|
|
99
|
+
<div class="tile-label">Скорость ответа, ток/с</div>
|
|
100
|
+
<div class="tile-value" id="m-tps">{{ s.tps_last|num }}</div>
|
|
101
|
+
<div class="tile-sub">в среднем по ответам прогона, с ожиданием сервера <span id="m-tps-avg" hidden>{{ s.tps_avg|num }}</span><span id="m-tps-partial" title="У стольких находок ответа модели целиком нет (сбой связи или сервера): что модель успела сгенерировать, в среднюю скорость не вошло"{% if not r.partial_stats %} hidden{% endif %}>{% if r.partial_stats %} · замеры неполные: {{ r.partial_stats }}{% endif %}</span></div>
|
|
102
|
+
</div>
|
|
103
|
+
</section>
|
|
104
|
+
{% else %}
|
|
105
|
+
{{ collector_warning(collector, "metrics", external_on, hidden=not (collector.state in ("stale", "missing") and (m.host or {}).status != "remote")) }}
|
|
106
|
+
<section class="tiles" aria-label="Метрики видеокарты и модели">
|
|
107
|
+
<div class="tile"><div class="tile-label">RAM компьютера с Ollama</div><div class="tile-value" id="obs-ram">Ожидаем измерение</div><div class="tile-sub" id="obs-ram-source">Нужен сборщик Windows-хоста</div></div>
|
|
108
|
+
<div class="tile"><div class="tile-label">CPU компьютера</div><div class="tile-value" id="obs-cpu">–</div><div class="tile-sub">Измерение Windows-хоста</div></div>
|
|
109
|
+
<div class="tile">
|
|
110
|
+
<div class="tile-label">Последний завершённый ответ, ток/с</div>
|
|
111
|
+
<div class="tile-value" id="m-tps">{{ s.tps_last|num }}</div>
|
|
112
|
+
<div class="tile-sub">в среднем <span id="m-tps-avg">{{ s.tps_avg|num }}</span><span id="m-tps-partial" title="У стольких находок ответа модели целиком нет (сбой связи или сервера): что модель успела сгенерировать, в среднюю скорость не вошло"{% if not r.partial_stats %} hidden{% endif %}>{% if r.partial_stats %} · замеры неполные: {{ r.partial_stats }}{% endif %}</span></div>
|
|
113
|
+
</div>
|
|
114
|
+
<div class="tile">
|
|
115
|
+
<div class="tile-label">Видеопамять</div>
|
|
116
|
+
<div class="tile-value" id="m-vram">{{ m.vram_used_mb|mib }}</div>
|
|
117
|
+
<div class="tile-sub">
|
|
118
|
+
<progress id="m-vram-bar" max="{{ m.vram_total_mb or 1 }}" value="{{ m.vram_used_mb or 0 }}" aria-label="Занятая видеопамять"{% if not m.vram_total_mb %} hidden{% endif %}></progress>
|
|
119
|
+
<span id="m-vram-total">{% if m.vram_total_mb %}из {{ m.vram_total_mb|mib }}{% elif m.vram_source == "ollama" %}по данным Ollama{% endif %}</span>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
<div class="tile">
|
|
123
|
+
<div class="tile-label">Загрузка видеокарты</div>
|
|
124
|
+
<div class="tile-value" id="m-util">{% if m.gpu and m.gpu.util_pct is not none %}{{ m.gpu.util_pct|num(0) }}%{% else %}–{% endif %}</div>
|
|
125
|
+
<div class="tile-sub" id="m-power">{% if m.gpu and m.gpu.power_w is not none %}{{ m.gpu.power_w|num(0) }} Вт{% endif %}</div>
|
|
126
|
+
</div>
|
|
127
|
+
<div class="tile">
|
|
128
|
+
<div class="tile-label">Температура</div>
|
|
129
|
+
<div class="tile-value" id="m-temp">{% if m.gpu and m.gpu.temp_c is not none %}{{ m.gpu.temp_c|num(0) }} °C{% else %}–{% endif %}</div>
|
|
130
|
+
<div class="tile-sub" id="m-gpu-name">{% if m.gpu %}{{ m.gpu.name }}{% elif m.pending %}измерение ещё не готово{% elif m.server and m.server.local == false %}видеокарта сервера в сети не показывается{% else %}nvidia-smi недоступна{% endif %}</div>
|
|
131
|
+
</div>
|
|
132
|
+
<div class="tile">
|
|
133
|
+
<div class="tile-label">Модель прогона в памяти</div>
|
|
134
|
+
{% set lm = s.run_model %}
|
|
135
|
+
{% set others = m.models|rejectattr("name", "equalto", lm.name if lm else "")|map(attribute="name")|list %}
|
|
136
|
+
<div class="tile-value tile-value-text mono" id="m-model">{{ lm.name if lm else ("ещё не измерено" if m.pending else "не загружена") }}</div>
|
|
137
|
+
<div class="tile-sub" id="m-model-vram">{% if lm and lm.vram_pct is not none %}{{ lm.vram_pct }}% в видеопамяти{% elif others %}в памяти: {{ others|join(", ") }}{% endif %}</div>
|
|
138
|
+
</div>
|
|
139
|
+
</section>
|
|
140
|
+
{% endif %}
|
|
141
|
+
|
|
142
|
+
<section class="panel" id="run-observer" aria-labelledby="obs-title"><h2 id="obs-title">Состояние обработки</h2><p id="obs-health" role="status">Получаем свежие данные…</p><p class="small" id="obs-result-time"></p><p class="small muted" id="obs-resource-time"></p>{% if not s.remote_executor %}<label>История ресурсов <select id="obs-window"><option value="15m">15 минут</option><option value="24h">24 часа</option></select></label><div class="resource-charts"><figure><figcaption>GPU, %</figcaption><svg id="obs-gpu-chart" role="img" aria-label="Загрузка GPU" viewBox="0 0 320 85"></svg></figure><figure><figcaption>Видеопамять, MiB</figcaption><svg id="obs-vram-chart" role="img" aria-label="Видеопамять" viewBox="0 0 320 85"></svg></figure><figure><figcaption>RAM компьютера, GiB</figcaption><svg id="obs-ram-chart" role="img" aria-label="Оперативная память компьютера" viewBox="0 0 320 85"></svg></figure></div><p class="hint">Общая загрузка видеокарты включает другие программы. Наличие модели в памяти само по себе не подтверждает обработку запроса.</p><details><summary>Как включить RAM/CPU хоста</summary>{% if STAND == "npm" %}<p>В учебном стенде сведения о компьютере пишет окно стенда: если их нет, закройте окно и запустите стенд снова командой <code>npx local-triage</code>.</p>{% else %}<p>При запуске через start.ps1 сборщик запускается автоматически. Для отдельного запуска в PowerShell: <code>.\scripts\host-metrics.ps1 -Action Start</code>. Память контейнера не подменяет RAM компьютера.</p>{% endif %}</details>{% endif %}</section>
|
|
143
|
+
<details class="panel" id="obs-gpus" hidden><summary>Отдельные видеокарты</summary><p class="hint">Общая память и мощность суммируются; загрузка и температура показывают максимум среди известных значений.</p><ul id="obs-gpu-list"></ul></details>
|
|
144
|
+
<section class="panel" aria-labelledby="feed-title">
|
|
145
|
+
<h2 id="feed-title">Последние вердикты</h2>
|
|
146
|
+
<div class="table-wrap">
|
|
147
|
+
<table class="table table-feed">
|
|
148
|
+
<thead><tr><th scope="col">ID</th><th scope="col">Вердикт</th><th scope="col">Правило</th><th scope="col" class="num">Время</th><th scope="col" class="num">ток/с</th></tr></thead>
|
|
149
|
+
<tbody id="feed">
|
|
150
|
+
{% for item in s.feed %}
|
|
151
|
+
<tr>
|
|
152
|
+
<td data-label="ID">{% if item.url %}<a class="mono" href="{{ item.url }}">{{ item.hub_id }}</a>{% else %}<span class="mono">{{ item.hub_id }}</span>{% endif %}</td>
|
|
153
|
+
<td data-label="Вердикт">{% if item.verdict %}{{ verdict_badge(item.verdict, item.confidence) }}{% if item.state == "cached" %} <span class="muted small">готовый</span>{% endif %}{% else %}<span class="badge item-{{ item.state }}"{% if item.error %} title="{{ item.error }}"{% endif %}>{{ item.error_label if item.state == "error" and item.error_label else item.state_label }}</span>{% if item.error and item.state != "error" %}<span class="muted small block">{{ item.error }}</span>{% endif %}{% endif %}</td>
|
|
154
|
+
<td data-label="Правило" class="small">{{ item.rule }}</td>
|
|
155
|
+
<td data-label="Время" class="num">{{ item.seconds|duration if item.seconds is not none else "–" }}</td>
|
|
156
|
+
<td data-label="ток/с" class="num">{{ item.eval_tps|num }}</td>
|
|
157
|
+
</tr>
|
|
158
|
+
{% else %}
|
|
159
|
+
<tr class="feed-empty"><td colspan="5" class="muted">Пока ничего не обработано.</td></tr>
|
|
160
|
+
{% endfor %}
|
|
161
|
+
</tbody>
|
|
162
|
+
</table>
|
|
163
|
+
</div>
|
|
164
|
+
</section>
|
|
165
|
+
</div>
|
|
166
|
+
{% endblock %}
|