Skip to content

Commit

Permalink
Merge branch 'stable/electriceel' of github.com:truenas/webui into NA…
Browse files Browse the repository at this point in the history
…S-131565-24.10.0

# Conflicts:
#	src/assets/i18n/ga.json
  • Loading branch information
undsoft committed Oct 10, 2024
2 parents 315b759 + d752456 commit f62ebb8
Show file tree
Hide file tree
Showing 101 changed files with 291 additions and 242 deletions.
2 changes: 2 additions & 0 deletions src/app/enums/catalog-app-state.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ export enum CatalogAppState {
Deploying = 'DEPLOYING',
Stopped = 'STOPPED',
Crashed = 'CRASHED',
Stopping = 'STOPPING',
}

export const appStateIcons = new Map<CatalogAppState, string>([
[CatalogAppState.Running, 'mdi-check-circle'],
[CatalogAppState.Deploying, 'mdi-progress-wrench'],
[CatalogAppState.Stopping, 'mdi-progress-wrench'],
[CatalogAppState.Stopped, 'mdi-stop-circle'],
[CatalogAppState.Crashed, 'mdi-alert-circle'],
]);
3 changes: 3 additions & 0 deletions src/app/helptext/sharing/smb/smb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ export const helptextSharingSmb = {
a list of supported macros. The connectpath **must** be preset before a client connects.',
),

placeholder_auxsmbconf: T('Additional Parameters String'),
tooltip_auxsmbconf: T('String of additional smb4.conf parameters not covered by the system\'s API.'),

actions_basic_mode: T('Basic Mode'),
actions_advanced_mode: T('Advanced Mode'),

Expand Down
1 change: 1 addition & 0 deletions src/app/interfaces/smb-share.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface SmbShare {
name: string;
path: string;
path_suffix: string;
auxsmbconf: string;
purpose: SmbPresetType;
recyclebin: boolean;
ro: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { Store } from '@ngrx/store';
import { TranslateService } from '@ngx-translate/core';
import {
combineLatest, filter, finalize,
combineLatest, filter,
Observable,
} from 'rxjs';
import { CatalogAppState } from 'app/enums/catalog-app-state.enum';
Expand Down Expand Up @@ -324,10 +324,8 @@ export class InstalledAppsComponent implements OnInit, AfterViewInit {
}

stop(name: string): void {
this.loader.open(this.translate.instant('Stopping "{app}"', { app: name }));
this.appService.stopApplication(name)
.pipe(
finalize(() => this.loader.close()),
this.errorHandler.catchError(),
untilDestroyed(this),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ <h1 matDialogTitle>
[options]="pools$"
></ix-select>

@if (canMigrateApplications) {
<ix-checkbox
formControlName="migrateApplications"
[label]="'Migrate applications to the new pool' | translate"
></ix-checkbox>
}

<ix-form-actions>
<button mat-button type="button" ixTest="cancel" [matDialogClose]="false">
{{ 'Cancel' | translate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,42 +75,6 @@ describe('SelectPoolDialogComponent', () => {
expect(spectator.inject(MatDialogRef).close).toHaveBeenCalledWith(true);
});

it('shows migrate checkbox when existing pool is changed to a new one', async () => {
const dockerStore = spectator.inject(DockerStore);
Object.defineProperty(dockerStore, 'selectedPool$', {
value: of('pool1'),
});
spectator.component.ngOnInit();

await form.fillForm({
Pool: 'pool2',
});

const migrateCheckbox = await form.getControl('Migrate applications to the new pool');
expect(migrateCheckbox).toBeTruthy();
});

it('sets new pool and migrates applications when form is submitted', async () => {
const dockerStore = spectator.inject(DockerStore);
Object.defineProperty(dockerStore, 'selectedPool$', {
value: of('pool1'),
});
spectator.component.ngOnInit();

await form.fillForm(
{
Pool: 'pool2',
'Migrate applications to the new pool': true,
},
);

const chooseButton = await loader.getHarness(MatButtonHarness.with({ text: 'Choose' }));
await chooseButton.click();

expect(spectator.inject(DockerStore).setDockerPool).toHaveBeenCalledWith('pool2');
expect(spectator.inject(MatDialogRef).close).toHaveBeenCalledWith(true);
});

it('shows a warning when no pools are available and takes user to create one', () => {
const appService = spectator.inject(ApplicationsService);
jest.spyOn(appService, 'getPoolList').mockReturnValue(of([] as Pool[]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ export class SelectPoolDialogComponent implements OnInit {
private dockerStore: DockerStore,
) { }

get canMigrateApplications(): boolean {
return Boolean(this.selectedPool) && this.selectedPool !== this.form.value.pool;
}

ngOnInit(): void {
this.loadPools();
}
Expand Down
3 changes: 3 additions & 0 deletions src/app/pages/apps/enum/app-status.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum AppStatus {
Deploying = 'DEPLOYING',
Stopped = 'STOPPED',
Stopping = 'STOPPING',
Crashed = 'CRASHED',
}

export const appStatusIcons = new Map<AppStatus, string>([
Expand All @@ -14,6 +15,7 @@ export const appStatusIcons = new Map<AppStatus, string>([
[AppStatus.Deploying, 'mdi-progress-wrench'],
[AppStatus.Stopping, 'mdi-progress-wrench'],
[AppStatus.Stopped, 'mdi-stop-circle'],
[AppStatus.Crashed, 'mdi-stop-circle'],
]);

export const appStatusLabels = new Map<AppStatus, string>([
Expand All @@ -22,4 +24,5 @@ export const appStatusLabels = new Map<AppStatus, string>([
[AppStatus.Deploying, T('Deploying')],
[AppStatus.Stopped, T('Stopped')],
[AppStatus.Stopping, T('Stopping')],
[AppStatus.Crashed, T('Crashed')],
]);
17 changes: 1 addition & 16 deletions src/app/pages/apps/utils/get-app-status.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
import { CatalogAppState } from 'app/enums/catalog-app-state.enum';
import { App, AppStartQueryParams } from 'app/interfaces/app.interface';
import { Job } from 'app/interfaces/job.interface';
import { AppStatus } from 'app/pages/apps/enum/app-status.enum';

export function getAppStatus(app: App, _?: Job<void, AppStartQueryParams>): AppStatus {
if (!app) return null;

let status: AppStatus;

switch (app.state) {
case CatalogAppState.Running:
status = AppStatus.Running;
break;
case CatalogAppState.Deploying:
status = AppStatus.Deploying;
break;
case CatalogAppState.Stopped:
status = AppStatus.Stopped;
break;
}

return status;
return app.state as unknown as AppStatus;
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
@media #{$media-lt-sm} {
display: block !important;
}

mat-card {
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
}

.card-list-item .value {
Expand Down
6 changes: 6 additions & 0 deletions src/app/pages/sharing/smb/smb-form/smb-form.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@
[label]="helptextSharingSmb.placeholder_path_suffix | translate"
[tooltip]="helptextSharingSmb.tooltip_path_suffix | translate"
></ix-input>

<ix-input
formControlName="auxsmbconf"
[label]="helptextSharingSmb.placeholder_auxsmbconf | translate"
[tooltip]="helptextSharingSmb.tooltip_auxsmbconf | translate"
></ix-input>
</ix-fieldset>
}

Expand Down
4 changes: 4 additions & 0 deletions src/app/pages/sharing/smb/smb-form/smb-form.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe('SmbFormComponent', () => {
purpose: SmbPresetType.MultiUserTimeMachine,
path: '/mnt/pool123/ds222',
path_suffix: '%U',
auxsmbconf: 'Aux SMB Conf',
home: false,
name: 'ds222',
comment: '',
Expand Down Expand Up @@ -95,6 +96,7 @@ describe('SmbFormComponent', () => {
durablehandle: 'Enable SMB2/3 Durable Handles',
fsrvp: 'Enable FSRVP',
path_suffix: 'Path Suffix',
auxsmbconf: 'Additional Parameters String',
watch_list: 'Watch List',
ignore_list: 'Ignore List',
};
Expand All @@ -109,6 +111,7 @@ describe('SmbFormComponent', () => {
verbose_name: 'Multi-user time machine',
cluster: false,
params: {
auxsmbconf: 'Aux SMB Conf',
path_suffix: '%U',
timemachine: true,
},
Expand All @@ -117,6 +120,7 @@ describe('SmbFormComponent', () => {
verbose_name: 'Private SMB Datasets and Shares',
cluster: false,
params: {
auxsmbconf: 'Aux SMB Conf',
path_suffix: '%U',
},
},
Expand Down
1 change: 1 addition & 0 deletions src/app/pages/sharing/smb/smb-form/smb-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export class SmbFormComponent implements OnInit, AfterViewInit {
durablehandle: [false],
fsrvp: [false],
path_suffix: [''],
auxsmbconf: [''],
audit: this.formBuilder.group({
enable: [false],
watch_list: [[] as string[]],
Expand Down
5 changes: 3 additions & 2 deletions src/assets/i18n/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
"Additional Hardware": "",
"Additional Kerberos application settings. See the \"appdefaults\" section of <a href=\"https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html\" target=\"_blank\">[krb.conf(5)]</a>. for available settings and usage syntax.": "",
"Additional Kerberos library settings. See the \"libdefaults\" section of <a href=\"https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html\" target=\"_blank\">[krb.conf(5)]</a>. for available settings and usage syntax.": "",
"Additional Parameters String": "",
"Additional domains to search. Separate entries by pressing <code>Enter</code>. Adding search domains can cause slow DNS lookups.": "",
"Additional hosts to be appended to <i>/etc/hosts</i>. Separate entries by pressing <code>Enter</code>. Hosts defined here are still accessible by name even when DNS is not available. See <a href=\"https://man7.org/linux/man-pages/man5/hosts.5.html\" target=\"_blank\">hosts(5)</a> for additional information.": "",
"Additional options for <a href=\"https://arthurdejong.org/nss-pam-ldapd/nslcd.conf.5\" target=\"_blank\">nslcd.conf</a>.": "",
Expand Down Expand Up @@ -978,6 +979,7 @@
"Copy to Clipboard": "",
"Cores": "",
"Country": "",
"Crashed": "",
"Create": "",
"Create ACME Certificate": "",
"Create ACME DNS-Authenticator": "",
Expand Down Expand Up @@ -2596,7 +2598,6 @@
"Middleware": "",
"Middleware - Credentials": "",
"Middleware - Method": "",
"Migrate applications to the new pool": "",
"Min Poll": "",
"Minimum": "",
"Minimum Memory": "",
Expand Down Expand Up @@ -4086,7 +4087,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand All @@ -4104,6 +4104,7 @@
"Storj iX": "",
"Storj is a decentralized, open-source cloud storage platform. It uses blockchain technology and cryptography to secure files. Instead of storing files in a centralized server, Storj splits up files, encrypts them, and distributes them across a network of computers around the world.": "",
"Stream Compression": "",
"String of additional smb4.conf parameters not covered by the system's API.": "",
"Strip ACL": "",
"Strip ACLs": "",
"Stripe": "",
Expand Down
5 changes: 3 additions & 2 deletions src/assets/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
"Additional Hardware": "",
"Additional Kerberos application settings. See the \"appdefaults\" section of <a href=\"https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html\" target=\"_blank\">[krb.conf(5)]</a>. for available settings and usage syntax.": "",
"Additional Kerberos library settings. See the \"libdefaults\" section of <a href=\"https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html\" target=\"_blank\">[krb.conf(5)]</a>. for available settings and usage syntax.": "",
"Additional Parameters String": "",
"Additional domains to search. Separate entries by pressing <code>Enter</code>. Adding search domains can cause slow DNS lookups.": "",
"Additional hosts to be appended to <i>/etc/hosts</i>. Separate entries by pressing <code>Enter</code>. Hosts defined here are still accessible by name even when DNS is not available. See <a href=\"https://man7.org/linux/man-pages/man5/hosts.5.html\" target=\"_blank\">hosts(5)</a> for additional information.": "",
"Additional options for <a href=\"https://arthurdejong.org/nss-pam-ldapd/nslcd.conf.5\" target=\"_blank\">nslcd.conf</a>.": "",
Expand Down Expand Up @@ -978,6 +979,7 @@
"Copy to Clipboard": "",
"Cores": "",
"Country": "",
"Crashed": "",
"Create": "",
"Create ACME Certificate": "",
"Create ACME DNS-Authenticator": "",
Expand Down Expand Up @@ -2596,7 +2598,6 @@
"Middleware": "",
"Middleware - Credentials": "",
"Middleware - Method": "",
"Migrate applications to the new pool": "",
"Min Poll": "",
"Minimum": "",
"Minimum Memory": "",
Expand Down Expand Up @@ -4086,7 +4087,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand All @@ -4104,6 +4104,7 @@
"Storj iX": "",
"Storj is a decentralized, open-source cloud storage platform. It uses blockchain technology and cryptography to secure files. Instead of storing files in a centralized server, Storj splits up files, encrypts them, and distributes them across a network of computers around the world.": "",
"Stream Compression": "",
"String of additional smb4.conf parameters not covered by the system's API.": "",
"Strip ACL": "",
"Strip ACLs": "",
"Stripe": "",
Expand Down
5 changes: 3 additions & 2 deletions src/assets/i18n/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
"Additional Hardware": "",
"Additional Kerberos application settings. See the \"appdefaults\" section of <a href=\"https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html\" target=\"_blank\">[krb.conf(5)]</a>. for available settings and usage syntax.": "",
"Additional Kerberos library settings. See the \"libdefaults\" section of <a href=\"https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html\" target=\"_blank\">[krb.conf(5)]</a>. for available settings and usage syntax.": "",
"Additional Parameters String": "",
"Additional domains to search. Separate entries by pressing <code>Enter</code>. Adding search domains can cause slow DNS lookups.": "",
"Additional hosts to be appended to <i>/etc/hosts</i>. Separate entries by pressing <code>Enter</code>. Hosts defined here are still accessible by name even when DNS is not available. See <a href=\"https://man7.org/linux/man-pages/man5/hosts.5.html\" target=\"_blank\">hosts(5)</a> for additional information.": "",
"Additional options for <a href=\"https://arthurdejong.org/nss-pam-ldapd/nslcd.conf.5\" target=\"_blank\">nslcd.conf</a>.": "",
Expand Down Expand Up @@ -978,6 +979,7 @@
"Copy to Clipboard": "",
"Cores": "",
"Country": "",
"Crashed": "",
"Create": "",
"Create ACME Certificate": "",
"Create ACME DNS-Authenticator": "",
Expand Down Expand Up @@ -2596,7 +2598,6 @@
"Middleware": "",
"Middleware - Credentials": "",
"Middleware - Method": "",
"Migrate applications to the new pool": "",
"Min Poll": "",
"Minimum": "",
"Minimum Memory": "",
Expand Down Expand Up @@ -4086,7 +4087,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand All @@ -4104,6 +4104,7 @@
"Storj iX": "",
"Storj is a decentralized, open-source cloud storage platform. It uses blockchain technology and cryptography to secure files. Instead of storing files in a centralized server, Storj splits up files, encrypts them, and distributes them across a network of computers around the world.": "",
"Stream Compression": "",
"String of additional smb4.conf parameters not covered by the system's API.": "",
"Strip ACL": "",
"Strip ACLs": "",
"Stripe": "",
Expand Down
5 changes: 3 additions & 2 deletions src/assets/i18n/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
"Additional Hardware": "",
"Additional Kerberos application settings. See the \"appdefaults\" section of <a href=\"https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html\" target=\"_blank\">[krb.conf(5)]</a>. for available settings and usage syntax.": "",
"Additional Kerberos library settings. See the \"libdefaults\" section of <a href=\"https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html\" target=\"_blank\">[krb.conf(5)]</a>. for available settings and usage syntax.": "",
"Additional Parameters String": "",
"Additional domains to search. Separate entries by pressing <code>Enter</code>. Adding search domains can cause slow DNS lookups.": "",
"Additional hosts to be appended to <i>/etc/hosts</i>. Separate entries by pressing <code>Enter</code>. Hosts defined here are still accessible by name even when DNS is not available. See <a href=\"https://man7.org/linux/man-pages/man5/hosts.5.html\" target=\"_blank\">hosts(5)</a> for additional information.": "",
"Additional options for <a href=\"https://arthurdejong.org/nss-pam-ldapd/nslcd.conf.5\" target=\"_blank\">nslcd.conf</a>.": "",
Expand Down Expand Up @@ -978,6 +979,7 @@
"Copy to Clipboard": "",
"Cores": "",
"Country": "",
"Crashed": "",
"Create": "",
"Create ACME Certificate": "",
"Create ACME DNS-Authenticator": "",
Expand Down Expand Up @@ -2596,7 +2598,6 @@
"Middleware": "",
"Middleware - Credentials": "",
"Middleware - Method": "",
"Migrate applications to the new pool": "",
"Min Poll": "",
"Minimum": "",
"Minimum Memory": "",
Expand Down Expand Up @@ -4086,7 +4087,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand All @@ -4104,6 +4104,7 @@
"Storj iX": "",
"Storj is a decentralized, open-source cloud storage platform. It uses blockchain technology and cryptography to secure files. Instead of storing files in a centralized server, Storj splits up files, encrypts them, and distributes them across a network of computers around the world.": "",
"Stream Compression": "",
"String of additional smb4.conf parameters not covered by the system's API.": "",
"Strip ACL": "",
"Strip ACLs": "",
"Stripe": "",
Expand Down
Loading

0 comments on commit f62ebb8

Please sign in to comment.