Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mgr/dashboard: Isolate each RBD component
Before when you accessed any RBD component, you were loading all 4 components at the same time and each was doing frequent requests to the server. Now it only loads 1 at a time. Fixes: https://tracker.ceph.com/issues/44278 Signed-off-by: Tiago Melo <tmelo@suse.com>
- Loading branch information
Tiago Melo
committed
Mar 5, 2020
1 parent
03a3355
commit 743f6d6
Showing
19 changed files
with
182 additions
and
112 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
25 changes: 0 additions & 25 deletions
25
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-images/rbd-images.component.html
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-images/rbd-images.component.spec.ts
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-images/rbd-images.component.ts
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.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
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
2 changes: 2 additions & 0 deletions
2
...ashboard/frontend/src/app/ceph/block/rbd-namespace-list/rbd-namespace-list.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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<cd-rbd-tabs></cd-rbd-tabs> | ||
|
||
<cd-table [data]="namespaces" | ||
(fetchData)="refresh()" | ||
columnMode="flex" | ||
|
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
6 changes: 6 additions & 0 deletions
6
.../mgr/dashboard/frontend/src/app/ceph/block/rbd-performance/rbd-performance.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,6 @@ | ||
<cd-rbd-tabs></cd-rbd-tabs> | ||
|
||
<cd-grafana [grafanaPath]="'rbd-overview?'" | ||
uid="41FrpeUiz" | ||
grafanaStyle="two"> | ||
</cd-grafana> |
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
...r/dashboard/frontend/src/app/ceph/block/rbd-performance/rbd-performance.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,31 @@ | ||
import { HttpClientTestingModule } from '@angular/common/http/testing'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
|
||
import { TabsModule } from 'ngx-bootstrap/tabs'; | ||
|
||
import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; | ||
import { SharedModule } from '../../../shared/shared.module'; | ||
import { RbdTabsComponent } from '../rbd-tabs/rbd-tabs.component'; | ||
import { RbdPerformanceComponent } from './rbd-performance.component'; | ||
|
||
describe('RbdPerformanceComponent', () => { | ||
let component: RbdPerformanceComponent; | ||
let fixture: ComponentFixture<RbdPerformanceComponent>; | ||
|
||
configureTestBed({ | ||
imports: [HttpClientTestingModule, RouterTestingModule, SharedModule, TabsModule.forRoot()], | ||
declarations: [RbdPerformanceComponent, RbdTabsComponent], | ||
providers: i18nProviders | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(RbdPerformanceComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
...nd/mgr/dashboard/frontend/src/app/ceph/block/rbd-performance/rbd-performance.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,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'cd-rbd-performance', | ||
templateUrl: './rbd-performance.component.html', | ||
styleUrls: ['./rbd-performance.component.scss'] | ||
}) | ||
export class RbdPerformanceComponent { | ||
constructor() {} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-tabs/rbd-tabs.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,23 @@ | ||
<tabset> | ||
<tab heading="Images" | ||
i18n-heading | ||
[active]="url === '/block/rbd'" | ||
(selectTab)="navigateTo('/block/rbd')"> | ||
</tab> | ||
<tab heading="Namespaces" | ||
i18n-heading | ||
[active]="url === '/block/rbd/namespaces'" | ||
(selectTab)="navigateTo('/block/rbd/namespaces')"> | ||
</tab> | ||
<tab heading="Trash" | ||
i18n-heading | ||
[active]="url === '/block/rbd/trash'" | ||
(selectTab)="navigateTo('/block/rbd/trash')"> | ||
</tab> | ||
<tab heading="Overall Performance" | ||
i18n-heading | ||
*ngIf="grafanaPermission.read" | ||
[active]="url === '/block/rbd/performance'" | ||
(selectTab)="navigateTo('/block/rbd/performance')"> | ||
</tab> | ||
</tabset> |
Empty file.
27 changes: 27 additions & 0 deletions
27
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-tabs/rbd-tabs.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,27 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
|
||
import { TabsModule } from 'ngx-bootstrap/tabs'; | ||
|
||
import { configureTestBed } from '../../../../testing/unit-test-helper'; | ||
import { RbdTabsComponent } from './rbd-tabs.component'; | ||
|
||
describe('RbdTabsComponent', () => { | ||
let component: RbdTabsComponent; | ||
let fixture: ComponentFixture<RbdTabsComponent>; | ||
|
||
configureTestBed({ | ||
imports: [TabsModule.forRoot(), RouterTestingModule], | ||
declarations: [RbdTabsComponent] | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(RbdTabsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
27 changes: 27 additions & 0 deletions
27
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-tabs/rbd-tabs.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,27 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
|
||
import { Permission } from '../../../shared/models/permissions'; | ||
import { AuthStorageService } from '../../../shared/services/auth-storage.service'; | ||
|
||
@Component({ | ||
selector: 'cd-rbd-tabs', | ||
templateUrl: './rbd-tabs.component.html', | ||
styleUrls: ['./rbd-tabs.component.scss'] | ||
}) | ||
export class RbdTabsComponent implements OnInit { | ||
grafanaPermission: Permission; | ||
url: string; | ||
|
||
constructor(private authStorageService: AuthStorageService, private router: Router) { | ||
this.grafanaPermission = this.authStorageService.getPermissions().grafana; | ||
} | ||
|
||
ngOnInit() { | ||
this.url = this.router.url; | ||
} | ||
|
||
navigateTo(url: string) { | ||
this.router.navigate([url]); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...nd/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.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
Oops, something went wrong.