import { SharedModule } from '../../shared/shared.module';
import { PerformanceCounterModule } from '../performance-counter/performance-counter.module';
+import { ConfigurationDetailsComponent } from './configuration/configuration-details/configuration-details.component';
import { ConfigurationComponent } from './configuration/configuration.component';
import { HostDetailsComponent } from './hosts/host-details/host-details.component';
import { HostsComponent } from './hosts/hosts.component';
OsdPerformanceHistogramComponent,
OsdScrubModalComponent,
OsdFlagsModalComponent,
- HostDetailsComponent
+ HostDetailsComponent,
+ ConfigurationDetailsComponent
]
})
export class ClusterModule {}
--- /dev/null
+<tabset cdTableDetail *ngIf="selection?.hasSingleSelection">
+ <tab i18n-heading
+ heading="Details">
+ <cd-table-key-value [data]="selection.first()" [autoReload]="false">
+ </cd-table-key-value>
+ </tab>
+</tabset>
--- /dev/null
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TabsModule } from 'ngx-bootstrap';
+
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
+import { DataTableModule } from '../../../../shared/datatable/datatable.module';
+import { ConfigurationDetailsComponent } from './configuration-details.component';
+
+describe('ConfigurationDetailsComponent', () => {
+ let component: ConfigurationDetailsComponent;
+ let fixture: ComponentFixture<ConfigurationDetailsComponent>;
+
+ configureTestBed({
+ declarations: [ConfigurationDetailsComponent],
+ imports: [DataTableModule, TabsModule.forRoot()]
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ConfigurationDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+import { Component, Input, OnChanges } from '@angular/core';
+
+import { CdTableSelection } from '../../../../shared/models/cd-table-selection';
+
+@Component({
+ selector: 'cd-configuration-details',
+ templateUrl: './configuration-details.component.html',
+ styleUrls: ['./configuration-details.component.scss']
+})
+export class ConfigurationDetailsComponent implements OnChanges {
+ @Input()
+ selection: CdTableSelection;
+ selectedItem: any;
+
+ constructor() {}
+
+ ngOnChanges() {
+ if (this.selection.hasSelection) {
+ this.selectedItem = this.selection.first();
+ }
+ }
+}
</select>
</div>
</div>
- <tabset cdTableDetail *ngIf="selection.hasSingleSelection">
- <tab i18n-heading
- heading="Details">
- <cd-table-key-value [data]="selection.first()" [autoReload]="false">
- </cd-table-key-value>
- </tab>
- </tabset>
- <ng-template #confValTpl let-value="value">
- <span *ngIf="value">
- <span *ngFor="let conf of value; last as isLast">
- {{ conf.section }}: {{ conf.value }}{{ !isLast ? "," : "" }}<br/>
- </span>
+ <cd-configuration-details cdTableDetail
+ [selection]="selection">
+ </cd-configuration-details>
+</cd-table>
+
+<ng-template #confValTpl let-value="value">
+ <span *ngIf="value">
+ <span *ngFor="let conf of value; last as isLast">
+ {{ conf.section }}: {{ conf.value }}{{ !isLast ? "," : "" }}<br/>
</span>
- </ng-template>
- <ng-template #confFlagTpl let-value="value">
- <span *ngIf="value !== ''">
- <span *ngFor="let flag of value; last as isLast">
- <span title="{{ flags[flag] }}">
- {{ flag | uppercase }}{{ !isLast ? "," : "" }}<br/>
- </span>
+ </span>
+</ng-template>
+
+<ng-template #confFlagTpl let-value="value">
+ <span *ngIf="value !== ''">
+ <span *ngFor="let flag of value; last as isLast">
+ <span title="{{ flags[flag] }}">
+ {{ flag | uppercase }}{{ !isLast ? "," : "" }}<br/>
</span>
</span>
- </ng-template>
-</cd-table>
+ </span>
+</ng-template>
import { configureTestBed } from '../../../../testing/unit-test-helper';
import { ConfigurationService } from '../../../shared/api/configuration.service';
import { SharedModule } from '../../../shared/shared.module';
+import { ConfigurationDetailsComponent } from './configuration-details/configuration-details.component';
import { ConfigurationComponent } from './configuration.component';
describe('ConfigurationComponent', () => {
let fixture: ComponentFixture<ConfigurationComponent>;
configureTestBed({
- declarations: [ConfigurationComponent],
+ declarations: [ConfigurationComponent, ConfigurationDetailsComponent],
providers: [ConfigurationService],
imports: [
SharedModule,