feat: basic search

This commit is contained in:
Vlad Stan 2024-11-25 13:55:52 +02:00
parent 777fcd9077
commit 366f89d5f1
2 changed files with 5 additions and 4 deletions
lnbits
core/templates/audit
static/js

@ -72,6 +72,7 @@
v-else-if="['component', 'response_code','request_method'].includes(col.name)"
v-model="searchData[col.name]"
:options="searchOptions[col.name]"
@update:model-value="searchAuditBy(col.name)"
:label="col.label"
style="width: 100px"
></q-select>

@ -106,12 +106,13 @@ window.app = Vue.createApp({
methods: {
async fetchAudit(props) {
try {
console.log("### fetchAudit", this.searchData)
const params = LNbits.utils.prepareFilterQuery(this.auditTable, props)
const {data} = await LNbits.api.request(
'GET',
`/audit/api/v1?${params}`
)
console.log("### data", data)
this.auditTable.pagination.rowsNumber = data.total
this.auditEntries = data.data
await this.fetchAuditStats(props)
@ -248,15 +249,14 @@ window.app = Vue.createApp({
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: 'HTTP Methods'
display: false,
}
}
},
data: {
datasets: [
{
label: 'HTTP Methods',
label: '',
data: [],
backgroundColor: [
'rgb(255, 99, 132)',