import { Routes, RouterModule } from '@angular/router';
import { AuthGuardService } from './shared/services/auth-guard.service';
import { LoginComponent } from './core/auth/login/login.component';
-import { HostsComponent } from './ceph/host/hosts/hosts.component';
+import { HostsComponent } from './ceph/cluster/hosts/hosts.component';
const routes: Routes = [
{ path: '', redirectTo: 'hosts', pathMatch: 'full' },
import { CoreModule } from './core/core.module';
import { SharedModule } from './shared/shared.module';
import { ToastModule } from 'ng2-toastr';
-import { HostModule } from './ceph/host/host.module';
+import { ClusterModule } from './ceph/cluster/cluster.module';
describe('AppComponent', () => {
beforeEach(async(() => {
CoreModule,
SharedModule,
ToastModule.forRoot(),
- HostModule
+ ClusterModule
],
declarations: [
AppComponent
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
-import { HostModule } from './host/host.module';
+import { ClusterModule } from './cluster/cluster.module';
@NgModule({
imports: [
CommonModule,
- HostModule
+ ClusterModule
],
declarations: []
})
--- /dev/null
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { HostsComponent } from './hosts/hosts.component';
+import { SharedModule } from '../../shared/shared.module';
+import { ServiceListPipe } from './service-list.pipe';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ SharedModule
+ ],
+ declarations: [HostsComponent, ServiceListPipe],
+})
+export class ClusterModule { }
--- /dev/null
+<table class="table table-bordered">
+ <thead>
+ <tr>
+ <th>
+ Hostname
+ </th>
+ <th>
+ Services
+ </th>
+ <th>
+ Version
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr *ngFor="let host of hosts">
+ <td>
+ {{ host.hostname }}
+ </td>
+ <td>
+ {{ host.services | serviceList }}
+ </td>
+ <td>
+ {{ host.ceph_version | cephShortVersion }}
+ </td>
+ </tr>
+ </tbody>
+</table>
--- /dev/null
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { HostsComponent } from './hosts.component';
+import { ServiceListPipe } from '../service-list.pipe';
+import { SharedModule } from '../../../shared/shared.module';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+
+describe('HostsComponent', () => {
+ let component: HostsComponent;
+ let fixture: ComponentFixture<HostsComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ imports: [
+ SharedModule,
+ HttpClientTestingModule
+ ],
+ declarations: [
+ HostsComponent,
+ ServiceListPipe
+ ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(HostsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+import { Component, OnInit } from '@angular/core';
+import { HostService } from '../../../shared/services/host.service';
+
+@Component({
+ selector: 'cd-hosts',
+ templateUrl: './hosts.component.html',
+ styleUrls: ['./hosts.component.scss']
+})
+export class HostsComponent implements OnInit {
+
+ hosts: any = [];
+
+ constructor(private hostService: HostService) { }
+
+ ngOnInit() {
+ this.hostService.list().then((resp) => {
+ this.hosts = resp;
+ });
+ }
+
+}
--- /dev/null
+import { ServiceListPipe } from './service-list.pipe';
+
+describe('ServiceListPipe', () => {
+ it('create an instance', () => {
+ const pipe = new ServiceListPipe();
+ expect(pipe).toBeTruthy();
+ });
+});
--- /dev/null
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'serviceList'
+})
+export class ServiceListPipe implements PipeTransform {
+ transform(value: any, args?: any): any {
+ const strings = [];
+ value.forEach((server) => {
+ strings.push(server.type + '.' + server.id);
+ });
+ return strings.join(', ');
+ }
+}
+++ /dev/null
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-
-import { HostsComponent } from './hosts/hosts.component';
-import { SharedModule } from '../../shared/shared.module';
-import { ServiceListPipe } from './service-list.pipe';
-
-@NgModule({
- imports: [
- CommonModule,
- SharedModule
- ],
- declarations: [HostsComponent, ServiceListPipe],
-})
-export class HostModule { }
+++ /dev/null
-<table class="table table-bordered">
- <thead>
- <tr>
- <th>
- Hostname
- </th>
- <th>
- Services
- </th>
- <th>
- Version
- </th>
- </tr>
- </thead>
- <tbody>
- <tr *ngFor="let host of hosts">
- <td>
- {{ host.hostname }}
- </td>
- <td>
- {{ host.services | serviceList }}
- </td>
- <td>
- {{ host.ceph_version | cephShortVersion }}
- </td>
- </tr>
- </tbody>
-</table>
+++ /dev/null
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { HostsComponent } from './hosts.component';
-import { ServiceListPipe } from '../service-list.pipe';
-import { SharedModule } from '../../../shared/shared.module';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-
-describe('HostsComponent', () => {
- let component: HostsComponent;
- let fixture: ComponentFixture<HostsComponent>;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- imports: [
- SharedModule,
- HttpClientTestingModule
- ],
- declarations: [
- HostsComponent,
- ServiceListPipe
- ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(HostsComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
+++ /dev/null
-import { Component, OnInit } from '@angular/core';
-import { HostService } from '../../../shared/services/host.service';
-
-@Component({
- selector: 'cd-hosts',
- templateUrl: './hosts.component.html',
- styleUrls: ['./hosts.component.scss']
-})
-export class HostsComponent implements OnInit {
-
- hosts: any = [];
-
- constructor(private hostService: HostService) { }
-
- ngOnInit() {
- this.hostService.list().then((resp) => {
- this.hosts = resp;
- });
- }
-
-}
+++ /dev/null
-import { ServiceListPipe } from './service-list.pipe';
-
-describe('ServiceListPipe', () => {
- it('create an instance', () => {
- const pipe = new ServiceListPipe();
- expect(pipe).toBeTruthy();
- });
-});
+++ /dev/null
-import { Pipe, PipeTransform } from '@angular/core';
-
-@Pipe({
- name: 'serviceList'
-})
-export class ServiceListPipe implements PipeTransform {
- transform(value: any, args?: any): any {
- const strings = [];
- value.forEach((server) => {
- strings.push(server.type + '.' + server.id);
- });
- return strings.join(', ');
- }
-}