fix: filter audit logs end user by username + complete resource filter (#4105)

* fix: filter audit logs end user by username + complete resource filter

* update ee ref

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
This commit is contained in:
HugoCasa
2024-07-23 16:23:33 +02:00
committed by GitHub
parent f76f639ee8
commit ccf281c87a
2 changed files with 22 additions and 5 deletions

View File

@@ -1 +1 @@
ba9196530fafbfe017d2592af2830a60b6fa62a0
7641d36277ffa75d816ed79d9b23eeae4f17f3a5

View File

@@ -9,7 +9,9 @@
AuditService,
ResourceService,
UserService,
type ListableResource
ScriptService,
FlowService,
AppService
} from '$lib/gen'
import { userStore, workspaceStore } from '$lib/stores'
@@ -18,7 +20,7 @@
import AutoComplete from 'simple-svelte-autocomplete'
let usernames: string[]
let resources: ListableResource[]
let resources: string[]
let loading: boolean = false
export let logs: AuditLog[] = []
@@ -82,9 +84,24 @@
}
async function loadResources() {
resources = await ResourceService.listResource({
const r = await ResourceService.listResource({
workspace: $workspaceStore!
})
const sPaths = await ScriptService.listScriptPaths({
workspace: $workspaceStore!
})
const fPaths = await FlowService.listFlowPaths({
workspace: $workspaceStore!
})
const a = await AppService.listApps({
workspace: $workspaceStore!
})
resources = r
.map((r) => r.path)
.concat(sPaths)
.concat(fPaths)
.concat(a.map((a) => a.path))
.sort()
}
$: {
@@ -324,7 +341,7 @@
<AutoComplete
noInputStyles
items={resources?.map((r) => r.path) ?? []}
items={resources}
value={resource}
bind:selectedItem={resource}
inputClassName="!h-[34px] py-1 !text-xs !w-48"