Skip to content

Commit

Permalink
refactor(springboot): fix styles
Browse files Browse the repository at this point in the history
  • Loading branch information
tadayosi committed Nov 21, 2023
1 parent b8ba2cd commit 66e1358
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/hawtio/src/plugins/springboot/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { hawtio, HawtioPlugin } from '@hawtiosrc/core'

import { pluginId, pluginPath } from './globals'
import { workspace } from '@hawtiosrc/plugins'
import { helpRegistry } from '@hawtiosrc/help'
import help from './help.md'
import { SpringBoot } from '@hawtiosrc/plugins/springboot/SpringBoot'
import { pluginId, pluginPath } from './globals'
import help from './help.md'
import { isActive } from './springboot-service'

const order = 17

export const springboot: HawtioPlugin = () => {
hawtio.addPlugin({
id: pluginId,
title: 'Spring Boot',
path: pluginPath,
order,
component: SpringBoot,
isActive: async () => workspace.treeContainsDomainAndProperties('org.springframework.boot'),
isActive,
})
helpRegistry.add(pluginId, 'Spring Boot', help, 17)
helpRegistry.add(pluginId, 'Spring Boot', help, order)
}
4 changes: 4 additions & 0 deletions packages/hawtio/src/plugins/springboot/springboot-service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { jolokiaService, workspace } from '@hawtiosrc/plugins'
import { HealthComponent, HealthData, JolokiaHealthData, Logger, LoggerConfiguration } from './types'

export function isActive(): Promise<boolean> {
return workspace.treeContainsDomainAndProperties('org.springframework.boot')
}

export async function loadHealth(): Promise<HealthData> {
const data = (await jolokiaService.execute(
'org.springframework.boot:type=Endpoint,name=Health',
Expand Down

0 comments on commit 66e1358

Please sign in to comment.