Skip to content

Commit

Permalink
NAS-125865: Remove support for clustering (#9362)
Browse files Browse the repository at this point in the history
  • Loading branch information
undsoft authored Dec 26, 2023
1 parent f25079a commit adf2b06
Show file tree
Hide file tree
Showing 95 changed files with 8 additions and 161 deletions.
3 changes: 0 additions & 3 deletions src/app/interfaces/api/api-call-directory.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,6 @@ export interface ApiCallDirectory {
'container.image.query': { params: QueryParams<ContainerImage>; response: ContainerImage[] };
'container.image.delete': { params: DeleteContainerImageParams; response: void };

// Cluster
'cluster.utils.is_clustered': { params: void; response: boolean };

// Device
'device.get_info': { params: [DeviceType]; response: Device[] };

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="cards">
<ix-smb-card *ixHasRole="[Role.SharingSmbRead]" [isClustered]="isClustered$ | async"></ix-smb-card>
<ix-smb-card *ixHasRole="[Role.SharingSmbRead]"></ix-smb-card>
<ix-nfs-card *ixHasRole="[Role.SharingNfsRead]"></ix-nfs-card>
<ix-iscsi-card *ixHasRole="[Role.SharingRead]"></ix-iscsi-card>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Spectator, createComponentFactory } from '@ngneat/spectator/jest';
import { MockComponents } from 'ng-mocks';
import { MockAuthService } from 'app/core/testing/classes/mock-auth.service';
import { mockAuth } from 'app/core/testing/utils/mock-auth.utils';
import { mockCall, mockWebsocket } from 'app/core/testing/utils/mock-websocket.utils';
import { Role } from 'app/enums/role.enum';
import { IscsiCardComponent } from 'app/pages/sharing/components/shares-dashboard/iscsi-card/iscsi-card.component';
import { NfsCardComponent } from 'app/pages/sharing/components/shares-dashboard/nfs-card/nfs-card.component';
Expand All @@ -22,9 +21,6 @@ describe('SharesDashboardComponent', () => {
),
],
providers: [
mockWebsocket([
mockCall('cluster.utils.is_clustered', true),
]),
mockAuth(),
],
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import { Component } from '@angular/core';
import { UntilDestroy } from '@ngneat/until-destroy';
import { Role } from 'app/enums/role.enum';
import { WebSocketService } from 'app/services/ws.service';

@UntilDestroy()
@Component({
templateUrl: './shares-dashboard.component.html',
styleUrls: ['./shares-dashboard.component.scss'],
})
export class SharesDashboardComponent {
isClustered$ = this.ws.call('cluster.utils.is_clustered');

readonly Role = Role;

constructor(private ws: WebSocketService) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,13 @@ <h3 class="card-title">
></ix-service-state-button>

<div class="actions">
<ix-tooltip
*ngIf="tableHint"
[header]="title | translate"
[message]="tableHint | translate"
></ix-tooltip>

<button
mat-button
[ixTest]="['smb-share', 'add']"
[disabled]="isAddActionDisabled"
(click)="openForm()"
>{{ 'Add' | translate }}</button>

<ix-service-extra-actions
*ngIf="!isClustered"
[service]="service$ | async"
></ix-service-extra-actions>
<ix-service-extra-actions [service]="service$ | async"></ix-service-extra-actions>
</div>
</mat-toolbar-row>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnInit,
ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit,
} from '@angular/core';
import { Router } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
Expand All @@ -11,7 +11,6 @@ import {
} from 'rxjs';
import { ServiceName } from 'app/enums/service-name.enum';
import { helptextSharingSmb } from 'app/helptext/sharing/smb/smb';
import { IxSimpleChanges } from 'app/interfaces/simple-changes.interface';
import { SmbShare, SmbSharesec } from 'app/interfaces/smb-share.interface';
import { WebsocketError } from 'app/interfaces/websocket-error.interface';
import { AsyncDataProvider } from 'app/modules/ix-table2/classes/async-data-provider/async-data-provider';
Expand All @@ -36,18 +35,13 @@ import { selectService } from 'app/store/services/services.selectors';
styleUrls: ['./smb-card.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SmbCardComponent implements OnInit, OnChanges {
@Input() isClustered: boolean;
export class SmbCardComponent implements OnInit {
service$ = this.store$.select(selectService(ServiceName.Cifs));

smbShares: SmbShare[] = [];
dataProvider: AsyncDataProvider<SmbShare>;
title = T('Windows (SMB) Shares');

isAddActionDisabled = false;
isDeleteActionDisabled = false;
tableHint?: string;

columns = createTable<SmbShare>([
textColumn({
title: helptextSharingSmb.column_name,
Expand Down Expand Up @@ -107,23 +101,6 @@ export class SmbCardComponent implements OnInit, OnChanges {
private store$: Store<ServicesState>,
) {}

ngOnChanges(changes: IxSimpleChanges<this>): void {
if (!changes.isClustered?.currentValue && !!changes.isClustered?.previousValue) {
this.updateEnabledFieldVisibility(false);
this.isAddActionDisabled = false;
this.isDeleteActionDisabled = false;
this.tableHint = null;
}

if (!!changes.isClustered?.currentValue && !changes.isClustered?.previousValue) {
this.updateEnabledFieldVisibility(true);

this.isAddActionDisabled = true;
this.isDeleteActionDisabled = true;
this.tableHint = this.translate.instant('This share is configured through TrueCommand');
}
}

ngOnInit(): void {
const smbShares$ = this.ws.call('sharing.smb.query').pipe(
tap((smbShares) => this.smbShares = smbShares),
Expand All @@ -135,17 +112,10 @@ export class SmbCardComponent implements OnInit, OnChanges {
}

openForm(row?: SmbShare): void {
if (this.isClustered) {
this.dialogService.info(
this.translate.instant(this.title),
this.translate.instant(this.tableHint),
);
} else {
const slideInRef = this.slideInService.open(SmbFormComponent, { data: row });
slideInRef.slideInClosed$.pipe(filter(Boolean), untilDestroyed(this)).subscribe(() => {
this.getSmbShares();
});
}
const slideInRef = this.slideInService.open(SmbFormComponent, { data: row });
slideInRef.slideInClosed$.pipe(filter(Boolean), untilDestroyed(this)).subscribe(() => {
this.getSmbShares();
});
}

doDelete(smb: SmbShare): void {
Expand Down
13 changes: 0 additions & 13 deletions src/app/pages/sharing/smb/smb-list/smb-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Router } from '@angular/router';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import _ from 'lodash';
import { take } from 'rxjs/operators';
import { shared, helptextSharingSmb } from 'app/helptext/sharing';
import { helptextVolumes } from 'app/helptext/storage/volumes/volume-list';
Expand Down Expand Up @@ -80,18 +79,6 @@ export class SmbListComponent implements EntityTableConfig<SmbShare> {
private appLoader: AppLoaderService,
) {}

preInit(entityList: EntityTableComponent<SmbShare>): void {
this.entityList = entityList;
this.ws.call('cluster.utils.is_clustered').pipe(untilDestroyed(this)).subscribe((isClustered) => {
this.isClustered = isClustered;
if (this.isClustered) {
this.addBtnDisabled = true;
this.noAdd = true;
_.find(this.entityList.allColumns, { name: helptextSharingSmb.column_enabled }).disabled = true;
}
});
}

afterInit(entityList: EntityTableComponent<SmbShare>): void {
this.entityList = entityList;
}
Expand Down
1 change: 0 additions & 1 deletion src/assets/i18n/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,6 @@
"This pool has an encrypted root dataset which is locked. Do you want to unlock it?": "",
"This process continues in the background after closing this dialog.": "",
"This session is current and cannot be terminated": "",
"This share is configured through TrueCommand": "",
"This system cannot communicate externally.": "",
"This system will restart when the update completes.": "",
"This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class. Before setting this property, a special class vdev must be added to the pool. See <a href=\"https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html\" target=\"_blank\">zpool(8)</a> for more details on the special allocation": "",
Expand Down
1 change: 0 additions & 1 deletion src/assets/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,6 @@
"This pool has an encrypted root dataset which is locked. Do you want to unlock it?": "",
"This process continues in the background after closing this dialog.": "",
"This session is current and cannot be terminated": "",
"This share is configured through TrueCommand": "",
"This system cannot communicate externally.": "",
"This system will restart when the update completes.": "",
"This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class. Before setting this property, a special class vdev must be added to the pool. See <a href=\"https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html\" target=\"_blank\">zpool(8)</a> for more details on the special allocation": "",
Expand Down
1 change: 0 additions & 1 deletion src/assets/i18n/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,6 @@
"This pool has an encrypted root dataset which is locked. Do you want to unlock it?": "",
"This process continues in the background after closing this dialog.": "",
"This session is current and cannot be terminated": "",
"This share is configured through TrueCommand": "",
"This system cannot communicate externally.": "",
"This system will restart when the update completes.": "",
"This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class. Before setting this property, a special class vdev must be added to the pool. See <a href=\"https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html\" target=\"_blank\">zpool(8)</a> for more details on the special allocation": "",
Expand Down
1 change: 0 additions & 1 deletion src/assets/i18n/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,6 @@
"This pool has an encrypted root dataset which is locked. Do you want to unlock it?": "",
"This process continues in the background after closing this dialog.": "",
"This session is current and cannot be terminated": "",
"This share is configured through TrueCommand": "",
"This system cannot communicate externally.": "",
"This system will restart when the update completes.": "",
"This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class. Before setting this property, a special class vdev must be added to the pool. See <a href=\"https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html\" target=\"_blank\">zpool(8)</a> for more details on the special allocation": "",
Expand Down
1 change: 0 additions & 1 deletion src/assets/i18n/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,6 @@
"This pool has an encrypted root dataset which is locked. Do you want to unlock it?": "",
"This process continues in the background after closing this dialog.": "",
"This session is current and cannot be terminated": "",
"This share is configured through TrueCommand": "",
"This system cannot communicate externally.": "",
"This system will restart when the update completes.": "",
"This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class. Before setting this property, a special class vdev must be added to the pool. See <a href=\"https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html\" target=\"_blank\">zpool(8)</a> for more details on the special allocation": "",
Expand Down
1 change: 0 additions & 1 deletion src/assets/i18n/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,6 @@
"This pool has an encrypted root dataset which is locked. Do you want to unlock it?": "",
"This process continues in the background after closing this dialog.": "",
"This session is current and cannot be terminated": "",
"This share is configured through TrueCommand": "",
"This system cannot communicate externally.": "",
"This system will restart when the update completes.": "",
"This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class. Before setting this property, a special class vdev must be added to the pool. See <a href=\"https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html\" target=\"_blank\">zpool(8)</a> for more details on the special allocation": "",
Expand Down
1 change: 0 additions & 1 deletion src/assets/i18n/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,6 @@
"This pool has an encrypted root dataset which is locked. Do you want to unlock it?": "",
"This process continues in the background after closing this dialog.": "",
"This session is current and cannot be terminated": "",
"This share is configured through TrueCommand": "",
"This system cannot communicate externally.": "",
"This system will restart when the update completes.": "",
"This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class. Before setting this property, a special class vdev must be added to the pool. See <a href=\"https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html\" target=\"_blank\">zpool(8)</a> for more details on the special allocation": "",
Expand Down
1 change: 0 additions & 1 deletion src/assets/i18n/br.json
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,6 @@
"This pool has an encrypted root dataset which is locked. Do you want to unlock it?": "",
"This process continues in the background after closing this dialog.": "",
"This session is current and cannot be terminated": "",
"This share is configured through TrueCommand": "",
"This system cannot communicate externally.": "",
"This system will restart when the update completes.": "",
"This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class. Before setting this property, a special class vdev must be added to the pool. See <a href=\"https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html\" target=\"_blank\">zpool(8)</a> for more details on the special allocation": "",
Expand Down
1 change: 0 additions & 1 deletion src/assets/i18n/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,6 @@
"This pool has an encrypted root dataset which is locked. Do you want to unlock it?": "",
"This process continues in the background after closing this dialog.": "",
"This session is current and cannot be terminated": "",
"This share is configured through TrueCommand": "",
"This system cannot communicate externally.": "",
"This system will restart when the update completes.": "",
"This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class. Before setting this property, a special class vdev must be added to the pool. See <a href=\"https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html\" target=\"_blank\">zpool(8)</a> for more details on the special allocation": "",
Expand Down
1 change: 0 additions & 1 deletion src/assets/i18n/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,6 @@
"This pool has an encrypted root dataset which is locked. Do you want to unlock it?": "",
"This process continues in the background after closing this dialog.": "",
"This session is current and cannot be terminated": "",
"This share is configured through TrueCommand": "",
"This system cannot communicate externally.": "",
"This system will restart when the update completes.": "",
"This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class. Before setting this property, a special class vdev must be added to the pool. See <a href=\"https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html\" target=\"_blank\">zpool(8)</a> for more details on the special allocation": "",
Expand Down
1 change: 0 additions & 1 deletion src/assets/i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3507,7 +3507,6 @@
"This pool has an encrypted root dataset which is locked. Do you want to unlock it?": "",
"This process continues in the background after closing this dialog.": "",
"This session is current and cannot be terminated": "",
"This share is configured through TrueCommand": "",
"This system cannot communicate externally.": "",
"This system will restart when the update completes.": "",
"This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class. Before setting this property, a special class vdev must be added to the pool. See <a href=\"https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html\" target=\"_blank\">zpool(8)</a> for more details on the special allocation": "",
Expand Down
1 change: 0 additions & 1 deletion src/assets/i18n/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,6 @@
"This pool has an encrypted root dataset which is locked. Do you want to unlock it?": "",
"This process continues in the background after closing this dialog.": "",
"This session is current and cannot be terminated": "",
"This share is configured through TrueCommand": "",
"This system cannot communicate externally.": "",
"This system will restart when the update completes.": "",
"This value represents the threshold block size for including small file blocks into the special allocation class. Blocks smaller than or equal to this value will be assigned to the special allocation class while greater blocks will be assigned to the regular class. Valid values are zero or a power of two from 512B up to 1M. The default size is 0 which means no small file blocks will be allocated in the special class. Before setting this property, a special class vdev must be added to the pool. See <a href=\"https://zfsonlinux.org/manpages/0.7.13/man8/zpool.8.html\" target=\"_blank\">zpool(8)</a> for more details on the special allocation": "",
Expand Down
Loading

0 comments on commit adf2b06

Please sign in to comment.