Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalWebpage
Commits
e5ea83b6
Commit
e5ea83b6
authored
Mar 01, 2018
by
Lukas Burgey
Browse files
Adapt to an API change
parent
497c54e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/mgmt/mgmt.component.html
View file @
e5ea83b6
<div
*ngIf=
"userService.loggedIn"
>
<h4>
Services
</h4>
<div
*ngIf=
"userService.
state.
services.length > 0"
>
<div
*ngIf=
"userService.services.length > 0"
>
<mat-accordion>
<app-service
*ngFor=
"let service of userService.
state.
services"
<app-service
*ngFor=
"let service of userService.services"
[serviceData]=
"service"
></app-service>
</mat-accordion>
</div>
<p
*ngIf=
"userService.
state.
services?.length == 0"
>
<p
*ngIf=
"userService.services?.length == 0"
>
You have no available services.
<br/>
This is due services requiring users to be member of a certain group.
</p>
...
...
src/app/user.service.ts
View file @
e5ea83b6
...
...
@@ -39,17 +39,13 @@ interface User {
deployments
:
Deployment
[];
}
interface
State
{
services
:
Service
[];
}
interface
StateAPI
{
s
tate
:
State
;
s
ervices
:
Service
[]
;
logged_in
:
boolean
;
}
interface
StateAPIUser
{
s
tate
:
State
;
s
ervices
:
Service
[]
;
logged_in
:
boolean
;
user
:
User
;
}
...
...
@@ -68,7 +64,6 @@ interface AuthInfo {
@
Injectable
()
export
class
UserService
{
public
loggedIn
=
false
;
public
state
:
State
;
public
user
:
User
;
public
sshKeyData
:
MatTableDataSource
<
any
>
;
public
userInfoData
:
MatTableDataSource
<
any
>
;
...
...
@@ -85,9 +80,6 @@ export class UserService {
}
public
logState
()
{
console
.
log
(
this
.
state
,
);
console
.
log
(
this
.
user
,
);
...
...
@@ -112,8 +104,8 @@ export class UserService {
}
this
.
loggedIn
=
data
.
logged_in
;
if
(
!
this
.
s
tate
)
{
this
.
s
tate
=
data
.
s
tate
;
if
(
!
this
.
s
ervices
)
{
this
.
s
ervices
=
data
.
s
ervices
;
}
this
.
user
=
data
.
user
;
...
...
@@ -137,7 +129,8 @@ export class UserService {
this
.
sshKeyData
=
null
;
this
.
userInfoData
=
null
;
}
this
.
logState
();
// this.logState();
}
public
getAuthInfo
()
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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