-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.ts
70 lines (67 loc) · 2.46 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import { HawtioPlugin, configManager } from '@hawtio/react'
import { appJmx } from './app-jmx'
import { customTree } from './custom-tree'
import { simple } from './simple'
/**
* The entry function for the plugin exposed to Hawtio.
*
* The default name for the function is "plugin". If you want to use the name other
* than the default one, you need to specify the name using `HawtioPlugin#pluginEntry()`
* method when registering the plugin to JMX MBean server.
*
* <code>
* new HawtioPlugin()
* .pluginEntry("registerMyPlugin");
* </code>
*
* @see src/main/java/io/hawt/examples/sampleplugin/PluginContextListener.java
*/
export const plugin: HawtioPlugin = () => {
simple()
customTree()
appJmx()
}
// Register the custom plugin version to Hawtio
// See package.json "replace-version" script for how to replace the version placeholder with a real version
configManager.addProductInfo('Hawtio Sample Plugin', '__PACKAGE_VERSION_PLACEHOLDER__')
/*
* This example also demonstrates how branding and styles can be customised from a WAR plugin.
*
* The Plugin API `configManager` provides `configure(configurer: (config: Hawtconfig) => void)` method
* and you can customise the `Hawtconfig` by invoking it from the plugin's `index.ts`.
*/
configManager.configure(config => {
// Branding & styles
config.branding = {
appName: 'Hawtio Sample WAR Plugin',
showAppName: true,
appLogoUrl: '/sample-plugin/branding/Logo-RedHat-A-Reverse-RGB.png',
css: '/sample-plugin/branding/app.css',
favicon: '/sample-plugin/branding/favicon.ico',
}
// Login page
config.login = {
description: 'Login page for Hawtio Sample WAR Plugin application.',
links: [
{ url: '#terms', text: 'Terms of use' },
{ url: '#help', text: 'Help' },
{ url: '#privacy', text: 'Privacy policy' },
],
}
// About modal
if (!config.about) {
config.about = {}
}
config.about.title = 'Hawtio Sample WAR Plugin'
config.about.description = 'About page for Hawtio Sample WAR Plugin application.'
config.about.imgSrc = '/sample-plugin/branding/Logo-RedHat-A-Reverse-RGB.png'
if (!config.about.productInfo) {
config.about.productInfo = []
}
config.about.productInfo.push(
{ name: 'Hawtio Sample Plugin - simple-plugin', value: '1.0.0' },
{ name: 'Hawtio Sample Plugin - custom-tree', value: '1.0.0' },
)
// If you want to disable specific plugins, you can specify the paths to disable them.
//config.disabledRoutes = ['/simple-plugin']
})