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
9efc4f0a
Commit
9efc4f0a
authored
6 years ago
by
Chris Hines
Browse files
Options
Downloads
Patches
Plain Diff
convert to a reduced set of parameters for stat
parent
1b6d4d0d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/authorisation.service.ts
+3
-3
3 additions, 3 deletions
src/app/authorisation.service.ts
src/app/tes.service.ts
+15
-23
15 additions, 23 deletions
src/app/tes.service.ts
with
18 additions
and
26 deletions
src/app/authorisation.service.ts
+
3
−
3
View file @
9efc4f0a
...
@@ -268,12 +268,12 @@ public getKeys(id?: Identity) {
...
@@ -268,12 +268,12 @@ public getKeys(id?: Identity) {
private
httperror
(
error
:
any
)
{
private
httperror
(
error
:
any
)
{
console
.
log
(
'
authorsation service got an error
'
);
console
.
log
(
'
authorsation service got an error
'
);
this
.
statusMsg
.
next
(
error
);
this
.
statusMsg
.
next
(
'
There was an error logging in or generating crypto tokens
'
);
console
.
log
(
error
);
console
.
error
(
error
);
}
}
private
httperrorLogout
(
error
:
any
,
sshauthzservice
:
SshAuthzServer
)
{
private
httperrorLogout
(
error
:
any
,
sshauthzservice
:
SshAuthzServer
)
{
console
.
log
(
'
authorsation service got an error
'
);
console
.
log
(
'
authorsation service got an error
'
);
this
.
statusMsg
.
next
(
error
);
this
.
statusMsg
.
next
(
'
There was an error logging out and clearing all tokens
'
);
console
.
log
(
error
);
console
.
log
(
error
);
if
(
!
(
sshauthzservice
.
logout
===
null
))
{
if
(
!
(
sshauthzservice
.
logout
===
null
))
{
window
.
open
(
sshauthzservice
.
logout
);
window
.
open
(
sshauthzservice
.
logout
);
...
...
This diff is collapsed.
Click to expand it.
src/app/tes.service.ts
+
15
−
23
View file @
9efc4f0a
...
@@ -102,7 +102,7 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
...
@@ -102,7 +102,7 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
this
.
statusMsg
.
next
(
"
A network error occured. Please try again latter
"
);
this
.
statusMsg
.
next
(
"
A network error occured. Please try again latter
"
);
return
return
}
}
console
.
log
(
error
);
console
.
error
(
error
);
if
(
error
.
status
==
404
||
error
.
status
==
400
)
{
if
(
error
.
status
==
404
||
error
.
status
==
400
)
{
this
.
statusMsg
.
next
(
"
Login expired. Please log in again.
"
);
this
.
statusMsg
.
next
(
"
Login expired. Please log in again.
"
);
this
.
authorisationService
.
updateAgentContents
();
this
.
authorisationService
.
updateAgentContents
();
...
@@ -123,26 +123,16 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
...
@@ -123,26 +123,16 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
let
bi
=
new
BatchInterface
();
let
bi
=
new
BatchInterface
();
bi
.
cancelcmd
=
identity
.
site
.
cancelcmd
;
bi
.
cancelcmd
=
identity
.
site
.
cancelcmd
;
bi
.
statcmd
=
identity
.
site
.
statcmd
;
bi
.
statcmd
=
identity
.
site
.
statcmd
;
// if (this.batchinterface[identity.repr()] === undefined) {
let
params
=
new
URLSearchParams
();
// this.getconfig(new Strudelapp(),identity)
params
.
set
(
'
statcmd
'
,
JSON
.
stringify
(
identity
.
site
.
statcmd
));
// // .pipe(catchError(this.handleError))
params
.
set
(
'
host
'
,
JSON
.
stringify
(
identity
.
site
.
host
));
// .subscribe(resp => { this.batchinterface[identity.repr()] = resp; this.getJobs(identity) },
params
.
set
(
'
username
'
,
JSON
.
stringify
(
identity
.
username
));
// error => this.getBatchInterfaceError(error));
console
.
log
(
'
getjob with params
'
,
params
.
toString
());
// // error => this.getJobsError(error,identity));
//
this
.
http
.
get
<
Job
[]
>
(
this
.
Base
+
'
/stat
'
+
'
?
'
+
params
.
toString
(),
options
)
//
// .pipe(catchError(this.networkError))
// } else {
.
subscribe
(
resp
=>
this
.
updateJoblist
(
resp
,
identity
),
// let paramstr = this.buildParams(null,identity,this.batchinterface[identity.repr()]);
error
=>
this
.
getJobsError
(
error
));
// this.http.get<Job[]>(this.Base+'/stat'+'?'+paramstr,options)
// // .pipe(catchError(this.networkError))
// .subscribe(resp => this.updateJoblist(resp, identity),
// error => this.getJobsError(error));
// }
let
paramstr
=
this
.
buildParams
(
null
,
identity
,
bi
);
this
.
http
.
get
<
Job
[]
>
(
this
.
Base
+
'
/stat
'
+
'
?
'
+
paramstr
,
options
)
// .pipe(catchError(this.networkError))
.
subscribe
(
resp
=>
this
.
updateJoblist
(
resp
,
identity
),
error
=>
this
.
getJobsError
(
error
));
}
}
public
getconfig
(
app
:
Strudelapp
,
identity
:
Identity
):
Observable
<
any
>
{
public
getconfig
(
app
:
Strudelapp
,
identity
:
Identity
):
Observable
<
any
>
{
...
@@ -154,7 +144,9 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
...
@@ -154,7 +144,9 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
submissionError
(
error
:
any
)
{
submissionError
(
error
:
any
)
{
if
(
error
.
status
!=
0
)
{
if
(
error
.
status
!=
0
)
{
this
.
statusMsg
.
next
(
error
.
error
.
message
);
this
.
statusMsg
.
next
(
'
Job submission failed
'
);
//this.statusMsg.next(error.error.message);
console
.
error
(
error
.
error
.
message
);
this
.
busy
.
next
(
false
);
this
.
busy
.
next
(
false
);
}
}
}
}
...
@@ -276,7 +268,6 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
...
@@ -276,7 +268,6 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
});
});
this
.
appwindowWatcher
=
timer
(
500
).
pipe
(
repeat
()).
subscribe
(()
=>
this
.
watchAppwindow
(
this
.
appwindow
,
dialogRef
));
this
.
appwindowWatcher
=
timer
(
500
).
pipe
(
repeat
()).
subscribe
(()
=>
this
.
watchAppwindow
(
this
.
appwindow
,
dialogRef
));
// this.appwindow.location.assign(windowloc);
// this.appwindow.location.assign(windowloc);
this
.
appwindow
.
focus
();
}
}
public
connect
(
job
:
Job
,
appinst
?:
any
)
{
public
connect
(
job
:
Job
,
appinst
?:
any
)
{
...
@@ -335,6 +326,7 @@ private httperror(errorstr: string) {
...
@@ -335,6 +326,7 @@ private httperror(errorstr: string) {
let
searchresult
=
errorstr
.
search
(
re
);
let
searchresult
=
errorstr
.
search
(
re
);
if
(
searchresult
!=
-
1
)
{
if
(
searchresult
!=
-
1
)
{
this
.
statusMsg
.
next
(
"
Some authentication tokens have expired, you may need to log in again
"
);
this
.
statusMsg
.
next
(
"
Some authentication tokens have expired, you may need to log in again
"
);
console
.
error
(
errorstr
);
this
.
authorisationService
.
updateAgentContents
();
this
.
authorisationService
.
updateAgentContents
();
}
}
console
.
error
(
errorstr
);
console
.
error
(
errorstr
);
...
...
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