plugins: event.userPanelAfterInfo
Massimo Melina committed
Dec 29, 2023 at 19:53 UTC
c2f30547a374fce1bc24eeb028c3a629d137c6eb
3 files changed
+8
-2
dev-plugins.md
+5
-1
@@ -305,6 +305,9 @@ This is a list of available frontend-events, with respective object parameter an
305
- you receive an entry of the list, and optionally produce React Component for visualization.
306
- parameter `{ entry: Entry }` (refer above for Entry object)
307
- output `ReactComponent`
308
+- `userPanelAfterInfo`
309
+ - no parameter
310
+ - output `Html`
311
312
## Other files
313
@@ -363,10 +366,11 @@ Where `h` is just `import { createElement as h } from 'react'`.
366
367
## API version history
368
366
-- 8.63 (v0.51.0)
369
+- 8.64 (v0.51.0)
370
- plugin's own hfs-lang files
371
- props.can_overwrite
372
- ctx.state.considerAsGui
373
+ - new event: userPanelAfterInfo
374
- 8.5 (v0.49.0)
375
- new event: entry
376
- exports.onDirEntry: entry.icon
frontend/src/UserPanel.ts
+2
@@ -9,6 +9,7 @@ import { logout } from './login'
9
import { MenuButton } from './menu'
10
import { hIcon, HTTP_NOT_ACCEPTABLE, working } from './misc'
11
import { t } from './i18n'
12
+import { CustomCode } from './components'
13
14
export default function showUserPanel() {
15
newDialog({
@@ -19,6 +20,7 @@ export default function showUserPanel() {
20
const snap = useSnapState()
21
return h('div', { id: 'user-panel' },
22
h('div', {}, t`Username`, ': ', snap.username),
23
+ h(CustomCode, { name: 'userPanelAfterInfo' }),
24
snap.canChangePassword && h(MenuButton, {
25
icon: 'password',
26
label: t`Change password`,
src/const.ts
+1
-1
@@ -7,7 +7,7 @@ import { mkdirSync } from 'fs'
7
import { basename, dirname, join } from 'path'
8
export * from './cross-const'
9
10
-export const API_VERSION = 8.63
10
+export const API_VERSION = 8.64
11
export const COMPATIBLE_API_VERSION = 1 // while changes in the api are not breaking, this number stays the same, otherwise it is made equal to API_VERSION
12
export const HFS_REPO = 'rejetto/hfs'
13