oplog update

master
Max 1 year ago
parent a4c7d3852f
commit a48ba912ea
  1. 6
      op25/gr-op25_repeater/apps/oplog/op25/__init__.py
  2. 1
      op25/gr-op25_repeater/apps/oplog/op25/templates/about.html
  3. 4
      op25/gr-op25_repeater/apps/oplog/op25/templates/error.html
  4. 5
      op25/gr-op25_repeater/apps/oplog/op25/templates/footer-links.html
  5. 14
      op25/gr-op25_repeater/apps/oplog/op25/templates/logs.html

@ -460,8 +460,10 @@ def purge():
params['ekeys'] = sorted(oplog_map.keys())
DataStore = column_helper('data_store')
destfile = ''
b = False
if 'bu' in params.keys():
if params['bu'] == 'true':
b = True
t = strftime("%Y%m%d_%H%M%S")
destfile = 'op25-backup-%s.db' % t
src = app.config['SQLALCHEMY_DATABASE_URI'][10:]
@ -487,7 +489,8 @@ def purge():
recCount = recCount.count()
dispQuery = delRec.compile(compile_kwargs={"literal_binds": True})
if simulate == 'false':
copyfile(src, dst)
if b == True:
copyfile(src, dst)
db.session.execute(delRec)
db.session.commit()
db.session.execute("VACUUM") # sqlite3 clean up -- reduces file size
@ -554,6 +557,7 @@ def data():
start_time = None if 'sdate' not in params.keys() else datetime.datetime.utcfromtimestamp(float(params['sdate']))
end_time = None if 'edate' not in params.keys() else datetime.datetime.utcfromtimestamp(float(params['edate']))
print(params)
sysid = None if 'sysid' not in params.keys() else int(params['sysid'])
stime = int(params['sdate']) #used in the queries

@ -46,6 +46,7 @@
<p class="card-text">
OP25 Logs (aka Oplog) is the OP25 sqlite3 logs database viewer.
</p>
<p class="card-text">
Copyright &copy; 2020, 2021 Max H. Parke KA1RBI<br>
Copyright &copy; 2020, 2021 Michael Rose

@ -80,7 +80,7 @@
Source: {{ source }}
</div>
{% endif %}
</div>
</div>
@ -188,4 +188,4 @@
{% block extra_javascripts %}
{% endblock %}
{% endblock %}

@ -6,11 +6,12 @@
<a href="{{ url_for('editsys') }}">System Tags</a>&nbsp;&nbsp;&nbsp;
<a href="{{ url_for('edit_tags') }}?cmd=tgid">Talkgroup Tags</a>&nbsp;&nbsp;&nbsp;
<a href="{{ url_for('edit_tags') }}?cmd=unit">Unit Tags</a>&nbsp;&nbsp;&nbsp;
<a href="{{ url_for('purge') }}">Purge Database</a>&nbsp;&nbsp;&nbsp;
<a href="{{ url_for('purge') }}">Purge</a>&nbsp;&nbsp;&nbsp;
<a href="{{ url_for('switch_db') }}">Backup & Switch</a>&nbsp;&nbsp;&nbsp;
<a href="{{ url_for('about') }}">About</a>
<br>
Server time: {{ t_loc() }} <br>
07.23.2021
08.29.2021
</div>
</div>
</div>

@ -128,16 +128,16 @@
var ed = edate();
var sysid = $('#systemSelect').val();
var filter_tgid = {%+ if params['tgid'] is defined %}
var filter_tgid = {% if params['tgid'] is defined %}
{{ params['tgid'] }};
{%+ else %}
{% else %}
0;
{%+ endif %}
var filter_suid = {%+ if params['suid'] is defined %}
{% endif %}
var filter_suid = {% if params['suid'] is defined %}
{{ params['suid'] }};
{%+ else %}
{% else %}
0;
{%+ endif %}
{% endif %}
console.log('filter_tgid=' + filter_tgid);
console.log(typeof filter_tgid);
@ -186,7 +186,7 @@
null,
null,
null,
{ render: function(data){ return data / 1000000; }},
{ render: function(data){ return data / 1000000; } },
],
{% endif %}

Loading…
Cancel
Save