[PRISM] Draft search toggle: staging models visible without prod publish
lint / hygiene (push) Failing after 23s

This commit is contained in:
root committed 2026-11-18 21:23:35 +03:00
1 parent 73cc6c98f7
commit fcc0c9f2d1
2 files changed
+60 -3

No files matched your search

+4 -1
View File
@@ -76,6 +76,7 @@ main{max-width:1560px;margin:0 auto;padding:22px 26px 70px}.view{display:none}.v
<select id="protocol"><option value="">Протокол</option><option>SIP</option><option>H.323</option></select>
<label class="tiny"><input type="checkbox" id="f4k"> 4K</label>
<label class="tiny"><input type="checkbox" id="showArchived" checked> показывать снятые</label>
<label class="tiny"><input type="checkbox" id="showDrafts"> черновики</label>
</div>
<div class="layout">
<aside class="card facets"><h3>Фасеты</h3><div id="facets"><span class="muted">—</span></div></aside>
@@ -270,6 +271,7 @@ function query(){
if(S.cls) p.set('class',S.cls); if(S.protocol) p.set('protocol',S.protocol);
if(S.feature) p.set('feature','4K');
if(!$('#showArchived').checked) p.set('archived','active');
if($('#showDrafts')?.checked) p.set('drafts','1');
return p.toString();
}
async function search(){
@@ -298,7 +300,7 @@ function renderResults(items){
if(!items.length){$('#results').innerHTML='<div class="card muted">Ничего не найдено. Уберите фильтр или проверьте, есть ли подтверждённые данные.</div>';return;}
$('#results').innerHTML = items.map(x=>`<div class="item ${x.archived?'archived':''}" onclick="openProduct('${esc(x.key)}')">
<div style="flex:1"><div class="vendor">${esc(x.vendor)}</div><div class="name">${esc(x.name)}</div>
<div class="meta">${esc(cl(x.solution_class))} · ${esc(rl(x.role))}${x.form_factor?' · '+esc(x.form_factor):''} ${x.market?'· <span class="pill">'+esc(x.market_label||x.market)+'</span>':''}</div>
<div class="meta">${esc(cl(x.solution_class))} · ${esc(rl(x.role))}${x.form_factor?' · '+esc(x.form_factor):''} ${x.market?'· <span class="pill">'+esc(x.market_label||x.market)+'</span>':''} ${x.draft?'· <span class="pill">черновик</span>':''}</div>
${x.archived?'<span class="badge-archive">снято · купить нельзя</span>':''}</div>
<div class="tiny muted" style="text-align:right">${esc(x.sales_scope||'')}<br>${esc((x.protocols||[]).slice(0,3).join(', '))}</div>
<label class="tiny" style="align-self:center" onclick="event.stopPropagation()"><input type="checkbox" ${isComp(x.key)?'checked':''} onchange="toggleCompare('${esc(x.key)}',this.checked)"> сравнить</label></div>`).join('');
@@ -487,6 +489,7 @@ async function boot(){
$('#protocol').onchange=e=>{S.protocol=e.target.value;search()};
$('#f4k').onchange=e=>{S.feature=e.target.checked;search()};
$('#showArchived').onchange=()=>search();
$('#showDrafts').onchange=()=>search();
$('#q').addEventListener('input',()=>{clearTimeout(window._t);window._t=setTimeout(()=>{S.q=$('#q').value;search()},250)});
document.querySelectorAll('.nav').forEach(b=>b.onclick=()=>setView(b.dataset.v));
await search();