Files
wekan/client/components/settings/adminReports.jade
T
Lauri Ojansivu a13ce5ef09 Admin Panel / Reports / Impersonation: paginated impersonation log report
Impersonation events are already recorded in the impersonatedUsers collection
whenever an admin impersonates a user (e.g. to export a private board). Surface
them as a new admin report, newest-first, with the same server-side search +
pagination as the other reports.

- server/publications/impersonationReport.js: impersonationReport publication
  (admin-only, sort createdAt -1, limit/skip, $or search over admin/user/board/
  attachment ids and reason) + getImpersonationReportCount method. Also publishes
  the referenced admin/impersonated user docs (same fields the People panel uses)
  so usernames resolve and the Edit user popup has its data.
- adminReports.jade/.js: new Impersonation side-menu entry, sub-template (Date,
  Admin, Impersonated user, Board, Reason), pagination + search wired through the
  shared reportConfig. Clicking a username opens the same editUser popup as
  Admin Panel / People.
- i18n: impersonationReportTitle, impersonation-admin, impersonation-user, reason.
2026-07-14 14:10:38 +03:00

242 lines
7.6 KiB
Plaintext

template(name="adminReports")
.setting-content.admin-reports-content
unless currentUser.isAdmin
| {{_ 'error-notAuthorized'}}
else
.content-body
.side-menu
ul
li
a.js-report-broken(data-id="report-broken")
i.fa.fa-chain-broken
| {{_ 'broken-cards'}}
li
a.js-report-files(data-id="report-files")
i.fa.fa-paperclip
| {{_ 'filesReportTitle'}}
li
a.js-report-rules(data-id="report-rules")
i.fa.fa-magic
| {{_ 'rulesReportTitle'}}
li
a.js-report-boards(data-id="report-boards")
i.fa.fa-columns
| {{_ 'boardsReportTitle'}}
li
a.js-report-cards(data-id="report-cards")
i.fa.fa-id-card-o
| {{_ 'cardsReportTitle'}}
li
a.js-report-impersonation(data-id="report-impersonation")
i.fa.fa-user-secret
| {{_ 'impersonationReportTitle'}}
.main-body
if loading.get
+spinner
else if showBrokenCardsReport.get
+brokenCardsReport
else if showFilesReport.get
+filesReport(currentPage=filesCurrentPage totalPages=filesTotalPages hasPrevPage=hasFilesPrevPage hasNextPage=hasFilesNextPage)
else if showRulesReport.get
+rulesReport(currentPage=rulesCurrentPage totalPages=rulesTotalPages hasPrevPage=hasRulesPrevPage hasNextPage=hasRulesNextPage)
else if showBoardsReport.get
+boardsReport(currentPage=boardsCurrentPage totalPages=boardsTotalPages hasPrevPage=hasBoardsPrevPage hasNextPage=hasBoardsNextPage)
else if showCardsReport.get
+cardsReport(currentPage=cardsCurrentPage totalPages=cardsTotalPages hasPrevPage=hasCardsPrevPage hasNextPage=hasCardsNextPage)
else if showImpersonationReport.get
+impersonationReport(currentPage=impersonationCurrentPage totalPages=impersonationTotalPages hasPrevPage=hasImpersonationPrevPage hasNextPage=hasImpersonationNextPage)
template(name="brokenCardsReport")
.global-search-results-list-wrapper
h1 {{_ 'broken-cards'}}
if resultsCount
+resultsPaged(this)
else
div {{_ 'no-results' }}
template(name="rulesReport")
h1 {{_ 'rulesReportTitle'}}
.admin-report-search
input.js-rules-search-input(type="text" placeholder="{{_ 'search'}}")
button.js-rules-search-button
i.fa.fa-search
| {{_ 'search'}}
.admin-report-pagination
button.js-rules-prev-page(class="{{#if hasPrevPage}}{{else}}disabled{{/if}}")
| <
span.admin-report-page-info {{currentPage}} / {{totalPages}}
button.js-rules-next-page(class="{{#if hasNextPage}}{{else}}disabled{{/if}}")
| >
if resultsCount
table
thead
tr
th Rule Title
th Board Title
th actionType
th activityType
each rule in results
tbody
tr
td {{ rule.title }}
td {{ rule.boardTitle }}
td {{ rule.action.actionType }}
td {{ rule.trigger.activityType }}
else
div {{_ 'no-results' }}
template(name="filesReport")
h1 {{_ 'filesReportTitle'}}
.admin-report-search
input.js-files-search-input(type="text" placeholder="{{_ 'search'}}")
button.js-files-search-button
i.fa.fa-search
| {{_ 'search'}}
.admin-report-pagination
button.js-files-prev-page(class="{{#if hasPrevPage}}{{else}}disabled{{/if}}")
| <
span.admin-report-page-info {{currentPage}} / {{totalPages}}
button.js-files-next-page(class="{{#if hasNextPage}}{{else}}disabled{{/if}}")
| >
if resultsCount
table
thead
tr
th Filename
th.right Size (kB)
th MIME Type
th Attachment ID
th Board ID
th Card ID
each att in results
tbody
tr
td {{ att.name }}
td.right {{ fileSize att.size }}
td {{ att.type }}
td {{ att._id }}
td {{ att.meta.boardId }}
td {{ att.meta.cardId }}
else
div {{_ 'no-results' }}
template(name="cardsReport")
h1 {{_ 'cardsReportTitle'}}
.admin-report-search
input.js-cards-search-input(type="text" placeholder="{{_ 'search'}}")
button.js-cards-search-button
i.fa.fa-search
| {{_ 'search'}}
.admin-report-pagination
button.js-cards-prev-page(class="{{#if hasPrevPage}}{{else}}disabled{{/if}}")
| <
span.admin-report-page-info {{currentPage}} / {{totalPages}}
button.js-cards-next-page(class="{{#if hasNextPage}}{{else}}disabled{{/if}}")
| >
if resultsCount
table.table
thead
tr
th Card Title
th Board
th Swimlane
th List
th Members
th Assignees
each card in results
tbody
tr
td {{abbreviate card.title }}
td {{abbreviate card.board.title }}
td {{abbreviate card.swimlane.title }}
td {{abbreviate card.list.title }}
td {{userNames card.members }}
td {{userNames card.assignees }}
else
div {{_ 'no-results' }}
template(name="impersonationReport")
h1 {{_ 'impersonationReportTitle'}}
.admin-report-search
input.js-impersonation-search-input(type="text" placeholder="{{_ 'search'}}")
button.js-impersonation-search-button
i.fa.fa-search
| {{_ 'search'}}
.admin-report-pagination
button.js-impersonation-prev-page(class="{{#if hasPrevPage}}{{else}}disabled{{/if}}")
| <
span.admin-report-page-info {{currentPage}} / {{totalPages}}
button.js-impersonation-next-page(class="{{#if hasNextPage}}{{else}}disabled{{/if}}")
| >
if resultsCount
table.table
thead
tr
th {{_ 'date'}}
th {{_ 'impersonation-admin'}}
th {{_ 'impersonation-user'}}
th {{_ 'board'}}
th {{_ 'reason'}}
each row in results
tbody
tr
td {{ formatDate row.createdAt }}
td
if row.adminId
a.edit-user.js-impersonation-edit-user(data-user-id="{{ row.adminId }}") {{ userName row.adminId }}
td
if row.userId
a.edit-user.js-impersonation-edit-user(data-user-id="{{ row.userId }}") {{ userName row.userId }}
td {{ row.boardId }}
td {{ row.reason }}
else
div {{_ 'no-results' }}
template(name="boardsReport")
h1 {{_ 'boardsReportTitle'}}
.admin-report-search
input.js-boards-search-input(type="text" placeholder="{{_ 'search'}}")
button.js-boards-search-button
i.fa.fa-search
| {{_ 'search'}}
.admin-report-pagination
button.js-boards-prev-page(class="{{#if hasPrevPage}}{{else}}disabled{{/if}}")
| <
span.admin-report-page-info {{currentPage}} / {{totalPages}}
button.js-boards-next-page(class="{{#if hasNextPage}}{{else}}disabled{{/if}}")
| >
if resultsCount
table.table
thead
tr
th Title
th Id
th Permission
th Archived?
th Members
th Organizations
th Teams
each board in results
tbody
tr
td {{abbreviate board.title }}
td {{abbreviate board._id }}
td {{ board.permission }}
td
= yesOrNo(board.archived)
td {{userNames board.members }}
td {{orgs board.orgs }}
td {{teams board.teams }}
else
div {{_ 'no-results' }}