Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
topframe committed Jan 11, 2025
1 parent 41415e6 commit 26d6a09
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public abstract class AboutMe {
pkg.getImplementationVersion() != null) {
VERSION = pkg.getImplementationVersion();
} else {
VERSION = System.getProperty("appmon.version", "1.0.x");
VERSION = System.getProperty("appmon.version", "1.0.x(20250111)");
}

POWERED_BY = "Powered by Aspectran " + VERSION;
Expand Down
2 changes: 1 addition & 1 deletion demo/app/config/root-web-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</aspect>

<translet name="/">
<redirect path="/appmon/front/"/>
<redirect path="/appmon/front/#{class:com.aspectran.utils.security.TimeLimitedPBTokenIssuer^token}"/>
</translet>

</aspectran>
12 changes: 6 additions & 6 deletions demo/app/webapps/appmon/WEB-INF/jsp/appmon/appmon.jsp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://aspectran.com/tags" prefix="aspectran" %>
<link rel="stylesheet" href="<aspectran:url value="/assets/appmon/css/appmon.css?20241226"/>">
<script src="<aspectran:url value="/assets/countries/countries.js?20241217"/>"></script>
<script src="<aspectran:url value="/assets/appmon/js/front-builder.js?20241226"/>"></script>
<script src="<aspectran:url value="/assets/appmon/js/front-viewer.js?20241226"/>"></script>
<script src="<aspectran:url value="/assets/appmon/js/websocket-client.js?20241226"/>"></script>
<script src="<aspectran:url value="/assets/appmon/js/polling-client.js?20241226"/>"></script>
<link rel="stylesheet" href="<aspectran:url value="/assets/appmon/css/appmon.css?${page.version}"/>">
<script src="<aspectran:url value="/assets/countries/countries.js?${page.version}"/>"></script>
<script src="<aspectran:url value="/assets/appmon/js/front-builder.js?${page.version}"/>"></script>
<script src="<aspectran:url value="/assets/appmon/js/front-viewer.js?${page.version}"/>"></script>
<script src="<aspectran:url value="/assets/appmon/js/websocket-client.js?${page.version}"/>"></script>
<script src="<aspectran:url value="/assets/appmon/js/polling-client.js?${page.version}"/>"></script>
<div class="grid-x endpoint-box compact horizontal">
<div class="cell options t10 b5">
<ul class="speed-options">
Expand Down
41 changes: 7 additions & 34 deletions demo/app/webapps/appmon/WEB-INF/jsp/templates/default.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="google" content="notranslate">
<title>${empty page.title ? "Aspectow Demo" : page.title}</title>
<meta name="description" content="${empty page.description ? "Welcome to the Aspectran Demo Site" : page.description}">
<title>${empty page.title ? "AppMon" : page.title}</title>
<meta name="description" content="${empty page.description ? "Welcome to AppMon" : page.description}">
<link rel="stylesheet" href="https://aspectran.com/assets/css/aspectran.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,700;1,400&display=swap">
<script src="https://aspectran.com/assets/js/modernizr-custom.js"></script>
Expand Down Expand Up @@ -39,7 +39,7 @@
<a class="logo" href="<aspectran:url value="/"/>" title="Aspectran"><img src="https://aspectran.com/assets/img/aspectran-site-logo.png" alt="Aspectran"/></a>
</div>
<div class="title-bar-center">
<a href="#top-of-page">Aspectran</a>
<a href="#top-of-page">AppMon</a>
</div>
<div class="title-bar-right" data-toggle="gnb-menu">
<a class="menu-icon" title="Menu"></a>
Expand All @@ -53,45 +53,18 @@
</div>
</div>
<div class="top-bar-left">
<ul class="dropdown menu" data-dropdown-menu>
<ul class="dropdown menu">
<li>
<a title="Sample applications built on Aspectran">Sample Apps</a>
<ul class="submenu menu vertical" data-submenu>
<li><a href="https://demo.aspectran.com">Aspectran Demo</a></li>
<li><a href="https://jpetstore.aspectran.com">JPetStore Demo</a></li>
</ul>
</li>
<li>
<a>Get Involved</a>
<ul class="submenu menu vertical" data-submenu>
<li><a href="https://github.com/aspectran/appmon">GitHub</a></li>
</ul>
</li>
</ul>
</div>
<div class="top-bar-right">
<ul class="dropdown menu" data-dropdown-menu>
<li>
<a href="<aspectran:url value="/appmon/front/"/>">Monitoring</a>
<a title="Sample applications built on Aspectran">AppMon</a>
</li>
</ul>
<div class="quick-search-box">
<form name="google_quick_search">
<div class="input-group">
<input class="input-group-field" type="text" name="keyword" placeholder="Search">
<div class="input-group-button">
<button type="submit" class="button"><i class="fi-magnifying-glass"></i></button>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="breadcrumbs-bar" style="display:none" data-hide-for="medium down">
<div class="grid-container ${page.style}">
<nav role="navigation" aria-label="You are here:">
<ul class="breadcrumbs" itemprop="breadcrumb">
<li><a href="<aspectran:url value="/"/>">Aspectow Demo</a></li>
<li><a href="<aspectran:url value="/"/>">AppMon</a></li>
</ul>
</nav>
</div>
Expand Down Expand Up @@ -133,7 +106,7 @@
<div class="cell">
<nav role="navigation" aria-label="You are here:">
<ul class="breadcrumbs" itemprop="breadcrumb">
<li><a href="/">Aspectow Demo</a></li>
<li><a href="/">AppMon</a></li>
</ul>
</nav>
</div>
Expand Down
2 changes: 1 addition & 1 deletion demo/app/webapps/root/WEB-INF/jsp/templates/default.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<div class="top-bar-left">
<ul class="dropdown menu" data-dropdown-menu>
<li>
<a>Log Relay</a>
<a>Aspectow AppMon</a>
</li>
</ul>
</div>
Expand Down
43 changes: 35 additions & 8 deletions front/src/main/java/com/aspectran/aspectow/appmon/FrontAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,65 @@
package com.aspectran.aspectow.appmon;

import com.aspectran.aspectow.appmon.manager.AppMonManager;
import com.aspectran.core.activity.Translet;
import com.aspectran.core.component.bean.annotation.Action;
import com.aspectran.core.component.bean.annotation.Autowired;
import com.aspectran.core.component.bean.annotation.Component;
import com.aspectran.core.component.bean.annotation.Dispatch;
import com.aspectran.core.component.bean.annotation.Request;
import com.aspectran.utils.StringUtils;
import com.aspectran.utils.annotation.jsr305.NonNull;
import com.aspectran.utils.logging.Logger;
import com.aspectran.utils.logging.LoggerFactory;
import com.aspectran.utils.security.InvalidPBTokenException;

import java.util.Map;

/**
* <p>Created: 2020/02/23</p>
*/
@Component("/front")
@Component
public class FrontAction {

private static final Logger logger = LoggerFactory.getLogger(FrontAction.class);

private final AppMonManager appMonManager;

@Autowired
public FrontAction(AppMonManager appMonManager) {
this.appMonManager = appMonManager;
}

@Request("/${endpoint}")
@Request("/")
@Dispatch("templates/default")
@Action("page")
public Map<String, String> home() {
return Map.of(
"include", "home/main",
"style", "fluid compact"
);
}

@Request("/front/${token}/${endpoint}")
@Dispatch("templates/default")
@Action("page")
public Map<String, String> front(String endpoint) {
public Map<String, String> front(@NonNull Translet translet, String token, String endpoint) {
try {
appMonManager.validateToken(token);
} catch (InvalidPBTokenException e) {
if (logger.isDebugEnabled()) {
logger.debug(e);
}
translet.redirect("../../../");
return null;
}
return Map.of(
"headinclude", "appmon/_endpoints",
"include", "appmon/appmon",
"style", "fluid compact",
"token", appMonManager.issueToken(),
"endpoint", StringUtils.nullToEmpty(endpoint)
"version", AboutMe.getVersion(),
"headinclude", "appmon/_endpoints",
"include", "appmon/appmon",
"style", "fluid compact",
"token", appMonManager.issueToken(),
"endpoint", StringUtils.nullToEmpty(endpoint)
);
}

Expand Down

0 comments on commit 26d6a09

Please sign in to comment.