diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e01cf1a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,11 @@
+
+#Operation Pandora Trigger Commandcenter
+
+_RESTful API using express.js and mongoose with mongodb + Angular4 Frontend_
+
+
+##Installation
+
+##Development
+
+##License Information
diff --git a/api/README.md b/api/README.md
deleted file mode 100644
index bf5adfb..0000000
--- a/api/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-
-#Operation Pandora Trigger Commandcenter RESTful API
-
-_node.js project using express.js and mongoose with mongodb_
-
-
-##Installation
-
diff --git a/api/server.js b/api/server.js
index 4bd0e3f..bb42e65 100644
--- a/api/server.js
+++ b/api/server.js
@@ -35,8 +35,8 @@ mongoose.Promise = global.Promise;
const app = express();
// Middlewares *************************************************
-app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
-app.use(express.static(path.join(__dirname, 'public')));
+app.use(favicon(path.join(__dirname + '/..', 'public', 'favicon.ico')));
+app.use(express.static(path.join(__dirname + '/..', 'public')));
app.use(bodyParser.json());
// logging
@@ -63,7 +63,7 @@ app.use(urls.command, apiAuthenticationMiddleware, commandRouter);
// send index.html on all different paths
app.use(function (req, res) {
- res.sendFile("public/index.html", {root: __dirname});
+ res.sendFile("public/index.html", {root: __dirname + '/..'});
});
diff --git a/docs/opt-cc-environment/nginx-https-cc-site.txt b/docs/opt-cc-environment/nginx-https-cc-site.txt
index 51ad0e9..9850020 100644
--- a/docs/opt-cc-environment/nginx-https-cc-site.txt
+++ b/docs/opt-cc-environment/nginx-https-cc-site.txt
@@ -1,34 +1,34 @@
-
+
server {
- listen 80;
- server_name cc.noarch.de;
- return 302 https://$server_name$request_uri;
-}
-
-server {
- listen 443 ssl;
- server_name cc.noarch.de;
-
- ssl on;
- ssl_certificate /etc/letsencrypt/live/noarch.de/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/noarch.de/privkey.pem;
- ssl_session_timeout 5m;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
- ssl_prefer_server_ciphers on;
- ssl_session_cache shared:SSL:10m;
-
- location / {
- gzip off;
- proxy_set_header X-Forwarded-Ssl on;
- client_max_body_size 5M;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Frame-Options SAMEORIGIN;
- proxy_pass http://localhost:8091;
- }
-}
+ listen 80;
+ server_name cc.noarch.de;
+ return 302 https://$server_name$request_uri;
+}
+
+server {
+ listen 443 ssl;
+ server_name cc.noarch.de;
+
+ ssl on;
+ ssl_certificate /etc/letsencrypt/live/noarch.de/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/noarch.de/privkey.pem;
+ ssl_session_timeout 5m;
+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+ ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
+ ssl_prefer_server_ciphers on;
+ ssl_session_cache shared:SSL:10m;
+
+ location / {
+ gzip off;
+ proxy_set_header X-Forwarded-Ssl on;
+ client_max_body_size 5M;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+ proxy_set_header Host $http_host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Frame-Options SAMEORIGIN;
+ proxy_pass http://localhost:8091;
+ }
+}
diff --git a/static/src/app/app.component.html b/static/src/app/app.component.html
index 3f36e2d..e506d03 100644
--- a/static/src/app/app.component.html
+++ b/static/src/app/app.component.html
@@ -15,6 +15,9 @@
diff --git a/static/src/app/app.config.ts b/static/src/app/app.config.ts
index 4481f74..a46c463 100644
--- a/static/src/app/app.config.ts
+++ b/static/src/app/app.config.ts
@@ -10,6 +10,7 @@ export class AppConfig {
public readonly apiRankPath = '/ranks/';
public readonly apiSquadPath = '/squads/';
public readonly apiUserPath = '/users/';
+ public readonly apiOverviewPath = '/overview';
public getAuthenticationHeader() :Headers {
let currentUser = JSON.parse(localStorage.getItem('currentUser'));
diff --git a/static/src/app/app.module.ts b/static/src/app/app.module.ts
index 4d7375a..31fbe14 100644
--- a/static/src/app/app.module.ts
+++ b/static/src/app/app.module.ts
@@ -25,6 +25,7 @@ import {AppConfig} from "./app.config";
import {LoginGuard} from "./login/login.guard";
import {AwardingService} from "./services/awarding-service/awarding.service";
import {HttpClient} from "./services/http-client";
+import {ArmyService} from "./services/army-service/army.service";
@NgModule({
imports: [BrowserModule, FormsModule, ReactiveFormsModule, appRouting, HttpModule],
@@ -32,6 +33,7 @@ import {HttpClient} from "./services/http-client";
HttpClient,
LoginService,
LoginGuard,
+ ArmyService,
UserService,
UserStore,
SquadService,
diff --git a/static/src/app/app.routing.ts b/static/src/app/app.routing.ts
index 96ecd42..d89d622 100644
--- a/static/src/app/app.routing.ts
+++ b/static/src/app/app.routing.ts
@@ -6,10 +6,13 @@ import {usersRoutes, usersRoutingComponents} from "./users/users.routing";
import {squadsRoutes, squadsRoutingComponents} from "./squads/squads.routing";
import {decorationsRoutes, decorationsRoutingComponents} from "./decorations/decoration.routing";
import {ranksRoutes, ranksRoutingComponents} from "./ranks/ranks.routing";
+import {ArmyComponent} from "./army/army.component";
export const appRoutes: Routes = [
+ {path: 'cc-overview', component: ArmyComponent},
+
{path: 'login', component: LoginComponent},
{path: 'cc-users', children: usersRoutes, canActivate: [LoginGuard]},
{path: '', redirectTo: '/cc-users', pathMatch: 'full'},
@@ -18,18 +21,14 @@ export const appRoutes: Routes = [
{path: 'cc-decorations', children: decorationsRoutes, canActivate: [LoginGuard]},
{path: 'cc-ranks', children: ranksRoutes, canActivate: [LoginGuard]},
-
/** Redirect Konfigurationen **/
-
-
{path: '404', component: NotFoundComponent},
-
{path: '**', redirectTo: '/404'}, // immer als letztes konfigurieren - erste Route die matched wird angesteuert
];
export const appRouting = RouterModule.forRoot(appRoutes);
-export const routingComponents = [LoginComponent, NotFoundComponent, ...usersRoutingComponents,
+export const routingComponents = [LoginComponent, ArmyComponent, NotFoundComponent, ...usersRoutingComponents,
...squadsRoutingComponents, ...decorationsRoutingComponents, ...ranksRoutingComponents];
export const routingProviders = [LoginGuard];
diff --git a/static/src/app/army/army.component.css b/static/src/app/army/army.component.css
new file mode 100644
index 0000000..ffcc23e
--- /dev/null
+++ b/static/src/app/army/army.component.css
@@ -0,0 +1,32 @@
+h1 {
+ width: 920px;
+ float: left;
+ margin-bottom: 50px;
+}
+
+img{
+ margin-top: 10px;
+ padding-right: 30px;
+}
+
+
+.div-table {
+ display: table;
+ border-radius: 10px;
+ margin-left: 1%;
+ width: auto;
+ background-color: rgba(240, 248, 255, 0.29);
+ border-spacing: 5px; /* cellspacing:poor IE support for this */
+}
+
+.div-table-row {
+ display: table-row;
+ width: auto;
+ clear: both;
+}
+
+.div-table-col {
+ float: left; /* fix for buggy browsers */
+ display: table-column;
+ padding: 5px 15px 5px 15px;
+}
diff --git a/static/src/app/army/army.component.html b/static/src/app/army/army.component.html
new file mode 100644
index 0000000..e5f96c7
--- /dev/null
+++ b/static/src/app/army/army.component.html
@@ -0,0 +1,61 @@
+Übersicht über alle Spieler, Squads und Armeen
+
+
+
+
+
NATO
+
+
+
+
+

+
+
+
+
{{squad.name}}
+
+
+
+
{{member.rank}} {{member.username}}
+
+
+
+ Mitglieder: {{squad.memberCount}}
+
+
+
+
+
+
+
Armeemitglieder: {{army.NATO.memberCount}}
+
+
+
+
CSAT
+
+
+
+
+

+
+
+
+
{{squad.name}}
+
+
+
+
{{member.rank}} {{member.username}}
+
+
+
+ Mitglieder: {{squad.memberCount}}
+
+
+
+
+
+
+
Armeemitglieder: {{army.CSAT.memberCount}}
+
+
+
diff --git a/static/src/app/army/army.component.ts b/static/src/app/army/army.component.ts
new file mode 100644
index 0000000..8c71381
--- /dev/null
+++ b/static/src/app/army/army.component.ts
@@ -0,0 +1,26 @@
+import {Component} from "@angular/core";
+import {Army} from "../models/model-interfaces";
+import {ArmyService} from "../services/army-service/army.service";
+
+
+@Component({
+ selector: 'army',
+ templateUrl: './army.component.html',
+ styleUrls: ['./army.component.css']
+})
+export class ArmyComponent {
+
+ army: Army = {NATO: {squads: [], memberCount: 0}, CSAT: {squads: [], memberCount:0}};
+
+ constructor(private armyService: ArmyService) {
+ }
+
+
+ ngOnInit() {
+ this.armyService.getArmy()
+ .subscribe(army => {
+ this.army = army;
+ console.log(army)
+ });
+ };
+}
diff --git a/static/src/app/models/model-interfaces.ts b/static/src/app/models/model-interfaces.ts
index a03ead3..6da451d 100644
--- a/static/src/app/models/model-interfaces.ts
+++ b/static/src/app/models/model-interfaces.ts
@@ -39,6 +39,35 @@ export interface Decoration {
isMedal?: boolean;
}
+export interface Army {
+ NATO: {
+ squads: {
+ _id,
+ name,
+ memberCount,
+ members: {
+ _id,
+ username,
+ rank
+ }[],
+ }[],
+ memberCount
+ },
+ CSAT: {
+ squads: {
+ _id,
+ name,
+ memberCount,
+ members: {
+ _id,
+ username,
+ rank
+ }[],
+ }[],
+ memberCount
+ },
+}
+
export interface Tag {
label: string;
}
diff --git a/static/src/app/services/army-service/army.service.ts b/static/src/app/services/army-service/army.service.ts
new file mode 100644
index 0000000..e940021
--- /dev/null
+++ b/static/src/app/services/army-service/army.service.ts
@@ -0,0 +1,19 @@
+import {Injectable} from "@angular/core";
+import {AppConfig} from "../../app.config";
+import {Http} from "@angular/http";
+
+
+@Injectable()
+export class ArmyService {
+
+ constructor(private http: Http,
+ private config: AppConfig) {
+ }
+
+ getArmy() {
+ return this.http.get(this.config.apiUrl + this.config.apiOverviewPath)
+ .map(res => res.json());
+ }
+
+}
+