From 76ec342d78b80020b4a7c5c4be193046ef646e27 Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Thu, 29 Mar 2018 01:36:41 +0100 Subject: [PATCH] mgr/dashboard: Add Api module Moved all the api related services into the new module. Signed-off-by: Tiago Melo --- .../ceph/block/iscsi/iscsi.component.spec.ts | 2 +- .../app/ceph/block/iscsi/iscsi.component.ts | 2 +- .../mirroring/mirroring.component.spec.ts | 2 +- .../block/mirroring/mirroring.component.ts | 2 +- .../pool-detail/pool-detail.component.ts | 2 +- .../src/app/ceph/cephfs/cephfs.module.ts | 4 +-- .../cephfs/cephfs/cephfs.component.spec.ts | 2 +- .../ceph/cephfs/cephfs/cephfs.component.ts | 2 +- .../cephfs/clients/clients.component.spec.ts | 2 +- .../ceph/cephfs/clients/clients.component.ts | 2 +- .../src/app/ceph/cluster/cluster.module.ts | 6 ---- .../configuration.component.spec.ts | 2 +- .../configuration/configuration.component.ts | 2 +- .../app/ceph/cluster/hosts/hosts.component.ts | 2 +- .../ceph/cluster/monitor/monitor.component.ts | 2 +- .../osd-details/osd-details.component.spec.ts | 8 ++--- .../osd/osd-details/osd-details.component.ts | 2 +- .../osd/osd-list/osd-list.component.spec.ts | 7 ++-- .../osd/osd-list/osd-list.component.ts | 2 +- .../app/ceph/dashboard/dashboard.module.ts | 4 +-- .../dashboard/health/health.component.spec.ts | 2 +- .../ceph/dashboard/health/health.component.ts | 2 +- .../performance-counter.module.ts | 4 --- .../performance-counter.component.spec.ts | 10 +++--- ...able-performance-counter.component.spec.ts | 4 +-- .../table-performance-counter.component.ts | 4 ++- .../rgw-daemon-details.component.spec.ts | 2 +- .../rgw-daemon-details.component.ts | 2 +- .../rgw-daemon-list.component.spec.ts | 8 ++--- .../rgw-daemon-list.component.ts | 2 +- .../frontend/src/app/ceph/rgw/rgw.module.ts | 4 --- .../app/core/auth/login/login.component.ts | 2 +- .../app/core/auth/logout/logout.component.ts | 2 +- .../frontend/src/app/shared/api/api.module.ts | 35 +++++++++++++++++++ .../shared/{services => api}/auth.service.ts | 2 +- .../api}/cephfs.service.spec.ts | 0 .../cephfs => shared/api}/cephfs.service.ts | 0 .../configuration.service.spec.ts | 0 .../configuration.service.ts | 0 .../api}/dashboard.service.spec.ts | 0 .../api}/dashboard.service.ts | 0 .../shared/{services => api}/host.service.ts | 0 .../api}/monitor.service.spec.ts | 0 .../cluster => shared/api}/monitor.service.ts | 0 .../osd => shared/api}/osd.service.spec.ts | 0 .../cluster/osd => shared/api}/osd.service.ts | 0 .../shared/{services => api}/pool.service.ts | 0 .../rbd-mirroring.service.spec.ts | 0 .../rbd-mirroring.service.ts | 0 .../api}/rgw-daemon.service.spec.ts | 0 .../api}/rgw-daemon.service.ts | 0 .../table-performance-counter.service.spec.ts | 0 .../api}/table-performance-counter.service.ts | 0 .../{services => api}/tcmu-iscsi.service.ts | 0 .../app/shared/services/services.module.ts | 8 +---- .../frontend/src/app/shared/shared.module.ts | 10 ++---- 56 files changed, 84 insertions(+), 78 deletions(-) create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/shared/api/api.module.ts rename src/pybind/mgr/dashboard/frontend/src/app/shared/{services => api}/auth.service.ts (89%) rename src/pybind/mgr/dashboard/frontend/src/app/{ceph/cephfs => shared/api}/cephfs.service.spec.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/{ceph/cephfs => shared/api}/cephfs.service.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/shared/{services => api}/configuration.service.spec.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/shared/{services => api}/configuration.service.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/{ceph/dashboard => shared/api}/dashboard.service.spec.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/{ceph/dashboard => shared/api}/dashboard.service.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/shared/{services => api}/host.service.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/{ceph/cluster => shared/api}/monitor.service.spec.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/{ceph/cluster => shared/api}/monitor.service.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/{ceph/cluster/osd => shared/api}/osd.service.spec.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/{ceph/cluster/osd => shared/api}/osd.service.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/shared/{services => api}/pool.service.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/shared/{services => api}/rbd-mirroring.service.spec.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/shared/{services => api}/rbd-mirroring.service.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/{ceph/rgw/services => shared/api}/rgw-daemon.service.spec.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/{ceph/rgw/services => shared/api}/rgw-daemon.service.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/{ceph/performance-counter/services => shared/api}/table-performance-counter.service.spec.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/{ceph/performance-counter/services => shared/api}/table-performance-counter.service.ts (100%) rename src/pybind/mgr/dashboard/frontend/src/app/shared/{services => api}/tcmu-iscsi.service.ts (100%) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.spec.ts index 78c19b0724758..526c951b511ae 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.spec.ts @@ -1,7 +1,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { AppModule } from '../../../app.module'; -import { TcmuIscsiService } from '../../../shared/services/tcmu-iscsi.service'; +import { TcmuIscsiService } from '../../../shared/api/tcmu-iscsi.service'; import { IscsiComponent } from './iscsi.component'; describe('IscsiComponent', () => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.ts index 00416a27e0b7a..2e3f384a76da6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.ts @@ -1,11 +1,11 @@ import { Component } from '@angular/core'; +import { TcmuIscsiService } from '../../../shared/api/tcmu-iscsi.service'; import { CellTemplate } from '../../../shared/enum/cell-template.enum'; import { CephShortVersionPipe } from '../../../shared/pipes/ceph-short-version.pipe'; import { DimlessPipe } from '../../../shared/pipes/dimless.pipe'; import { ListPipe } from '../../../shared/pipes/list.pipe'; import { RelativeDatePipe } from '../../../shared/pipes/relative-date.pipe'; -import { TcmuIscsiService } from '../../../shared/services/tcmu-iscsi.service'; @Component({ selector: 'cd-iscsi', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirroring.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirroring.component.spec.ts index f20d0484c018d..a9deeae7eec0e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirroring.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirroring.component.spec.ts @@ -5,7 +5,7 @@ import { BsDropdownModule, TabsModule } from 'ngx-bootstrap'; import { ProgressbarModule } from 'ngx-bootstrap/progressbar'; import { Observable } from 'rxjs/Observable'; -import { RbdMirroringService } from '../../../shared/services/rbd-mirroring.service'; +import { RbdMirroringService } from '../../../shared/api/rbd-mirroring.service'; import { SharedModule } from '../../../shared/shared.module'; import { MirrorHealthColorPipe } from '../mirror-health-color.pipe'; import { MirroringComponent } from './mirroring.component'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirroring.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirroring.component.ts index b52865e1180b5..74de5628536db 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirroring.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirroring.component.ts @@ -3,9 +3,9 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; import * as _ from 'lodash'; +import { RbdMirroringService } from '../../../shared/api/rbd-mirroring.service'; import { ViewCacheStatus } from '../../../shared/enum/view-cache-status.enum'; import { CephShortVersionPipe } from '../../../shared/pipes/ceph-short-version.pipe'; -import { RbdMirroringService } from '../../../shared/services/rbd-mirroring.service'; @Component({ selector: 'cd-mirroring', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/pool-detail/pool-detail.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/pool-detail/pool-detail.component.ts index 98ac59c66640a..56480770761ba 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/pool-detail/pool-detail.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/pool-detail/pool-detail.component.ts @@ -1,11 +1,11 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { PoolService } from '../../../shared/api/pool.service'; import { ViewCacheStatus } from '../../../shared/enum/view-cache-status.enum'; import { CdTableColumn } from '../../../shared/models/cd-table-column'; import { DimlessBinaryPipe } from '../../../shared/pipes/dimless-binary.pipe'; import { DimlessPipe } from '../../../shared/pipes/dimless.pipe'; -import { PoolService } from '../../../shared/services/pool.service'; @Component({ selector: 'cd-pool-detail', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs.module.ts index c47051c18e6e3..16ccbf41e208f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs.module.ts @@ -7,7 +7,6 @@ import { ProgressbarModule } from 'ngx-bootstrap/progressbar'; import { AppRoutingModule } from '../../app-routing.module'; import { SharedModule } from '../../shared/shared.module'; import { CephfsChartComponent } from './cephfs-chart/cephfs-chart.component'; -import { CephfsService } from './cephfs.service'; import { CephfsComponent } from './cephfs/cephfs.component'; import { ClientsComponent } from './clients/clients.component'; @@ -19,7 +18,6 @@ import { ClientsComponent } from './clients/clients.component'; ChartsModule, ProgressbarModule.forRoot() ], - declarations: [CephfsComponent, ClientsComponent, CephfsChartComponent], - providers: [CephfsService] + declarations: [CephfsComponent, ClientsComponent, CephfsChartComponent] }) export class CephfsModule {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.spec.ts index 3df655defa6df..e85f85f52040d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.spec.ts @@ -5,9 +5,9 @@ import { ChartsModule } from 'ng2-charts/ng2-charts'; import { BsDropdownModule, ProgressbarModule } from 'ngx-bootstrap'; import { Observable } from 'rxjs/Observable'; +import { CephfsService } from '../../../shared/api/cephfs.service'; import { SharedModule } from '../../../shared/shared.module'; import { CephfsChartComponent } from '../cephfs-chart/cephfs-chart.component'; -import { CephfsService } from '../cephfs.service'; import { CephfsComponent } from './cephfs.component'; describe('CephfsComponent', () => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.ts index 774ce4e0ad67e..cdbbb6fef3c97 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs/cephfs.component.ts @@ -4,9 +4,9 @@ import { ActivatedRoute } from '@angular/router'; import * as _ from 'lodash'; import { Subscription } from 'rxjs/Subscription'; +import { CephfsService } from '../../../shared/api/cephfs.service'; import { DimlessBinaryPipe } from '../../../shared/pipes/dimless-binary.pipe'; import { DimlessPipe } from '../../../shared/pipes/dimless.pipe'; -import { CephfsService } from '../cephfs.service'; @Component({ selector: 'cd-cephfs', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/clients/clients.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/clients/clients.component.spec.ts index d3506a9068610..1f4d4a5c9165d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/clients/clients.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/clients/clients.component.spec.ts @@ -4,8 +4,8 @@ import { RouterTestingModule } from '@angular/router/testing'; import { BsDropdownModule } from 'ngx-bootstrap'; import { Observable } from 'rxjs/Observable'; +import { CephfsService } from '../../../shared/api/cephfs.service'; import { SharedModule } from '../../../shared/shared.module'; -import { CephfsService } from '../cephfs.service'; import { ClientsComponent } from './clients.component'; describe('ClientsComponent', () => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/clients/clients.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/clients/clients.component.ts index fc2cbdec61b24..6402da14ee7ad 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/clients/clients.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/clients/clients.component.ts @@ -1,8 +1,8 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { CephfsService } from '../../../shared/api/cephfs.service'; import { ViewCacheStatus } from '../../../shared/enum/view-cache-status.enum'; -import { CephfsService } from '../cephfs.service'; @Component({ selector: 'cd-clients', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts index d661f51baed41..3840b48b6eae7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts @@ -10,14 +10,12 @@ import { SharedModule } from '../../shared/shared.module'; import { PerformanceCounterModule } from '../performance-counter/performance-counter.module'; import { ConfigurationComponent } from './configuration/configuration.component'; import { HostsComponent } from './hosts/hosts.component'; -import { MonitorService } from './monitor.service'; import { MonitorComponent } from './monitor/monitor.component'; import { OsdDetailsComponent } from './osd/osd-details/osd-details.component'; import { OsdListComponent } from './osd/osd-list/osd-list.component'; import { OsdPerformanceHistogramComponent } from './osd/osd-performance-histogram/osd-performance-histogram.component'; -import { OsdService } from './osd/osd.service'; @NgModule({ entryComponents: [ @@ -39,10 +37,6 @@ import { OsdService } from './osd/osd.service'; OsdListComponent, OsdDetailsComponent, OsdPerformanceHistogramComponent - ], - providers: [ - MonitorService, - OsdService ] }) export class ClusterModule {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.spec.ts index 0d98766efd46b..96a5a2cc4ba5c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.spec.ts @@ -3,7 +3,7 @@ import { FormsModule } from '@angular/forms'; import { Observable } from 'rxjs/Observable'; -import { ConfigurationService } from '../../../shared/services/configuration.service'; +import { ConfigurationService } from '../../../shared/api/configuration.service'; import { SharedModule } from '../../../shared/shared.module'; import { ConfigurationComponent } from './configuration.component'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts index 7c6ed68b448cd..8df7729997188 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; -import { ConfigurationService } from '../../../shared/services/configuration.service'; +import { ConfigurationService } from '../../../shared/api/configuration.service'; @Component({ selector: 'cd-configuration', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts index 28a193fd8ce8d..bb22e86a9ab21 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; +import { HostService } from '../../../shared/api/host.service'; import { CdTableColumn } from '../../../shared/models/cd-table-column'; import { CephShortVersionPipe } from '../../../shared/pipes/ceph-short-version.pipe'; -import { HostService } from '../../../shared/services/host.service'; @Component({ selector: 'cd-hosts', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor/monitor.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor/monitor.component.ts index 0a23129667ef1..de18f79248689 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor/monitor.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor/monitor.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; +import { MonitorService } from '../../../shared/api/monitor.service'; import { CellTemplate } from '../../../shared/enum/cell-template.enum'; -import { MonitorService } from '../monitor.service'; @Component({ selector: 'cd-monitor', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.spec.ts index c24618286de12..19403193311ee 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.spec.ts @@ -5,11 +5,11 @@ import { TabsModule } from 'ngx-bootstrap'; import { DataTableModule } from '../../../../shared/datatable/datatable.module'; import { CdTableSelection } from '../../../../shared/models/cd-table-selection'; +import { SharedModule } from '../../../../shared/shared.module'; import { PerformanceCounterModule } from '../../../performance-counter/performance-counter.module'; import { OsdPerformanceHistogramComponent } from '../osd-performance-histogram/osd-performance-histogram.component'; -import { OsdService } from '../osd.service'; import { OsdDetailsComponent } from './osd-details.component'; describe('OsdDetailsComponent', () => { @@ -22,13 +22,13 @@ describe('OsdDetailsComponent', () => { HttpClientModule, TabsModule.forRoot(), PerformanceCounterModule, - DataTableModule + DataTableModule, + SharedModule ], declarations: [ OsdDetailsComponent, OsdPerformanceHistogramComponent - ], - providers: [OsdService] + ] }) .compileComponents(); })); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts index 7f2af3724976e..5c4752d492ea1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts @@ -2,8 +2,8 @@ import { Component, Input, OnChanges } from '@angular/core'; import * as _ from 'lodash'; +import { OsdService } from '../../../../shared/api/osd.service'; import { CdTableSelection } from '../../../../shared/models/cd-table-selection'; -import { OsdService } from '../osd.service'; @Component({ selector: 'cd-osd-details', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts index 7a1ef0254a845..f9a60585c9da1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts @@ -7,12 +7,12 @@ import { ComponentsModule } from '../../../../shared/components/components.modul import { DataTableModule } from '../../../../shared/datatable/datatable.module'; import { DimlessPipe } from '../../../../shared/pipes/dimless.pipe'; import { FormatterService } from '../../../../shared/services/formatter.service'; +import { SharedModule } from '../../../../shared/shared.module'; import { PerformanceCounterModule } from '../../../performance-counter/performance-counter.module'; import { OsdDetailsComponent } from '../osd-details/osd-details.component'; import { OsdPerformanceHistogramComponent } from '../osd-performance-histogram/osd-performance-histogram.component'; -import { OsdService } from '../osd.service'; import { OsdListComponent } from './osd-list.component'; describe('OsdListComponent', () => { @@ -26,14 +26,15 @@ describe('OsdListComponent', () => { PerformanceCounterModule, TabsModule.forRoot(), DataTableModule, - ComponentsModule + ComponentsModule, + SharedModule ], declarations: [ OsdListComponent, OsdDetailsComponent, OsdPerformanceHistogramComponent ], - providers: [OsdService, DimlessPipe, FormatterService] + providers: [ DimlessPipe, FormatterService] }) .compileComponents(); })); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts index ad64f5c87c997..2f3980947f5bb 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts @@ -1,10 +1,10 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; +import { OsdService } from '../../../../shared/api/osd.service'; import { CellTemplate } from '../../../../shared/enum/cell-template.enum'; import { CdTableColumn } from '../../../../shared/models/cd-table-column'; import { CdTableSelection } from '../../../../shared/models/cd-table-selection'; import { DimlessBinaryPipe } from '../../../../shared/pipes/dimless-binary.pipe'; -import { OsdService } from '../osd.service'; @Component({ selector: 'cd-osd-list', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/dashboard.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/dashboard.module.ts index cf4c025060fc5..34744fc09adad 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/dashboard.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/dashboard.module.ts @@ -6,7 +6,6 @@ import { ChartsModule } from 'ng2-charts'; import { TabsModule } from 'ngx-bootstrap/tabs'; import { SharedModule } from '../../shared/shared.module'; -import { DashboardService } from './dashboard.service'; import { DashboardComponent } from './dashboard/dashboard.component'; import { HealthPieComponent } from './health-pie/health-pie.component'; import { HealthComponent } from './health/health.component'; @@ -31,7 +30,6 @@ import { PgStatusPipe } from './pg-status.pipe'; MdsSummaryPipe, PgStatusStylePipe, HealthPieComponent - ], - providers: [DashboardService] + ] }) export class DashboardModule {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.spec.ts index 983b1452e89da..847cabdfbd78a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.spec.ts @@ -3,8 +3,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { DashboardService } from '../../../shared/api/dashboard.service'; import { SharedModule } from '../../../shared/shared.module'; -import { DashboardService } from '../dashboard.service'; import { HealthComponent } from './health.component'; describe('HealthComponent', () => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts index 3cdddc970e3c4..94e21636ad775 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts @@ -2,7 +2,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import * as _ from 'lodash'; -import { DashboardService } from '../dashboard.service'; +import { DashboardService } from '../../../shared/api/dashboard.service'; @Component({ selector: 'cd-health', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter.module.ts index f2c20299f4c4e..6c3181bfeae7b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter.module.ts @@ -6,7 +6,6 @@ import { SharedModule } from '../../shared/shared.module'; import { PerformanceCounterComponent } from './performance-counter/performance-counter.component'; -import { TablePerformanceCounterService } from './services/table-performance-counter.service'; import { TablePerformanceCounterComponent } from './table-performance-counter/table-performance-counter.component'; @@ -21,9 +20,6 @@ import { TablePerformanceCounterComponent, PerformanceCounterComponent ], - providers: [ - TablePerformanceCounterService - ], exports: [ TablePerformanceCounterComponent ] diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter/performance-counter.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter/performance-counter.component.spec.ts index a4cc717023179..e4c6ddcc1d515 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter/performance-counter.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter/performance-counter.component.spec.ts @@ -3,8 +3,10 @@ import { RouterTestingModule } from '@angular/router/testing'; import { BsDropdownModule } from 'ngx-bootstrap'; +import { + TablePerformanceCounterService +} from '../../../shared/api/table-performance-counter.service'; import { PerformanceCounterModule } from '../performance-counter.module'; -import { TablePerformanceCounterService } from '../services/table-performance-counter.service'; import { PerformanceCounterComponent } from './performance-counter.component'; describe('PerformanceCounterComponent', () => { @@ -27,11 +29,7 @@ describe('PerformanceCounterComponent', () => { beforeEach( async(() => { TestBed.configureTestingModule({ - imports: [ - PerformanceCounterModule, - BsDropdownModule.forRoot(), - RouterTestingModule - ], + imports: [PerformanceCounterModule, BsDropdownModule.forRoot(), RouterTestingModule], providers: [{ provide: TablePerformanceCounterService, useValue: fakeService }] }).compileComponents(); }) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.spec.ts index 4baefe8911daf..6a219590074a2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.spec.ts @@ -5,7 +5,6 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { BsDropdownModule } from 'ngx-bootstrap'; import { SharedModule } from '../../../shared/shared.module'; -import { TablePerformanceCounterService } from '../services/table-performance-counter.service'; import { TablePerformanceCounterComponent } from './table-performance-counter.component'; describe('TablePerformanceCounterComponent', () => { @@ -20,8 +19,7 @@ describe('TablePerformanceCounterComponent', () => { HttpClientModule, BsDropdownModule.forRoot(), SharedModule - ], - providers: [ TablePerformanceCounterService ] + ] }) .compileComponents(); })); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.ts index 6ac05c9849a6e..30c283e3231ed 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/table-performance-counter/table-performance-counter.component.ts @@ -1,7 +1,9 @@ import { Component, Input, OnInit, TemplateRef, ViewChild } from '@angular/core'; +import { + TablePerformanceCounterService +} from '../../../shared/api/table-performance-counter.service'; import { CdTableColumn } from '../../../shared/models/cd-table-column'; -import { TablePerformanceCounterService } from '../services/table-performance-counter.service'; /** * Display the specified performance counters in a datatable. diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.spec.ts index afce56a2bacf8..e5686b056af49 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.spec.ts @@ -2,10 +2,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { RgwDaemonService } from '../../../shared/api/rgw-daemon.service'; import { CdTableSelection } from '../../../shared/models/cd-table-selection'; import { SharedModule } from '../../../shared/shared.module'; import { PerformanceCounterModule } from '../../performance-counter/performance-counter.module'; -import { RgwDaemonService } from '../services/rgw-daemon.service'; import { RgwDaemonDetailsComponent } from './rgw-daemon-details.component'; describe('RgwDaemonDetailsComponent', () => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.ts index 8ac62fac84c84..f3587a0a58a1e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.ts @@ -2,8 +2,8 @@ import { Component, Input, OnChanges } from '@angular/core'; import * as _ from 'lodash'; +import { RgwDaemonService } from '../../../shared/api/rgw-daemon.service'; import { CdTableSelection } from '../../../shared/models/cd-table-selection'; -import { RgwDaemonService } from '../services/rgw-daemon.service'; @Component({ selector: 'cd-rgw-daemon-details', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.spec.ts index c0d331e3599f6..f4f08f4c52807 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.spec.ts @@ -5,9 +5,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { TabsModule } from 'ngx-bootstrap/tabs'; import { DataTableModule } from '../../../shared/datatable/datatable.module'; +import { SharedModule } from '../../../shared/shared.module'; import { PerformanceCounterModule } from '../../performance-counter/performance-counter.module'; import { RgwDaemonDetailsComponent } from '../rgw-daemon-details/rgw-daemon-details.component'; -import { RgwDaemonService } from '../services/rgw-daemon.service'; import { RgwDaemonListComponent } from './rgw-daemon-list.component'; describe('RgwDaemonListComponent', () => { @@ -22,9 +22,9 @@ describe('RgwDaemonListComponent', () => { HttpClientTestingModule, HttpClientModule, TabsModule.forRoot(), - PerformanceCounterModule - ], - providers: [ RgwDaemonService ] + PerformanceCounterModule, + SharedModule + ] }) .compileComponents(); })); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.ts index ce1c2456fdf03..affe3962cd8cd 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.ts @@ -1,9 +1,9 @@ import { Component } from '@angular/core'; +import { RgwDaemonService } from '../../../shared/api/rgw-daemon.service'; import { CdTableColumn } from '../../../shared/models/cd-table-column'; import { CdTableSelection } from '../../../shared/models/cd-table-selection'; import { CephShortVersionPipe } from '../../../shared/pipes/ceph-short-version.pipe'; -import { RgwDaemonService } from '../services/rgw-daemon.service'; @Component({ selector: 'cd-rgw-daemon-list', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw.module.ts index a888940c27da6..14577d9c71ff4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw.module.ts @@ -7,7 +7,6 @@ import { SharedModule } from '../../shared/shared.module'; import { PerformanceCounterModule } from '../performance-counter/performance-counter.module'; import { RgwDaemonDetailsComponent } from './rgw-daemon-details/rgw-daemon-details.component'; import { RgwDaemonListComponent } from './rgw-daemon-list/rgw-daemon-list.component'; -import { RgwDaemonService } from './services/rgw-daemon.service'; @NgModule({ entryComponents: [ @@ -26,9 +25,6 @@ import { RgwDaemonService } from './services/rgw-daemon.service'; declarations: [ RgwDaemonListComponent, RgwDaemonDetailsComponent - ], - providers: [ - RgwDaemonService ] }) export class RgwModule { } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/login/login.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/login/login.component.ts index f8f46254976cc..f1a1f90f088f3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/login/login.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/login/login.component.ts @@ -3,9 +3,9 @@ import { Router } from '@angular/router'; import { ToastsManager } from 'ng2-toastr'; +import { AuthService } from '../../../shared/api/auth.service'; import { Credentials } from '../../../shared/models/credentials'; import { AuthStorageService } from '../../../shared/services/auth-storage.service'; -import { AuthService } from '../../../shared/services/auth.service'; @Component({ selector: 'cd-login', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/logout/logout.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/logout/logout.component.ts index 4bf11e368712b..4a8405e2eefad 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/logout/logout.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/logout/logout.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; -import { AuthService } from '../../../shared/services/auth.service'; +import { AuthService } from '../../../shared/api/auth.service'; @Component({ selector: 'cd-logout', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/api.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/api.module.ts new file mode 100644 index 0000000000000..dbb1af6d5a7d2 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/api.module.ts @@ -0,0 +1,35 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; + +import { AuthService } from './auth.service'; +import { CephfsService } from './cephfs.service'; +import { ConfigurationService } from './configuration.service'; +import { DashboardService } from './dashboard.service'; +import { HostService } from './host.service'; +import { MonitorService } from './monitor.service'; +import { OsdService } from './osd.service'; +import { PoolService } from './pool.service'; +import { RbdMirroringService } from './rbd-mirroring.service'; +import { RgwDaemonService } from './rgw-daemon.service'; +import { TablePerformanceCounterService } from './table-performance-counter.service'; +import { TcmuIscsiService } from './tcmu-iscsi.service'; + +@NgModule({ + imports: [CommonModule], + declarations: [], + providers: [ + AuthService, + CephfsService, + ConfigurationService, + DashboardService, + HostService, + MonitorService, + OsdService, + PoolService, + RbdMirroringService, + RgwDaemonService, + TablePerformanceCounterService, + TcmuIscsiService + ] +}) +export class ApiModule {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/auth.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/auth.service.ts similarity index 89% rename from src/pybind/mgr/dashboard/frontend/src/app/shared/services/auth.service.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/auth.service.ts index 88a7136289e33..c915884a03451 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/auth.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/auth.service.ts @@ -2,7 +2,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Credentials } from '../models/credentials'; -import { AuthStorageService } from './auth-storage.service'; +import { AuthStorageService } from '../services/auth-storage.service'; @Injectable() export class AuthService { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.spec.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs.service.spec.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.spec.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs.service.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/configuration.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/configuration.service.spec.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/shared/services/configuration.service.spec.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/configuration.service.spec.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/configuration.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/configuration.service.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/shared/services/configuration.service.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/configuration.service.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/dashboard.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/dashboard.service.spec.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/dashboard.service.spec.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/dashboard.service.spec.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/dashboard.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/dashboard.service.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/dashboard.service.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/dashboard.service.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/host.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/shared/services/host.service.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.service.spec.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor.service.spec.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.service.spec.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.service.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor.service.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.service.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.spec.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd.service.spec.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.spec.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd.service.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/pool.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/pool.service.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/shared/services/pool.service.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/pool.service.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/rbd-mirroring.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.spec.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/shared/services/rbd-mirroring.service.spec.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.spec.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/rbd-mirroring.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/shared/services/rbd-mirroring.service.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/services/rgw-daemon.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-daemon.service.spec.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/services/rgw-daemon.service.spec.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-daemon.service.spec.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/services/rgw-daemon.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-daemon.service.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/services/rgw-daemon.service.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-daemon.service.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/services/table-performance-counter.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/table-performance-counter.service.spec.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/services/table-performance-counter.service.spec.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/table-performance-counter.service.spec.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/services/table-performance-counter.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/table-performance-counter.service.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/services/table-performance-counter.service.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/table-performance-counter.service.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/tcmu-iscsi.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/tcmu-iscsi.service.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/src/app/shared/services/tcmu-iscsi.service.ts rename to src/pybind/mgr/dashboard/frontend/src/app/shared/api/tcmu-iscsi.service.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/services.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/services.module.ts index 04d4a3ccbde3c..60ddb4d70840f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/services.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/services.module.ts @@ -1,21 +1,15 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { ConfigurationService } from './configuration.service'; import { FormatterService } from './formatter.service'; -import { RbdMirroringService } from './rbd-mirroring.service'; import { SummaryService } from './summary.service'; -import { TcmuIscsiService } from './tcmu-iscsi.service'; @NgModule({ imports: [CommonModule], declarations: [], providers: [ FormatterService, - SummaryService, - TcmuIscsiService, - ConfigurationService, - RbdMirroringService + SummaryService ] }) export class ServicesModule { } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/shared.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/shared.module.ts index 96c6facd2d9de..931a8f9569906 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/shared.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/shared.module.ts @@ -1,6 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; +import { ApiModule } from './api/api.module'; import { ComponentsModule } from './components/components.module'; import { DataTableModule } from './datatable/datatable.module'; import { DimlessBinaryDirective } from './directives/dimless-binary.directive'; @@ -8,10 +9,7 @@ import { PasswordButtonDirective } from './directives/password-button.directive' import { PipesModule } from './pipes/pipes.module'; import { AuthGuardService } from './services/auth-guard.service'; import { AuthStorageService } from './services/auth-storage.service'; -import { AuthService } from './services/auth.service'; import { FormatterService } from './services/formatter.service'; -import { HostService } from './services/host.service'; -import { PoolService } from './services/pool.service'; import { ServicesModule } from './services/services.module'; @NgModule({ @@ -20,7 +18,8 @@ import { ServicesModule } from './services/services.module'; PipesModule, ComponentsModule, ServicesModule, - DataTableModule + DataTableModule, + ApiModule ], declarations: [ PasswordButtonDirective, @@ -35,12 +34,9 @@ import { ServicesModule } from './services/services.module'; DataTableModule ], providers: [ - AuthService, AuthStorageService, AuthGuardService, - PoolService, FormatterService, - HostService ], }) export class SharedModule {} -- 2.39.5