Browse Source

modify visualization

guantao 17 hours ago
parent
commit
2529d63284
1 changed files with 2 additions and 2 deletions
  1. 2 2
      knowhub/server.py

+ 2 - 2
knowhub/server.py

@@ -2932,7 +2932,7 @@ def frontend():
                          data-id="${t.id}">
                         <div class="font-bold text-gray-800 text-sm truncate" title="${escapeHtml(t.title || t.id)}">${escapeHtml(t.title || t.id.split('/').pop())}</div>
                         <div class="mt-1 flex items-center justify-between">
-                            <span class="text-xs px-2 py-0.5 bg-gray-100 rounded text-gray-600 truncate max-w-[100px]">${escapeHtml(t.metadata && t.metadata.status ? t.metadata.status : '未设置')}</span>
+                            <span class="text-xs px-2 py-0.5 rounded truncate max-w-[100px] ${(t.metadata && t.metadata.status === '已接入') ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-600'}">${escapeHtml(t.metadata && t.metadata.status ? t.metadata.status : '未设置')}</span>
                             <span class="text-[10px] text-gray-400">${escapeHtml(t.content_type || '')}</span>
                         </div>
                     </div>`).join('');
@@ -2985,7 +2985,7 @@ def frontend():
                             <span class="px-2.5 py-1 bg-indigo-50 text-indigo-700 rounded-md border border-indigo-100">
                                 📁 分类: ${escapeHtml(meta.category || '–')}
                             </span>
-                            <span class="px-2.5 py-1 bg-gray-50 text-gray-700 rounded-md border border-gray-200">
+                            <span class="px-2.5 py-1 rounded-md border ${(meta.status === '已接入') ? 'bg-green-50 text-green-700 border-green-200' : 'bg-gray-50 text-gray-700 border-gray-200'}">
                                 🏷️ 状态: ${escapeHtml(meta.status || '–')}
                             </span>
                             <span class="px-2.5 py-1 bg-blue-50 text-blue-700 rounded-md border border-blue-100">