Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgr/dashboard: Add Api module #21126

Merged
merged 2 commits into from Apr 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/pybind/mgr/dashboard/frontend/src/app/app.module.ts
Expand Up @@ -30,15 +30,12 @@ export class CustomOption extends ToastOptions {
BrowserAnimationsModule,
ToastModule.forRoot(),
AppRoutingModule,
HttpClientModule,
CoreModule,
SharedModule,
CephModule,
AccordionModule.forRoot(),
BsDropdownModule.forRoot(),
TabsModule.forRoot(),
HttpClientModule,
BrowserAnimationsModule
TabsModule.forRoot()
],
exports: [SharedModule],
providers: [
Expand Down
@@ -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', () => {
Expand Down
@@ -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',
Expand Down
Expand Up @@ -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';
Expand Down
Expand Up @@ -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',
Expand Down
@@ -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',
Expand Down
Expand Up @@ -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';

Expand All @@ -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 {}
Expand Up @@ -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', () => {
Expand Down
Expand Up @@ -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',
Expand Down
Expand Up @@ -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', () => {
Expand Down
@@ -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',
Expand Down
Expand Up @@ -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: [
Expand All @@ -39,10 +37,6 @@ import { OsdService } from './osd/osd.service';
OsdListComponent,
OsdDetailsComponent,
OsdPerformanceHistogramComponent
],
providers: [
MonitorService,
OsdService
]
})
export class ClusterModule {}
Expand Up @@ -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';

Expand Down
@@ -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',
Expand Down
@@ -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',
Expand Down
@@ -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',
Expand Down
Expand Up @@ -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', () => {
Expand All @@ -22,13 +22,13 @@ describe('OsdDetailsComponent', () => {
HttpClientModule,
TabsModule.forRoot(),
PerformanceCounterModule,
DataTableModule
DataTableModule,
SharedModule
],
declarations: [
OsdDetailsComponent,
OsdPerformanceHistogramComponent
],
providers: [OsdService]
]
})
.compileComponents();
}));
Expand Down
Expand Up @@ -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',
Expand Down
Expand Up @@ -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', () => {
Expand All @@ -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();
}));
Expand Down
@@ -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',
Expand Down
Expand Up @@ -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';
Expand All @@ -31,7 +30,6 @@ import { PgStatusPipe } from './pg-status.pipe';
MdsSummaryPipe,
PgStatusStylePipe,
HealthPieComponent
],
providers: [DashboardService]
]
})
export class DashboardModule {}
Expand Up @@ -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', () => {
Expand Down
Expand Up @@ -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',
Expand Down
Expand Up @@ -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';
Expand All @@ -21,9 +20,6 @@ import {
TablePerformanceCounterComponent,
PerformanceCounterComponent
],
providers: [
TablePerformanceCounterService
],
exports: [
TablePerformanceCounterComponent
]
Expand Down
Expand Up @@ -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', () => {
Expand All @@ -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();
})
Expand Down
Expand Up @@ -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', () => {
Expand All @@ -20,8 +19,7 @@ describe('TablePerformanceCounterComponent', () => {
HttpClientModule,
BsDropdownModule.forRoot(),
SharedModule
],
providers: [ TablePerformanceCounterService ]
]
})
.compileComponents();
}));
Expand Down
@@ -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.
Expand Down
Expand Up @@ -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', () => {
Expand Down