-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: Add LOGS tab in Trial details page
In this commit: * Create a distinct LOGS tab, which displays the trial's logs in the Trial details page. * Don't show the backend's error popup for logs, but show the message error in the admonition. Signed-off-by: Elena Zioga <elena@arrikto.com>
- Loading branch information
Showing
10 changed files
with
173 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
.../pages/experiment-details/trials-table/trial-details/trial-logs/trial-logs.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!--if no logs are present at all then show a warning message--> | ||
<ng-container *ngIf="logsRequestError"> | ||
<lib-panel icon="error" color="warn"> | ||
Error: {{ logsRequestError }} | ||
</lib-panel> | ||
</ng-container> | ||
|
||
<ng-container *ngIf="!logsRequestError"> | ||
<lib-logs-viewer | ||
class="logs-viewer" | ||
heading="Trial Logs" | ||
[subHeading]="''" | ||
[logs]="logs" | ||
></lib-logs-viewer> | ||
</ng-container> |
9 changes: 9 additions & 0 deletions
9
.../pages/experiment-details/trials-table/trial-details/trial-logs/trial-logs.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
lib-panel { | ||
display: block; | ||
margin-top: 1rem; | ||
} | ||
|
||
.logs-viewer { | ||
margin-bottom: 2rem; | ||
margin-top: 1rem; | ||
} |
36 changes: 36 additions & 0 deletions
36
...ges/experiment-details/trials-table/trial-details/trial-logs/trial-logs.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { | ||
HeadingSubheadingRowModule, | ||
KubeflowModule, | ||
LogsViewerModule, | ||
} from 'kubeflow'; | ||
|
||
import { TrialLogsComponent } from './trial-logs.component'; | ||
|
||
describe('TrialLogsComponent', () => { | ||
let component: TrialLogsComponent; | ||
let fixture: ComponentFixture<TrialLogsComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [TrialLogsComponent], | ||
imports: [ | ||
CommonModule, | ||
KubeflowModule, | ||
HeadingSubheadingRowModule, | ||
LogsViewerModule, | ||
], | ||
}).compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(TrialLogsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
...pp/pages/experiment-details/trials-table/trial-details/trial-logs/trial-logs.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-trial-logs', | ||
templateUrl: './trial-logs.component.html', | ||
styleUrls: ['./trial-logs.component.scss'], | ||
}) | ||
export class TrialLogsComponent { | ||
public logs: string[]; | ||
|
||
@Input() logsRequestError: string; | ||
|
||
@Input() | ||
set trialLogs(trialLogs: string) { | ||
if (!trialLogs) { | ||
return; | ||
} | ||
|
||
const arrayOfLogs = trialLogs.split('\n'); | ||
this.logs = arrayOfLogs; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...c/app/pages/experiment-details/trials-table/trial-details/trial-logs/trial-logs.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { TrialLogsComponent } from './trial-logs.component'; | ||
import { | ||
HeadingSubheadingRowModule, | ||
KubeflowModule, | ||
LogsViewerModule, | ||
} from 'kubeflow'; | ||
|
||
@NgModule({ | ||
declarations: [TrialLogsComponent], | ||
imports: [ | ||
CommonModule, | ||
KubeflowModule, | ||
HeadingSubheadingRowModule, | ||
LogsViewerModule, | ||
], | ||
exports: [TrialLogsComponent], | ||
}) | ||
export class TrialLogsModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters