This commit is contained in:
1 parent
afe6ce858c
commit
07a1976f98
2 files changed
+21
-3
No files matched your search
+18
-1
@@ -1392,6 +1392,23 @@ def staging_items():
|
||||
return sorted(out, key=lambda z: ((z.get("vendor") or ""), (z.get("model") or "")))
|
||||
|
||||
|
||||
def staging_edges():
|
||||
out = []
|
||||
for p in sorted(glob.glob("/root/buryan-infra/ops/combine/staging/*/models.yaml")):
|
||||
try:
|
||||
d = yaml.safe_load(open(p, encoding="utf-8")) or {}
|
||||
except Exception:
|
||||
continue
|
||||
for c in d.get("compatibility") or []:
|
||||
if isinstance(c, dict) and c.get("from") and c.get("to"):
|
||||
out.append({"batch": os.path.basename(os.path.dirname(p)),
|
||||
"from": c.get("from"), "to": c.get("to"),
|
||||
"kind": c.get("kind") or "compatible",
|
||||
"condition": c.get("condition"),
|
||||
"source": c.get("source")})
|
||||
return out
|
||||
|
||||
|
||||
def coverage_report():
|
||||
mats = load_yaml("materials.yaml").get("materials") or []
|
||||
mat_by_vendor = {}
|
||||
@@ -1655,7 +1672,7 @@ class H(BaseHTTPRequestHandler):
|
||||
if p == "/api/archive":
|
||||
return self._out({"items": archived_items()})
|
||||
if p == "/api/staging":
|
||||
return self._out({"items": staging_items()})
|
||||
return self._out({"items": staging_items(), "edges": staging_edges()})
|
||||
if p == "/api/room-roles":
|
||||
return self._out(room_roles())
|
||||
if p == "/api/room-needs":
|
||||
|
||||
@@ -197,9 +197,10 @@ async function loadMaterials(){
|
||||
}
|
||||
async function loadInbox(){
|
||||
$('#inboxbox').innerHTML='<span class="muted">загрузка…</span>';
|
||||
const r=await api('/api/staging'); const xs=r.items||[];
|
||||
const r=await api('/api/staging'); const xs=r.items||[]; const es=r.edges||[];
|
||||
if(!xs.length){$('#inboxbox').innerHTML='<div class="muted">Staging пуст. Запустите extraction на ПК и скопируйте results.</div>';return;}
|
||||
$('#inboxbox').innerHTML=`<table class="bom"><thead><tr><th>Партия</th><th>Вендор</th><th>Модель</th><th>Роль</th><th>Статус</th><th>Источник</th></tr></thead><tbody>${xs.map(x=>`<tr><td class="muted">${esc(x.batch||'')}</td><td>${esc(x.vendor||'')}</td><td><b>${esc(x.model||'')}</b></td><td>${esc(x.role||'')}</td><td>${x.existing?'существует':'новая'} · ${esc(x.review||'')}</td><td class="muted">${x.source_url?`<a href="${esc(x.source_url)}" target="_blank" rel="noopener">URL</a>`:esc(x.source_file||'local')}</td></tr>`).join('')}</tbody></table><div class="hint">Прод не изменяется. Принятие — отдельным шагом после сверки цитаты.</div>`;
|
||||
const edgeHtml=es.length?`<h4 style="margin:16px 0 6px">Compatibility (${es.length})</h4><table class="bom"><thead><tr><th>От</th><th>К</th><th>Тип</th><th>Условие</th></tr></thead><tbody>${es.slice(0,80).map(e=>`<tr><td>${esc(e.from)}</td><td>${esc(e.to)}</td><td>${esc(e.kind)}</td><td class="muted">${esc(e.condition||'')}</td></tr>`).join('')}</tbody></table>`:'';
|
||||
$('#inboxbox').innerHTML=`<table class="bom"><thead><tr><th>Партия</th><th>Вендор</th><th>Модель</th><th>Роль</th><th>Статус</th><th>Источник</th></tr></thead><tbody>${xs.map(x=>`<tr><td class="muted">${esc(x.batch||'')}</td><td>${esc(x.vendor||'')}</td><td><b>${esc(x.model||'')}</b></td><td>${esc(x.role||'')}</td><td>${x.existing?'существует':'новая'} · ${esc(x.review||'')}</td><td class="muted">${x.source_url?`<a href="${esc(x.source_url)}" target="_blank" rel="noopener">URL</a>`:esc(x.source_file||'local')}</td></tr>`).join('')}</tbody></table>${edgeHtml}<div class="hint">Прод не изменяется. Принятие — отдельным шагом после сверки цитаты.</div>`;
|
||||
}
|
||||
async function loadCoverage(){
|
||||
$('#coveragebox').innerHTML='<span class="muted">загрузка…</span>';
|
||||
|
||||
Reference in new issue
Block a user