-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
195 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 28 additions & 28 deletions
56
home/src/main/java/org/dominokit/domino/home/client/views/ui/HomeViewImpl.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"http.port": 8080 | ||
"http.port": 8080, | ||
"app.root.path": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...ain/java/org/dominokit/domino/uidemoserver/server/resources/DynamicIndexPageProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.dominokit.domino.uidemoserver.server.resources; | ||
|
||
import com.google.auto.service.AutoService; | ||
import io.vertx.core.http.HttpServerResponse; | ||
import io.vertx.core.json.JsonObject; | ||
import io.vertx.ext.web.RoutingContext; | ||
import io.vertx.ext.web.templ.freemarker.FreeMarkerTemplateEngine; | ||
import org.dominokit.domino.api.server.PluginContext; | ||
import org.dominokit.domino.api.server.plugins.IndexPageProvider; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
@AutoService(IndexPageProvider.class) | ||
public class DynamicIndexPageProvider implements IndexPageProvider { | ||
|
||
public static final Logger LOGGER = LoggerFactory.getLogger(DynamicIndexPageProvider.class); | ||
private final JsonObject engineContext = new JsonObject(); | ||
|
||
public DynamicIndexPageProvider(JsonObject engineContext) { | ||
this.engineContext.mergeIn(engineContext); | ||
} | ||
|
||
@Override | ||
public HttpServerResponse serveIndexPage(PluginContext context, RoutingContext routingContext, int statusCode) { | ||
LOGGER.info("Loading index page using dynamic index page loader..."); | ||
FreeMarkerTemplateEngine engine = FreeMarkerTemplateEngine.create(context.getVertx()); | ||
|
||
HttpServerResponse response = routingContext | ||
.response() | ||
.setStatusCode(statusCode) | ||
.putHeader("Content-type", "text/html"); | ||
|
||
engine.render(engineContext | ||
, "templates/index.ftl", processedTemplate -> { | ||
if(processedTemplate.succeeded()) { | ||
String content = processedTemplate.result().toString(); | ||
response.putHeader("Content-length", content.length() + "") | ||
.write(content); | ||
response.end(); | ||
}else{ | ||
response.end(); | ||
LOGGER.error("failed to process index page template : ", processedTemplate.cause()); | ||
} | ||
}); | ||
|
||
return response; | ||
} | ||
|
||
} |
65 changes: 65 additions & 0 deletions
65
ui-demo-server/ui-demo-server-backend/src/main/resources/templates/index.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!doctype html> | ||
|
||
<html> | ||
<head> | ||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-143772295-1"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', 'UA-143772295-1'); | ||
</script> | ||
|
||
<!-- Google Tag Manager --> | ||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | ||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | ||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | ||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | ||
})(window,document,'script','dataLayer','GTM-KRZMCDW');</script> | ||
<!-- End Google Tag Manager --> | ||
|
||
<meta charset=UTF-8> | ||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> | ||
|
||
<!--<link type="text/css" rel="stylesheet" href="/static/css/domino-ui.css">--> | ||
<link type="text/css" rel="stylesheet" href="${appRootPath}/fontawesome/css/fontawesome-all.css"> | ||
<link type="text/css" rel="stylesheet" href="${appRootPath}/css/domino-ui.dev.css"> | ||
<link type="text/css" rel="stylesheet" href="${appRootPath}/css/themes/all-themes.css"> | ||
<link type="text/css" rel="stylesheet" href="${appRootPath}/dev.css"> | ||
<link type="text/css" rel="stylesheet" href="${appRootPath}/ui-demo.css"> | ||
<link rel="stylesheet" type="text/css" href="${appRootPath}/prettify/prettify.css"> | ||
<link rel="stylesheet" type="text/css" href="${appRootPath}/prettify/desert.css"> | ||
|
||
<title>ui-demo</title> | ||
<script type="text/javascript" src="${appRootPath}/prettify/prettify.js"></script> | ||
<script src="${appRootPath}/polyfill/polyfill-ie11.js"></script> | ||
<script src="${appRootPath}/app.nocache.js"></script> | ||
|
||
<script> | ||
((window.gitter = {}).chat = {}).options = { | ||
room: 'domino-gwt/domino-ui' | ||
}; | ||
</script> | ||
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script> | ||
</head> | ||
|
||
<body> | ||
<!-- Google Tag Manager (noscript) --> | ||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KRZMCDW" | ||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> | ||
<!-- End Google Tag Manager (noscript) --> | ||
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' | ||
style="position:absolute;width:0;height:0;border:0"></iframe> | ||
|
||
<noscript> | ||
<div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"> | ||
Your web browser must have JavaScript enabled | ||
in order for this application to display correctly. | ||
</div> | ||
</noscript> | ||
|
||
</body> | ||
</html> |