MCPcopy Create free account
hub / github.com/bytebase/bytebase / buildFilterString

Function buildFilterString

frontend/src/react/components/AuditLogTable.tsx:86–102  ·  view source on GitHub ↗
(filter: AuditLogFilter)

Source from the content-addressed store, hash-verified

84}
85
86function buildFilterString(filter: AuditLogFilter): string {
87 const parts: string[] = [];
88 if (filter.method) parts.push(`method == "${filter.method}"`);
89 if (filter.level !== undefined)
90 parts.push(`severity == "${AuditLog_Severity[filter.level]}"`);
91 if (filter.userEmail)
92 parts.push(`user == "${userNamePrefix}${filter.userEmail}"`);
93 if (filter.createdTsAfter)
94 parts.push(
95 `create_time >= "${dayjs(filter.createdTsAfter).utc().format()}"`
96 );
97 if (filter.createdTsBefore)
98 parts.push(
99 `create_time <= "${dayjs(filter.createdTsBefore).utc().format()}"`
100 );
101 return parts.join(" && ");
102}
103
104function buildAuditLogFilter(params: SearchParams): AuditLogFilter {
105 const filter: AuditLogFilter = {};

Callers 1

AuditLogTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected