Skip to content
Snippets Groups Projects
Commit 7378e7a8 authored by fsiddi's avatar fsiddi
Browse files

Foundation for tables editablilty

parent e77d9979
No related branches found
No related tags found
No related merge requests found
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<th>Hostname</th> <th>Hostname</th>
......
...@@ -16,6 +16,7 @@ $(document).ready(function() { ...@@ -16,6 +16,7 @@ $(document).ready(function() {
$('#clients').dataTable( { $('#clients').dataTable( {
"bProcessing": true, "bProcessing": true,
"iDisplayLength": 25, "iDisplayLength": 25,
//"sAjaxSource": '/json_source_2.txt'
"sAjaxSource": '/clients/list.json' "sAjaxSource": '/clients/list.json'
} ); } );
......
...@@ -237,7 +237,9 @@ def handle(socket, address): ...@@ -237,7 +237,9 @@ def handle(socket, address):
print('[<-] Sending list of clients to interface') print('[<-] Sending list of clients to interface')
table_rows = [] table_rows = []
for client in clients_list: for client in clients_list:
table_rows.append([client.get_attributes('hostname'), client.is_online()]) table_rows.append({"DT_RowId": client.get_attributes('id'),
"0" : client.get_attributes('hostname'),
"1" : client.is_online()})
table_data = json.dumps(json_output('dataTable', table_rows)) table_data = json.dumps(json_output('dataTable', table_rows))
fileobj.write(table_data + '\n') fileobj.write(table_data + '\n')
fileobj.flush() fileobj.flush()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment