소스 검색

Add some content to the main view

 * list all the nodes in the database
oz123 11 년 전
부모
커밋
0c420eb630
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      scripts/webui.py

+ 8 - 0
scripts/webui.py

@@ -135,6 +135,14 @@ def listnodes():
     nodeids = db.listnodes()
     nodes = db.getnodes(nodeids)
 
+    nodesd = [''] * len(nodes)
+    for idx, node in enumerate(nodes):
+        tags = node.tags
+        tags = filter(None, tags)
+        nodesd[idx]=('@'.join((node.username, node.url)), ','.join(tags))
+
+    output = template('make_table', rows=nodesd)
+    return output
 
 debug(True)
 run(reloader=True)