LibraryPanels: Expose library panels in dashboard apiserver (#92213)

This commit is contained in:
Ryan McKinley
2024-08-27 12:12:22 +03:00
committed by GitHub
parent 7ad3d9bf76
commit 419edef4dc
24 changed files with 867 additions and 5 deletions
@@ -0,0 +1,18 @@
SELECT p.id, p.uid, p.folder_uid,
p.created, created_user.uid as created_by,
p.updated, updated_user.uid as updated_by,
p.name, p.type, p.description, p.model
FROM {{ .Ident .LibraryElementTable }} as p
LEFT OUTER JOIN {{ .Ident .UserTable }} AS created_user ON p.created_by = created_user.id
LEFT OUTER JOIN {{ .Ident .UserTable }} AS updated_user ON p.updated_by = updated_user.id
WHERE p.org_id = {{ .Arg .Query.OrgID }}
{{ if .Query.LastID }}
AND p.id > {{ .Arg .Query.LastID }}
{{ end }}
{{ if .Query.UID }}
AND p.uid = {{ .Arg .Query.UID }}
{{ end }}
ORDER BY p.id DESC
{{ if .Query.Limit }}
LIMIT {{ .Arg .Query.Limit }}
{{ end }}