operator: add route to get app event log

we cannot go via /cloudron/eventlog since that requires admin
This commit is contained in:
Girish Ramakrishnan
2021-09-21 19:45:29 -07:00
parent 06e5f9baa1
commit 82d4fdf24e
3 changed files with 27 additions and 0 deletions

View File

@@ -79,6 +79,8 @@ exports = module.exports = {
getIcon,
getMemoryLimit,
listEventlog,
downloadFile,
uploadFile,
@@ -2287,6 +2289,16 @@ async function schedulePendingTasks() {
}
}
async function listEventlog(app, page, perPage) {
assert.strictEqual(typeof app, 'object');
assert.strictEqual(typeof page, 'number');
assert.strictEqual(typeof perPage, 'number');
const actions = [];
const search = app.id;
return await eventlog.listPaged(actions, search, page, perPage);
}
function downloadFile(app, filePath, callback) {
assert.strictEqual(typeof app, 'object');
assert.strictEqual(typeof filePath, 'string');