--- /dev/null
+<div class="modal-header">
+ <button type="button"
+ class="close pull-right"
+ aria-label="Close"
+ (click)="modalRef.hide()">
+ <span aria-hidden="true">×</span>
+ </button>
+</div>
+<div class="modal-body">
+ <h1>ceph</h1>
+ <div class="product-versions">
+ <strong>Ceph version</strong>
+ {{ versionNumber }}
+ <br>
+ {{ versionHash }}
+ <br>
+ {{ versionName }}
+ </div>
+</div>
+<div class="modal-footer">
+ <div class="text-right">
+ <img src="assets/Ceph_Logo_Stacked_RGB_120411_fa_348x348.png"
+ class="ceph-logo"
+ alt="Ceph">
+ </div>
+</div>
--- /dev/null
+.product-versions {
+ margin-top: 30px;
+}
+.product-versions strong {
+ margin-right: 10px;
+}
+.modal-header {
+ border-bottom: none;
+}
+.modal-body {
+ padding-left: 80px;
+ padding-right: 80px;
+}
+.modal-footer {
+ border-top: none;
+}
+h1 {
+ font-size: 4em;
+}
+.ceph-logo {
+ width: 25%;
+}
--- /dev/null
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { BsModalRef } from 'ngx-bootstrap';
+import 'rxjs/add/observable/of';
+import { Observable } from 'rxjs/Observable';
+
+import { SummaryService } from '../../../shared/services/summary.service';
+import { SharedModule } from '../../../shared/shared.module';
+import { configureTestBed } from '../../../shared/unit-test-helper';
+import { AboutComponent } from './about.component';
+
+class SummaryServiceMock {
+ summaryData$ = Observable.of({
+ version:
+ 'ceph version 14.0.0-855-gb8193bb4cd ' +
+ '(b8193bb4cda16ccc5b028c3e1df62bc72350a15d) nautilus (dev)'
+ });
+}
+
+describe('AboutComponent', () => {
+ let component: AboutComponent;
+ let fixture: ComponentFixture<AboutComponent>;
+
+ configureTestBed({
+ imports: [SharedModule, HttpClientTestingModule],
+ declarations: [AboutComponent],
+ providers: [BsModalRef, { provide: SummaryService, useClass: SummaryServiceMock }]
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(AboutComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+
+ it('should parse version', () => {
+ expect(component.versionNumber).toBe('14.0.0-855-gb8193bb4cd');
+ expect(component.versionHash).toBe('(b8193bb4cda16ccc5b028c3e1df62bc72350a15d)');
+ expect(component.versionName).toBe('nautilus (dev)');
+ });
+});
--- /dev/null
+import { Component, OnDestroy, OnInit } from '@angular/core';
+
+import { BsModalRef } from 'ngx-bootstrap';
+import { Subscription } from 'rxjs';
+
+import { SummaryService } from '../../../shared/services/summary.service';
+
+@Component({
+ selector: 'cd-about',
+ templateUrl: './about.component.html',
+ styleUrls: ['./about.component.scss']
+})
+export class AboutComponent implements OnInit, OnDestroy {
+ versionNumber: string;
+ versionHash: string;
+ versionName: string;
+ subs: Subscription;
+
+ constructor(public modalRef: BsModalRef, private summaryService: SummaryService) {}
+
+ ngOnInit() {
+ this.subs = this.summaryService.summaryData$.subscribe((summary: any) => {
+ if (!summary) {
+ return;
+ }
+ const version = summary.version.replace('ceph version ', '').split(' ');
+ this.versionNumber = version[0];
+ this.versionHash = version[1];
+ this.versionName = version.slice(2, version.length).join(' ');
+ });
+ }
+
+ ngOnDestroy(): void {
+ this.subs.unsubscribe();
+ }
+}
target="_blank">API
</a>
</li>
+ <li>
+ <a i18n
+ class="dropdown-item"
+ (click)="openAboutModal()">About
+ </a>
+ </li>
</ul>
</div>
import { Component, OnInit } from '@angular/core';
+import { BsModalRef, BsModalService } from 'ngx-bootstrap';
+
import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
import { SummaryService } from '../../../shared/services/summary.service';
+import { AboutComponent } from '../about/about.component';
@Component({
selector: 'cd-dashboard-help',
styleUrls: ['./dashboard-help.component.scss']
})
export class DashboardHelpComponent implements OnInit {
-
docsUrl: string;
+ modalRef: BsModalRef;
- constructor(private summaryService: SummaryService,
- private cephReleaseNamePipe: CephReleaseNamePipe) {}
+ constructor(
+ private summaryService: SummaryService,
+ private cephReleaseNamePipe: CephReleaseNamePipe,
+ private modalService: BsModalService
+ ) {}
ngOnInit() {
const subs = this.summaryService.summaryData$.subscribe((summary: any) => {
subs.unsubscribe();
});
}
+
+ openAboutModal() {
+ this.modalRef = this.modalService.show(AboutComponent);
+ }
}
import { AppRoutingModule } from '../../app-routing.module';
import { SharedModule } from '../../shared/shared.module';
import { AuthModule } from '../auth/auth.module';
+import { AboutComponent } from './about/about.component';
import { DashboardHelpComponent } from './dashboard-help/dashboard-help.component';
import { NavigationComponent } from './navigation/navigation.component';
import { NotificationsComponent } from './notifications/notifications.component';
import { TaskManagerComponent } from './task-manager/task-manager.component';
@NgModule({
+ entryComponents: [AboutComponent],
imports: [
CommonModule,
AuthModule,
RouterModule
],
declarations: [
+ AboutComponent,
NavigationComponent,
NotificationsComponent,
TaskManagerComponent,