HAL management console
hpehl Merge pull request #281 from hpehl/HAL-1537
HAL-1537: Support Eclipse MicroProfile Metrics in Web Console
Latest commit 963e1ea Nov 14, 2018
Permalink
Failed to load latest commit information.
app HAL-1537: Support Eclipse MicroProfile Metrics in Web Console Nov 14, 2018
ballroom HAL-1537: Support Eclipse MicroProfile Metrics in Web Console Nov 14, 2018
bom Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
build Add degraph styling Mar 26, 2018
config Fix JsInterop warning for return type of 'Void Keycloak.UserProfile.s… Oct 1, 2018
core HAL-1537: Basic setup for MicroProfile metrics Nov 14, 2018
db Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
dmr HAL-1537: Support Eclipse MicroProfile Metrics in Web Console Nov 14, 2018
docker added image information of hal-wildfly-nightly into the POM Aug 21, 2018
flow Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
fraction Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
js Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
meta HAL-1537: Basic setup for MicroProfile metrics Nov 14, 2018
parent-with-dependencies Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
parent-with-gwt Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
processors HAL-1511, JBEAP-15253: Simplify safe HTML generation for DataTable co… Sep 27, 2018
resources HAL-1537: Basic setup for MicroProfile metrics Nov 14, 2018
spi HAL-1303: Adjust PR Sep 27, 2018
standalone Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
testsuite Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
themes Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
yarn Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
.gitignore Restore .gitignore files Apr 26, 2017
CODE_OF_CONDUCT.md Use two versions: Maven version and semantic version Apr 16, 2018
CONTRIBUTING.md Move hal.next -> console Mar 28, 2018
LICENSE.txt Fix license information Jun 13, 2018
README.md Merge branch 'develop' of github.com:hal/console into develop Jun 14, 2018
esdoc.sh Move hal.next -> console Mar 28, 2018
loc.sh HAL-1478: Replace Bower with Yarn dependencies Jun 14, 2018
pom.xml Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
release.sh Adjust themes in release.sh Jun 13, 2018
snapshot.sh Exclude maven module 'yarn' from reactor; documentation Jun 5, 2018
spinner.sh Tweak publish.sh Mar 19, 2016
version.txt Create maintenance branch '3.0.x'; next development version is '3.1.0' Aug 14, 2018
versionBump.sh Fixed versionBump.sh to update module-i18n.gwt.xml Aug 30, 2018
zanata.sh Fix zanata.sh to exclude non-localized HTML previews when pushing to … Aug 14, 2018

README.md

TC Build Chat on Gitter

HAL is the project name for the WildFly and JBoss EAP management console. It's part of every WildFly and JBoss EAP installation. To get started simply fire up your browser and open http://localhost:9990.

Technical Stack

HAL is a client side RIA without server side dependencies. It is a GWT application - which means it's written almost completely in Java. GWT is used to transpile the Java code into a bunch of JavaScript, HTML and CSS files. HAL uses some external JavaScript libraries as well. These dependencies are managed using Yarn which is in turn integrated into the Maven build using the maven-frontend-plugin. Take a look at the package.json too see all JavaScript dependencies.

In a nutshell the console uses the following technical stack:

Build

For a full build use

mvn clean install

This includes the GWT compiler, which might take a while. If you just want to make sure that there are no compilation or test failures, you can skip the GWT compiler and use

mvn clean install -Dgwt.skipCompilation

Production Builds

To build a HAL release ready to be used as standalone console, for WildFly or JBoss EAP use one of the following commands:

  • Standalone: mvn clean install -P prod,theme-hal
  • WildFly: mvn clean install -P prod,theme-wildfly
  • JBoss EAP: mvn clean install -P prod,theme-eap

Run

The GWT development mode starts a local Jetty server. As a one time prerequisite you need to add the URL of the local Jetty server as an allowed origin to your WildFly / JBoss EAP configuration:

Standalone Mode

/core-service=management/management-interface=http-interface:list-add(name=allowed-origins,value=http://localhost:8888)
reload

Domain Mode

/host=master/core-service=management/management-interface=http-interface:list-add(name=allowed-origins,value=http://localhost:8888)
reload --host=master

The main GWT application is located in the app folder. To run the console use

cd app
mvn gwt:devmode

This will start the development mode. Wait until you see a message like

00:00:15,703 [INFO] Code server started in 15.12 s ms

Then open http://localhost:8888/dev.html in your browser and connect to your WildFly / JBoss EAP instance.

Debug

Start the console as described in the previous chapter. GWT uses the SourceMaps standard to map the Java source code to the transpiled JavaScript code. This makes it possible to use the browser development tools for debugging.

In Chrome open the development tools and switch to the 'Sources' tab. Press ⌘ P and type the name of the Java source file you want to open.

Let's say we want to debug the enable / disable action in the data source column in configuration. Open the class DataSourceColumn and put a breakpoint on the first line of method void setEnabled(ResourceAddress, boolean, SafeHtml) (should be line 285). Now select a data source like the default 'ExampleDS' data source and press the enable / disable link in the preview. The browser should stop at the specified line and you can use the development tools to inspect and change variables.

Inspect Variables

If you're used to debug Java applications in your favorite IDE, the debugging experience in the browser development tools might feel strange at first. You can inspect simple types like boolean, numbers and strings. Support for native JavaScript types like arrays and objects is also very good. On the other hand Java types like lists or maps are not very well supported. In addition most variable names are suffixed with something like _0_g$. We recommend to inspect these variables using the console and call the toString() method on the respective object.

Develop

To apply changes made to Java code you just need to refresh the browser. GWT will detect the modifications and only transpile the changed sources.

Changes to other resources require a little bit more effort. To make it easier, you can use the script app/refresh.sh. Change to the app folder and call refresh.sh with one of the following parameters, depending what kind of resource you've modified:

  • less: Compile LESS stylesheets
  • html: Update HTML snippets
  • i18n: Process i18n resource bundles
  • mbui: Regenerate MBUI resources

After calling the script, refresh the browser to see your changes.

Replace Existing Console

If you want to replace the console of an existing WildFly installation use the following steps:

  1. mvn clean install -P prod,theme-wildfly
  2. cp app/target/hal-console-<version>-resources.jar $WILDFLY_HOME/modules/system/layers/base/org/jboss/as/console/main
  3. Edit $WILDFLY_HOME/modules/system/layers/base/org/jboss/as/console/main/module.xml and adjust the <resources/> config: <resource-root path="hal-console-<version>-resources.jar"/>

Licenses