Add route hook action

This commit is contained in:
Chocobozzz 2019-07-26 09:42:52 +02:00
parent 1fd372ecbc
commit 73a0294104
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 16 additions and 1 deletions

View File

@ -46,6 +46,13 @@ function register ({ registerHook, peertubeHelpers }) {
handler: result => addSymbolToVideoNameResult(result, ':D') handler: result => addSymbolToVideoNameResult(result, ':D')
}) })
// Router hooks
registerHook({
target: 'action:router.navigation-end',
handler: params => console.log('New URL! %s.', params.path)
})
// Fake hook // Fake hook
registerHook({ registerHook({

View File

@ -15,9 +15,17 @@ async function register ({ registerHook, registerSetting, settingsManager, stora
name: 'admin-name', name: 'admin-name',
label: 'Admin name', label: 'Admin name',
type: 'input', type: 'input',
private: true,
default: defaultAdmin default: defaultAdmin
}) })
registerSetting({
name: 'user-name',
label: 'User name',
type: 'input',
private: false
})
const value = await storageManager.getData('toto') const value = await storageManager.getData('toto')
console.log(value) console.log(value)

View File

@ -1,6 +1,6 @@
{ {
"name": "peertube-plugin-hello-world", "name": "peertube-plugin-hello-world",
"version": "0.0.11", "version": "0.0.12",
"description": "Hello world PeerTube plugin example", "description": "Hello world PeerTube plugin example",
"engine": { "engine": {
"peertube": ">=1.3.0" "peertube": ">=1.3.0"