admin/monitor: user column

Massimo Melina committed Aug 7, 2022 at 18:07 UTC ea305c703a7cdf517dc8d5a56174d771d31848d1
3 files changed +7 -7
admin/src/MonitorPage.ts
+4
@@ -94,6 +94,10 @@ function Connections() {
94 maxWidth: 400,
95 valueGetter: ({ row, value }) => (row.v === 6 ? `[${value}]` : value) + ' :' + row.port
96 },
97 + {
98 + field: 'user',
99 + headerName: "User",
100 + },
101 {
102 field: 'started',
103 headerName: "Started",
server/src/api.monitor.ts
+2
@@ -4,6 +4,7 @@ import { pendingPromise, wait } from './misc'
4 import { ApiHandlers, SendListReadable } from './apiMiddleware'
5 import Koa from 'koa'
6 import { totalGot, totalInSpeed, totalOutSpeed, totalSent } from './throttler'
7 +import { getCurrentUsername } from './perm'
8
9 const apis: ApiHandlers = {
10
@@ -74,6 +75,7 @@ const apis: ApiHandlers = {
75
76 function fromCtx(ctx?: Koa.Context) {
77 return ctx && {
78 + user: getCurrentUsername(ctx),
79 archive: ctx.state.archive,
80 path: (ctx.fileSource || ctx.state.archive) && ctx.path // only for downloading files
81 }
todo.md
+1 -7
@@ -1,7 +1,6 @@
1 # To do
2 - fix: chrome is prompting to save credentials without username because of login's double-form
3 - admin: check + update
4 -- admin/monitor: account column
4 - frontend: hide closer button on login dialog accessing a protected resource, as it's no use
5 - easier nat life
6 - show public ip use, https://github.com/sindresorhus/public-ip
@@ -19,8 +18,7 @@
18 - admin: in a group, show linked accounts
19 - admin: warn in case of items with same name
20 - command line help --help
22 -- download-counter: expose results on admin
23 -- frontend: make a "login" route, and link it in side the 404's suggest-login message
21 +- plugin download-counter: expose results on admin
22 - whitelist di ip
23 - plugin to show country by ip in admin/monitor
24 - log filter option
@@ -30,10 +28,6 @@
28 - publish to npm (so people can "npm install hfs")
29 - frontend search supporting masks
30 - remove seconds from time
33 -- plugin to download latest release
34 - - https://api.github.com/repos/rejetto/hfs/releases/latest
35 - - check if 'created_at' is after exe's timestamp
36 - - if positive search 'assets' array for 'name' matching exe, and download 'browser_download_url', and replace exe
31 - upload
32 - upload unzipping (while streaming?)
33 - plugin to make letsencrypt easier