[PRISM] Add review_status to model APIs and DB tab
This commit is contained in:
1 parent
1503402355
commit
5bdcbcea70
2 files changed
+3
-3
No files matched your search
+1
-1
@@ -1706,7 +1706,7 @@ def prism_models(limit=300):
|
||||
lim = max(1, min(int(limit), 500))
|
||||
sql = (
|
||||
"select coalesce(json_agg(row_to_json(t)),'[]'::json)::text from ("
|
||||
"select m.id,m.vendor,m.name,m.role,m.domain,m.status,m.quality_status,"
|
||||
"select m.id,m.vendor,m.name,m.role,m.domain,m.status,m.quality_status,m.review_status,"
|
||||
"(m.quality->>'is_product')::boolean as is_product,"
|
||||
"(select count(*) from prism.specs sp where sp.model_id=m.id) as specs,"
|
||||
"(select count(*) from prism.evidence ev where ev.model_id=m.id) as evidence "
|
||||
|
||||
@@ -637,11 +637,11 @@ window.loadPrismDb = async function(){
|
||||
const e = v => String(v ?? '').replace(/[<>&"]/g, c => ({'<':'<','>':'>','&':'&','"':'"'}[c]));
|
||||
let html = '<table style="width:100%;border-collapse:collapse;font-size:12px"><thead><tr>' +
|
||||
'<th align="left">Вендор</th><th align="left">Модель</th><th align="left">Роль</th>' +
|
||||
'<th align="left">Домен</th><th align="left">Качество</th><th>Specs</th><th>Evidence</th>' +
|
||||
'<th align="left">Домен</th><th align="left">Качество</th><th align="left">Review</th><th>Specs</th><th>Evidence</th>' +
|
||||
'</tr></thead><tbody>';
|
||||
for (const m of rows) {
|
||||
html += '<tr><td>' + e(m.vendor) + '</td><td>' + e(m.name) + '</td><td>' + e(m.role || '—') +
|
||||
'</td><td>' + e(m.domain || '—') + '</td><td>' + e(m.quality_status || m.status || '—') +
|
||||
'</td><td>' + e(m.domain || '—') + '</td><td>' + e(m.quality_status || m.status || '—') + '</td><td>' + e(m.review_status || '—') +
|
||||
'</td><td align="right">' + (m.specs || 0) + '</td><td align="right">' + (m.evidence || 0) + '</td></tr>';
|
||||
}
|
||||
box.innerHTML = html + '</tbody></table>';
|
||||
|
||||
Reference in new issue
Block a user