diff --git a/README.md b/README.md index fc1f4e9..c8df24c 100644 --- a/README.md +++ b/README.md @@ -96,12 +96,23 @@ to start the container run: $ docker run \ -e TZ="CET" \ -e LANG="en_US.UTF-8" \ - -v $PWD/docker/configuration/config.xml:/opt/jboss/wildfly/config.xml \ + -v $PWD/docker/configuration/config.xml:/opt/jboss/config.xml \ -p "8080:8080" \ imixs/muluk:latest **Note:** The MULUK_CONFIG_FILE must point to your local config.xml file + + + +## Rest API + +You can request the current config state with the Rest API endpoint: + + http://localhos:8080/api/config + +This will return the XML object including the latest monitoring data. + ## Local Development During development you can build a dev version providing debugging mode. To build the dev version run: @@ -115,7 +126,7 @@ to start the container in dev mode run: -e TZ="CET" \ -e LANG="en_US.UTF-8" \ -v $PWD/docker/deployments:/opt/jboss/wildfly/standalone/deployments/ \ - -v $PWD/docker/configuration/config.xml:/opt/jboss/wildfly/config.xml \ + -v $PWD/docker/configuration/config.xml:/opt/jboss/config.xml \ -p "8080:8080" \ -p "8787:8787" \ imixs/muluk:latest diff --git a/src/main/java/org/imixs/muluk/RestService.java b/src/main/java/org/imixs/muluk/RestService.java new file mode 100644 index 0000000..cca6cae --- /dev/null +++ b/src/main/java/org/imixs/muluk/RestService.java @@ -0,0 +1,87 @@ +/* + * Imixs-Workflow + * + * Copyright (C) 2001-2020 Imixs Software Solutions GmbH, + * http://www.imixs.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You can receive a copy of the GNU General Public + * License at http://www.gnu.org/licenses/gpl.html + * + * Project: + * https://www.imixs.org + * https://github.com/imixs/imixs-workflow + * + * Contributors: + * Imixs Software Solutions GmbH - Project Management + * Ralph Soika - Software Developer + */ + +package org.imixs.muluk; + +import java.io.IOException; +import java.io.OutputStream; + +import javax.ejb.Stateless; +import javax.inject.Inject; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; + +/** + * The RestService provides the api to get the current config + * + * @author rsoika + * + */ +@Path("/") +@Produces({ MediaType.APPLICATION_XML, MediaType.TEXT_XML }) +@Stateless +public class RestService { + + @Inject + MonitorService monitorService; + + @GET + @Produces(MediaType.APPLICATION_XHTML_XML) + public StreamingOutput getRoot() { + + return new StreamingOutput() { + public void write(OutputStream out) throws IOException, WebApplicationException { + + out.write("
".getBytes()); + out.write("".getBytes()); + out.write("
".getBytes()); + } + }; + } + + /** + * Method to invalidate the current user session + *

+ * Should be called by a client + * + * @return + */ + @GET + @Path("/config") + public Response convertResultList() { + return Response.ok(monitorService.getConfig()).header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML) + .build(); + } + +} diff --git a/src/main/webapp/css/dark/muluk.css b/src/main/webapp/css/dark/muluk.css index 20819b7..2da91ef 100644 --- a/src/main/webapp/css/dark/muluk.css +++ b/src/main/webapp/css/dark/muluk.css @@ -179,9 +179,12 @@ body { #imixs-footer { width: 100%; + margin-top:50px; padding: 10px 30px 10px 210px; text-align: right; - border-top: 1px solid #ccc; + border-top: 1px solid #999; + color: #999; + font-size:0.8em; } #imixs-footer a { diff --git a/src/main/webapp/layout/template.xhtml b/src/main/webapp/layout/template.xhtml index 02e1bd6..d38d615 100644 --- a/src/main/webapp/layout/template.xhtml +++ b/src/main/webapp/layout/template.xhtml @@ -69,7 +69,7 @@ -

+ \ No newline at end of file