Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Tabu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dennis Willers
Tabu
Commits
ed45d4a5
Commit
ed45d4a5
authored
Dec 28, 2020
by
Dennis Willers
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Durchstich zur Middleware - Datenbankverbindung
Fehlerfix, bzw. so das die App wieder läuft
parent
7c9f731f
Pipeline
#271
passed with stages
in 7 minutes and 25 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
67 additions
and
23 deletions
+67
-23
app.module.ts
src/app/app.module.ts
+2
-0
TabuMiddlewareService.ts
src/app/dao/TabuMiddlewareService.ts
+32
-0
error.component.html
src/app/error/error.component.html
+1
-1
overview.component.html
src/app/overview/overview.component.html
+10
-12
select-game.component.html
src/app/select-game/select-game.component.html
+6
-4
select-game.component.scss
src/app/select-game/select-game.component.scss
+4
-0
select-game.component.ts
src/app/select-game/select-game.component.ts
+8
-4
environment.prod.ts
src/environments/environment.prod.ts
+2
-1
environment.ts
src/environments/environment.ts
+2
-1
No files found.
src/app/app.module.ts
View file @
ed45d4a5
import
{
BrowserModule
}
from
'
@angular/platform-browser
'
;
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
HttpClientModule
}
from
'
@angular/common/http
'
;
import
{
AppRoutingModule
}
from
'
./app-routing.module
'
;
import
{
AppComponent
}
from
'
./app.component
'
;
...
...
@@ -27,6 +28,7 @@ import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
ErrorComponent
,
],
imports
:
[
HttpClientModule
,
BrowserModule
,
AppRoutingModule
,
BrowserAnimationsModule
,
...
...
src/app/dao/TabuMiddlewareService.ts
0 → 100644
View file @
ed45d4a5
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
environment
}
from
'
../../environments/environment
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
TabuMiddlewareService
{
constructor
(
private
http
:
HttpClient
)
{
}
private
async
request
(
method
:
string
,
url
:
string
,
data
?:
any
):
Promise
<
any
>
{
const
result
=
this
.
http
.
request
(
method
,
url
,
{
body
:
data
,
responseType
:
'
json
'
,
observe
:
'
body
'
,
});
return
new
Promise
((
resolve
,
reject
)
=>
{
result
.
subscribe
(
resolve
,
reject
);
});
}
getSpielSessions
():
Promise
<
any
>
{
return
this
.
request
(
'
GET
'
,
`
${
environment
.
tabuMiddlewareURL
}
SpielSession`
);
}
addSpielSession
(
event
:
any
):
Promise
<
any
>
{
return
this
.
request
(
'
POST
'
,
`
${
environment
.
tabuMiddlewareURL
}
addSpielSession`
,
event
);
}
}
src/app/error/error.component.html
View file @
ed45d4a5
...
...
@@ -3,7 +3,7 @@
Leider konnte die Seite nicht erreicht werden, bitte überprüfen Sie den Link oder kehren Sie auf die
<a
href=
"router.navigate(['/overview'])"
>
Startseite
</a>
zurück
</h3>
<br>
<mat-progress-spinner
color=
"primary"
mode=
"
mod
e"
value=
"value"
>
<mat-progress-spinner
color=
"primary"
mode=
"
determinat
e"
value=
"value"
>
</mat-progress-spinner>
</div>
...
...
src/app/overview/overview.component.html
View file @
ed45d4a5
...
...
@@ -7,18 +7,16 @@
<mat-card-title>
Spielstand
</mat-card-title>
<mat-card-content>
<br>
<center>
<table>
<tr>
<th>
Team rot
</th>
<th>
Team blau
</th>
</tr>
<tr>
<th>
0
</th>
<th>
0
</th>
</tr>
</table>
</center>
<table
style=
"align-self: center; align-content: center; align-items: center"
>
<tr>
<th>
Team rot
</th>
<th>
Team blau
</th>
</tr>
<tr>
<th>
0
</th>
<th>
0
</th>
</tr>
</table>
</mat-card-content>
<mat-card-actions>
<br>
...
...
src/app/select-game/select-game.component.html
View file @
ed45d4a5
<div
style=
"text-align: center; margin-left: 15em; margin-right: 15em; margin-top: 5em;"
>
<h1>
Willkommen bei Tabu im Online-Multiplayer-Modus
</h1>
<h2>
Ideal im Lockdown!
</h2>
<mat-card
class=
"transparent"
>
<h1>
Willkommen bei Tabu im Online-Multiplayer-Modus
</h1>
<h2>
Ideal im Lockdown!
</h2>
</mat-card>
<br>
<br>
<br>
<mat-card>
<mat-card
class=
"transparent"
>
<mat-card-title>
Spielsuche
</mat-card-title>
<mat-card-subtitle>
Finde ein Spiel über den Spielnamen oder erstelle ein neues
</mat-card-subtitle>
<mat-card-content>
...
...
@@ -16,7 +18,7 @@
</form>
</mat-card-content>
<mat-card-actions>
<button
mat-raised-button
color=
"primary"
>
Spiel erstellen
</button>
<button
mat-raised-button
color=
"primary"
(click)=
"getSpielSessions()"
>
Spiel erstellen
</button>
<button
mat-raised-button
color=
"primary"
(click)=
"joinGame($event)"
>
Spiel beitreten
</button>
</mat-card-actions>
</mat-card>
...
...
src/app/select-game/select-game.component.scss
View file @
ed45d4a5
...
...
@@ -7,3 +7,7 @@
.example-full-width
{
width
:
100%
;
}
.transparent
{
opacity
:
90%
;
}
src/app/select-game/select-game.component.ts
View file @
ed45d4a5
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
TabuMiddlewareService
}
from
'
../dao/TabuMiddlewareService
'
;
@
Component
({
selector
:
'
app-select-game
'
,
...
...
@@ -8,16 +9,19 @@ import {Router} from '@angular/router';
})
export
class
SelectGameComponent
implements
OnInit
{
constructor
(
private
router
:
Router
)
{
}
constructor
(
private
router
:
Router
,
private
server
:
TabuMiddlewareService
)
{
}
ngOnInit
():
void
{
}
getSpielname
(
event
:
any
):
void
{
event
.
target
.
value
;
getSpielSessions
():
any
{
console
.
log
(
'
Start
'
)
const
response
=
this
.
server
.
getSpielSessions
();
console
.
log
(
'
Response:
'
,
response
);
}
joinGame
(
event
:
any
):
void
{
joinGame
(
event
:
any
):
void
{
this
.
router
.
navigate
([
'
/overview
'
]);
}
}
src/environments/environment.prod.ts
View file @
ed45d4a5
export
const
environment
=
{
production
:
true
production
:
true
,
tabuMiddlewareURL
:
'
http://192.168.0.50:3150/
'
};
src/environments/environment.ts
View file @
ed45d4a5
...
...
@@ -3,7 +3,8 @@
// The list of file replacements can be found in `angular.json`.
export
const
environment
=
{
production
:
false
production
:
false
,
tabuMiddlewareURL
:
'
http://192.168.0.50:3150/
'
};
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment