Skip to content

Commit

Permalink
Merge branch 'master' of github.com:truenas/webui into NAS-131013
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/app/pages/audit/components/event-data-details-card/event-data-details-card.component.html
#	src/app/pages/audit/components/event-data-details-card/event-data-details-card.component.ts
  • Loading branch information
undsoft committed Sep 9, 2024
2 parents 6e2044f + 74f18b7 commit b7f30b8
Show file tree
Hide file tree
Showing 211 changed files with 514 additions and 741 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}

.tooltip-message {
font-family: var(--font-family-body2);
font-family: var(--font-family-body);
font-size: 12px;
line-height: 1.3;
}
4 changes: 2 additions & 2 deletions src/app/enums/enclosure-slot-status.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export enum EnclosureSlotStatus {
}

export enum DriveBayLightStatus {
Identify = 'IDENTIFY',
Fault = 'FAULT',
On = 'ON',
Off = 'OFF',
Clear = 'CLEAR',
}

export enum EnclosureStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
.message {
&.pre {
display: block;
font-family: 'Droid Sans Mono', 'Courier New', Courier, monospace;
font-family: var(--font-family-body);
unicode-bidi: isolate;
white-space: pre;
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/modules/tooltip/tooltip.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}

.tooltip-message {
font-family: Roboto, sans-serif;
font-family: var(--font-family-body);
font-size: 12px;
line-height: 1.3;

Expand All @@ -47,5 +47,5 @@
}

.tooltip-title {
font-family: Roboto, sans-serif;
font-family: var(--font-family-body);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import {
import { MatDialog } from '@angular/material/dialog';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import { filter, map, tap } from 'rxjs/operators';
import {
filter, map, take, tap,
} from 'rxjs/operators';
import { Role } from 'app/enums/role.enum';
import { ContainerImage } from 'app/interfaces/container-image.interface';
import { EmptyService } from 'app/modules/empty/empty.service';
Expand Down Expand Up @@ -50,9 +52,14 @@ export class DockerImagesListComponent implements OnInit {
this.onListFiltered(this.filterString);
},
onColumnCheck: (checked) => {
this.containerImages.forEach((image) => image.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
this.dataProvider.currentPage$.pipe(
take(1),
untilDestroyed(this),
).subscribe((images) => {
images.forEach((image) => image.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
});
},
cssClass: 'checkboxs-column',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

.logs {
background: black;
font-family: 'Inconsolata';
font-family: var(--font-family-monospace);
height: calc(100% - 70px);
overflow: auto;
padding: 5px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ <h3 mat-card-title>
<ix-copy-button [text]="yamlContent()" [jsonText]="log().event_data"></ix-copy-button>
</mat-card-header>
<mat-card-content>
<pre [innerHTML]="yamlContent()"></pre>
<pre>{{ yamlContent() }}</pre>
</mat-card-content>
</mat-card>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { AuditEntry } from 'app/interfaces/audit/audit.interface';
export class EventDataDetailsCardComponent {
readonly log = input.required<AuditEntry>();

protected readonly yamlContent = computed(() => {
protected yamlContent = computed(() => {
return jsonToYaml(convertObjectKeysToHumanReadable(this.log().event_data));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class WidgetInterfaceComponent implements WidgetComponent<WidgetInterface
protected chartData = computed<ChartData<'line'>>(() => {
const currentTheme = this.theme.currentTheme();
const response = this.networkStats();
const networkInterfaceName = this.interfaceId();
const networkInterfaceName = this.interface().value.name;
const startDate = Date.now() - oneHourMillis - oneMinuteMillis;
const labels = response.map((_, index) => (startDate + index * 1000));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { ZfsPropertySource } from 'app/enums/zfs-property-source.enum';
import { helptextDatasetForm } from 'app/helptext/storage/volumes/datasets/dataset-form';
import { Dataset } from 'app/interfaces/dataset.interface';
import { SystemInfo } from 'app/interfaces/system-info.interface';
import { ZfsProperty } from 'app/interfaces/zfs-property.interface';
import { DialogService } from 'app/modules/dialog/dialog.service';
import { IxFieldsetHarness } from 'app/modules/forms/ix-forms/components/ix-fieldset/ix-fieldset.harness';
import { IxSelectHarness } from 'app/modules/forms/ix-forms/components/ix-select/ix-select.harness';
Expand Down Expand Up @@ -359,6 +360,30 @@ describe('OtherOptionsSectionComponent', () => {
expect(await aclMode.getValue()).toBe('Inherit');
expect(await aclMode.isDisabled()).toBe(true);
});

it('should not disable incorrect ACL type & ACL mode setup to allow user to fix the issue in edit mode', async () => {
spectator.setInput({
parent: parentDataset,
existing: {
...existingDataset,
acltype: {
value: DatasetAclType.Posix,
} as ZfsProperty<DatasetAclType, string>,
aclmode: {
value: AclMode.Passthrough,
} as ZfsProperty<AclMode, string>,
},
});

const aclType = await form.getControl('ACL Type') as IxSelectHarness;
const aclMode = await form.getControl('ACL Mode') as IxSelectHarness;

expect(await aclMode.getValue()).toBe('Passthrough');
expect(await aclMode.isDisabled()).toBe(false);

expect(await aclType.getValue()).toBe('POSIX');
expect(await aclType.isDisabled()).toBe(false);
});
});

describe('ZFS Deduplication', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,16 @@ export class OtherOptionsSectionComponent implements OnInit, OnChanges {
const aclModeControl = this.form.controls.aclmode;
const aclTypeControl = this.form.controls.acltype;

const invalidPosixOrOffAclType = (aclTypeControl.value === DatasetAclType.Posix
|| aclTypeControl.value === DatasetAclType.Off) && aclModeControl.value !== AclMode.Discard;

const invalidInheritAclType = aclTypeControl.value === DatasetAclType.Inherit
&& aclModeControl.value !== AclMode.Inherit;

if (!!this.existing && (invalidPosixOrOffAclType || invalidInheritAclType) && !aclTypeControl.touched) {
return;
}

if (!this.parent) {
aclModeControl.disable({ emitEvent: false });
aclTypeControl.disable({ emitEvent: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ export class SnapshotListComponent implements OnInit {
this.onListFiltered(this.filterString);
},
onColumnCheck: (checked) => {
this.snapshots.forEach((bootenv) => bootenv.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
this.dataProvider.currentPage$.pipe(
take(1),
untilDestroyed(this),
).subscribe((snapshots) => {
snapshots.forEach((snapshot) => snapshot.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
});
},
cssClass: 'checkboxs-column',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { MatDialog } from '@angular/material/dialog';
import { Router } from '@angular/router';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import { filter, forkJoin, map } from 'rxjs';
import {
filter, forkJoin, map, take,
} from 'rxjs';
import { Role } from 'app/enums/role.enum';
import { SmartTestResultPageType } from 'app/enums/smart-test-results-page-type.enum';
import { buildNormalizedFileSize } from 'app/helpers/file-size.utils';
Expand Down Expand Up @@ -55,9 +57,14 @@ export class DiskListComponent implements OnInit {
this.onListFiltered(this.filterString);
},
onColumnCheck: (checked) => {
this.disks.forEach((disk) => disk.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
this.dataProvider.currentPage$.pipe(
take(1),
untilDestroyed(this),
).subscribe((disks) => {
disks.forEach((disk) => disk.selected = checked);
this.dataProvider.setRows([]);
this.onListFiltered(this.filterString);
});
},
}),
textColumn({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ describe('AddVdevsComponent – Add Vdev to existing pool', () => {
{ type: TopologyItemType.Mirror, disks: ['sda3', 'sda0'] },
],
dedup: [
{ type: TopologyItemType.Mirror, disks: ['sda1', 'sda2', 'sda5'] },
{ type: TopologyItemType.Mirror, disks: ['sda2', 'sda5', 'sda6'] },
],
log: [
{ type: TopologyItemType.Stripe, disks: ['sda6'] },
{ type: TopologyItemType.Stripe, disks: ['sda1'] },
],
spares: [],
special: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,24 +234,24 @@ describe('PoolManagerComponent – create pool', () => {
name: 'pool1',
topology: {
cache: [{
disks: ['sda3'],
disks: ['sda2'],
type: 'STRIPE',
}],
data: [{
disks: ['sda0'],
disks: ['sda3'],
type: 'STRIPE',
}],
dedup: [{
disks: ['sda1'],
disks: ['sda6'],
type: 'STRIPE',
}],
log: [{
disks: ['sda2'],
disks: ['sda0'],
type: 'STRIPE',
}],
spares: ['sda5'],
spares: ['sda1'],
special: [{
disks: ['sda6'],
disks: ['sda5'],
type: 'STRIPE',
}],
},
Expand Down
Loading

0 comments on commit b7f30b8

Please sign in to comment.