Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
strudelv2_spa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
strudelv2_spa
Commits
9dce3905
Commit
9dce3905
authored
5 years ago
by
Chris Hines
Browse files
Options
Downloads
Patches
Plain Diff
fix identity managment observables (a bit, more work to be done)
parent
fdad4f55
No related branches found
No related tags found
3 merge requests
!106
if stat fails, display the error instead of immediately refreshing...
,
!99
Dev
,
!44
Dev
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/app/app.component.ts
+2
-2
2 additions, 2 deletions
src/app/app.component.ts
src/app/computesites.service.ts
+8
-7
8 additions, 7 deletions
src/app/computesites.service.ts
src/app/launcher/launcher.component.ts
+8
-7
8 additions, 7 deletions
src/app/launcher/launcher.component.ts
with
18 additions
and
16 deletions
src/app/app.component.ts
+
2
−
2
View file @
9dce3905
...
...
@@ -45,10 +45,10 @@ export class AppComponent {
this
.
settingsService
.
theme$
.
subscribe
((
v
)
=>
this
.
setTheme
(
v
))
this
.
authService
.
loggedInAuthZ
.
pipe
(
isdefined
).
subscribe
((
v
)
=>
{
console
.
log
(
'
update this.loggedin
'
);
this
.
loggedin
=
(
<
[]
>
v
).
length
}
);
).
subscribe
((
v
)
=>
{
console
.
log
(
'
update this.loggedin
'
);
this
.
loggedin
=
(
<
[]
>
v
).
length
;
console
.
log
(
this
.
loggedin
)
}
);
this
.
authService
.
loggedOutAuthZ
.
pipe
(
isdefined
).
subscribe
((
v
)
=>
{
console
.
log
(
'
update this.loggedout
'
);
this
.
loggedout
=
(
<
[]
>
v
).
length
}
);
).
subscribe
((
v
)
=>
{
console
.
log
(
'
update this.loggedout
'
);
this
.
loggedout
=
(
<
[]
>
v
).
length
;
console
.
log
(
this
.
loggedout
)
}
);
}
toggleMenu
()
{
...
...
This diff is collapsed.
Click to expand it.
src/app/computesites.service.ts
+
8
−
7
View file @
9dce3905
...
...
@@ -2,8 +2,8 @@ import { Injectable } from '@angular/core';
import
{
Computesite
,
Strudelapp
}
from
'
./computesite
'
;
import
{
BehaviorSubject
,
of
,
combineLatest
}
from
'
rxjs
'
;
import
{
HttpClientModule
,
HttpClient
,
HttpHeaders
,
HttpErrorResponse
}
from
'
@angular/common/http
'
;
import
{
Observable
}
from
'
rxjs
/Observable
'
;
import
{
catchError
,
map
,
tap
}
from
'
rxjs/operators
'
;
import
{
Observable
}
from
'
rxjs
'
;
import
{
catchError
,
map
,
tap
,
filter
}
from
'
rxjs/operators
'
;
import
{
Identity
}
from
'
./identity
'
;
import
{
TesService
}
from
'
./tes.service
'
;
import
{
AuthorisationService
}
from
'
./authorisation.service
'
;
...
...
@@ -29,7 +29,8 @@ export class ComputesitesService {
//this.computesites.subscribe(computesites => this.getStrudelApps(computesites))
this
.
computesites
.
subscribe
((
cs
)
=>
this
.
authorisationService
.
updateAgentContents
());
this
.
authorisationService
.
agentContents
.
subscribe
(
ac
=>
this
.
updateIdentities
(
ac
));
combineLatest
([
this
.
authorisationService
.
agentContents
,
this
.
computesites
.
pipe
(
filter
((
v
)
=>
v
!==
[]))])
.
subscribe
(([
ac
,
computesites
])
=>
this
.
updateIdentities
(
ac
,
computesites
));
this
.
identities
.
subscribe
((
ids
)
=>
this
.
getStrudelAppsIds
(
ids
))
this
.
getComputeSites
();
}
...
...
@@ -188,8 +189,8 @@ export class ComputesitesService {
return
[];
}
private
updateIdentities
(
resp
)
{
let
certs
=
resp
;
private
updateIdentities
(
agentContents
,
computesites
)
{
let
certs
=
agentContents
;
var
cs
:
Computesite
;
var
identities
:
Identity
[]
=
[];
var
appidentities
:
Identity
[]
=
[];
...
...
@@ -197,10 +198,10 @@ export class ComputesitesService {
// If the agent contents is set to null we are probably still updating it
console
.
log
(
'
updateIdentities ... check your subscriptions
'
);
if
(
resp
==
null
)
{
if
(
agentContents
==
null
)
{
return
}
for
(
cs
of
this
.
computesites
.
value
)
{
for
(
cs
of
computesites
)
{
for
(
let
i
in
certs
)
{
let
principals
=
this
.
siteMatch
(
certs
[
i
],
cs
);
for
(
let
principal
of
principals
)
{
...
...
This diff is collapsed.
Click to expand it.
src/app/launcher/launcher.component.ts
+
8
−
7
View file @
9dce3905
...
...
@@ -69,13 +69,10 @@ export class LauncherComponent implements OnInit {
private
strudelappsService
:
StrudelappsService
,
private
settingsService
:
SettingsService
,
)
{
this
.
subscriptions
=
[];
this
.
subscriptions
.
push
(
this
.
authService
.
sshAuthzServers
.
subscribe
(
o
=>
{
this
.
updateSshAuthZServers
(
o
)}));
this
.
subscriptions
.
push
(
this
.
computeSitesService
.
identities
.
subscribe
(
o
=>
this
.
navLogin
(
o
)));
this
.
subscriptions
.
push
(
this
.
computeSitesService
.
appidentities
.
subscribe
(
o
=>
this
.
getHealth
(
o
)));
this
.
app$
=
new
BehaviorSubject
<
Strudelapp
>
(
null
);
this
.
identity$
=
new
BehaviorSubject
<
Identity
>
(
null
);
this
.
identity
=
null
;
this
.
app$
=
new
BehaviorSubject
<
Strudelapp
>
(
null
);
this
.
identity$
=
new
BehaviorSubject
<
Identity
>
(
null
);
this
.
identity
=
null
;
//this.quotas = new BehaviorSubject<any[]>([]);
}
...
...
@@ -167,6 +164,10 @@ export class LauncherComponent implements OnInit {
//this.route.paramMap.subscribe((params: ParamMap) => this.updateIdApp(params));
// if the conents of the ssh agent changes we will get a whole new set of identity objects. In that case we must update out id subject
this
.
computeSitesService
.
appidentities
.
pipe
(
notNull
).
subscribe
(
(
appidentities
)
=>
this
.
refreshId
(
<
Identity
[]
>
appidentities
));
this
.
subscriptions
=
[];
this
.
subscriptions
.
push
(
this
.
authService
.
sshAuthzServers
.
subscribe
(
o
=>
{
this
.
updateSshAuthZServers
(
o
)}));
this
.
subscriptions
.
push
(
this
.
computeSitesService
.
identities
.
subscribe
(
o
=>
this
.
navLogin
(
o
)));
this
.
subscriptions
.
push
(
this
.
computeSitesService
.
appidentities
.
subscribe
(
o
=>
this
.
getHealth
(
o
)));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment