Skip to content

Commit

Permalink
Introducing a "center" zone for the Admin Center.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Nov 6, 2017
1 parent fecac75 commit ce0379f
Show file tree
Hide file tree
Showing 15 changed files with 244 additions and 314 deletions.
Expand Up @@ -1166,6 +1166,14 @@ public static boolean isPlatform() {
return platform;
}

public static boolean isMultiAppPlatform() {
return isPlatform() && !isSingleApp();
}

public static boolean isSingleApp() {
return new File("/app").exists();
}

public static boolean isMavenBuild() {
return mavenBuild;
}
Expand Down
Expand Up @@ -6,3 +6,30 @@ jdbc:

hibernate:
dialect: org.hibernate.dialect.HSQLDialect

center-zone:
home: /_
brand: '<i class="fa fa-dashboard"></i> Admin Center'
search: false
fluid: true
menu:
Overview: /_
Routes: /_routes
Configuration: /_config
Processes: /_processes
Metrics: /_metrics
Manageables: /_manageables
Application:
Beans: /_beans
Entities: /_entities
System:
Terminate / Restart: /_terminate
Classpath: /_classpath
Memory pool: /_jmx/mempool
JVM Threads: /_jmx/threads
Operating system: /_jmx/os
Garbage collection: /_jmx/gc
Memory: /_jmx/memory
Runtime: /_jmx/runtime
Classes: /_jmx/classes
Compilation: /_jmx/compilation
Expand Up @@ -9,7 +9,7 @@ rapidoid-admin:
benchmark:
plan: r1:d5:c64

platform-zone:
center-zone:
home: /rapidoid
brand: '<i class="fa fa-shield"></i> Rapidoid'
search: false
Expand Down
27 changes: 0 additions & 27 deletions commons/rapidoid-commons/src/main/resources/built-in-config.yml
Expand Up @@ -19,33 +19,6 @@ gui:

main-zone: {}

admin-zone:
home: /_
brand: '<i class="fa fa-dashboard"></i> Admin Center'
search: false
fluid: true
menu:
Overview: /_
Routes: /_routes
Configuration: /_config
Processes: /_processes
Metrics: /_metrics
Manageables: /_manageables
Application:
Beans: /_beans
Entities: /_entities
System:
Terminate / Restart: /_terminate
Classpath: /_classpath
Memory pool: /_jmx/mempool
JVM Threads: /_jmx/threads
Operating system: /_jmx/os
Garbage collection: /_jmx/gc
Memory: /_jmx/memory
Runtime: /_jmx/runtime
Classes: /_jmx/classes
Compilation: /_jmx/compilation

users:
admin:
roles: administrator
Expand Down
Expand Up @@ -36,8 +36,8 @@
@Since("5.3.2")
public class DefaultSetup extends RapidoidInitializer {

private static final String MAIN_ZONE = Msc.isPlatform() ? "platform" : "main";
private static final String ADMIN_ZONE = Msc.isPlatform() ? "platform" : "admin";
private static final String MAIN_ZONE = Msc.isMultiAppPlatform() ? "platform" : "main";
private static final String ADMIN_ZONE = Msc.isMultiAppPlatform() ? "platform" : "admin";

final Setup on;
final Setup admin;
Expand Down
Expand Up @@ -38,10 +38,12 @@ public void testMainZone() {
On.get("/a").json(zoneHandler);
On.get("/b").zone("admin").json(zoneHandler);
On.get("/c").zone("other").json(zoneHandler);
On.get("/d").zone("center").json(zoneHandler);

onlyGet("/a");
onlyGet("/b");
onlyGet("/c");
onlyGet("/d");
}

}
Expand Up @@ -17,36 +17,6 @@
"fluid" : false,
"cdn" : "auto"
},
"admin-zone" : {
"home" : "/_",
"brand" : "<i class=\"fa fa-dashboard\"></i> Admin Center",
"search" : false,
"fluid" : true,
"menu" : {
"Overview" : "/_",
"Routes" : "/_routes",
"Configuration" : "/_config",
"Processes" : "/_processes",
"Metrics" : "/_metrics",
"Manageables" : "/_manageables",
"Application" : {
"Beans" : "/_beans",
"Entities" : "/_entities"
},
"System" : {
"Terminate / Restart" : "/_terminate",
"Classpath" : "/_classpath",
"Memory pool" : "/_jmx/mempool",
"JVM Threads" : "/_jmx/threads",
"Operating system" : "/_jmx/os",
"Garbage collection" : "/_jmx/gc",
"Memory" : "/_jmx/memory",
"Runtime" : "/_jmx/runtime",
"Classes" : "/_jmx/classes",
"Compilation" : "/_jmx/compilation"
}
}
},
"users" : {
"admin" : {
"roles" : "administrator"
Expand Down Expand Up @@ -157,5 +127,35 @@
"keyManagerPassword" : "",
"truststore" : "",
"truststorePassword" : ""
},
"center-zone" : {
"home" : "/_",
"brand" : "<i class=\"fa fa-dashboard\"></i> Admin Center",
"search" : false,
"fluid" : true,
"menu" : {
"Overview" : "/_",
"Routes" : "/_routes",
"Configuration" : "/_config",
"Processes" : "/_processes",
"Metrics" : "/_metrics",
"Manageables" : "/_manageables",
"Application" : {
"Beans" : "/_beans",
"Entities" : "/_entities"
},
"System" : {
"Terminate / Restart" : "/_terminate",
"Classpath" : "/_classpath",
"Memory pool" : "/_jmx/mempool",
"JVM Threads" : "/_jmx/threads",
"Operating system" : "/_jmx/os",
"Garbage collection" : "/_jmx/gc",
"Memory" : "/_jmx/memory",
"Runtime" : "/_jmx/runtime",
"Classes" : "/_jmx/classes",
"Compilation" : "/_jmx/compilation"
}
}
}
}
Expand Up @@ -28,36 +28,6 @@
"fluid" : false,
"cdn" : "auto"
},
"admin-zone" : {
"home" : "/_",
"brand" : "<i class=\"fa fa-dashboard\"></i> Admin Center",
"search" : false,
"fluid" : true,
"menu" : {
"Overview" : "/_",
"Routes" : "/_routes",
"Configuration" : "/_config",
"Processes" : "/_processes",
"Metrics" : "/_metrics",
"Manageables" : "/_manageables",
"Application" : {
"Beans" : "/_beans",
"Entities" : "/_entities"
},
"System" : {
"Terminate / Restart" : "/_terminate",
"Classpath" : "/_classpath",
"Memory pool" : "/_jmx/mempool",
"JVM Threads" : "/_jmx/threads",
"Operating system" : "/_jmx/os",
"Garbage collection" : "/_jmx/gc",
"Memory" : "/_jmx/memory",
"Runtime" : "/_jmx/runtime",
"Classes" : "/_jmx/classes",
"Compilation" : "/_jmx/compilation"
}
}
},
"users" : {
"admin" : {
"roles" : "administrator"
Expand Down
Expand Up @@ -18,36 +18,6 @@
"fluid" : false,
"cdn" : "auto"
},
"admin-zone" : {
"home" : "/_",
"brand" : "<i class=\"fa fa-dashboard\"></i> Admin Center",
"search" : false,
"fluid" : true,
"menu" : {
"Overview" : "/_",
"Routes" : "/_routes",
"Configuration" : "/_config",
"Processes" : "/_processes",
"Metrics" : "/_metrics",
"Manageables" : "/_manageables",
"Application" : {
"Beans" : "/_beans",
"Entities" : "/_entities"
},
"System" : {
"Terminate / Restart" : "/_terminate",
"Classpath" : "/_classpath",
"Memory pool" : "/_jmx/mempool",
"JVM Threads" : "/_jmx/threads",
"Operating system" : "/_jmx/os",
"Garbage collection" : "/_jmx/gc",
"Memory" : "/_jmx/memory",
"Runtime" : "/_jmx/runtime",
"Classes" : "/_jmx/classes",
"Compilation" : "/_jmx/compilation"
}
}
},
"users" : {
"admin" : {
"roles" : "administrator"
Expand Down Expand Up @@ -170,7 +140,7 @@
"benchmark" : {
"plan" : "r1:d5:c64"
},
"platform-zone" : {
"center-zone" : {
"home" : "/rapidoid",
"brand" : "<i class=\"fa fa-shield\"></i> Rapidoid",
"search" : false,
Expand Down
Expand Up @@ -18,36 +18,6 @@
"fluid" : false,
"cdn" : "auto"
},
"admin-zone" : {
"home" : "/_",
"brand" : "<i class=\"fa fa-dashboard\"></i> Admin Center",
"search" : false,
"fluid" : true,
"menu" : {
"Overview" : "/_",
"Routes" : "/_routes",
"Configuration" : "/_config",
"Processes" : "/_processes",
"Metrics" : "/_metrics",
"Manageables" : "/_manageables",
"Application" : {
"Beans" : "/_beans",
"Entities" : "/_entities"
},
"System" : {
"Terminate / Restart" : "/_terminate",
"Classpath" : "/_classpath",
"Memory pool" : "/_jmx/mempool",
"JVM Threads" : "/_jmx/threads",
"Operating system" : "/_jmx/os",
"Garbage collection" : "/_jmx/gc",
"Memory" : "/_jmx/memory",
"Runtime" : "/_jmx/runtime",
"Classes" : "/_jmx/classes",
"Compilation" : "/_jmx/compilation"
}
}
},
"users" : {
"admin" : {
"roles" : "administrator"
Expand Down

0 comments on commit ce0379f

Please sign in to comment.