Skip to content

Commit

Permalink
Make UI mobile-friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
AO-StreetArt committed Dec 16, 2018
1 parent a9bdc75 commit f5856c0
Show file tree
Hide file tree
Showing 13 changed files with 345 additions and 416 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ MAINTAINER Alex Barry
VOLUME /tmp
ADD build/libs/adrestia-0.2.0.jar app.jar
ADD src/main/webapp/WEB-INF/jsp src/main/webapp/WEB-INF/jsp
ADD src/main/webapp/css src/main/webapp/css
ADD src/main/resources src/main/resources
ENV JAVA_OPTS=""
ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar
36 changes: 26 additions & 10 deletions src/main/java/com/ao/adrestia/AdrestiaApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;

Expand All @@ -57,7 +59,9 @@
@EnableWebSecurity
@Import(AdrestiaMongoConfiguration.class)
@SpringBootApplication(exclude = {SolrAutoConfiguration.class})
public class AdrestiaApplication extends WebSecurityConfigurerAdapter {
public class AdrestiaApplication
extends WebSecurityConfigurerAdapter
implements WebMvcConfigurer {
private BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();

// Is Authentication required for accessing our HTTP Server
Expand All @@ -74,18 +78,38 @@ public class AdrestiaApplication extends WebSecurityConfigurerAdapter {
@Autowired
ApplicationUserRepository applicationUserRepository;

// Bean definition for Zuul Routing Filter
@Bean
public RoutingFilter routingFilter() {
return new RoutingFilter();
}

// Bean definition for Zuul Persistence Filter
@Bean PersistenceFilter persistenceFilter() {
return new PersistenceFilter();
}

// Bean definition for Password Encoder (Hashing Pw's)
@Bean
public BCryptPasswordEncoder bCryptPasswordEncoder() {
return encoder;
}

// Enable loading custom CSS Files
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/css/**").addResourceLocations("/css/");
}

// Configure Web Security
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();

if (httpAuthActive) {
http.authorizeRequests()
.antMatchers("/health").permitAll()
.antMatchers("/favicon.ico").permitAll()
.antMatchers("/portal/login").permitAll()
.antMatchers(HttpMethod.POST, "/login").permitAll()
.antMatchers("/**").authenticated()
Expand All @@ -100,6 +124,7 @@ protected void configure(HttpSecurity http) throws Exception {
}
}

// Configure Authentication
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
if (httpAuthActive) {
Expand All @@ -111,13 +136,4 @@ protected void configure(AuthenticationManagerBuilder auth) throws Exception {
public static void main(String[] args) {
SpringApplication.run(AdrestiaApplication.class, args);
}

@Bean
public RoutingFilter routingFilter() {
return new RoutingFilter();
}

@Bean PersistenceFilter persistenceFilter() {
return new PersistenceFilter();
}
}
7 changes: 6 additions & 1 deletion src/main/java/com/ao/adrestia/controller/HomeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ protected String home(final Map<String, Object> model, final Principal principal
logger.info("Home page");
if (principal == null && authActive) {
logger.warn("No Principal Detected");
return "redirect:/logout";
return "redirect:/portal/login";
}
model.put("userId", principal);
return "home";
}

@RequestMapping(value = "/", method = RequestMethod.GET)
protected String resolveRoot(final Map<String, Object> model, final Principal principal) {
return "forward:/portal/home";
}

}
37 changes: 9 additions & 28 deletions src/main/webapp/WEB-INF/jsp/assetBrowser.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootswatch/4.1.3/sandstone/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<!-- Custom CSS -->
<link href="/css/aeselBrowserBaseStyle.css" rel="stylesheet">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8"/>
<title>Aesel Asset Browser</title>
Expand All @@ -23,18 +25,6 @@
<script src="https://cdn.babylonjs.com/babylon.js"></script>
<script src="https://preview.babylonjs.com/loaders/babylonjs.loaders.min.js"></script>
<style>
html, body {
overflow: hidden;
width : 100%;
height : 100%;
margin : 0;
padding : 0;
}
.col-centered{
float: none;
margin: 0 auto;
}
#renderCanvas {
width : 100%;
height : 100%;
Expand All @@ -43,19 +33,13 @@
</style>
</head>
<body>
<div class="pre-scrollable" style="height:100%;max-height: 100%;">
<div class="container-fluid" style="height:100%;">
<div class="container-fluid pre-scrollable" style="height:100%;max-height:100%;">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="#">Aesel</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor01">
<a class="navbar-brand" href="#"></a>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="/portal/home">Home</a>
</li>
<li class="nav-item"><a class="nav-link" href="#">|</a></li>
<li class="nav-item" id="projectBrowser">
<a class="nav-link" href="/projectBrowser">Projects</a>
</li>
Expand All @@ -65,12 +49,10 @@
<li class="nav-item" id="assetBrowser">
<a class="nav-link active" href="#">Assets <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item"><a class="nav-link" href="#">|</a></li>
<li class="nav-item" id="docs">
<a class="nav-link" href="https://aesel.readthedocs.io/en/latest/index.html">Documentation</a>
</li>
</ul>
</div>
</nav>
<div class="row">
<div class="col-md-12">
Expand All @@ -84,11 +66,11 @@
<div class="col-md-12">
<div class="btn-toolbar" role="toolbar" aria-label="Asset Toolbar" style="justify-content: center;">
<div class="btn-group" role="group" aria-label="Asset Toolbar">
<button id="view" type="button" class="btn btn-primary" style="z-index:265">View</button>
<button id="download" type="button" class="btn btn-primary" style="z-index:265">Download</button>
<button id="edit" type="button" class="btn btn-primary" style="z-index:265">Edit Asset</button>
<button id="create" type="button" class="btn btn-primary" style="z-index:265">Create Asset</button>
<button id="delete" type="button" class="btn btn-primary" style="z-index:265">Delete Asset</button>
<button id="view" type="button" class="btn btn-primary" style="z-index:265"><span style="font-size:larger;">View</span></button>
<button id="download" type="button" class="btn btn-primary" style="z-index:265"><span style="font-size:larger;">Download</span></button>
<button id="edit" type="button" class="btn btn-primary" style="z-index:265"><span style="font-size:larger;">Edit Asset</span></button>
<button id="create" type="button" class="btn btn-primary" style="z-index:265"><span style="font-size:larger;">Create Asset</span></button>
<button id="delete" type="button" class="btn btn-primary" style="z-index:265"><span style="font-size:larger;">Delete Asset</span></button>
</div>
</div>
</div>
Expand All @@ -113,7 +95,6 @@
<p> &copy; 2018 AO Labs</p>
</footer>
</div>
</div>
<script>
// Global WegGL variables to access in callbacks
var canvas = null;
Expand Down
81 changes: 29 additions & 52 deletions src/main/webapp/WEB-INF/jsp/assetEdit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,20 @@
<script src="https://cdn.jsdelivr.net/gh/StephanWagner/jBox@v0.5.1/dist/jBox.all.min.js"></script>
<link href="https://cdn.jsdelivr.net/gh/StephanWagner/jBox@v0.5.1/dist/jBox.all.min.css" rel="stylesheet">

<!-- Custom CSS -->
<link href="/css/aeselBrowserBaseStyle.css" rel="stylesheet">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8"/>
<title>Aesel Asset</title>

<style>
html, body {
overflow: hidden;
width : 100%;
height : 100%;
margin : 0;
padding : 0;
}
input {
width : 100%;
}
html {
overflow-y: hidden;
}
</style>
</head>
<body>
<div class="pre-scrollable" style="height:100%;max-height: 100%;">
<div class="container-fluid" style="height:100%;">
<div class="container-fluid pre-scrollable" style="height:100%;max-height:100%;">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="#">Aesel</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor01">
<a class="navbar-brand" href="#"></a>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="/portal/home">Home</a>
</li>
<li class="nav-item"><a class="nav-link" href="#">|</a></li>
<li class="nav-item" id="projectBrowser">
<a class="nav-link" href="/projectBrowser">Projects</a>
</li>
Expand All @@ -58,87 +38,84 @@
<li class="nav-item active" id="assetBrowser">
<a class="nav-link" href="#">Assets <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item"><a class="nav-link" href="#">|</a></li>
<li class="nav-item" id="docs">
<a class="nav-link" href="https://aesel.readthedocs.io/en/latest/index.html">Documentation</a>
</li>
</ul>
</div>
</nav>
<div class="row">
<div class="col-md-12">
<h1 style="text-align: center;">Asset</h1>
</div>
</div>
<div class="row">
<div class="col-md-2">
Key:
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Key:</p>
</div>
<div class="col-md-10" class="tooltip" title="The unique identifier of the Scene.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The unique identifier of the Scene.">
<input id="keyinp" type="text" class="form-control-plaintext" name="Key" placeholder="Key"></input>
</div>
</div>
<div class="row">
<div class="col-md-2">
Name:
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Name:</p>
</div>
<div class="col-md-10" class="tooltip" title="The human-readable name of the Scene.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The human-readable name of the Scene.">
<input id="nameinp" type="text" class="form-control-plaintext" name="Name" placeholder="Name"></input>
</div>
</div>
<div class="row">
<div class="col-md-2">
Content Type:
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Content Type:</p>
</div>
<div class="col-md-10" class="tooltip" title="The latitude of the Scene for distance queries.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The latitude of the Scene for distance queries.">
<input id="ctypeinp" type="text" class="form-control-plaintext" name="ContentType" placeholder="Content Type"></input>
</div>
</div>
<div class="row">
<div class="col-md-2">
File Type:
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>File Type:</p>
</div>
<div class="col-md-10" class="tooltip" title="The longitude of the Scene for distance queries.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The longitude of the Scene for distance queries.">
<input id="ftypeinp" type="text" class="form-control-plaintext" name="FileType" placeholder="File Type"></input>
</div>
</div>
<div class="row">
<div class="col-md-2">
Asset Type:
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Asset Type:</p>
</div>
<div class="col-md-10" class="tooltip" title="The longitude of the Scene for distance queries.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The longitude of the Scene for distance queries.">
<input id="atypeinp" type="text" class="form-control-plaintext" name="AssetType" placeholder="Asset Type"></input>
</div>
</div>
<div class="row">
<div class="col-md-2">
Tags:
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>Tags:</p>
</div>
<div class="col-md-10" class="tooltip" title="The tags associated to the Scene.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The tags associated to the Scene.">
<input id="tagsinp" type="text" class="form-control-plaintext" name="Tags" placeholder="Tags"></input>
</div>
</div>
<div class="row">
<div class="col-md-2">
File:
<div class="col-xs-5 col-sm-4 col-md-2 col-lg-2">
<p>File:</p>
</div>
<div class="col-md-10" class="tooltip" title="The actual asset file to upload.">
<div class="col-xs-7 col-sm-8 col-md-10 col-lg-10" class="tooltip" title="The actual asset file to upload.">
<input id="fileinp" name="file" type="file" class="form-control-file"></input>
</div>
</div>
<div class="row">
<div class="col-md-6" class="tooltip" title="Cancel the changes.">
<button id="cancel" type="button" class="btn btn-primary">Cancel</button>
<div class="col-md-6 col-lg-6" class="tooltip" title="Cancel the changes.">
<button id="cancel" type="button" class="btn btn-primary"><span style="font-size:larger;">Cancel</span></button>
</div>
<div class="col-md-6" class="tooltip" title="Save the Asset.">
<button id="save" type="button" class="btn btn-primary">Save</button>
<div class="col-md-6 col-lg-6" class="tooltip" title="Save the Asset.">
<button id="save" type="button" class="btn btn-primary"><span style="font-size:larger;">Save</span></button>
</div>
</div>
<footer class="footer">
<p> &copy; 2018 AO Labs</p>
</footer>
</div>
</div>
<script>
// The Asset Key is injected here by the server before
// it returns the page
Expand Down

0 comments on commit f5856c0

Please sign in to comment.