Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
feudalWebpage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
feudal
feudalWebpage
Commits
7c8e3369
Commit
7c8e3369
authored
Nov 29, 2017
by
Lukas Burgey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove router
parent
43f4a021
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
27 deletions
+8
-27
src/app/app.component.html
src/app/app.component.html
+1
-1
src/app/app.module.ts
src/app/app.module.ts
+4
-0
src/app/user.service.ts
src/app/user.service.ts
+3
-26
No files found.
src/app/app.component.html
View file @
7c8e3369
...
...
@@ -5,6 +5,6 @@
</mat-toolbar>
<div
class=
"outer"
>
<div
class=
"inner"
>
<
router-outlet></router-outle
t>
<
app-mgmt></app-mgm
t>
</div>
</div>
src/app/app.module.ts
View file @
7c8e3369
...
...
@@ -33,6 +33,7 @@ import { ProfileComponent } from './profile/profile.component';
import
{
ServiceComponent
}
from
'
./service/service.component
'
;
import
{
SshKeysComponent
}
from
'
./ssh-keys/ssh-keys.component
'
;
/*
const routes = [
{
path: '',
...
...
@@ -43,6 +44,7 @@ const routes = [
redirectTo: '/',
},
];
*/
@
NgModule
({
declarations
:
[
...
...
@@ -63,9 +65,11 @@ const routes = [
cookieName
:
'
csrftoken
'
,
headerName
:
'
HTTP_X_CSRFTOKEN
'
,
}),
/*
RouterModule.forRoot(
routes,
),
*/
MatButtonModule
,
MatToolbarModule
,
MatTableModule
,
...
...
src/app/user.service.ts
View file @
7c8e3369
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Router
,
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
HttpClient
,
HttpErrorResponse
}
from
'
@angular/common/http
'
;
import
{
Observable
}
from
'
rxjs/Observable
'
;
import
'
rxjs/add/operator/map
'
;
...
...
@@ -65,19 +64,11 @@ export class UserService {
constructor
(
public
router
:
Router
,
public
activatedRoute
:
ActivatedRoute
,
public
cookieService
:
CookieService
,
public
http
:
HttpClient
,
public
snackBar
:
SnackBarService
,
)
{
this
.
errorStatus
().
subscribe
(
(
operational
)
=>
{
if
(
operational
)
{
this
.
update
();
}
}
);
this
.
update
();
}
public
logState
()
{
...
...
@@ -89,19 +80,6 @@ export class UserService {
);
}
public
errorStatus
():
Observable
<
boolean
>
{
return
this
.
activatedRoute
.
params
.
map
(
(
params
)
=>
{
if
(
'
error
'
in
params
)
{
this
.
snackBar
.
open
(
'
Backend error:
'
+
params
[
'
error
'
]);
return
false
;
}
else
{
return
true
;
}
}
);
}
public
backendOperational
():
Observable
<
boolean
>
{
return
this
.
http
.
get
(
'
/backend/api/operational
'
).
map
(
(
data
)
=>
{
...
...
@@ -175,10 +153,9 @@ export class UserService {
}
public
logout
()
{
this
.
http
.
get
(
'
/backend/auth_logout/
'
).
subscribe
(
this
.
http
.
post
(
'
/backend/auth_logout/
'
,
{}
).
subscribe
(
data
=>
{
this
.
update
();
this
.
router
.
navigate
([
''
]);
this
.
updateData
(
data
);
}
);
}
...
...
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