feat: basic audit page

This commit is contained in:
Vlad Stan 2024-11-19 15:30:23 +02:00
parent de544d09ad
commit 7c90983600
4 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,10 @@
{% extends "base.html" %} {% from "macros.jinja" import window_vars with context
%} {% block page %}
<div class="row q-col-gutter-md justify-center">
<div class="col">xxxxx</div>
</div>
{% endblock %} {% block scripts %} {{ window_vars(user) }}
<script src="{{ static_url_for('static', 'js/audit.js') }}"></script>
{% endblock %}

View File

@ -384,6 +384,19 @@ async def users_index(request: Request, user: User = Depends(check_admin)):
},
)
@generic_router.get("/audit", response_class=HTMLResponse)
async def users_index(request: Request, user: User = Depends(check_admin)):
if not settings.lnbits_audit_enabled:
raise HTTPException(HTTPStatus.NOT_FOUND, "Audit not enabled")
return template_renderer().TemplateResponse(
"audit/index.html",
{
"request": request,
"user": user.json(),
},
)
@generic_router.get("/uuidv4/{hex_value}")
async def hex_to_uuid4(hex_value: str):

File diff suppressed because one or more lines are too long

13
lnbits/static/js/audit.js Normal file
View File

@ -0,0 +1,13 @@
window.app = Vue.createApp({
el: '#vue',
mixins: [window.windowMixin],
data: function () {
return {}
},
created() {
console.log('### audit entries')
},
methods: {}
})