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,440 @@
|
|
|
1
|
+
{# Общие элементы страниц. Описание – docs/DESIGN.md. Макросы видят только глобальные имена шаблонов (подписи
|
|
2
|
+
из app/view.py): адреса, настройки и пороги передаются аргументами. #}
|
|
3
|
+
|
|
4
|
+
{# Значок 16 px: SVG 24×24, обводка цветом текста; без label скрыт от чтения с экрана #}
|
|
5
|
+
{% macro icon(name, label="", cls="") -%}
|
|
6
|
+
{%- set shapes = {
|
|
7
|
+
"archive": '<rect x="2" y="3" width="20" height="5" rx="1"/><path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"/><path d="M10 12h4"/>',
|
|
8
|
+
"arrow-left": '<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>',
|
|
9
|
+
"arrow-right": '<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>',
|
|
10
|
+
"arrow-up": '<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>',
|
|
11
|
+
"book": '<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20"/>',
|
|
12
|
+
"check": '<path d="M20 6 9 17l-5-5"/>',
|
|
13
|
+
"check-circle": '<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>',
|
|
14
|
+
"chevron-down": '<path d="m6 9 6 6 6-6"/>',
|
|
15
|
+
"chevron-right": '<path d="m9 18 6-6-6-6"/>',
|
|
16
|
+
"clock": '<circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/>',
|
|
17
|
+
"code": '<path d="m16 18 6-6-6-6"/><path d="m8 6-6 6 6 6"/>',
|
|
18
|
+
"copy": '<rect x="8" y="8" width="14" height="14" rx="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',
|
|
19
|
+
"download": '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10 5 5 5-5"/><path d="M12 15V3"/>',
|
|
20
|
+
"edit": '<path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/>',
|
|
21
|
+
"external": '<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>',
|
|
22
|
+
"eye": '<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/>',
|
|
23
|
+
"file": '<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5Z"/><path d="M14 2v6h6"/>',
|
|
24
|
+
"folder": '<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>',
|
|
25
|
+
"inbox": '<path d="M22 12h-6l-2 3h-4l-2-3H2"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11Z"/>',
|
|
26
|
+
"info": '<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>',
|
|
27
|
+
"keyboard": '<rect x="2" y="5" width="20" height="14" rx="2"/><path d="M6 9h.01M10 9h.01M14 9h.01M18 9h.01M6 13h.01M18 13h.01M8 15h8"/>',
|
|
28
|
+
"list": '<path d="M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"/>',
|
|
29
|
+
"list-check": '<path d="M11 18H3M15 18l2 2 4-4M16 12H3M16 6H3"/>',
|
|
30
|
+
"logo": '<rect class="logo-bg" x="1" y="1" width="22" height="22" rx="6"/><path class="logo-fg" d="m7 12.5 3.2 3.2L17 9"/>',
|
|
31
|
+
"message": '<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>',
|
|
32
|
+
"moon": '<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>',
|
|
33
|
+
"package": '<path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"/><path d="M12 22V12"/><path d="m3.3 7 8.7 5 8.7-5"/>',
|
|
34
|
+
"pause": '<rect x="6" y="4" width="4" height="16" rx="1"/><rect x="14" y="4" width="4" height="16" rx="1"/>',
|
|
35
|
+
"play": '<path d="m6 3 14 9-14 9V3z"/>',
|
|
36
|
+
"plus": '<path d="M5 12h14M12 5v14"/>',
|
|
37
|
+
"refresh": '<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>',
|
|
38
|
+
"search": '<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',
|
|
39
|
+
"settings": '<path d="M20 7h-9M14 17H5"/><circle cx="17" cy="17" r="3"/><circle cx="7" cy="7" r="3"/>',
|
|
40
|
+
"shield": '<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/><path d="m9 12 2 2 4-4"/>',
|
|
41
|
+
"stop": '<rect x="5" y="5" width="14" height="14" rx="1"/>',
|
|
42
|
+
"sun": '<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/>',
|
|
43
|
+
"trash": '<path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><path d="M10 11v6M14 11v6"/>',
|
|
44
|
+
"upload": '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m17 8-5-5-5 5"/><path d="M12 3v12"/>',
|
|
45
|
+
"warning": '<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4M12 17h.01"/>',
|
|
46
|
+
"x": '<path d="M18 6 6 18M6 6l12 12"/>',
|
|
47
|
+
} -%}
|
|
48
|
+
{%- if name in shapes -%}
|
|
49
|
+
<svg class="icon icon-{{ name }}{% if cls %} {{ cls }}{% endif %}" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" focusable="false"{% if label %} role="img" aria-label="{{ label }}"{% else %} aria-hidden="true"{% endif %}>{{ shapes[name]|safe }}</svg>
|
|
50
|
+
{%- endif -%}
|
|
51
|
+
{%- endmacro %}
|
|
52
|
+
|
|
53
|
+
{# ---------------------------------------------------------------- макросы этапа 1 (вывод не меняется) #}
|
|
54
|
+
|
|
55
|
+
{% macro verdict_badge(value, confidence=None) -%}
|
|
56
|
+
{%- if value -%}<span class="badge verdict verdict-{{ value }}">{{ VERDICT_LABELS.get(value, value) }}{% if confidence is not none %} · {{ confidence }}%{% endif %}</span>
|
|
57
|
+
{%- else -%}<span class="badge verdict verdict-none">нет</span>{%- endif -%}
|
|
58
|
+
{%- endmacro %}
|
|
59
|
+
|
|
60
|
+
{% macro severity(value) -%}
|
|
61
|
+
{%- if value == "critical" -%}<span class="sev-badge">{{ SEVERITY_LABELS[value] }}</span>
|
|
62
|
+
{%- elif value -%}<span class="sev sev-{{ value }}">{{ SEVERITY_LABELS.get(value, value) }}</span>
|
|
63
|
+
{%- else -%}<span class="muted">–</span>{%- endif -%}
|
|
64
|
+
{%- endmacro %}
|
|
65
|
+
|
|
66
|
+
{% macro run_state(state) -%}
|
|
67
|
+
<span class="state state-{{ state }}">{{ RUN_STATE_LABELS.get(state, state) }}</span>
|
|
68
|
+
{%- endmacro %}
|
|
69
|
+
|
|
70
|
+
{# ---------------------------------------------------------------- бейджи и отметки #}
|
|
71
|
+
|
|
72
|
+
{# Вид находки: SAST, SCA, лицензии, DAST #}
|
|
73
|
+
{% macro kind_badge(kind) -%}
|
|
74
|
+
<span class="badge badge-kind">{{ KIND_LABELS.get(kind, kind) }}</span>
|
|
75
|
+
{%- endmacro %}
|
|
76
|
+
|
|
77
|
+
{# Уверенность модели словами и в процентах: от 80 – высокая, 50–79 – средняя, ниже 50 – низкая #}
|
|
78
|
+
{% macro confidence(value) -%}
|
|
79
|
+
{%- if value is not none and value != "" -%}
|
|
80
|
+
{%- set pct = [[value|int, 0]|max, 100]|min -%}
|
|
81
|
+
{%- set level = "high" if pct >= 80 else ("mid" if pct >= 50 else "low") -%}
|
|
82
|
+
<span class="conf conf-{{ level }}" title="Насколько модель уверена в своём вердикте"><span class="conf-bar" aria-hidden="true"><span class="conf-fill p-{{ pct }}"></span></span>уверенность {{ {"high": "высокая", "mid": "средняя", "low": "низкая"}[level] }}, {{ pct }}%</span>
|
|
83
|
+
{%- endif -%}
|
|
84
|
+
{%- endmacro %}
|
|
85
|
+
|
|
86
|
+
{# Находка в каталоге тестов: только показ, отбор и решение не меняются #}
|
|
87
|
+
{% macro test_code_badge(path) -%}
|
|
88
|
+
{%- if is_test_path(path) -%}<span class="badge badge-muted test-code-badge" title="Путь находки – в каталоге test или tests">тестовый код</span>{%- endif -%}
|
|
89
|
+
{%- endmacro %}
|
|
90
|
+
|
|
91
|
+
{# Отметки находки; дата – во всплывающей подсказке #}
|
|
92
|
+
{# Сборщик метрик компьютера не работает (HOSTCOL-01): что без него не работает и что
|
|
93
|
+
запустить. what: metrics – страница прогона, run – запуск прогона, external – внешние провайдеры. #}
|
|
94
|
+
{% macro collector_warning(c, what="metrics", external_on=False, hidden=False, id="collector-warning") -%}
|
|
95
|
+
{# внешний запрос из контейнера встаёт без свежих адресов компьютера (llm_net: in_container и нет адресов не старше
|
|
96
|
+
5 минут) – только тогда фраза о внешних провайдерах; на странице прогона её показывает и прячет скрипт #}
|
|
97
|
+
{% set blocks_external = external_on and c.expected and not c.addresses %}
|
|
98
|
+
<div class="callout callout-warn collector-warning" id="{{ id }}" role="status" data-external-on="{{ 1 if external_on else 0 }}"{% if hidden %} hidden{% endif %}>
|
|
99
|
+
<p><strong>{% if what == "external" %}Запросы к внешним провайдерам сейчас не уйдут: нет свежих адресов этого компьютера{% else %}Сборщик метрик компьютера не работает{% endif %}</strong><span data-collector-detail-wrap{% if not c.detail %} hidden{% endif %}> – <span data-collector-detail>{{ c.detail }}</span></span>. После перезагрузки компьютера сборщик сам не запускается.</p>
|
|
100
|
+
{% if STAND == "npm" %}<p>В учебном стенде сведения о компьютере пишет окно стенда. Закройте его и запустите стенд снова той же командой <code>npx local-triage</code>.</p>{% else %}<p>Запустите его в PowerShell из папки приложения (там, где <span class="mono">start.ps1</span>): <code>.\scripts\host-metrics.ps1 -Action Start</code> – приложение перезапускать не нужно, предупреждение исчезнет само{% if what != "metrics" %} после обновления страницы{% endif %}.</p>{% endif %}
|
|
101
|
+
<p class="small">{% if what == "external" %}Адреса компьютера передаёт этот сборщик. Без них приложение не может исключить, что адрес провайдера ведёт на сам компьютер, поэтому внешний запрос не отправляется.{% elif what == "run" %}Без него на странице прогона не видно памяти и процессора компьютера{% if blocks_external %}, а запросы к внешним провайдерам не уходят{% endif %}.{% else %}Без него не видно памяти и процессора компьютера<span data-collector-external{% if not blocks_external %} hidden{% endif %}>, а запросы к внешним провайдерам не уходят</span>.{% endif %}</p>
|
|
102
|
+
</div>
|
|
103
|
+
{%- endmacro %}
|
|
104
|
+
|
|
105
|
+
{% macro marks(reviewed=False, entered=False, reviewed_at="", entered_at="", missing=False) -%}
|
|
106
|
+
{%- if reviewed or entered or missing -%}
|
|
107
|
+
<span class="marks">
|
|
108
|
+
{%- if reviewed %}<span class="badge badge-ok" title="Проверено{% if reviewed_at %} {{ reviewed_at|ts }}{% endif %}">{{ icon("check") }}<span class="badge-label">проверено</span></span>{% endif %}
|
|
109
|
+
{%- if entered %}<span class="badge badge-info" title="Внесено в Hub{% if entered_at %} {{ entered_at|ts }}{% endif %}">{{ icon("check-circle") }}<span class="badge-label">в Hub</span></span>{% endif %}
|
|
110
|
+
{%- if missing %}<span class="badge badge-muted" title="В последней загруженной выгрузке этой находки нет">нет в выгрузке</span>{% endif -%}
|
|
111
|
+
</span>
|
|
112
|
+
{%- endif -%}
|
|
113
|
+
{%- endmacro %}
|
|
114
|
+
|
|
115
|
+
{# Цвет по версии шкалы; по умолчанию прежняя шкала 3.x. У 2.0 высокий начинается с 7, критического нет #}
|
|
116
|
+
{% macro cvss(score, version="") -%}
|
|
117
|
+
{%- if score is none or score == "" -%}<span class="muted">–</span>
|
|
118
|
+
{%- else -%}
|
|
119
|
+
{%- set s = (score|string)|replace(",", ".")|float -%}
|
|
120
|
+
{%- if version == "2.0" -%}
|
|
121
|
+
{%- set level = "high" if s >= 7 else ("medium" if s >= 4 else "low") -%}
|
|
122
|
+
{%- else -%}
|
|
123
|
+
{%- set level = "critical" if s >= 9 else ("high" if s >= 7 else ("medium" if s >= 4 else ("low" if s > 0 else "none"))) -%}
|
|
124
|
+
{%- endif -%}
|
|
125
|
+
<span class="cvss cvss-{{ level }}" title="CVSS {{ score|num }}">{{ score|num }}</span>
|
|
126
|
+
{%- endif -%}
|
|
127
|
+
{%- endmacro %}
|
|
128
|
+
|
|
129
|
+
{# Вывод по компоненту SCA (models.ScaAnswer.conclusion) #}
|
|
130
|
+
{% macro sca_conclusion(value, label="") -%}
|
|
131
|
+
{%- set labels = {"update": "обновить", "not_applicable": "не применимо", "unclear": "неясно"} -%}
|
|
132
|
+
{%- if value in labels -%}<span class="badge conclusion conclusion-{{ value }}"{% if value == "not_applicable" %} title="Ложное срабатывание: компонент или уязвимость определены ошибочно"{% endif %}>{{ label or labels[value] }}</span>
|
|
133
|
+
{%- else -%}<span class="badge badge-muted">{{ label or "нет ответа" }}</span>{%- endif -%}
|
|
134
|
+
{%- endmacro %}
|
|
135
|
+
|
|
136
|
+
{# ---------------------------------------------------------------- ход и счётчики #}
|
|
137
|
+
|
|
138
|
+
{# Полоса хода: «проверено» и поверх – «внесено в Hub»; ширина – классом p-N (встроенные стили запрещены политикой CSP) #}
|
|
139
|
+
{% macro progress(done, total, entered=None, label="Проверено", entered_label="Внесено в Hub", caption=True) -%}
|
|
140
|
+
{%- set total_n = total|int -%}
|
|
141
|
+
{%- set done_n = done|int -%}
|
|
142
|
+
{%- set pct = 0 if total_n <= 0 else [(done_n * 100 / total_n)|round(0, "floor")|int, 100]|min -%}
|
|
143
|
+
{%- set pct = 1 if (done_n > 0 and pct == 0) else pct -%}
|
|
144
|
+
{%- if entered is not none -%}
|
|
145
|
+
{%- set entered_n = entered|int -%}
|
|
146
|
+
{%- set epct = 0 if total_n <= 0 else [(entered_n * 100 / total_n)|round(0, "floor")|int, 100]|min -%}
|
|
147
|
+
{%- set epct = 1 if (entered_n > 0 and epct == 0) else epct -%}
|
|
148
|
+
{%- endif -%}
|
|
149
|
+
<div class="progress-block">
|
|
150
|
+
<div class="pbar"{% if caption %} aria-hidden="true"{% else %} role="img" aria-label="{{ label }} {{ done_n }} из {{ total_n }}{% if entered is not none %}, {{ entered_label }} {{ entered_n }}{% endif %}"{% endif %}><span class="pbar-fill pbar-done p-{{ pct }}"></span>{% if entered is not none %}<span class="pbar-fill pbar-entered p-{{ epct }}"></span>{% endif %}</div>
|
|
151
|
+
{% if caption %}<div class="pbar-caption"><span class="pbar-key">{{ label }} <strong>{{ done_n }}</strong> из {{ total_n }}</span>{% if entered is not none %}<span class="pbar-key pbar-key-entered">{{ entered_label }} <strong>{{ entered_n }}</strong></span>{% endif %}</div>{% endif %}
|
|
152
|
+
</div>
|
|
153
|
+
{%- endmacro %}
|
|
154
|
+
|
|
155
|
+
{# Счётчик для .stats: подпись читается первой, число показано крупно сверху #}
|
|
156
|
+
{% macro stat(value, label, tone="", sub="", href="", active=False) -%}
|
|
157
|
+
{% if href %}<a class="stat stat-filter{% if tone %} stat-{{ tone }}{% endif %}{% if active %} is-active{% endif %}" href="{{ href }}"{% if active %} aria-current="true"{% endif %}>{% else %}<div class="stat{% if tone %} stat-{{ tone }}{% endif %}">{% endif %}<span class="stat-label">{{ label }}</span><span class="stat-value">{{ value }}</span>{% if sub %}<span class="stat-sub">{{ sub }}</span>{% endif %}{% if href %}</a>{% else %}</div>{% endif %}
|
|
158
|
+
{%- endmacro %}
|
|
159
|
+
|
|
160
|
+
{# ---------------------------------------------------------------- навигация #}
|
|
161
|
+
|
|
162
|
+
{% macro chip(href, label, active=False, count=None) -%}
|
|
163
|
+
<a class="chip{% if active %} is-active{% endif %}" href="{{ href }}"{% if active %} aria-current="true"{% endif %}>{{ label }}{% if count is not none %} <span class="chip-count">{{ count }}</span>{% endif %}</a>
|
|
164
|
+
{%- endmacro %}
|
|
165
|
+
|
|
166
|
+
{# Вкладки: items – кортежи (ключ, подпись, адрес[, число]); active – ключ текущей #}
|
|
167
|
+
{% macro tabs(items, active, label="Разделы") -%}
|
|
168
|
+
<nav class="tabs" aria-label="{{ label }}">
|
|
169
|
+
{%- for item in items %}<a class="tab" href="{{ item[2] }}"{% if item[0] == active %} aria-current="page"{% endif %}>{{ item[1] }}{% if item|length > 3 and item[3] is not none %} <span class="tab-count">{{ item[3] }}</span>{% endif %}</a>{% endfor -%}
|
|
170
|
+
</nav>
|
|
171
|
+
{%- endmacro %}
|
|
172
|
+
|
|
173
|
+
{# Вкладки проекта: total – находок в выгрузке, sca – находок SCA Security, defects – дефектов из карточек (ADR-0120);
|
|
174
|
+
active – ключ #}
|
|
175
|
+
{% macro project_tabs(project, total, sca, active, defects=None) -%}
|
|
176
|
+
{{ tabs([("overview", "Обзор", "/projects/%d" % project.id), ("findings", "Находки", "/projects/%d/findings" % project.id, total), ("sca", "SCA", "/projects/%d/sca" % project.id, sca), ("components", "Компоненты", "/projects/%d/components" % project.id), ("defects", "Дефекты", "/projects/%d/defects" % project.id, defects)], active, label="Разделы проекта") }}
|
|
177
|
+
{%- endmacro %}
|
|
178
|
+
|
|
179
|
+
{# ---------------------------------------------------------------- пустое состояние #}
|
|
180
|
+
|
|
181
|
+
{# Пустое место с подсказкой, что сделать дальше; свои кнопки – через {% call empty_state(...) %} #}
|
|
182
|
+
{% macro empty_state(title, text="", href="", action="", icon_name="inbox") -%}
|
|
183
|
+
<div class="empty-state">
|
|
184
|
+
<span class="empty-icon">{{ icon(icon_name) }}</span>
|
|
185
|
+
<p class="empty-title">{{ title }}</p>
|
|
186
|
+
{% if text %}<p class="empty-text">{{ text }}</p>{% endif %}
|
|
187
|
+
{% if href or caller is defined %}<div class="empty-actions">{% if href %}<a class="btn btn-primary" href="{{ href }}">{{ action or "Продолжить" }}</a>{% endif %}{% if caller is defined %}{{ caller() }}{% endif %}</div>{% endif %}
|
|
188
|
+
</div>
|
|
189
|
+
{%- endmacro %}
|
|
190
|
+
|
|
191
|
+
{# ---------------------------------------------------------- классы CWE #}
|
|
192
|
+
|
|
193
|
+
{# Номер класса CWE ссылкой на карточку справочника /cwe/{id}; номера нет – текстом #}
|
|
194
|
+
{% macro cwe_link(value, label="", cls="mono") -%}
|
|
195
|
+
{%- set key = cwe_number(value) -%}
|
|
196
|
+
{%- if key -%}{{ catalog_link('cwe', key, label or key, cls=cls) }}{%- else -%}<span class="{{ cls }}">{{ label or value }}</span>{%- endif -%}
|
|
197
|
+
{%- endmacro %}
|
|
198
|
+
|
|
199
|
+
{% macro catalog_link(kind, key, label="", href="", cls="mono") -%}
|
|
200
|
+
{%- set target = href or ('/' ~ kind ~ '/' ~ key) -%}
|
|
201
|
+
{%- set note = reference_status(kind, key) if reference_status is defined else '' -%}
|
|
202
|
+
<a class="{{ cls }}{% if note %} reference-unavailable{% endif %}"{% if note %} title="{{ note }}" aria-description="{{ note }}"{% endif %} href="{{ work_link(target) if work_link is defined else target }}">{{ label or key }}</a>
|
|
203
|
+
{%- endmacro %}
|
|
204
|
+
|
|
205
|
+
{# Перечень номеров CWE через точку с пробелом (таблица SCA, перечень классов находки) #}
|
|
206
|
+
{% macro cwe_tags(values, sep=" · ", cls="mono") -%}
|
|
207
|
+
{%- for v in values -%}
|
|
208
|
+
{{- cwe_link(v, cls=cls) }}{{ sep if not loop.last }}
|
|
209
|
+
{%- endfor -%}
|
|
210
|
+
{%- endmacro %}
|
|
211
|
+
|
|
212
|
+
{# Внешний адрес из данных справочника: ссылка только по правилу norm_link, иначе текст #}
|
|
213
|
+
{% macro ext_link(url, label="", cls="") -%}
|
|
214
|
+
{%- set href = url|norm_link -%}
|
|
215
|
+
{%- if href -%}<a class="{{ cls }}" href="{{ href }}" rel="noopener noreferrer" target="_blank">{{ label or url }}</a>{%- elif label -%}<span class="{{ cls }}">{{ label }}</span>{%- else -%}<span class="break">{{ url }}</span>{%- endif -%}
|
|
216
|
+
{%- endmacro %}
|
|
217
|
+
|
|
218
|
+
{# ---------------------------------------------------------------- код #}
|
|
219
|
+
|
|
220
|
+
{# Код с номерами строк; разметка строк та же, что на этапе 1 (на неё опираются тесты и скрипт) #}
|
|
221
|
+
{% macro code_view(rows, label="Код вокруг находки", box_id="code", wrap=True) -%}
|
|
222
|
+
<div class="code{% if wrap %} code-wrap{% endif %}" id="{{ box_id }}" tabindex="0" role="region" aria-label="{{ label }}">
|
|
223
|
+
<table class="code-table">
|
|
224
|
+
<tbody>
|
|
225
|
+
{% for r in rows %}{% set cls = (("is-target" if r.target else ("is-evidence" if r.evidence else "")) ~ (" is-steering" if r.steering else ""))|trim %}<tr{% if r.n %} id="L{{ r.n }}"{% endif %}{% if cls %} class="{{ cls }}"{% endif %}><td class="ln">{% if r.target %}<span class="mark" aria-hidden="true">▶</span>{% elif r.steering %}<span class="mark mark-steer" aria-hidden="true">!</span>{% endif %}{{ r.n if r.n else "" }}</td><td class="src">{{ r.text }}</td></tr>
|
|
226
|
+
{% endfor %}
|
|
227
|
+
</tbody>
|
|
228
|
+
</table>
|
|
229
|
+
</div>
|
|
230
|
+
{%- endmacro %}
|
|
231
|
+
|
|
232
|
+
{% macro code_legend(steering=False) -%}
|
|
233
|
+
<p class="legend small"><span class="swatch swatch-target" aria-hidden="true">▶</span> строка срабатывания <span class="swatch swatch-evidence" aria-hidden="true"></span> строки из объяснения модели{% if steering %} <span class="swatch swatch-steer" aria-hidden="true">!</span> похоже на указания для модели{% endif %}</p>
|
|
234
|
+
{%- endmacro %}
|
|
235
|
+
|
|
236
|
+
{# Кнопка копирования: текст из атрибута или содержимое элемента по id #}
|
|
237
|
+
{% macro copy_button(label="Скопировать", text=None, target=None, small=True, done="") -%}
|
|
238
|
+
<button type="button" class="btn{% if small %} btn-small{% endif %}"{% if target %} data-copy-target="{{ target }}"{% else %} data-copy-text="{{ text or '' }}"{% endif %}{% if done %} data-copy-done="{{ done }}"{% endif %}>{{ icon("copy") }}{{ label }}</button>
|
|
239
|
+
{%- endmacro %}
|
|
240
|
+
|
|
241
|
+
{# Дефект для Hub (заголовок и текст) – в карточках SAST и SCA. Панель видна, когда сохранено решение с итогом
|
|
242
|
+
«истинная» или «ложная»; скрипт карточки показывает и прячет её по ответу на сохранение (defect_ready) и копирует
|
|
243
|
+
заголовок и текст, полученные с сервера. Без скрипта – форма сохраняет номер, а текст виден ниже для копирования. #}
|
|
244
|
+
{#- Каркас панели «Дефект для Hub»: общий для SAST и SCA; пояснение о том, что делать в Hub, – у каждого вида своё
|
|
245
|
+
(defect_panel_sast, defect_panel_sca) -#}
|
|
246
|
+
{% macro _defect_panel(defect, action, existing=None, auto=False) -%}
|
|
247
|
+
<section class="panel defect-panel" id="defect-panel" aria-labelledby="defect-title"{% if not defect.ready %} hidden{% endif %}>
|
|
248
|
+
<h2 id="defect-title">Дефект для Hub</h2>
|
|
249
|
+
{% if existing %}<p class="callout callout-ok" id="defect-exists"><strong>Дефект для этой находки уже есть:</strong> <a href="{{ existing.card_url }}">{{ existing.text }}</a>{% if existing.origin == "import" %} (занесён из Hub){% endif %}. Заголовок и текст ниже – для сверки и копирования; изменения в Hub – «Push в Hub» в карточке дефекта.</p>
|
|
250
|
+
{% elif auto %}<p class="hint" id="defect-auto-hint">Дефект создаётся кнопкой «Создать дефект» в блоке ниже. Копирование нужно, только если заводите дефект в Hub вручную.{% if defect.hint and not defect.ready %} {{ defect.hint }}{% endif %}</p>
|
|
251
|
+
{% else %}<p class="hint">Создайте дефект в Hub вручную: заголовок дефекта – в название, полный текст дефекта – в описание.{{ caller() }} {{ defect.hint }}</p>{% endif %}
|
|
252
|
+
{% if defect.warnings %}
|
|
253
|
+
<div class="callout callout-warn" role="note" id="defect-warnings">
|
|
254
|
+
<p><strong>Перед копированием проверьте:</strong></p>
|
|
255
|
+
<ul>{% for w in defect.warnings %}<li>{{ w }}</li>{% endfor %}</ul>
|
|
256
|
+
<p>Если всё верно, отметьте «Предупреждения проверены»; иначе поправьте комментарий для Hub и сохраните решение.</p>
|
|
257
|
+
</div>
|
|
258
|
+
{% endif %}
|
|
259
|
+
{#- текст не по требованиям команды (ADR-0123): предупреждение без запрета – «Создать дефект в Hub» такой текст не отправит.
|
|
260
|
+
Полный текст скрыт (обоснование – текст модели или агента к другому выводу) – перечня нет: нарушения цитируют
|
|
261
|
+
строки скрытого текста -#}
|
|
262
|
+
{% if defect.form_problems and not defect.comment_check and not defect.comment_others %}
|
|
263
|
+
<div class="callout callout-warn" role="note" id="defect-form-problems">
|
|
264
|
+
<p><strong>Текст не по требованиям команды:</strong></p>
|
|
265
|
+
<ul>{% for p in defect.form_problems %}<li>{{ p }}</li>{% endfor %}</ul>
|
|
266
|
+
<p>Скопировать текст можно, но «Создать дефект в Hub» его не отправит: поправьте решение в карточке и сохраните его.</p>
|
|
267
|
+
</div>
|
|
268
|
+
{% endif %}
|
|
269
|
+
{% if defect.note %}<p class="field-hint" id="defect-note">{{ defect.note }}</p>{% endif %}
|
|
270
|
+
<form method="post" action="{{ action }}" id="defect-form" class="inline-form">
|
|
271
|
+
<label class="field">
|
|
272
|
+
<span class="field-label">Номер дефекта в Hub</span>
|
|
273
|
+
<span class="defect-number"><span class="mono" aria-hidden="true">ID</span><input type="number" name="number" id="defect-number" value="{{ defect.entered_number or defect.number }}" min="1" max="999999" inputmode="numeric" aria-describedby="defect-number-hint"></span>
|
|
274
|
+
</label>
|
|
275
|
+
<label class="check" id="defect-confirm-row"{% if not defect.warnings %} hidden{% endif %}><input type="checkbox" name="confirm" value="1" id="defect-confirm"> Предупреждения проверены</label>
|
|
276
|
+
{% if defect.review_revision is defined %}<input type="hidden" name="review_revision" value="{{ defect.review_revision }}" id="defect-review-revision">{% endif %}
|
|
277
|
+
<input type="hidden" name="number_shown" value="{{ defect.saved_number if defect.saved_number is defined and defect.saved_number is not none else (defect.number if defect.stored else "") }}" id="defect-number-shown">
|
|
278
|
+
<label class="check" id="defect-comment-confirm-row"{% if not defect.comment_check %} hidden{% endif %}><input type="checkbox" name="comment_confirmed" value="1" id="defect-comment-confirm"> Текст проверен – обоснование подходит к итоговому вердикту</label>
|
|
279
|
+
<button type="submit" class="btn" name="part" value="title" id="copy-defect-title">{{ icon("copy") }}Скопировать заголовок дефекта</button>
|
|
280
|
+
<button type="submit" class="btn" name="part" value="body" id="copy-defect-body">{{ icon("copy") }}Скопировать полный текст дефекта</button>
|
|
281
|
+
</form>
|
|
282
|
+
{% if defect.group_note %}<p class="small text-warn" id="defect-group-note">{{ defect.group_note }}</p>{% endif %}
|
|
283
|
+
<p class="field-hint" id="defect-number-hint">{% if defect.stored %}Номер сохранён для этой {{ defect.subject }}.{% else %}Предложен следующий номер по счётчику проекта – поправьте, если в Hub он другой.{% endif %}{% if defect.needs_team %} Название команды для первой фразы – на странице <a href="/settings#defect-title">«Настройки»</a>.{% endif %}</p>
|
|
284
|
+
<p class="copy-status" id="defect-status" role="status" aria-live="polite"></p>
|
|
285
|
+
<details class="hub-preview" id="defect-preview">
|
|
286
|
+
<summary>Заголовок и текст дефекта</summary>
|
|
287
|
+
<pre class="hub-text" id="defect-title-text">{{ defect.title }}</pre>
|
|
288
|
+
{% if defect.comment_others %}<p class="small text-warn" id="defect-body-hidden">Полный текст не показан: в дефект входят находки, где комментарий – текст агента к другому выводу ({{ defect.comment_others[:10]|join(", ") }}). Поправьте комментарий в их карточках.</p>
|
|
289
|
+
{% elif defect.comment_check %}<p class="small text-warn" id="defect-body-hidden">Полный текст не показан: обоснование написано моделью к другому вердикту. Поправьте комментарий и сохраните решение или отметьте «Текст проверен» и скопируйте полный текст.</p>{% endif %}
|
|
290
|
+
<pre class="hub-text" id="defect-body-text">{% if not defect.comment_check and not defect.comment_others %}{{ defect.body }}{% endif %}</pre>
|
|
291
|
+
<button type="button" class="btn btn-small" id="defect-copied-manually" hidden>Скопировал текст дефекта вручную</button>
|
|
292
|
+
</details>
|
|
293
|
+
</section>
|
|
294
|
+
{%- endmacro %}
|
|
295
|
+
|
|
296
|
+
{#- Панель дефекта SAST: дефект создаётся из отмеченных находок группы; у слившейся группы с разными номерами – только
|
|
297
|
+
находки этого дефекта -#}
|
|
298
|
+
{#- «Отправить в Hub» (ADR-0115): статус находки с комментарием и сроком действия уходит через исполнителя.
|
|
299
|
+
hub – hub_status_routes.card_context; action – адрес отправки; project_id – для адресов состояния и сверки.
|
|
300
|
+
Поле срока обязательное и без умолчания: календарь или быстрый срок. -#}
|
|
301
|
+
{% macro hub_send_panel(hub, action, project_id, stale=False, revision="") -%}
|
|
302
|
+
<div class="hub-send" id="hub-send">
|
|
303
|
+
<h3 class="hub-send-title">Отправить в Hub</h3>
|
|
304
|
+
{% if hub.blocker %}<p class="small muted" id="hub-send-blocker">{{ hub.blocker }}</p>
|
|
305
|
+
{% elif hub.research_conflict %}
|
|
306
|
+
<p class="small text-warn" id="hub-send-conflict">Совет агента «не применимо» расходится с исследованием, принятым после решения ({{ hub.research_conflict }}). Проверьте находку: подтвердите совет или измените решение и сохраните, затем отправляйте.</p>
|
|
307
|
+
{% elif hub.fixed %}
|
|
308
|
+
<p class="small" id="hub-send-fixed">{{ hub.fixed }}</p>
|
|
309
|
+
{% if hub.fixed_from_export %}<p><a class="btn btn-small" id="hub-send-fixed-sync" href="/projects/{{ project_id }}/defects">Открыть вкладку «Дефекты»</a></p>{% endif %}
|
|
310
|
+
{% elif hub.in_defect %}
|
|
311
|
+
{# находка входит в дефект (dev32): статус в Hub через дефект – формы отправки нет #}
|
|
312
|
+
<div class="small" id="hub-send-in-defect">
|
|
313
|
+
<p id="hub-send-in-defect-text">{{ hub.in_defect.text }}</p>
|
|
314
|
+
<p><a class="btn btn-small" href="{{ hub.in_defect.url }}" id="hub-send-in-defect-link">Открыть дефект {{ hub.in_defect.label }}</a></p>
|
|
315
|
+
</div>
|
|
316
|
+
{% else %}
|
|
317
|
+
<form method="post" action="{{ action }}" id="hub-send-form" class="stack-form" data-ajax data-include="review-revision" data-busy="Ставлю в очередь…">
|
|
318
|
+
{# редакция решения – и без скрипта (со скриптом её заменяет актуальная #review-revision); отпечаток данных
|
|
319
|
+
находки, которые видел оператор: после обновления выгрузки отправка отклоняется #}
|
|
320
|
+
<input type="hidden" name="review_revision" value="{{ revision }}">
|
|
321
|
+
<input type="hidden" name="finding_sig" value="{{ hub.sig }}">
|
|
322
|
+
<input type="hidden" name="text_hash" id="hub-send-text-hash" value="{{ hub.text_hash }}">
|
|
323
|
+
{# назначение, которое показала карточка (KIMI-12): адрес Hub или приложение сменили после показа – отказ #}
|
|
324
|
+
<input type="hidden" name="hub_base" id="hub-send-hub-base" value="{{ hub.hub_base }}">
|
|
325
|
+
<input type="hidden" name="hub_app_id" id="hub-send-app-id" value="{{ hub.hub_app_id }}">
|
|
326
|
+
{# статус уже стоит в Hub, текущего комментария там нет (dev29): замена двумя шагами по подтверждению #}
|
|
327
|
+
{% set replacing = hub.replace and hub.replace.active %}
|
|
328
|
+
{% if replacing %}<input type="hidden" name="replace" value="1" id="hub-send-replace">{% endif %}
|
|
329
|
+
{% if hub.note %}<p class="small text-warn" id="hub-send-note">{{ hub.note }}</p>{% endif %}
|
|
330
|
+
<p class="small text-warn" id="hub-send-replace-note"{% if not replacing %} hidden{% endif %}>{{ hub.replace.note if hub.replace else "" }}</p>
|
|
331
|
+
<div class="field">
|
|
332
|
+
<label class="field-label" for="hub-send-expires">Срок действия статуса <span aria-hidden="true">*</span></label>
|
|
333
|
+
<input type="date" name="expires" id="hub-send-expires"{% if hub.expires %} value="{{ hub.expires }}"{% endif %} min="{{ hub.min }}" max="{{ hub.max }}" required aria-describedby="hub-send-hint">
|
|
334
|
+
<span class="cluster review-presets" role="group" aria-label="Быстрый срок действия">{% for days, value in hub.presets %}<button type="button" class="btn btn-ghost btn-small" data-date-for="hub-send-expires" data-date-value="{{ value }}" title="{{ value }}">+{{ days }} дней</button>{% endfor %}<button type="button" class="btn btn-ghost btn-small" id="hub-send-last" hidden>как в прошлый раз</button></span>
|
|
335
|
+
<span class="field-hint" id="hub-send-hint">В Hub уходит сохранённое решение: статус, комментарий (как в предпросмотре) и срок. Исполнитель отправит его при следующем обращении; отметка «Внесено в Hub» поставится сама, когда Hub ответит.</span>
|
|
336
|
+
<span class="field-hint" id="hub-send-until-preview" aria-live="polite" hidden></span>
|
|
337
|
+
</div>
|
|
338
|
+
{# без скрипта – свой флажок; со скриптом – общий «Текст проверен» карточки (app.js) #}
|
|
339
|
+
<label class="check small" id="hub-send-confirm-label"{% if not stale %} hidden{% endif %}><input type="checkbox" name="comment_confirmed" value="1" id="hub-send-comment-confirm"> Текст проверен – обоснование подходит к итоговому вердикту</label>
|
|
340
|
+
<label class="check small" id="hub-send-replace-confirm"{% if not replacing %} hidden{% endif %}><input type="checkbox" name="replace_confirm" value="1" id="hub-send-replace-box"{% if replacing %} required{% endif %}> <span id="hub-send-replace-text">{{ hub.replace.check if hub.replace else "" }}</span></label>
|
|
341
|
+
<div class="actions"><button type="submit" class="btn btn-primary" id="hub-send-button">{% if replacing %}Обновить комментарий в Hub{% else %}Отправить в Hub{% endif %}</button></div>
|
|
342
|
+
</form>
|
|
343
|
+
{% endif %}
|
|
344
|
+
<p class="small hub-send-status{% if hub.last.tone %} text-{{ hub.last.tone }}{% endif %}" id="hub-send-status" role="status" aria-live="polite"{% if not hub.last.text %} hidden{% endif %}{% if hub.last.op_id and not hub.last.final %} data-poll="/projects/{{ project_id }}/hub/ops/{{ hub.last.op_id }}?hub_id={{ hub.hub_id }}"{% endif %}>{% if hub.last.time %}{{ hub.last.time.prefix }}<time datetime="{{ hub.last.time.datetime }}">{{ hub.last.time.fallback }}</time>{{ hub.last.time.suffix }}{% else %}{{ hub.last.text }}{% endif %}</p>
|
|
345
|
+
{# «Сверить» в разметке всегда: опрос показывает кнопку и меняет номер операции без перезагрузки #}
|
|
346
|
+
<form method="post" action="/projects/{{ project_id }}/hub/verify" id="hub-verify-form" class="actions" data-ajax data-busy="Ставлю сверку…"{% if not hub.last.verify %} hidden{% endif %}>
|
|
347
|
+
<input type="hidden" name="op_id" id="hub-verify-op" value="{{ hub.last.op_id or '' }}"><input type="hidden" name="hub_id" value="{{ hub.hub_id }}">
|
|
348
|
+
<button type="submit" class="btn btn-small" id="hub-verify-button">Pull из Hub</button>
|
|
349
|
+
</form>
|
|
350
|
+
</div>
|
|
351
|
+
{%- endmacro %}
|
|
352
|
+
|
|
353
|
+
{% macro defect_panel_sast(defect, action, existing=None, auto=False) -%}
|
|
354
|
+
{% call _defect_panel(defect, action, existing, auto) %}{% if defect.merge_split %} В этой группе после обновления приложения разные номера дефектов: в Hub отметьте только находки этого дефекта (с номером из поля ниже), остальные относятся к другому. Статус находок менять не нужно.{% else %} Дефект создаётся из отмеченных галочкой находок: вместе с этой отметьте находки из списка «Та же строка, та же категория и тот же код» (если он есть). Статус находок менять не нужно.{% endif %}{% endcall %}
|
|
355
|
+
{%- endmacro %}
|
|
356
|
+
|
|
357
|
+
{#- Панель дефекта SCA: дефект на версию компонента, короткий текст – в комментарий к смене статуса -#}
|
|
358
|
+
{% macro defect_panel_sca(defect, action, existing=None, auto=False) -%}
|
|
359
|
+
{% call _defect_panel(defect, action, existing, auto) %} Короткий текст для Hub (кнопка внизу) – в комментарий к смене статуса находки.{% endcall %}
|
|
360
|
+
{%- endmacro %}
|
|
361
|
+
|
|
362
|
+
{#- «Создать дефект в Hub» (ADR-0120): заготовка → предпросмотр → «Создать» → подтверждение чтением. hd –
|
|
363
|
+
hub_defect_routes.card_context; action – адрес заготовки; shown_hash – отпечаток текста дефекта, который видит
|
|
364
|
+
оператор (SAST – тело, SCA – подпись набора); ready – текст дефекта готов (панель «Дефект для Hub» видна). -#}
|
|
365
|
+
{% macro hub_defect_panel(hd, action, project_id, shown_hash="", revision="", ready=False, hint="") -%}
|
|
366
|
+
{% set row = hd.row %}
|
|
367
|
+
{# блок виден всегда: пока текст дефекта не готов, вместо кнопки – причина (скрытый блок без
|
|
368
|
+
объяснения оставлял оператора без кнопки «Создать дефект») #}
|
|
369
|
+
<div class="hub-send hub-defect" id="hub-defect">
|
|
370
|
+
<h3 class="hub-send-title">Создать дефект в Hub</h3>
|
|
371
|
+
{% if not ready and (not row or row.state == "failed") and not hd.blocker and not hd.link %}<p class="small muted" id="hub-defect-not-ready">Создать дефект пока нельзя: {{ hint or "текст дефекта не готов – сохраните решение и текст дефекта в разделах выше." }}</p>{% endif %}
|
|
372
|
+
{% if row %}<p><a id="defect-card-link" href="/projects/{{ project_id }}/defects/{{ row.id }}">Карточка дефекта</a></p>{% endif %}
|
|
373
|
+
{% if hd.blocker %}<p class="small muted" id="hub-defect-blocker">{{ hd.blocker }}</p>
|
|
374
|
+
{% else %}
|
|
375
|
+
{% if row and row.state == "preview" and hd.preview %}
|
|
376
|
+
<section class="hub-defect-preview" id="hub-defect-preview" aria-labelledby="hub-defect-preview-title">
|
|
377
|
+
<h4 id="hub-defect-preview-title">Предпросмотр дефекта</h4>
|
|
378
|
+
<p class="small">Заголовок: <span class="mono break" id="hub-defect-summary">{{ hd.preview.summary }}</span></p>
|
|
379
|
+
<p class="small" id="hub-defect-targets">Будут привязаны находки ({{ hd.preview.targets|length }}): {% for t in hd.preview.targets %}{% if t.url %}<a class="mono" href="{{ t.url }}">{{ t.hub_id }}</a>{% else %}<span class="mono">{{ t.hub_id }}</span>{% endif %}{{ ", " if not loop.last }}{% endfor %}.</p>
|
|
380
|
+
{% if hd.preview.left_out %}<p class="small text-warn" id="hub-defect-left-out">Не войдут: {% for e in hd.preview.left_out %}<span class="mono">{{ e.hub_id }}</span> – {{ e.why }}{{ "; " if not loop.last }}{% endfor %}.</p>{% endif %}
|
|
381
|
+
{% if hd.preview.warnings %}<ul class="small text-warn" id="hub-defect-warnings">{% for w in hd.preview.warnings %}<li>{{ w }}</li>{% endfor %}</ul>{% endif %}
|
|
382
|
+
<form method="post" action="/projects/{{ project_id }}/hub/defects/{{ row.id }}/create" id="hub-defect-create-form" class="stack-form" data-ajax data-busy="Ставлю в очередь…">
|
|
383
|
+
<input type="hidden" name="create_snapshot" value="{{ hd.preview.snapshot }}">
|
|
384
|
+
<p class="field-hint">«Создать» разрешает один POST создания и чтение результата. Если Hub не привязал часть показанного состава, исполнитель выполнит одну привязку недостающих находок и подтверждающее чтение. Повторного создания нет.</p>
|
|
385
|
+
<label class="field"><span class="field-label">Приоритет</span>
|
|
386
|
+
{% if hd.preview.priorities %}<select name="priority" id="hub-defect-priority">{% for name in hd.preview.priorities %}<option value="{{ name }}"{% if name == hd.preview.priority %} selected{% endif %}>{{ name }}</option>{% endfor %}</select>
|
|
387
|
+
{% else %}<input type="text" name="priority" id="hub-defect-priority" value="{{ hd.preview.priority }}" readonly aria-describedby="hub-defect-levels-hint">{% endif %}</label>
|
|
388
|
+
<label class="field"><span class="field-label">Серьёзность</span>
|
|
389
|
+
{% if hd.preview.severities %}<select name="severity" id="hub-defect-severity">{% for name in hd.preview.severities %}<option value="{{ name }}"{% if name == hd.preview.severity %} selected{% endif %}>{{ name }}</option>{% endfor %}</select>
|
|
390
|
+
{% else %}<input type="text" name="severity" id="hub-defect-severity" value="{{ hd.preview.severity }}" readonly aria-describedby="hub-defect-levels-hint">{% endif %}</label>
|
|
391
|
+
{% if not hd.preview.priorities or not hd.preview.severities %}<p class="field-hint" id="hub-defect-levels-hint">Значение из заготовки Hub: списка для выбора справочник Hub не дал.</p>{% endif %}
|
|
392
|
+
<div class="actions"><button type="submit" class="btn btn-primary" id="hub-defect-create">Создать</button></div>
|
|
393
|
+
</form>
|
|
394
|
+
<p class="small" id="hub-defect-body-title">Текст дефекта (уйдёт в описание):</p>
|
|
395
|
+
<pre class="hub-text" id="hub-defect-body">{{ hd.preview.command_text }}</pre>
|
|
396
|
+
{% if hd.preview.where_added and not hd.preview.hub_adds %}<p class="small" id="hub-defect-where">В конце текста раздел «Где исправлять»: Hub не отдал служебный блок, сведения взяты из связанных находок.</p>{% endif %}
|
|
397
|
+
<p class="small muted">Текст уйдёт как HTML (абзацы и пункты){% if hd.preview.hub_adds %}; следом в описание уйдёт служебный блок Hub из заготовки (объект сканирования, дата, ветка, коммит, трасса, категории) – как у дефектов, созданных в Hub; он виден в карточке дефекта{% else %}; блока «Информация об объекте сканирования» заготовка не дала – в описание уйдёт только текст{% endif %}. Статусы находок не меняются.</p>
|
|
398
|
+
<form method="post" action="/projects/{{ project_id }}/hub/defects/{{ row.id }}/cancel" id="hub-defect-cancel-form" class="actions" data-ajax data-busy="Отменяю…">
|
|
399
|
+
<button type="submit" class="btn btn-small" id="hub-defect-cancel" aria-describedby="hub-defect-cancel-hint">Отменить предпросмотр</button>
|
|
400
|
+
<span class="field-hint" id="hub-defect-cancel-hint">Поменялись решение, текст или состав – отмените и запросите заготовку заново.</span>
|
|
401
|
+
</form>
|
|
402
|
+
</section>
|
|
403
|
+
{% endif %}
|
|
404
|
+
{% if (not row or row.state == "failed") and not hd.bound and not hd.blocker and hd.add_url %}
|
|
405
|
+
<p class="small" id="hub-defect-add"><a href="{{ hd.add_url }}" id="hub-defect-add-link">Добавить в существующий дефект…</a> – находка войдёт в дефект, созданный раньше; текст дефекта не изменится.</p>
|
|
406
|
+
{% endif %}
|
|
407
|
+
{% if (not row or row.state == "failed") and hd.link %}
|
|
408
|
+
{# новая находка группы с готовым дефектом (ADR-0121 п. 5): привязка к нему вместо второго дефекта #}
|
|
409
|
+
<form method="post" action="{{ action|replace('/hub-defect', '/hub-defect-link', 1) }}" id="hub-defect-link-form" class="stack-form" data-ajax data-include="review-revision" data-busy="Ставлю в очередь…">
|
|
410
|
+
<input type="hidden" name="review_revision" value="{{ revision }}">
|
|
411
|
+
<input type="hidden" name="text_hash" value="{{ shown_hash }}">
|
|
412
|
+
<input type="hidden" name="defect" value="{{ hd.link.parent.id }}">
|
|
413
|
+
{# показанный состав: маршрут сверяет его с собранным заново (ADR-0121 п. 5) #}
|
|
414
|
+
<input type="hidden" name="targets" value="{{ hd.link.shown }}">
|
|
415
|
+
<p class="small" id="hub-defect-link-targets">В группе «та же строка, категория и код» уже есть дефект {{ hd.link.label }} с тем же текстом решения. К нему привяжутся находки ({{ hd.link.targets|length }}): {% for t in hd.link.targets %}{% if t.url %}<a class="mono" href="{{ t.url }}">{{ t.hub_id }}</a>{% else %}<span class="mono">{{ t.hub_id }}</span>{% endif %}{{ ", " if not loop.last }}{% endfor %}.</p>
|
|
416
|
+
{% if hd.link.left_out %}<p class="small text-warn" id="hub-defect-link-left-out">Не войдут: {% for e in hd.link.left_out %}<span class="mono">{{ e.hub_id }}</span> – {{ e.why }}{{ "; " if not loop.last }}{% endfor %}.</p>{% endif %}
|
|
417
|
+
<p class="field-hint" id="hub-defect-link-hint">Второй дефект не создаётся: исполнитель привяжет находки к этому дефекту в Hub, приложение проверит привязку чтением и поставит отметку «Внесено в Hub» с тем же номером ID{{ hd.link.parent.number }}. Статусы находок не меняются. Решение другое – поправьте и сохраните его: будет отдельный дефект.</p>
|
|
418
|
+
<div class="actions"><button type="submit" class="btn" id="hub-defect-link-button">Привязать к дефекту {{ hd.link.label }}</button></div>
|
|
419
|
+
</form>
|
|
420
|
+
{% elif (not row or row.state == "failed") and ready %}
|
|
421
|
+
<form method="post" action="{{ action }}" id="hub-defect-form" class="stack-form" data-ajax data-include="review-revision" data-busy="Ставлю в очередь…">
|
|
422
|
+
<input type="hidden" name="review_revision" value="{{ revision }}">
|
|
423
|
+
<input type="hidden" name="text_hash" id="hub-defect-text-hash" value="{{ shown_hash }}">
|
|
424
|
+
<p class="field-hint" id="hub-defect-hint">Исполнитель запросит у Hub заготовку дефекта по находкам (группа «та же строка, категория и код» с тем же решением; у SCA – набор), карточка покажет предпросмотр. Дефект создаётся после «Создать» и считается созданным, когда чтение из Hub подтвердит привязку находок.</p>
|
|
425
|
+
<div class="actions"><button type="submit" class="btn" id="hub-defect-button">Создать дефект</button></div>
|
|
426
|
+
</form>
|
|
427
|
+
{% endif %}
|
|
428
|
+
{% if row and row.origin == "import" and row.state == "done" %}
|
|
429
|
+
{# дефект, занесённый из Hub (ADR-0124 п. 8): заведён в Hub не приложением, отметок «Внесено в Hub» занесение не ставит #}
|
|
430
|
+
<p class="small text-ok" id="hub-defect-done">Дефект {% if row.hub_link %}<a href="{{ row.hub_link }}" rel="noopener noreferrer" target="_blank">№{{ row.hub_defect_id }}</a>{% else %}№{{ row.hub_defect_id }}{% endif %}{% if row.number %} (<span class="mono">ID{{ row.number }}</span>){% endif %}, занесён из Hub · <a href="/projects/{{ project_id }}/defects">вкладка «Дефекты»</a></p>
|
|
431
|
+
{% elif row and row.state in ("done", "mismatch") %}<p class="small{% if row.state == 'done' %} text-ok{% endif %}" id="hub-defect-done">{% if row.blank_op_id or row.create_op_id %}Дефект создан в Hub: {% elif row.state == "mismatch" %}Привязка к дефекту в Hub неполная: {% else %}Находки привязаны к дефекту в Hub: {% endif %}{% if row.hub_link %}<a href="{{ row.hub_link }}" rel="noopener noreferrer" target="_blank">№{{ row.hub_defect_id }}</a>{% else %}№{{ row.hub_defect_id }}{% endif %} · <span class="mono">ID{{ row.number }}</span> · <a href="/projects/{{ project_id }}/defects">вкладка «Дефекты»</a></p>{% endif %}
|
|
432
|
+
{% endif %}
|
|
433
|
+
{% if hd.decision_changed %}<p class="small text-warn" id="hub-defect-decision-changed">Решение изменено после создания дефекта {{ hd.bound_label }} – дефект в Hub прежний: поправьте его в Hub сами, если нужно.</p>{% endif %}
|
|
434
|
+
<p class="small hub-send-status{% if hd.view.tone %} text-{{ hd.view.tone }}{% endif %}" id="hub-defect-status" role="status" aria-live="polite"{% if not hd.view.text %} hidden{% endif %}{% if hd.poll_url %} data-poll="{{ hd.poll_url }}"{% endif %}>{{ hd.view.text }}</p>
|
|
435
|
+
{% if hd.view.diff %}<pre class="hub-text text-warn" id="hub-defect-confirmation-diff">{{ hd.view.diff }}</pre>{% endif %}
|
|
436
|
+
<form method="post" action="/projects/{{ project_id }}/hub/defects/{{ row.id if row else 0 }}/verify" id="hub-defect-verify-form" class="actions" data-ajax data-busy="Ставлю сверку…"{% if not hd.view.verify %} hidden{% endif %}>
|
|
437
|
+
<button type="submit" class="btn btn-small" id="hub-defect-verify">Pull из Hub</button>
|
|
438
|
+
</form>
|
|
439
|
+
</div>
|
|
440
|
+
{%- endmacro %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% if task_context %}<input type="hidden" name="origin" value="{{ task_context.origin }}">{% if task_context.via %}<input type="hidden" name="via" value="{{ task_context.via }}">{% endif %}{% endif %}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{% if task_context and task_context.visible %}
|
|
2
|
+
<aside class="task-context" id="task-context" aria-label="Возврат к рабочей задаче">
|
|
3
|
+
<div><span class="small muted">Открыто из: {{ task_context.project }}</span><strong class="break block">{{ task_context.label }}</strong></div>
|
|
4
|
+
<nav class="actions" aria-label="Возврат к работе">
|
|
5
|
+
<a class="btn btn-small btn-primary" id="task-origin" href="{{ task_context.origin }}">{{ task_context.title }}</a>
|
|
6
|
+
{% if task_context.queue != task_context.origin %}<a class="btn btn-small" id="task-queue" href="{{ task_context.queue }}">К рабочему списку</a>{% endif %}
|
|
7
|
+
{% if task_context.via %}<a class="btn btn-small btn-ghost" id="task-previous" href="{{ work_link(task_context.via) }}">Предыдущая статья</a>{% endif %}
|
|
8
|
+
</nav>
|
|
9
|
+
{% if task_context.missing %}<p class="hint">Исходной находки нет в текущей выгрузке. Возврат ведёт в сохранённую историческую карточку.</p>{% endif %}
|
|
10
|
+
</aside>
|
|
11
|
+
{% endif %}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{#- «Идентичность пакетов» (план dev17, п. 4.5): итог перехода при принятии состояния Hub и смене назначения.
|
|
2
|
+
identity – сводка rebind_packages (или {"error"}), entity_rows – package_transition.entity_rows(identity). -#}
|
|
3
|
+
{% macro identity_summary(identity, entity_rows, id_prefix="identity", labels={}) %}
|
|
4
|
+
{% if identity %}
|
|
5
|
+
<section class="panel" id="{{ id_prefix }}-summary" aria-labelledby="{{ id_prefix }}-title">
|
|
6
|
+
<h3 id="{{ id_prefix }}-title">Идентичность пакетов</h3>
|
|
7
|
+
{% if identity.error %}<p class="text-warn" id="{{ id_prefix }}-error">{{ identity.error }}</p>{% else %}
|
|
8
|
+
<dl class="terms">
|
|
9
|
+
<dt>Находок с другим пакетом</dt><dd>{{ identity.findings or 0 }} (уточнение – {{ identity.refine or 0 }}, изменение – {{ identity.change or 0 }})</dd>
|
|
10
|
+
<dt>Уточнена экосистема</dt><dd>{{ identity.ecosystem_refined or 0 }}</dd>
|
|
11
|
+
<dt>Дополнены координаты</dt><dd>{{ identity.coordinates_added or 0 }}</dd>
|
|
12
|
+
<dt>Добавлена область npm</dt><dd>{{ identity.scope_added or 0 }}</dd>
|
|
13
|
+
<dt>Имя заменено</dt><dd>{{ identity.name_replaced or 0 }}</dd>
|
|
14
|
+
<dt>Не разрешено</dt><dd>{{ identity.unresolved or 0 }}</dd>
|
|
15
|
+
<dt>Сведений нет</dt><dd>{{ identity.no_library or 0 }}</dd>
|
|
16
|
+
<dt>Расхождений версии</dt><dd>{{ identity.version_mismatch or 0 }}</dd>
|
|
17
|
+
{% if identity.decisions %}<dt>Снято «Проверено»</dt><dd>{{ identity.decisions.reviewed_removed or 0 }}</dd>
|
|
18
|
+
<dt>Подпись решения переписана</dt><dd>{{ identity.decisions.sig_rewritten or 0 }}</dd>
|
|
19
|
+
<dt>Решений по другой версии находки</dt><dd>{{ identity.decisions.other_version or 0 }}</dd>
|
|
20
|
+
<dt>Согласий без действующего ответа</dt><dd>{{ identity.decisions.agree_stale or 0 }}</dd>{% endif %}
|
|
21
|
+
{% if identity.defects %}<dt>Дефектов с пересчитанными ключами номеров</dt><dd>{{ identity.defects.families or 0 }}</dd>
|
|
22
|
+
<dt>Резервов номеров перенесено / в архив</dt><dd>{{ identity.defects.reserves_moved or 0 }} / {{ identity.defects.reserves_archived or 0 }}</dd>
|
|
23
|
+
<dt>Дефектов без единственного набора</dt><dd>{{ identity.defects.without_set_key_total if identity.defects.without_set_key_total is defined else (identity.defects.without_set_key or [])|length }}</dd>{% endif %}
|
|
24
|
+
{% if identity.pending_total %}<dt>Мест в наборах выбрать заново</dt><dd>{{ identity.pending_total }}</dd>{% endif %}
|
|
25
|
+
</dl>
|
|
26
|
+
{% if entity_rows %}
|
|
27
|
+
<div class="table-wrap"><table class="table" id="{{ id_prefix }}-entities">
|
|
28
|
+
<thead><tr><th scope="col">Что</th><th scope="col">Перенесено</th><th scope="col">В архив</th></tr></thead>
|
|
29
|
+
<tbody>{% for e in entity_rows %}<tr><td>{{ e.label }}</td><td>{{ e.moved }}</td><td>{{ e.archived }}</td></tr>{% endfor %}</tbody>
|
|
30
|
+
</table></div>
|
|
31
|
+
{% endif %}
|
|
32
|
+
{% if identity.groups %}
|
|
33
|
+
<div class="table-wrap"><table class="table" id="{{ id_prefix }}-groups">
|
|
34
|
+
<thead><tr><th scope="col">Было</th><th scope="col">Стало</th><th scope="col">Вид</th><th scope="col">Находок</th><th scope="col">Исследование</th><th scope="col">Перенесено / в архив</th><th scope="col">Новые места в наборах</th></tr></thead>
|
|
35
|
+
<tbody>{% for g in identity.groups %}<tr><td class="mono">{{ g["from"] }}</td><td class="mono">{{ g["to"]|join(", ") }}</td><td>{{ g.kind }}{% if g.change %} ({{ g.change }}){% endif %}</td><td>{{ g.findings }}</td><td>{{ g.research }}</td><td>{% for table, n in (g.moved or {}).items() %}{{ labels.get(table, table) }}: перенесено {{ n }}; {% endfor %}{% for table, n in (g.archived or {}).items() %}{{ labels.get(table, table) }}: в архив {{ n }}; {% endfor %}{% if not g.moved and not g.archived %}–{% endif %}</td><td>{% for t, n in g.new_sets %}набор {{ n }}{% if not loop.last %}, {% endif %}{% else %}–{% endfor %}</td></tr>{% endfor %}</tbody>
|
|
36
|
+
</table></div>
|
|
37
|
+
{% if identity.groups|length >= 200 %}<p class="hint">Показаны первые 200 групп.</p>{% endif %}
|
|
38
|
+
{% endif %}
|
|
39
|
+
{% endif %}
|
|
40
|
+
</section>
|
|
41
|
+
{% endif %}
|
|
42
|
+
{% endmacro %}
|