From 66e135867171e27c6fb4435e1dad379b1cc6d9c7 Mon Sep 17 00:00:00 2001 From: Tadayoshi Sato Date: Tue, 21 Nov 2023 13:09:09 +0900 Subject: [PATCH] refactor(springboot): fix styles --- packages/hawtio/src/plugins/springboot/index.ts | 13 ++++++++----- .../src/plugins/springboot/springboot-service.ts | 4 ++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/hawtio/src/plugins/springboot/index.ts b/packages/hawtio/src/plugins/springboot/index.ts index ffcef010..ff469f67 100644 --- a/packages/hawtio/src/plugins/springboot/index.ts +++ b/packages/hawtio/src/plugins/springboot/index.ts @@ -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) } diff --git a/packages/hawtio/src/plugins/springboot/springboot-service.ts b/packages/hawtio/src/plugins/springboot/springboot-service.ts index 36cf9c72..e0913c8e 100644 --- a/packages/hawtio/src/plugins/springboot/springboot-service.ts +++ b/packages/hawtio/src/plugins/springboot/springboot-service.ts @@ -1,6 +1,10 @@ import { jolokiaService, workspace } from '@hawtiosrc/plugins' import { HealthComponent, HealthData, JolokiaHealthData, Logger, LoggerConfiguration } from './types' +export function isActive(): Promise { + return workspace.treeContainsDomainAndProperties('org.springframework.boot') +} + export async function loadHealth(): Promise { const data = (await jolokiaService.execute( 'org.springframework.boot:type=Endpoint,name=Health',