Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hpc-team
strudelv2_spa
Commits
e13fd70f
Commit
e13fd70f
authored
Jul 25, 2019
by
Chris Hines
Browse files
add titles to the tables of user information
parent
a709c844
Pipeline
#7535
passed with stages
in 3 minutes and 6 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/app/computesite.ts
View file @
e13fd70f
...
@@ -39,4 +39,5 @@ export class Health {
...
@@ -39,4 +39,5 @@ export class Health {
msg
:
string
;
msg
:
string
;
type
:
string
;
type
:
string
;
data
:
any
;
data
:
any
;
title
:
string
;
}
}
src/app/identity.ts
View file @
e13fd70f
...
@@ -16,8 +16,8 @@ export class Identity {
...
@@ -16,8 +16,8 @@ export class Identity {
this
.
username
=
username
;
this
.
username
=
username
;
this
.
site
=
site
;
this
.
site
=
site
;
this
.
keyCerts
=
[];
this
.
keyCerts
=
[];
this
.
systemalerts
=
new
BehaviorSubject
<
Health
[]
>
(
[]
);
this
.
systemalerts
=
new
BehaviorSubject
<
Health
[]
>
(
null
);
this
.
accountalerts
=
new
BehaviorSubject
<
Health
[]
>
(
[]
);
this
.
accountalerts
=
new
BehaviorSubject
<
Health
[]
>
(
null
);
this
.
joblist
=
new
BehaviorSubject
<
Job
[]
>
([]);
this
.
joblist
=
new
BehaviorSubject
<
Job
[]
>
([]);
this
.
quotas
=
[];
this
.
quotas
=
[];
}
}
...
...
src/app/launcher/launcher.component.html
View file @
e13fd70f
...
@@ -50,17 +50,19 @@
...
@@ -50,17 +50,19 @@
<mat-sidenav-content>
<mat-sidenav-content>
<div
fxLayout=
"column"
style=
"height: 100%"
>
<div
fxLayout=
"column"
style=
"height: 100%"
>
<div
*ngIf=
"identitySubject | async as id"
>
<!-- the list of warning either on the computer system or the users account -->
<!-- the list of warning either on the computer system or the users account -->
<div
*ngIf=
"(identitySubject | async) !== null && (appSubject | async) === null"
>
<div
*ngIf=
"id !== null && (appSubject | async) === null"
>
<div
*ngIf=
"countErrors(((identitySubject | async).systemalerts | async),((identitySubject | async).accountalerts | async)) == 0; then noAlerts else displayAlerts"
></div>
<ng-template
#noAlerts
><h2>
No Alerts for {{ (identitySubject | async).displayName() }}
</h2></ng-template>
<div
*ngIf=
"(id.systemalerts | async) == null || (id.accountalerts | async) == null; then loading else displayAlerts"
></div>
<ng-template
#loading
><h2>
Loading ...
</h2></ng-template>
<ng-template
#displayAlerts
>
<ng-template
#displayAlerts
>
<h2>
Alerts for {{ (identitySubject | async).displayName() }}
</h2>
<!-- This is all the system level alerts-->
<!-- This is all the system level alerts-->
<mat-list>
<mat-list>
<div
*ngFor=
"let h of
(
(id
entitySubject | async)
.systemalerts | async)"
>
<div
*ngFor=
"let h of (id.systemalerts | async)"
>
<mat-list-item>
<mat-list-item>
<div
*ngIf=
"h.stat == 'error'"
>
<div
*ngIf=
"h.stat == 'error'"
>
<div
class=
'health-warn'
>
<div
class=
'health-warn'
>
...
@@ -81,6 +83,7 @@
...
@@ -81,6 +83,7 @@
</mat-list-item>
</mat-list-item>
</div>
</div>
<div
*ngIf=
"h.type == 'table'"
>
<div
*ngIf=
"h.type == 'table'"
>
<h3>
{{ h.title }}
</h3>
<table
mat-table
[dataSource]=
"h.data.rows"
style=
"width: 100%"
>
<table
mat-table
[dataSource]=
"h.data.rows"
style=
"width: 100%"
>
<ng-container
*ngFor=
"let c of h.data.cols"
matColumnDef=
"{{c.key}}"
>
<ng-container
*ngFor=
"let c of h.data.cols"
matColumnDef=
"{{c.key}}"
>
<th
mat-header-cell
*matHeaderCellDef
>
{{ c.header }}
</th>
<th
mat-header-cell
*matHeaderCellDef
>
{{ c.header }}
</th>
...
@@ -101,6 +104,7 @@
...
@@ -101,6 +104,7 @@
<app-joblist
[identitySubject]=
"identitySubject"
[appSubject]=
"appSubject"
></app-joblist>
<app-joblist
[identitySubject]=
"identitySubject"
[appSubject]=
"appSubject"
></app-joblist>
</div>
</div>
</div>
</div>
</div>
</mat-sidenav-content>
</mat-sidenav-content>
...
...
src/app/launcher/launcher.component.ts
View file @
e13fd70f
...
@@ -77,20 +77,24 @@ export class LauncherComponent implements OnInit {
...
@@ -77,20 +77,24 @@ export class LauncherComponent implements OnInit {
countErrors
(
a
:
Health
[],
b
:
Health
[])
{
countErrors
(
a
:
Health
[],
b
:
Health
[])
{
var
count
:
number
=
0
var
count
:
number
=
0
var
h
:
Health
;
var
h
:
Health
;
for
(
h
of
a
)
{
if
(
a
!=
null
)
{
if
(
h
.
stat
==
'
error
'
||
h
.
stat
==
'
warn
'
)
{
for
(
h
of
a
)
{
count
++
;
if
(
h
.
stat
==
'
error
'
||
h
.
stat
==
'
warn
'
)
{
}
count
++
;
if
(
!
isNaN
(
parseInt
(
h
.
stat
)))
{
}
count
=
count
+
parseInt
(
h
.
stat
);
if
(
!
isNaN
(
parseInt
(
h
.
stat
)))
{
count
=
count
+
parseInt
(
h
.
stat
);
}
}
}
}
}
for
(
h
of
b
)
{
if
(
b
!=
null
)
{
if
(
h
.
stat
==
'
error
'
||
h
.
stat
==
'
warn
'
)
{
for
(
h
of
b
)
{
count
++
;
if
(
h
.
stat
==
'
error
'
||
h
.
stat
==
'
warn
'
)
{
}
count
++
;
if
(
!
isNaN
(
parseInt
(
h
.
stat
)))
{
}
count
=
count
+
parseInt
(
h
.
stat
);
if
(
!
isNaN
(
parseInt
(
h
.
stat
)))
{
count
=
count
+
parseInt
(
h
.
stat
);
}
}
}
}
}
return
count
;
return
count
;
...
@@ -154,12 +158,6 @@ export class LauncherComponent implements OnInit {
...
@@ -154,12 +158,6 @@ export class LauncherComponent implements OnInit {
this
.
identitySubject
.
next
(
id
);
this
.
identitySubject
.
next
(
id
);
this
.
appSubject
.
next
(
null
);
this
.
appSubject
.
next
(
null
);
if
(
id
!=
null
)
{
for
(
let
a
of
id
.
accountalerts
.
value
)
{
console
.
log
(
'
acocunt alert
'
);
console
.
log
(
a
);
}
}
//if (id != null) {
//if (id != null) {
// We will subscribe to account alerts until the id changes (in which case we will subscribe to account alerts
// We will subscribe to account alerts until the id changes (in which case we will subscribe to account alerts
// on the next id
// on the next id
...
...
src/app/tes.service.ts
View file @
e13fd70f
...
@@ -228,6 +228,7 @@ getUserHealth(identity: Identity) {
...
@@ -228,6 +228,7 @@ getUserHealth(identity: Identity) {
return
return
}
}
if
(
identity
.
site
.
userhealth
===
undefined
)
{
if
(
identity
.
site
.
userhealth
===
undefined
)
{
identity
.
accountalerts
.
next
([]);
return
return
}
}
params
.
set
(
'
statcmd
'
,
JSON
.
stringify
(
identity
.
site
.
userhealth
));
params
.
set
(
'
statcmd
'
,
JSON
.
stringify
(
identity
.
site
.
userhealth
));
...
@@ -240,8 +241,8 @@ getUserHealth(identity: Identity) {
...
@@ -240,8 +241,8 @@ getUserHealth(identity: Identity) {
}
}
getHealthAlerts
(
identity
:
Identity
)
{
getHealthAlerts
(
identity
:
Identity
)
{
identity
.
accountalerts
.
next
(
[]
);
identity
.
accountalerts
.
next
(
null
);
identity
.
systemalerts
.
next
(
[]
);
identity
.
systemalerts
.
next
(
null
);
this
.
getCachetIncidents
(
identity
);
this
.
getCachetIncidents
(
identity
);
this
.
getUserHealth
(
identity
);
this
.
getUserHealth
(
identity
);
}
}
...
@@ -253,6 +254,7 @@ getCachetIncidents(identity: Identity) {
...
@@ -253,6 +254,7 @@ getCachetIncidents(identity: Identity) {
let
params
=
new
URLSearchParams
();
let
params
=
new
URLSearchParams
();
if
(
identity
.
site
.
cacheturis
===
undefined
||
identity
.
site
.
cacheturis
.
length
==
0
)
{
if
(
identity
.
site
.
cacheturis
===
undefined
||
identity
.
site
.
cacheturis
.
length
==
0
)
{
identity
.
systemalerts
.
next
([]);
return
return
}
}
for
(
let
uri
of
identity
.
site
.
cacheturis
)
{
for
(
let
uri
of
identity
.
site
.
cacheturis
)
{
...
@@ -264,6 +266,9 @@ getCachetIncidents(identity: Identity) {
...
@@ -264,6 +266,9 @@ getCachetIncidents(identity: Identity) {
addCachetIncidents
(
identity
,
resp
)
{
addCachetIncidents
(
identity
,
resp
)
{
let
ci
=
identity
.
systemalerts
.
value
;
let
ci
=
identity
.
systemalerts
.
value
;
if
(
ci
==
null
)
{
ci
=
[]
}
for
(
let
i
of
resp
.
data
)
{
for
(
let
i
of
resp
.
data
)
{
if
(
i
.
status
==
3
||
i
.
status
==
4
)
{
if
(
i
.
status
==
3
||
i
.
status
==
4
)
{
continue
;
continue
;
...
@@ -278,11 +283,17 @@ addCachetIncidents(identity,resp) {
...
@@ -278,11 +283,17 @@ addCachetIncidents(identity,resp) {
addUserHealth
(
identity
,
resp
)
{
addUserHealth
(
identity
,
resp
)
{
let
ci
=
identity
.
accountalerts
.
value
;
let
ci
=
identity
.
accountalerts
.
value
;
if
(
ci
==
null
)
{
ci
=
[]
}
console
.
log
(
'
in add User HEalth
'
);
console
.
log
(
'
in add User HEalth
'
);
for
(
let
i
of
resp
)
{
for
(
let
i
of
resp
)
{
let
h
=
new
Health
();
let
h
=
new
Health
();
h
.
stat
=
i
.
stat
;
h
.
stat
=
i
.
stat
;
h
.
msg
=
i
.
message
;
h
.
msg
=
i
.
message
;
if
(
i
.
title
!=
undefined
)
{
h
.
title
=
i
.
title
;
}
if
(
i
.
type
!=
undefined
)
{
if
(
i
.
type
!=
undefined
)
{
h
.
type
=
i
.
type
;
h
.
type
=
i
.
type
;
h
.
data
=
i
.
data
;
h
.
data
=
i
.
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