Skip to content

Commit

Permalink
Another fixes
Browse files Browse the repository at this point in the history
* Fix add user functionality

* Set wifi credentials in settings

* Fix pylint

* Add image and some fixes

* Fix log representation issues

- Remove links in logs
- Device name instead device ID
- Heh, remove checkbox on init page with DB restore:)
  • Loading branch information
leechwort committed Feb 5, 2024
1 parent ba73390 commit 3a0de96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/models/access_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_full_log(cls, start_time=None, end_time=None, limit=100, offset=0):
cursor = connection.cursor()

query = """
SELECT u.name, u.key, d.name, d.id, operation_type, operation_time
SELECT u.name, u.key, d.name AS device_name, d.id, operation_type, operation_time
FROM event_logs
LEFT JOIN users u ON event_logs.user_key = u.key
LEFT JOIN devices d ON d.id = event_logs.device_id
Expand Down
3 changes: 0 additions & 3 deletions app/templates/auth/init_app.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ <h2>Create your admin user</h2>

<label for="password">Admin Password:</label>
<input type="password" id="password" name="password" required>

<input type="checkbox" id="toggleCheckbox" disabled>
<label for="toggleCheckbox">Restore from database backup</label>

<div id="contentToToggle">
<input type=file name=file>
Expand Down
6 changes: 3 additions & 3 deletions app/templates/prismo/logs.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@
title: 'Name',
render: (data, type, row) => {
if (data === null) return '–'
return '<a href="/user/' + row.key + '">' + data + '</a>'
return data
}
},
{
data: 'id',
data: 'device_name',
title: 'Device',
render: (data, type, row) => '<a href="/device/' + data + '">' + data + '</a>'
render: (data, type, row) => data
},
{ data: 'operation_type', title: 'Operation Type' },
{ data: 'operation_time',
Expand Down

0 comments on commit 3a0de96

Please sign in to comment.