mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 01:35:28 +01:00
Make audit entries configurable
This commit is contained in:
parent
3995560ba2
commit
2e96c40d62
@ -191,11 +191,11 @@ class helpers_management:
|
|||||||
Audit_Log.log_msg: audit_msg,
|
Audit_Log.log_msg: audit_msg,
|
||||||
Audit_Log.source_ip: source_ip
|
Audit_Log.source_ip: source_ip
|
||||||
}).execute()
|
}).execute()
|
||||||
#todo make this user configurable
|
|
||||||
#deletes records when they're more than 100
|
#deletes records when they're more than 100
|
||||||
ordered = Audit_Log.select().order_by(+Audit_Log.created)
|
ordered = Audit_Log.select().order_by(+Audit_Log.created)
|
||||||
for item in ordered:
|
for item in ordered:
|
||||||
if Audit_Log.select().count() > 300:
|
#configurable through app/config/config.json
|
||||||
|
if Audit_Log.select().count() > helper.get_setting('max_audit_entries'):
|
||||||
Audit_Log.delete().where(Audit_Log.audit_id == item.audit_id).execute()
|
Audit_Log.delete().where(Audit_Log.audit_id == item.audit_id).execute()
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
@ -212,7 +212,8 @@ class helpers_management:
|
|||||||
#deletes records when they're more than 100
|
#deletes records when they're more than 100
|
||||||
ordered = Audit_Log.select().order_by(+Audit_Log.created)
|
ordered = Audit_Log.select().order_by(+Audit_Log.created)
|
||||||
for item in ordered:
|
for item in ordered:
|
||||||
if Audit_Log.select().count() > 300:
|
#configurable through app/config/config.json
|
||||||
|
if Audit_Log.select().count() > helper.get_setting('max_audit_entries'):
|
||||||
Audit_Log.delete().where(Audit_Log.audit_id == item.audit_id).execute()
|
Audit_Log.delete().where(Audit_Log.audit_id == item.audit_id).execute()
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
"show_contribute_link": true,
|
"show_contribute_link": true,
|
||||||
"virtual_terminal_lines": 70,
|
"virtual_terminal_lines": 70,
|
||||||
"max_log_lines": 700,
|
"max_log_lines": 700,
|
||||||
|
"max_audit_entries": 300,
|
||||||
"keywords": ["help", "chunk"],
|
"keywords": ["help", "chunk"],
|
||||||
"allow_nsfw_profile_pictures": false
|
"allow_nsfw_profile_pictures": false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user