Skip to content

Commit

Permalink
fixed filters on UI
Browse files Browse the repository at this point in the history
  • Loading branch information
bkbilly committed Sep 12, 2017
1 parent c7a90b0 commit a75777b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
11 changes: 6 additions & 5 deletions Worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,26 +403,27 @@ def getSensorsLog(self, limit=100, selectTypes='all',
try:
mymatch = re.match(r'^\((.*)\) \[(.*)\] (.*)', line)
if mymatch:
logType = mymatch.group(1)
logType = mymatch.group(1).split(',')
logTime = mymatch.group(2)
logText = mymatch.group(3)
except Exception:
mymatch = re.match(r'^\[(.*)\] (.*)', line)
if mymatch:
logType = "unknown"
logType = ["unknown"]
logTime = mymatch.group(1)
logText = mymatch.group(2)
if (logType in selectTypes or 'all' in selectTypes):
if (logType[0] in selectTypes or 'all' in selectTypes):
if fromtext is not None:
txtlimit += 1
limit = txtlimit
txtmatch = re.match(r'.*{0}.*'.format(fromtext), logText)
if txtmatch:
txtlimit = 0
add = True
if 'sensor' in logType:
if 'sensor' in logType[0]:
try:
stype, status, uuid = logType.split(',')
# stype, status, uuid = logType.split(',')
status, uuid = logType[1], logType[2]
if status == 'start':
startedSensors[uuid] = {
'start': logTime,
Expand Down
9 changes: 4 additions & 5 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,11 @@ <h1 class="settingsTitle">MQTT Settings</h1>
<div id="logSettings">
<select id="logtype">
<option value="all" selected="selected">Show all Logs</option>
<option value="disabled_sensor,enabled_sensor">All Sensors</option>
<option value="disabled_sensor">Disabled Sensors</option>
<option value="enabled_sensor">Enabled Sensors</option>
<option value="system">System Logs</option>
<option value="user_action">User Actions</option>
<option value="sensor">Sensors</option>
<option value="alarm">Alarm Actions</option>
<option value="user_action">User Actions</option>
<option value="system">System</option>
<option value="error">Errors</option>
</select>
<select id="loglimit">
<option value="10" selected="selected">10</option>
Expand Down

0 comments on commit a75777b

Please sign in to comment.