-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Split Discover to only display if no current connection (#188)
* Splits the Discover plugin into 2: * Discover Core: preferences and header menu (always active) * Discover: page dashboad component (only active if no current connection) * discover-core * Moves preferences to this plugin * Moves header menu to this plugin * Adds as a new plugin, always active * By not including a plugin-path, the plugin will not be listed in the nav sidebar * discover * Dashboard only active if the connect-server does not contain a current connection
- Loading branch information
1 parent
bddcb0e
commit c8453a0
Showing
6 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { Logger } from '@hawtio/react' | ||
|
||
export const pluginName = 'hawtio-online-discover-core' | ||
export const log = Logger.get(pluginName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { hawtio, HawtioPlugin, preferencesRegistry } from '@hawtio/react' | ||
import { HeaderMenuDropDown } from './HeaderMenuDropDown' | ||
import { DiscoverPreferences } from './DiscoverPreferences' | ||
|
||
const pluginId = 'discover-core' | ||
const pluginTitle = 'Discover' | ||
|
||
/* | ||
* Discover core plugin, always enabled, provides: | ||
* - preferences for managing the polling of pods in master | ||
* - the universal header menu listing all the pods | ||
* | ||
* No plugin-path since it is not required to display a | ||
* link in the nav-bar to display a main component | ||
*/ | ||
|
||
export const discoverCore: HawtioPlugin = () => { | ||
hawtio.addPlugin({ | ||
id: pluginId, | ||
title: pluginTitle, | ||
headerItems: [{ component: HeaderMenuDropDown, universal: true }], | ||
isActive: async () => true, | ||
}) | ||
|
||
preferencesRegistry.add(pluginId, pluginTitle, DiscoverPreferences) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters