Unverified Commit bb60e1cc authored by Evgeny Stepanovych's avatar Evgeny Stepanovych Committed by GitHub
Browse files

Merge pull request #6075 from truenas/NAS-113104

NAS-113104 / 22.02-RC.2 / NAS-113104: Removing multipath support and some other unused components
parents f74a045e a51777b9
base DOCS DOCS-3538 NAS-010101 NAS-100796 NAS-105865 NAS-108939 NAS-110488 NAS-110533 NAS-110571 NAS-110777 NAS-110800 NAS-111872 NAS-111962-master NAS-111989 NAS-112060 NAS-112189 NAS-112307 NAS-112334 NAS-112343 NAS-112371 NAS-112556 NAS-112556-akt NAS-112767 NAS-112767-alt2 NAS-112767-mocks NAS-112795 NAS-112921 NAS-112945 NAS-112995-22.12 NAS-113044 NAS-113053 NAS-113219 NAS-113238 NAS-113257 NAS-113292 NAS-113293-reproduction NAS-113363-3 NAS-113370 NAS-113375 NAS-113377 NAS-113378 NAS-113464 NAS-113464-alt NAS-113474 NAS-113486 NAS-113490 NAS-113511 NAS-113590 NAS-113598 NAS-113651 NAS-113671 NAS-113675 NAS-113679 NAS-113695 NAS-113701 NAS-113706 NAS-113708 NAS-113709 NAS-113723-22.02-RC.2 NAS-113733 NAS-113734 NAS-113738-22.02 NAS-113760 NAS-113790 NAS-113817 NAS-113821 NAS-113837 NAS-113860 NAS-113867 NAS-113876 NAS-113903 NAS-113903-2 NAS-113904-2 NAS-113953 NAS-114032 NAS-114045 NAS-114058 NAS-114084 NAS-114087 NAS-114088 NAS-114098 NAS-114171 NAS-114173 NAS-114179 NAS-114179-2 NAS-114204 NAS-114214 NAS-114215 NAS-114241 NAS-114338 NAS-114347 NAS-114389 NAS-114410 NAS-114413-2 NAS-114420 NAS-114428 NAS-114447 NAS-114448 NAS-114448-bluefin NAS-114471 NAS-114546 NAS-114549 NAS-114554 NAS-114607 NAS-114622 NAS-114639 NAS-114659 NAS-114660 NAS-114751 NAS-114769 NAS-114806 NAS-114845 NAS-114846 NAS-114881 NAS-114915 NAS-114950 NAS-115146 NAS-115162 NAS-115254 NAS-115271 NAS-115339 NAS-115340 NAS-115357 NAS-115488 NAS-115546 NAS-115547 NAS-115593 NAS-115593-2 NAS-115593-3 NAS-115593-4 NAS-115593-5 NAS-115593-6 NAS-115593-7 NAS-115713-22-12 NAS-115759 NAS-115759-22.12 NAS-115887-22.02.1 NAS-115942-22.02 NAS-116151 NAS-116162 NAS-116334-1 NAS-116334-2 NAS-116393 NAS-116395 NAS-116397 NAS-116397-2 NAS-116397-3 NAS-116398 NAS-116405 NAS-116406 NAS-116410 NAS-116422 NAS-116450 NAS-116469 NAS-116609 NAS-116715 NAS-116715-mobile NAS-116715-v2 NAS-116724 NAS-116915 NAS-116916 NAS-117017 NAS-117019 NAS-117028-22.12-BETA.2 NAS-117060 NAS-117098 NAS-117149-22.12 NAS-117216 NAS-117233 NAS-117239 NAS-117253 NAS-117278 NAS-117317 NAS-117323 NAS-117333 NAS-117401 NAS-117439 NAS-117475 NAS-117476 NAS-117481-test NAS-117520 NAS-117573-v2 NAS-117594 NAS-117628 NAS-117688-bluefin NAS-117700 NAS-117713-12 NAS-117714 NAS-117718 NAS-117734 NAS-117768 NAS-117813 NAS-117823 NAS-117841-2 NAS-117846 NAS-117959 NAS-118036 NAS-118044 NAS-118113 NAS-118165 NAS-118303 NAS-118454-22.12 NAS-118465 NAS-118505-22.12 NAS-118545 NAS-118548 NAS-119131 NAS-119140 NAS-119180-22.12.1 NAS-119431 NAS-119556-23.10 NAS-119615-22.12.1 NAS-119668 NAS-119695 NAS-119749-bluefin NAS-119750-22.12.1 NAS-119806 NAS-119812 NAS-119886-22.12.1 NAS-119996 NAS-119996-bluefin NAS-120045 NAS-120047 NAS-120057 NAS-120173-22.12.1 NAS-120181-22.12.1 NAS-120264-22.12.1 NAS-120274 NAS-120296-22.12.1 NAS-120326-22.12.1 NAS-120490_ NAS-120503 NAS-121006-22.12.2 NAS-121124 NAS-121128-22.12.2 NAS-121128-release-22.12.2 NAS-121136 NAS-121177 NAS-121218-22.12.3 NAS-121300 NAS-121316 NAS-121541 NAS-121542 NAS-121686 NAS-121721-22.12.3 NAS-121778 NAS-121827 NAS-121884-22.12.3 NAS-122267-22.12.4 NAS-122372 NAS-122601 NAS-122686 NAS-122706 NAS-122721 NAS-122751-23.10-BETA.1 NAS-122759 NAS-122781 NAS-122794-23.10 NAS-122855 NAS-122870-bluefin NAS-122969 NAS-122993-22.12.4 NAS-123055-22.12.4 NAS-123278 NAS-123295 NAS-123437 NAS-123478-22.12.4 NAS-123484 NAS-123492 NAS-123526-22.12.4 NAS-123651 NAS-123651-23.10-BETA.1 NAS-123666 NAS-123723 NAS-123723-cobia NAS-123762 NAS-123762-23.10 NAS-123778-23.10 NAS-123778-23.10-RC.1 NAS-123778-RC.1 NAS-123801 NAS-123810-23.10 NAS-123813-22.12.4 NAS-123836 NAS-123836-23.10-BETA.1 NAS-123836-24.04 NAS-123861 NAS-123911-23.10-BETA.1 NAS-123928-23.10 NAS-123931-22.12.4 NAS-123945 NAS-124044 NAS-124077 NAS-124131-23.10 NAS-124137 NAS-124183 NAS-124231 NAS-124232 NAS-124237-23.10 NAS-124325-23.10.0 NAS-124335 NAS-124354 NAS-124430 NAS-124454 NAS-124481-23.10.0 NAS-124481-23.10.1 NAS-124555-23.10.0 NAS-124555-23.10.1 NAS-124666 NAS-124707-23.10.0 NAS-124707-23.10.1 NAS-124716 NAS-124846-23.10.0 NAS-124846-23.10.1 NAS-124892 NAS-124895-23.10.1 NAS-124908 NAS-124951 NAS-124964 NAS-124999 NAS-125092 NAS-125213-23.10.1 NAS-125307 NAS-125532 NAS-125568 NAS-125607-validator NAS-125616-23.10.2 NAS-125654 NAS-125703-23.10.2 NAS-125728 NAS-125931 NAS-126699 NAS-126774-24.04-RC.1 NAS-126774-dragonfish NAS-126795 NAS-126795-test NAS-126795-test2 NAS-127001 NAS-127002-24.04-RC.1 NAS-127022 NAS-127041-24.04-BETA.1 NAS-127049-24.04-RC.1 NAS-127297-24.04-RC.1 NAS-127297-24.10 NAS-127369 NAS-127551 NAS-127551-alt NAS-127589-24.04.0 NAS-127593 NAS-127615-24.04.0 NAS-127660 NAS-127794 NAS-127829-24.10 NAS-127854-24.04.0 NAS-128030 NAS-128045 NAS-128071 NAS-128173 NAS-128209 NAS-128287 NAS-128289 TE-1553-dragonfish TE-1628 auto-129 back bugfix/NAS-117859-sidebar-menu-fix bugfix/NAS-117941-error-when-removing-pools-and-visit-datasets bugfix/NAS-118171-rsynk-task-local-path bugfix/NAS-118260-boot-env-keep-table-row bugfix/NAS-118282-search-input-fixes bugfix/NAS-118404-dataset-icon-role-double-toooltip bugfix/NAS-118414-warning-modal-icon bugfix/NAS-118415-tree-select-undefined bugfix/NAS-118454-acl-manager-after-dataset-creation-fix bugfix/NAS-118470-multiselext-styles-are-broken bugfix/NAS-118503-datasets-glitch-fix bugfix/NAS-118504-redirect-to-correct-dataset-after-permissions-submit bugfix/NAS-118510-redirect-url-fix-after-manual-change bugfix/NAS-118530-advanced-settings-box-duplicates bugfix/NAS-118541-progress-bar-oberflows bugfix/NAS-118557-replication-task-forbid-custom-retention-policy-cases bugfix/NAS-118600-smb-share-redirect bugfix/NAS-118601-remove-mixed-for-zfs-datasets cpu-pinning dataset-tree-tooltips developer/lyy feature/NAS-117754-font-rendering feature/NAS-117968-tooltips-to-status-icons-on-pools feature/NAS-118058-improve-dashboard-icons-sync-pool-and-storage feature/NAS-118147-html-refactoring feature/NAS-118269-improve-ui feature/NAS-118303 feature/NAS-118333-storage-dashboard-icons-update feature/NAS-118334-screentype-enum feature/NAS-118335-improve-spinners-look feature/NAS-118349-datasets-long-names feature/NAS-118360-handle-clipboard-api-not-available feature/NAS-118412-pool-processing-modal feature/NAS-118466-root-path-mnt feature/NAS-118543-user-password-field feauture/NAS-117474-datasets-table-header-sticky l10n_master llll master master-old metrics-enable patch-1 patch-235 q5sys-3838 rel-v0.0.1 release-test/22.02.3 release/22.02 release/22.02-RC.2 release/22.02-test release/22.02.1 release/22.02.2 release/22.02.3 release/22.02.4 release/22.12 release/22.12-BETA.1 release/22.12-BETA.2 release/22.12-RC.1 release/22.12.1 release/22.12.2 release/22.12.3 release/22.12.4 release/23.10-BETA.1 release/23.10-RC.1 release/23.10.0 release/23.10.1 release/23.10.1.1 release/23.10.1.2 release/23.10.1.3 release/23.10.2 release/24.04-BETA.1 release/24.04-RC.1 release/24.04.0 renediepenbroek/master revert-6783-NAS-116405 revert-7745-NAS-120274 stable/angelfish stable/bluefin stable/cobia stable/dragonfish t1356-scaleuitest test-xxxyyy testing-refine-branchout-process testing-refine-branchout-process2 v0.0.2 TS-24.04-RC.1 TS-24.04-BETA.1 TS-23.10.2 TS-23.10.1.3 TS-23.10.1.2 TS-23.10.1.1 TS-23.10.1 TS-23.10.0.1 TS-23.10.0 TS-23.10-RC.1 TS-23.10-BETA.1 TS-22.12.4.2 TS-22.12.4.1 TS-22.12.4 TS-22.12.3.3 TS-22.12.3.2 TS-22.12.3.1 TS-22.12.3 TS-22.12.2 TS-22.12.1 TS-22.12.0 TS-22.12-RC.1 TS-22.12-BETA.2 TS-22.12-BETA.1 TS-22.12-ALPHA.1 TS-22.02.4 TS-22.02.3 TS-22.02.2.1 TS-22.02.2 TS-22.02.1 TS-22.02.0.1 TS-22.02.0 TS-22.2.0 TS-22.02.RELEASE.1 TS-22.02-RC.2 TS-12.12.3 DN110M-CS-v2.0
No related merge requests found
Showing with 35 additions and 318 deletions
+35 -318
......@@ -6,7 +6,6 @@ import { ApiDirectory, ApiMethod } from 'app/interfaces/api-directory.interface'
import { Dataset, ExtraDatasetQueryOptions } from 'app/interfaces/dataset.interface';
import { Enclosure } from 'app/interfaces/enclosure.interface';
import { CoreEvent } from 'app/interfaces/events';
import { Multipath } from 'app/interfaces/multipath.interface';
import { NetworkInterface } from 'app/interfaces/network-interface.interface';
import { Pool } from 'app/interfaces/pool.interface';
import { QueryParams } from 'app/interfaces/query-api.interface';
......@@ -88,13 +87,6 @@ export class ApiService {
responseEvent: 'DisksData',
},
},
MultipathRequest: {
apiCall: {
args: [] as QueryParams<Multipath>[],
namespace: 'multipath.query',
responseEvent: 'MultipathData',
},
},
EnclosureDataRequest: {
apiCall: {
namespace: 'enclosure.query',
......
......@@ -143,7 +143,6 @@ import { KubernetesConfig, KubernetesConfigUpdate } from 'app/interfaces/kuberne
import { LdapConfig, LdapConfigUpdate, LdapConfigUpdateResult } from 'app/interfaces/ldap-config.interface';
import { LldpConfig, LldpConfigUpdate } from 'app/interfaces/lldp-config.interface';
import { MailConfig, MailConfigUpdate, SendMailParams } from 'app/interfaces/mail-config.interface';
import { Multipath } from 'app/interfaces/multipath.interface';
import {
NetworkActivityChoice,
NetworkConfiguration,
......@@ -501,9 +500,6 @@ export type ApiDirectory = {
'kubernetes.update': { params: [Partial<KubernetesConfigUpdate>]; response: KubernetesConfig };
'kubernetes.bindip_choices': { params: void; response: Choices };
// Multipath
'multipath.query': { params: QueryParams<Multipath>; response: Multipath[] };
// Mail
'mail.config': { params: void; response: MailConfig };
'mail.update': { params: [MailConfigUpdate]; response: MailConfig };
......
......@@ -7,7 +7,6 @@ import { ForceSidenavEvent } from 'app/interfaces/events/force-sidenav-event.int
import { LabelDrivesEvent } from 'app/interfaces/events/label-drives-event.interface';
import { MediaChangeEvent } from 'app/interfaces/events/media-change-event.interface';
import { MemoryStatsEvent } from 'app/interfaces/events/memory-stats-event.interface';
import { MultipathDataEvent, MultipathRequestEvent } from 'app/interfaces/events/multipath-event.interface';
import { NetworkInterfacesChangedEvent } from 'app/interfaces/events/network-interfaces-changed-event.interface';
import { NicInfoEvent } from 'app/interfaces/events/nic-info-event.interface';
import { PoolDataEvent } from 'app/interfaces/events/pool-data-event.interface';
......@@ -66,6 +65,4 @@ export type CoreEvent =
| UserPreferencesEvent
| LabelDrivesEvent
| MemoryStatsEvent
| MultipathRequestEvent
| MultipathDataEvent
| EnclosureLabelChangedEvent;
import { Multipath } from 'app/interfaces/multipath.interface';
import { QueryParams } from 'app/interfaces/query-api.interface';
export interface MultipathRequestEvent {
name: 'MultipathRequest';
sender: unknown;
data: QueryParams<Multipath>;
}
export interface MultipathDataEvent {
name: 'MultipathData';
sender: unknown;
data: Multipath[];
}
export interface Multipath {
type: string;
name: string;
status: string;
children: MultipathChild[];
}
export interface MultipathChild {
type: string;
name: string;
status: string;
lun_id: string;
}
<!-- <ng-template [ngTemplateOutlet]="templateTop" [ngTemplateOutletContext]="this"></ng-template> -->
<mat-card class="card">
<div class="center">
<mat-icon class="icon" role="img" fontSet="mdi-set" fontIcon="mdi-tools" ></mat-icon>
<h1>Coming soon!</h1>
<a [href]="helpurl" target="_blank">Click to learn more.</a>
</div>
</mat-card>
.center {
text-align: center;
}
.icon {
font-size: 96px;
height: auto;
width: 96px;
}
.card {
align-items: center;
flex-direction: column;
justify-content: center;
margin: auto;
position: relative;
top: 150px;
width: 275px;
}
import { Component, Input } from '@angular/core';
import urls from 'app/helptext/urls';
@Component({
selector: 'entity-comingsoon',
templateUrl: './entity-comingsoon.component.html',
styleUrls: ['./entity-comingsoon.component.scss', '../entity-form/entity-form.component.scss'],
providers: [],
})
export class EntityComingsoonComponent {
@Input() conf = { help_path: 'hub/scale/dev-notes/' };
helpurl: string;
constructor() {
this.helpurl = urls.docurl;
if (this.conf['help_path']) {
this.helpurl = this.helpurl.concat(this.conf['help_path']);
}
}
}
<div>
<div fxLayout="row wrap" fxLayout.xs="column" >
<div *ngFor="let item of routeParts" fxFlex="50">
<mat-card>
<mat-card-content>
<div fxLayout="row" fxLayoutAlign="space-between center">
<div>
<button mat-icon-button (click)="goList(item)">
<mat-icon aria-label="Example icon-button with a heart icon">{{item.data.icon}}</mat-icon>
</button>
<span><a class="text-click" (click)="goList(item)">{{item.data.title}}</a></span>
</div>
<div>
<button mat-icon-button (click)="goAdd(item)" *ngIf="item.addPath">
<mat-icon aria-label="Example icon-button with a heart icon">add_circle</mat-icon>
</button>
</div>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
</div>
.text-click {
cursor: pointer;
}
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute, Route } from '@angular/router';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
import { ProductType } from 'app/enums/product-type.enum';
import { WebSocketService } from 'app/services/ws.service';
export interface EntityDashboardRoutePart extends Route {
addPath?: string;
}
@UntilDestroy()
@Component({
selector: 'entity-dashboard',
templateUrl: './entity-dashboard.component.html',
styleUrls: ['./entity-dashboard.component.scss'],
})
export class EntityDashboardComponent implements OnInit {
routeParts: EntityDashboardRoutePart[] = [];
protected parent = '';
protected scale_exclude = ['nis', 'multipaths'];
protected enterpriseOnly = ['viewenclosure'];
productType = window.localStorage.getItem('product_type') as ProductType;
constructor(
protected ws: WebSocketService,
protected router: Router,
protected aroute: ActivatedRoute,
public translate: TranslateService,
) {
}
ngOnInit(): void {
this.parent = this.aroute.parent.parent.routeConfig.path;
const routeConfigs: EntityDashboardRoutePart[] = this.aroute.parent.routeConfig.children;
routeConfigs.forEach((routeConfig) => {
if (routeConfig.path !== '' && !routeConfig.path.includes(':')) {
if (_.find(routeConfig.children, { path: 'add' })) {
routeConfig['addPath'] = 'add';
} else if (_.find(routeConfig.children, { path: 'import' })) {
routeConfig['addPath'] = 'import';
}
this.routeParts.push(routeConfig);
}
});
let exclude: string[] = [];
if (this.productType.includes(ProductType.Scale)) {
exclude = exclude.concat(this.scale_exclude);
}
if (!this.productType.includes(ProductType.Enterprise)) {
exclude = exclude.concat(this.enterpriseOnly);
}
this.ws.call('ipmi.is_loaded').pipe(untilDestroyed(this)).subscribe((isIpmiLoaded) => {
if (!isIpmiLoaded) {
this.remove('ipmi');
}
});
this.ws.call('multipath.query').pipe(untilDestroyed(this)).subscribe((res) => {
if (!res || res.length === 0) {
this.remove('multipaths');
}
});
exclude.forEach((element) => {
this.remove(element);
});
}
remove(element: string): void {
this.routeParts = _.remove(this.routeParts, (r) => r['path'] !== element);
}
goList(item: EntityDashboardRoutePart): void {
this.router.navigate(new Array('/').concat([this.parent, item.path]));
}
goAdd(item: EntityDashboardRoutePart): void {
this.router.navigate(new Array('/').concat([this.parent, item.path, item.addPath]));
}
}
......@@ -31,8 +31,6 @@ import { DocsService } from 'app/services/docs.service';
import { JobService } from 'app/services/index';
import { EntityCardActionsComponent } from './entity-card/entity-card-actions.component';
import { EntityCardComponent } from './entity-card/entity-card.component';
import { EntityComingsoonComponent } from './entity-comingsoon/entity-comingsoon.component';
import { EntityDashboardComponent } from './entity-dashboard/entity-dashboard.component';
import { EntityDialogComponent } from './entity-dialog/entity-dialog.component';
import { EntityEmptyComponent } from './entity-empty/entity-empty.component';
import { DynamicFieldDirective } from './entity-form/components/dynamic-field/dynamic-field.directive';
......@@ -88,10 +86,25 @@ import { TableService } from './table/table.service';
@NgModule({
imports: [
CommonModule, FormsModule, ReactiveFormsModule, DragDropModule, RouterModule,
MaterialModule, ColorPickerModule, NgxDatatableModule, CdkTableModule, TreeModule.forRoot(),
NgxUploaderModule, FlexLayoutModule, TranslateModule, CdkTreeModule,
OverlayModule, A11yModule, TreeTableModule, NgxFilesizeModule, CommonDirectivesModule,
CommonModule,
FormsModule,
ReactiveFormsModule,
DragDropModule,
RouterModule,
MaterialModule,
ColorPickerModule,
NgxDatatableModule,
CdkTableModule,
TreeModule.forRoot(),
NgxUploaderModule,
FlexLayoutModule,
TranslateModule,
CdkTreeModule,
OverlayModule,
A11yModule,
TreeTableModule,
NgxFilesizeModule,
CommonDirectivesModule,
TooltipModule,
],
declarations: [
......@@ -150,10 +163,8 @@ import { TableService } from './table/table.service';
ToolbarMultimenuComponent,
ToolbarMultiSelectComponent,
FormStatusComponent,
EntityComingsoonComponent,
TableComponent,
ExpandableTableComponent,
EntityDashboardComponent,
EntityEmptyComponent,
FormDictComponent,
WizardSummaryComponent,
......@@ -184,7 +195,6 @@ import { TableService } from './table/table.service';
ToolbarMenuComponent,
ToolbarMultimenuComponent,
ToolbarMultiSelectComponent,
EntityComingsoonComponent,
TableComponent,
ExpandableTableComponent,
CdkTreeModule,
......
......@@ -241,7 +241,6 @@
</span>
<span *ngIf="vdev.type == 'DISK'" class="vdev" >
<mat-icon *ngIf="trimMultipath(vdev.disk).isMultipath" class="multipath-icon" role="img" svgIcon="multipath"></mat-icon>
<span>
{{trimMultipath(vdev.disk).name}}
</span>
......@@ -251,8 +250,7 @@
<span *ngIf="vdev.type !== 'DISK' && vdev.children.length <= 3;" class="vdev" >
<span *ngFor="let device of vdev.children; let child = index">
<div *ngIf="device.disk">
<mat-icon *ngIf="trimMultipath(device.disk.name).isMultipath" class="multipath-icon" role="img" svgIcon="multipath"></mat-icon>
<span>{{trimMultipath(device.disk.name).isMultipath ? device.disk.name : device.disk}}</span>
<span>{{device.disk}}</span>
{{trimMultipath(device.disk.name).name}}
<span *ngIf="child < 3 - 1 && child !== vdev.children.length - 1">,</span>&nbsp;&nbsp;
</div>
......@@ -262,8 +260,7 @@
<span *ngIf="vdev.children.length > 3;" class="vdev">
<span *ngFor="let device of vdev.children; let child = index" [ngClass]="{'hidden': child >= 3}">
<div *ngIf="device.disk">
<mat-icon *ngIf="trimMultipath(device.disk).isMultipath" class="multipath-icon" role="img" svgIcon="multipath"></mat-icon>
<span>{{trimMultipath(device.disk).isMultipath ? trimMultipath(device.disk).name : device.disk}}</span>
<span>{{device.disk}}</span>
<span *ngIf="child < 3 - 1 && child !== vdev.children.length - 1">,</span>&nbsp;&nbsp;
</div>
</span>
......@@ -285,11 +282,10 @@
*ngFor="let disk of path[currentSlideIndex].dataSource.children; let i=index"
role="listitem"
(click)="updateSlide('disk details', true, currentSlideIndex + 1, i, currentSlideTopology, disk )"
(click)="getDiskDetails('name', disk.disk, checkMultipath(disk.disk))"
(click)="getDiskDetails('name', disk.disk)"
[ngClass]="{'clickable': true}"
>
<strong >
<mat-icon *ngIf="checkMultipath(disk.disk)" class="multipath-icon" role="img" svgIcon="multipath"></mat-icon>
<strong>
<span *ngIf="disk.status !== 'UNAVAIL'">{{trimMultipath(disk.disk).fullName}}</span>
<span *ngIf="disk.status == 'UNAVAIL'">Unknown Disk</span>
:
......@@ -314,13 +310,10 @@
<mat-list-item
role="listitem"
(click)="updateSlide('disk details', true, currentSlideIndex + 1, undefined, currentSlideTopology, path[currentSlideIndex].dataSource)"
(click)="getDiskDetails('name', path[currentSlideIndex].dataSource.disk, checkMultipath(path[currentSlideIndex].dataSource.disk))"
(click)="getDiskDetails('name', path[currentSlideIndex].dataSource.disk)"
[ngClass]="{'clickable': true}"
>
<strong>
<span *ngIf="checkMultipath(path[2].dataSource.disk)">
<mat-icon class="multipath-icon" role="img" svgIcon="multipath"></mat-icon>
</span>
{{trimMultipath(path[2].dataSource.disk).fullName}}
:
</strong>
......@@ -338,20 +331,10 @@
<ng-template #disk_details>
<div class="list-subheader"><span class="capitalize">{{"Disk Details" | translate}}</span></div>
<mat-list >
<mat-list-item *ngIf="!currentMultipathDetails" role="listitem">
<strong> {{"Name" | translate}}:</strong>&nbsp;&nbsp; {{currentMultipathDetails ? checkMultipathLabel(path[currentSlideIndex].dataSource.disk) : path[currentSlideIndex].dataSource.disk}}
<mat-list-item role="listitem">
<strong> {{"Name" | translate}}:</strong>&nbsp;&nbsp; {{path[currentSlideIndex].dataSource.disk}}
</mat-list-item>
<ng-template [ngIf]="currentMultipathDetails">
<mat-list-item role="listitem">
<strong> {{"Multipath Name" | translate}}:</strong>&nbsp;&nbsp; {{currentMultipathDetails ? checkMultipathLabel(path[currentSlideIndex].dataSource.disk) : path[currentSlideIndex].dataSource.disk}}
</mat-list-item>
<mat-list-item *ngFor="let child of currentMultipathDetails.children" role="listitem">
<strong class="multipath-detail-label"><span class="capitalize">{{child.status.toLowerCase()}}</span> {{"Disk" | translate}}:</strong>&nbsp;&nbsp; {{child.name}}
</mat-list-item>
</ng-template>
<mat-list-item role="listitem">
<strong> GUID:</strong>&nbsp;&nbsp; {{path[currentSlideIndex].dataSource.guid}}
</mat-list-item>
......
......@@ -22,16 +22,6 @@
z-index: 2;
}
.mat-icon.multipath-icon {
color: var(--fg2);
height: 18px;
margin-right: 4px;
padding: 0 1px 2px;
position: relative;
top: 3px;
width: 18px;
}
.xs.widget mat-toolbar-row.view-overview .controls,
.widget mat-toolbar-row.view-overview .primary-nav {
color: #efefef; /* Dont use CSS var here as it is over a dark image*/
......
......@@ -19,8 +19,6 @@ import { styler, tween } from 'popmotion';
import { PoolStatus } from 'app/enums/pool-status.enum';
import { VDevType } from 'app/enums/v-dev-type.enum';
import { DisksDataEvent } from 'app/interfaces/events/disks-data-event.interface';
import { MultipathDataEvent } from 'app/interfaces/events/multipath-event.interface';
import { Multipath } from 'app/interfaces/multipath.interface';
import { Pool, PoolTopologyCategory } from 'app/interfaces/pool.interface';
import { Disk, VDev } from 'app/interfaces/storage.interface';
import { VolumeData } from 'app/interfaces/volume-data.interface';
......@@ -169,7 +167,6 @@ export class WidgetPoolComponent extends WidgetComponent implements OnInit, Afte
level: 'safe',
};
currentMultipathDetails: Multipath;
currentDiskDetails: Disk;
get currentDiskDetailsKeys(): (keyof Disk)[] {
return this.currentDiskDetails ? Object.keys(this.currentDiskDetails) as (keyof Disk)[] : [];
......@@ -213,23 +210,9 @@ export class WidgetPoolComponent extends WidgetComponent implements OnInit, Afte
this.cdr.detectChanges();
this.core.register({ observerClass: this, eventName: 'MultipathData' }).pipe(untilDestroyed(this)).subscribe((evt: MultipathDataEvent) => {
this.currentMultipathDetails = evt.data[0];
const activeDisk = evt.data[0].children.find((prop) => prop.status == 'ACTIVE');
this.core.emit({ name: 'DisksRequest', data: [[['name', '=', activeDisk.name]]] });
});
this.core.register({ observerClass: this, eventName: 'DisksData' }).pipe(untilDestroyed(this)).subscribe((evt: DisksDataEvent) => {
const currentPath = this.path[this.currentSlideIndex];
let currentName = 'unknown';
if (currentPath?.dataSource) {
if (this.currentMultipathDetails) {
currentName = this.checkMultipathLabel(currentPath.dataSource.disk);
} else if (currentPath.dataSource.disk) {
currentName = currentPath.dataSource.disk;
}
}
const currentName = currentPath?.dataSource?.disk || 'unknown';
if ((!currentName || currentName === 'unknown') && evt.data.length == 0) {
this.currentDiskDetails = null;
......@@ -292,54 +275,25 @@ export class WidgetPoolComponent extends WidgetComponent implements OnInit, Afte
this.checkVolumeHealth();
}
getDiskDetails(key: string, value: string, isMultipath?: boolean): void {
if (isMultipath && key == 'name') {
const v = 'multipath/' + this.checkMultipathLabel(value);
this.core.emit({ name: 'MultipathRequest', data: [[[key, '=', v]]] });
} else if (!isMultipath) {
delete this.currentMultipathDetails;
this.core.emit({ name: 'DisksRequest', data: [[[key, '=', value]]] });
} else {
console.warn('If this is a multipath disk, you must query by name!');
}
}
checkMultipathLabel(name: string): string {
if (name == null) {
name = 'N/A';
}
const truth = this.checkMultipath(name);
let diskName = name;
if (truth) {
const str = name.replace('multipath/', '');
const spl = str.split('p');
diskName = spl[0];
}
return diskName;
}
checkMultipath(name: string): boolean {
if (name) {
const truth = name.startsWith('multipath/');
return truth;
}
return false;
getDiskDetails(key: string, value: string): void {
this.core.emit({ name: 'DisksRequest', data: [[[key, '=', value]]] });
}
trimMultipath(disk: string): { isMultipath?: boolean; name: string; fullName?: string } {
/**
* @deprecated Multipath is not supported
*/
trimMultipath(disk: string): { name: string; fullName?: string } {
if (!disk || disk == null) {
return { name: disk };
}
const isMultipath = disk.includes('multipath/');
const fullName = isMultipath ? disk.replace('multipath/', '') : disk;
const fullName = disk;
const spl = fullName.split('-');
const suffix = spl.length > 1 ? '... ' : '';
const name = spl[0] + suffix;
return {
isMultipath,
name,
fullName,
};
......
......@@ -11,10 +11,6 @@
<mat-card-title fxFlex="65%">
<h3 class="mat-card-title-text">
{{ reportTitle }}
<span *ngIf="multipathTitle">
{{ multipathTitle }}
<mat-icon class="multipath-icon" role="img" svgIcon="multipath"></mat-icon>
</span>
</h3>
</mat-card-title>
<!-- Controls/Tools -->
......
......@@ -10,12 +10,6 @@
margin: 0;
}
.mat-icon.multipath-icon {
color: var(--fg2);
position: relative;
top: 3px;
}
.card-title-text {
display: table;
font-size: 1.42em;
......
......@@ -62,7 +62,6 @@ export class ReportComponent extends WidgetComponent implements AfterViewInit, O
@Input() localControls?: boolean = true;
@Input() dateFormat?: DateTime;
@Input() report: Report;
@Input() multipathTitle?: string;
@Input() identifier?: string;
// TODO: Make boolean
@Input() retroLogo?: string | number;
......@@ -76,11 +75,7 @@ export class ReportComponent extends WidgetComponent implements AfterViewInit, O
readonly ProductType = ProductType;
get reportTitle(): string {
let trimmed = this.report.title.replace(/[\(\)]/g, '');
if (this.multipathTitle) {
trimmed = trimmed.replace(this.identifier, '');
return trimmed;
}
const trimmed = this.report.title.replace(/[\(\)]/g, '');
return this.identifier ? trimmed.replace(/{identifier}/, this.identifier) : this.report.title;
}
......
export interface MultipathDisk {
disk: string;
name: string;
status: string;
}
......@@ -14,7 +14,6 @@
*ngIf="retroLogo && activeReports[key] && activeReports[key].identifiers.length > 0"
[retroLogo]="retroLogo"
[report]="activeReports[key]"
[multipathTitle]="multipathTitles[activeReports[key].identifiers[0]]"
[identifier]="activeReports[key].identifiers[0]"
></report>
<report *ngIf="activeReports[key].identifiers.length == 0" [report]="activeReports[key]"></report>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment