mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 18:42:28 +08:00
24 lines
665 B
JavaScript
24 lines
665 B
JavaScript
const notes = await api.runOnBackend(() => {
|
|
return api.sql.getRows(`
|
|
SELECT
|
|
notes.noteId,
|
|
COUNT(revisions.revisionId) AS count
|
|
FROM notes
|
|
JOIN revisions USING (noteId)
|
|
WHERE notes.isDeleted = 0
|
|
GROUP BY notes.noteId
|
|
ORDER BY count DESC
|
|
LIMIT 100`);
|
|
});
|
|
|
|
const $statsTable = api.$container.find('.stats-table');
|
|
|
|
for (const note of notes) {
|
|
$statsTable.append(
|
|
$("<tr>")
|
|
.append(
|
|
$("<td>").append(await api.createNoteLink(note.noteId, {showNotePath: true}))
|
|
)
|
|
.append($("<td nowrap>").text(note.count))
|
|
);
|
|
} |