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

Merge pull request #5520 from truenas/NAS-110827-2

NAS-110827 / 21.08 / NAS-110827 - Enabling max-len linter rule
parents 05ff93f7 249f3318
base DOCS DOCS-3538 NAS-010101 NAS-100796 NAS-105865 NAS-108939 NAS-110078 NAS-110081 NAS-110488 NAS-110533 NAS-110571 NAS-110777 NAS-110800 NAS-111664 NAS-111872 NAS-111962-master NAS-111989 NAS-112060 NAS-112080 NAS-112189 NAS-112273 NAS-112282 NAS-112307 NAS-112309 NAS-112309-alt NAS-112334 NAS-112343 NAS-112371 NAS-112556 NAS-112556-akt NAS-112617 NAS-112629 NAS-112663 NAS-112710 NAS-112724 NAS-112739 NAS-112767 NAS-112767-alt2 NAS-112767-mocks NAS-112771 NAS-112795 NAS-112846 NAS-112908 NAS-112921 NAS-112945 NAS-112969 NAS-112976 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/21.08-BETA.1 release/21.08-BETA.2 release/22.02 release/22.02-RC.1 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 truenas/21.08-stable 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-22.02-RC.1 TS-22.02-RC.1-2 TS-22.02-RC.1-1 TS-21.08-BETA.2 TS-21.08-BETA.1 TS-12.12.3 DN110M-CS-v2.0
No related merge requests found
Showing with 627 additions and 399 deletions
+627 -399
......@@ -32,9 +32,15 @@ module.exports = {
"no-return-assign": "off",
"no-empty": ["error", { "allowEmptyCatch": true }],
"arrow-body-style": "off",
"max-len": ["error", 170, 2, {
"ignoreUrls": true,
"ignoreComments": false,
"ignoreRegExpLiterals": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}],
// TODO: Aibnb rules that are disabled for now as they cannot be fixed automatically
"max-len": "off",
"no-underscore-dangle": "off",
"@typescript-eslint/naming-convention": "off",
"class-methods-use-this": "off",
......
......@@ -35,7 +35,13 @@ export class CatalogSummaryDialog implements OnInit {
this.filteredVersions = {};
Object.keys(this.catalogApp.versions).forEach((key) => {
const version = this.catalogApp.versions[key];
if (this.selectedStatus == this.statusOptions[0] || this.selectedStatus == this.statusOptions[1] && version.healthy || this.selectedStatus == this.statusOptions[2] && !version.healthy) {
if (
this.selectedStatus == this.statusOptions[0]
|| this.selectedStatus == this.statusOptions[1]
&& version.healthy
|| this.selectedStatus == this.statusOptions[2]
&& !version.healthy
) {
this.filteredVersions[key] = version;
}
});
......
......@@ -92,11 +92,11 @@ export class TooltipComponent {
card = formParent;
} else if (formParent.offsetParent && formParent.offsetParent.tagName.toLowerCase() == 'mat-card') {
card = formParent.offsetParent;
} else if (formParent.offsetParent.offsetParent && formParent.offsetParent.offsetParent.tagName.toLowerCase() == 'mat-card') {
} else if (formParent.offsetParent.offsetParent?.tagName.toLowerCase() == 'mat-card') {
card = formParent.offsetParent.offsetParent;
} else if (formParent.offsetParent.offsetParent.offsetParent && formParent.offsetParent.offsetParent.offsetParent.tagName.toLowerCase() == 'mat-card') {
} else if (formParent.offsetParent.offsetParent.offsetParent?.tagName.toLowerCase() == 'mat-card') {
card = formParent.offsetParent.offsetParent.offsetParent;
} else if (formParent.offsetParent.offsetParent.offsetParent.offsetParent && formParent.offsetParent.offsetParent.offsetParent.offsetParent.tagName.toLowerCase() == 'mat-card') {
} else if (formParent.offsetParent.offsetParent.offsetParent.offsetParent?.tagName.toLowerCase() == 'mat-card') {
card = formParent.offsetParent.offsetParent.offsetParent.offsetParent;
}
this.isSlideInForm = card.parentNode.classList.value.includes('slidein-entity-form');
......
......@@ -197,7 +197,8 @@ export class EntityTreeTableComponent implements OnInit, AfterViewInit {
isTableOverflow(): boolean {
let hasHorizontalScrollbar = false;
if (this.table) {
hasHorizontalScrollbar = this.table._elementRef.nativeElement.parentNode.parentNode.scrollWidth > this.table._elementRef.nativeElement.parentNode.parentNode.clientWidth;
const parentNode = this.table._elementRef.nativeElement.parentNode;
hasHorizontalScrollbar = parentNode.parentNode.scrollWidth > parentNode.parentNode.clientWidth;
}
return hasHorizontalScrollbar;
}
......
......@@ -1522,7 +1522,9 @@ export class CloudCredentialsFormComponent implements FormConfiguration {
field_name += '-' + provider;
}
if (entityForm.formGroup.controls[field_name]) {
entityForm.formGroup.controls[field_name].setValue(field_name == 'auth_version-OPENSTACK_SWIFT' ? entityForm.wsResponseIdx[i].toString() : entityForm.wsResponseIdx[i]);
entityForm.formGroup.controls[field_name].setValue(field_name == 'auth_version-OPENSTACK_SWIFT'
? entityForm.wsResponseIdx[i].toString()
: entityForm.wsResponseIdx[i]);
}
}
}
......
......@@ -311,7 +311,9 @@ export class SshConnectionsFormComponent implements FormConfiguration {
}
isManualAuthFormValid(): boolean {
return this.entityForm.formGroup.controls['host'].valid && this.entityForm.formGroup.controls['private_key'].valid && this.entityForm.formGroup.controls['username'].valid;
return this.entityForm.formGroup.controls['host'].valid
&& this.entityForm.formGroup.controls['private_key'].valid
&& this.entityForm.formGroup.controls['username'].valid;
}
setDisabled(fieldConfig: any, fieldName: string, disable: boolean, hide = false): void {
......
......@@ -799,7 +799,11 @@ export class ReplicationWizardComponent {
(res: ReplicationTask[]) => {
for (const task of res) {
if (task.transport !== TransportMode.Legacy) {
const lable = task.name + ' (' + ((task.state && task.state.datetime) ? 'last run ' + this.datePipe.transform(new Date(task.state.datetime.$date), 'MM/dd/yyyy') : 'never ran') + ')';
// TODO: Change to icu message format.
const lable = task.name + ' (' + ((task.state && task.state.datetime)
? 'last run ' + this.datePipe.transform(new Date(task.state.datetime.$date), 'MM/dd/yyyy')
: 'never ran')
+ ')';
exist_replicationField.options.push({ label: lable, value: task });
if (this.pk === task.id) {
this.loadOrClearReplicationTask(task);
......@@ -909,8 +913,13 @@ export class ReplicationWizardComponent {
step1Init(): void {
this.entityWizard.formArray.controls[1].controls['retention_policy'].valueChanges.subscribe((value: any) => {
const disable = value === RetentionPolicy.Source;
disable ? this.entityWizard.formArray.controls[1].controls['lifetime_value'].disable() : this.entityWizard.formArray.controls[1].controls['lifetime_value'].enable();
disable ? this.entityWizard.formArray.controls[1].controls['lifetime_unit'].disable() : this.entityWizard.formArray.controls[1].controls['lifetime_unit'].enable();
if (disable) {
this.entityWizard.formArray.controls[1].controls['lifetime_value'].disable();
this.entityWizard.formArray.controls[1].controls['lifetime_unit'].disable();
} else {
this.entityWizard.formArray.controls[1].controls['lifetime_value'].enable();
this.entityWizard.formArray.controls[1].controls['lifetime_unit'].enable();
}
});
}
......@@ -985,7 +994,16 @@ export class ReplicationWizardComponent {
task['ssh_credentials_source'] = task.ssh_credentials.id;
}
for (const i of ['source_datasets_from', 'target_dataset_from', 'ssh_credentials_source', 'ssh_credentials_target', 'transport', 'source_datasets', 'target_dataset']) {
const controls = [
'source_datasets_from',
'target_dataset_from',
'ssh_credentials_source',
'ssh_credentials_target',
'transport',
'source_datasets',
'target_dataset',
];
for (const i of controls) {
const ctrl = this.entityWizard.formArray.controls[0].controls[i];
if (ctrl && !ctrl.disabled) {
ctrl.setValue(task[i]);
......@@ -1131,7 +1149,11 @@ export class ReplicationWizardComponent {
};
if (payload.encryption) {
payload['encryption_key_format'] = data['encryption_key_format'];
payload['encryption_key'] = data['encryption_key_format'] === EncryptionKeyFormat.Passphrase ? data['encryption_key_passphrase'] : (data['encryption_key_generate'] ? this.replicationService.generateEncryptionHexKey(64) : data['encryption_key_hex']);
payload['encryption_key'] = data['encryption_key_format'] === EncryptionKeyFormat.Passphrase
? data['encryption_key_passphrase']
: (data['encryption_key_generate']
? this.replicationService.generateEncryptionHexKey(64)
: data['encryption_key_hex']);
payload['encryption_key_location'] = data['encryption_key_location_truenasdb'] ? '$TrueNAS' : data['encryption_key_location'];
}
......@@ -1366,14 +1388,18 @@ export class ReplicationWizardComponent {
}
getSnapshots(): void {
let transport = this.entityWizard.formArray.controls[0].controls['transport'].enabled ? this.entityWizard.formArray.controls[0].controls['transport'].value : TransportMode.Local;
let transport = this.entityWizard.formArray.controls[0].controls['transport'].enabled
? this.entityWizard.formArray.controls[0].controls['transport'].value
: TransportMode.Local;
// count local snapshots if transport is SSH/SSH-NETCAT, and direction is PUSH
if (this.entityWizard.formArray.controls[0].controls['ssh_credentials_target'].value) {
transport = TransportMode.Local;
}
const payload = [
this.entityWizard.formArray.controls[0].controls['source_datasets'].value || [],
(this.entityWizard.formArray.controls[0].controls['naming_schema'].enabled && this.entityWizard.formArray.controls[0].controls['naming_schema'].value) ? this.entityWizard.formArray.controls[0].controls['naming_schema'].value.split(' ') : [this.defaultNamingSchema],
(this.entityWizard.formArray.controls[0].controls['naming_schema'].enabled && this.entityWizard.formArray.controls[0].controls['naming_schema'].value)
? this.entityWizard.formArray.controls[0].controls['naming_schema'].value.split(' ')
: [this.defaultNamingSchema],
transport,
transport === TransportMode.Local ? null : this.entityWizard.formArray.controls[0].controls['ssh_credentials_source'].value,
];
......
......@@ -246,7 +246,15 @@ export class JailFormService {
for (let i = 0; i < value[propName].length; i++) {
const subAddr = value[propName][i];
if (subAddr[propName] != '' && subAddr[propName] != undefined) {
multi_ipaddr.push(this.getFullIP(ipType, subAddr[ipType + '_interface'], subAddr[propName], subAddr[ipType + (ipType == 'ip4' ? '_netmask' : '_prefix')], ip4_interfaceField, ip6_interfaceField));
const ip = this.getFullIP(
ipType,
subAddr[ipType + '_interface'],
subAddr[propName],
subAddr[ipType + (ipType == 'ip4' ? '_netmask' : '_prefix')],
ip4_interfaceField,
ip6_interfaceField,
);
multi_ipaddr.push(ip);
}
}
value[propName] = multi_ipaddr.join(',');
......
......@@ -143,9 +143,23 @@ export class ConfigurationComponent implements FormConfiguration {
name: 'outbound_network_activity',
placeholder: '',
options: [
{ label: helptext.outbound_network_activity.allow.placeholder, value: 'DENY', tooltip: helptext.outbound_network_activity.allow.tooltip }, // deny type + empty list
{ label: helptext.outbound_network_activity.deny.placeholder, value: 'ALLOW', tooltip: helptext.outbound_network_activity.deny.tooltip }, // allow type + empty list
{ label: helptext.outbound_network_activity.specific.placeholder, value: 'SPECIFIC', tooltip: helptext.outbound_network_activity.specific.tooltip },
// deny type + empty list
{
label: helptext.outbound_network_activity.allow.placeholder,
value: 'DENY',
tooltip: helptext.outbound_network_activity.allow.tooltip,
},
// allow type + empty list
{
label: helptext.outbound_network_activity.deny.placeholder,
value: 'ALLOW',
tooltip: helptext.outbound_network_activity.deny.tooltip,
},
{
label: helptext.outbound_network_activity.specific.placeholder,
value: 'SPECIFIC',
tooltip: helptext.outbound_network_activity.specific.tooltip,
},
],
value: 'DENY',
},
......
......@@ -171,7 +171,9 @@ export class NetworkComponent extends ViewControllerComponent implements OnInit,
afterGetData() {
const state = this.parent.navigation.extras.state as { configureOpenVPN: string };
if (state && state.configureOpenVPN) {
state.configureOpenVPN === 'client' ? this.parent.modalService.open('slide-in-form', this.parent.openvpnClientComponent) : this.parent.modalService.open('slide-in-form', this.parent.openvpnServerComponent);
state.configureOpenVPN === 'client'
? this.parent.modalService.open('slide-in-form', this.parent.openvpnClientComponent)
: this.parent.modalService.open('slide-in-form', this.parent.openvpnServerComponent);
}
},
};
......
......@@ -399,7 +399,9 @@ export class ReportsDashboardComponent implements OnInit, OnDestroy, /* HandleCh
name: 'metrics',
width: 'calc(50% - 16px)',
placeholder: T('Choose a metric'),
options: this.diskMetrics ? this.diskMetrics : [{ label: 'None available', value: 'negative' }], // eg. [{label:'temperature',value:'temperature'},{label:'operations', value:'disk_ops'}],
// eg. [{label:'temperature',value:'temperature'},{label:'operations', value:'disk_ops'}],
options: this.diskMetrics ? this.diskMetrics : [{ label: 'None available', value: 'negative' }],
required: true,
multiple: true,
tooltip: T('Choose a metric to display.'),
......
......@@ -421,7 +421,13 @@ export class ServiceFTPComponent implements FormConfiguration, OnInit {
this.rootlogin_fg = entityEdit.formGroup.controls['rootlogin'];
this.rootloginSubscription = this.rootlogin_fg.valueChanges.subscribe((res: any) => {
if (res && !this.warned && !this.rootlogin) {
this.dialog.confirm(helptext.rootlogin_dialog_title, helptext.rootlogin_dialog_message, false, T('Continue'), false, '', null, {}, null, false, T('Cancel'), true).subscribe((confirm: any) => {
this.dialog.confirm({
title: helptext.rootlogin_dialog_title,
message: helptext.rootlogin_dialog_message,
buttonMsg: T('Continue'),
cancelMsg: T('Cancel'),
disableClose: true,
}).subscribe((confirm) => {
if (!confirm) {
this.rootlogin_fg.setValue(false);
} else {
......
......@@ -196,7 +196,10 @@ export class TargetFormComponent implements FormConfiguration {
(initiatorsRes) => {
initiatorGroupField.options.push({ label: 'None', value: null });
for (let i = 0; i < initiatorsRes.length; i++) {
const optionLabel = initiatorsRes[i].id + ' (' + (initiatorsRes[i].initiators.length === 0 ? 'ALL Initiators Allowed' : initiatorsRes[i].initiators.toString()) + ')';
const optionLabel = initiatorsRes[i].id
+ ' ('
+ (initiatorsRes[i].initiators.length === 0 ? 'ALL Initiators Allowed' : initiatorsRes[i].initiators.toString())
+ ')';
initiatorGroupField.options.push({ label: optionLabel, value: initiatorsRes[i].id });
}
resolve(true);
......
......@@ -64,7 +64,11 @@ export class TargetListComponent implements OnInit {
}
doAdd(rowId: string = null): void {
this.modalService.open('slide-in-form', new TargetFormComponent(this.router, this.aroute, this.iscsiService, this.loader, this.translate, this.ws, this.modalService), rowId);
this.modalService.open(
'slide-in-form',
new TargetFormComponent(this.router, this.aroute, this.iscsiService, this.loader, this.translate, this.ws, this.modalService),
rowId,
);
this.modalService.onClose$.subscribe(() => {
this.entityList.getData();
});
......
......@@ -1559,7 +1559,10 @@ export class VolumesListTableConfig implements InputTableConf {
body['pbkdf2iters'] = formValue.pbkdf2iters;
}
payload.push(body);
const dialogRef = self.mdDialog.open(EntityJobComponent, { data: { title: helptext.encryption_options_dialog.save_encryption_options }, disableClose: true });
const dialogRef = self.mdDialog.open(EntityJobComponent, {
data: { title: helptext.encryption_options_dialog.save_encryption_options },
disableClose: true,
});
dialogRef.componentInstance.setDescription(helptext.encryption_options_dialog.saving_encryption_options);
dialogRef.componentInstance.setCall(method, payload);
dialogRef.componentInstance.submit();
......@@ -1787,7 +1790,22 @@ export class VolumesListTableConfig implements InputTableConf {
export class VolumesListComponent extends EntityTableComponent implements OnInit, OnDestroy {
title = T('Pools');
zfsPoolRows: ZfsPoolData[] = [];
conf: InputTableConf = new VolumesListTableConfig(this, this.router, '', [], this.mdDialog, this.ws, this.dialogService, this.loader, this.translate, this.storage, {}, this.messageService, this.http, this.validationService);
conf: InputTableConf = new VolumesListTableConfig(
this,
this.router,
'',
[],
this.mdDialog,
this.ws,
this.dialogService,
this.loader,
this.translate,
this.storage,
{},
this.messageService,
this.http,
this.validationService,
);
actionComponent = {
getActions: (row: Pool) => {
......@@ -1810,7 +1828,22 @@ export class VolumesListComponent extends EntityTableComponent implements OnInit
return actions;
},
conf: new VolumesListTableConfig(this, this.router, '', [], this.mdDialog, this.ws, this.dialogService, this.loader, this.translate, this.storage, {}, this.messageService, this.http, this.validationService),
conf: new VolumesListTableConfig(
this,
this.router,
'',
[],
this.mdDialog,
this.ws,
this.dialogService,
this.loader,
this.translate,
this.storage,
{},
this.messageService,
this.http,
this.validationService,
),
};
expanded = false;
......@@ -1860,11 +1893,27 @@ export class VolumesListComponent extends EntityTableComponent implements OnInit
readonly PoolStatus = PoolStatus;
constructor(protected core: CoreService, protected rest: RestService, protected router: Router, protected ws: WebSocketService,
protected _eRef: ElementRef, protected dialogService: DialogService, protected loader: AppLoaderService,
protected mdDialog: MatDialog, protected erdService: ErdService, protected translate: TranslateService,
public sorter: StorageService, protected job: JobService, protected storage: StorageService, protected pref: PreferencesService,
protected messageService: MessageService, protected http: HttpClient, modalService: ModalService, public tableService: EntityTableService, protected validationService: ValidationService) {
constructor(
protected core: CoreService,
protected rest: RestService,
protected router: Router,
protected ws: WebSocketService,
protected _eRef: ElementRef,
protected dialogService: DialogService,
protected loader: AppLoaderService,
protected mdDialog: MatDialog,
protected erdService: ErdService,
protected translate: TranslateService,
public sorter: StorageService,
protected job: JobService,
protected storage: StorageService,
protected pref: PreferencesService,
protected messageService: MessageService,
protected http: HttpClient,
modalService: ModalService,
public tableService: EntityTableService,
protected validationService: ValidationService,
) {
super(core, rest, router, ws, _eRef, dialogService, loader, erdService, translate, sorter, job, pref, mdDialog, modalService, tableService);
this.actionsConfig = { actionType: VolumesListControlsComponent, actionConfig: this };
......@@ -1928,7 +1977,22 @@ export class VolumesListComponent extends EntityTableComponent implements OnInit
}
pool.children = pChild ? [pChild] : [];
pool.volumesListTableConfig = new VolumesListTableConfig(this, this.router, pool.id, datasets, this.mdDialog, this.ws, this.dialogService, this.loader, this.translate, this.storage, pool, this.messageService, this.http, this.validationService);
pool.volumesListTableConfig = new VolumesListTableConfig(
this,
this.router,
pool.id,
datasets,
this.mdDialog,
this.ws,
this.dialogService,
this.loader,
this.translate,
this.storage,
pool,
this.messageService,
this.http,
this.validationService,
);
pool.type = 'zpool';
if (pool.children && pool.children[0]) {
......
......@@ -145,7 +145,13 @@ export class FailoverComponent implements FormConfiguration, OnDestroy {
this.master_fg = this.entityForm.formGroup.controls['master'];
this.masterSubscription = this.master_fg.valueChanges.subscribe((res: any) => {
if (!res && !this.warned) {
this.dialog.confirm(helptext_system_failover.master_dialog_title, helptext_system_failover.master_dialog_warning, false, T('Continue'), false, '', null, {}, null, false, T('Cancel'), true).subscribe((confirm: boolean) => {
this.dialog.confirm({
title: helptext_system_failover.master_dialog_title,
message: helptext_system_failover.master_dialog_warning,
buttonMsg: T('Continue'),
cancelMsg: T('Cancel'),
disableClose: true,
}).subscribe((confirm) => {
if (!confirm) {
this.master_fg.setValue(true);
} else {
......
......@@ -633,7 +633,9 @@ export class UpdateComponent implements OnInit, OnDestroy {
this.router.navigate([this.router.url + '/manualupdate']);
break;
case 'applyPending':
const message = this.isHA ? 'The standby controller will be automatically restarted to finalize the update. Apply updates and restart the standby controller?' : 'The system will reboot and be briefly unavailable while applying updates. Apply updates and reboot?';
const message = this.isHA
? 'The standby controller will be automatically restarted to finalize the update. Apply updates and restart the standby controller?'
: 'The system will reboot and be briefly unavailable while applying updates. Apply updates and reboot?';
this.dialogService.confirm(
T('Apply Pending Updates'), T(message),
).subscribe((res: boolean) => {
......
......@@ -289,8 +289,10 @@ export class EnclosureDisksComponent implements AfterContentInit, OnChanges, OnD
ngOnChanges(changes: SimpleChanges): void {
if (changes.selectedEnclosure) {
// Enabled subenclosure functionality
this.subenclosure = changes.selectedEnclosure.currentValue.enclosureKey == this.system.headIndex && this.system.rearIndex ? changes.selectedEnclosure.currentValue : undefined;
this.loadEnclosure(changes.selectedEnclosure.currentValue, EnclosureLocation.Front);
this.subenclosure = this.selectedEnclosure.enclosureKey == this.system.headIndex && this.system.rearIndex
? this.selectedEnclosure
: undefined;
this.loadEnclosure(this.selectedEnclosure, EnclosureLocation.Front);
}
}
......@@ -773,7 +775,9 @@ export class EnclosureDisksComponent implements AfterContentInit, OnChanges, OnD
}
// Also check slot status
const elements: any[] = this.system.rearIndex && disk.enclosure.number == this.system.rearIndex ? this.system.enclosures[disk.enclosure.number].elements : this.system.enclosures[disk.enclosure.number].elements[0].elements;
const elements: any[] = this.system.rearIndex && disk.enclosure.number == this.system.rearIndex
? this.system.enclosures[disk.enclosure.number].elements
: this.system.enclosures[disk.enclosure.number].elements[0].elements;
const slot = elements.filter((s: any) => s.slot == disk.enclosure.slot)[0];
if (!failed && slot.fault) {
......@@ -812,7 +816,9 @@ export class EnclosureDisksComponent implements AfterContentInit, OnChanges, OnD
}
// Also check slot status
const elements = this.system.rearIndex && disk.enclosure.number == this.system.rearIndex ? this.system.enclosures[disk.enclosure.number].elements : this.system.enclosures[disk.enclosure.number].elements[0].elements;
const elements = this.system.rearIndex && disk.enclosure.number == this.system.rearIndex
? this.system.enclosures[disk.enclosure.number].elements
: this.system.enclosures[disk.enclosure.number].elements[0].elements;
const slot = elements.filter((s: any) => s.slot == disk.enclosure.slot);
if (!failed && slot.fault) {
......
......@@ -1097,11 +1097,19 @@ export class VMWizardComponent {
this.ws.call('vm.delete', [vm_res.id, { zvols: false, force: false }]).subscribe(
() => {
this.loader.close();
this.dialogService.errorReport(T('Error creating VM.'), T('We ran into an error while trying to create the ') + error.device.dtype + ' device.\n' + error.reason, error.trace.formatted);
this.dialogService.errorReport(
T('Error creating VM.'),
T('We ran into an error while trying to create the ') + error.device.dtype + ' device.\n' + error.reason,
error.trace.formatted,
);
},
(err) => {
this.loader.close();
this.dialogService.errorReport(T('Error creating VM.'), T('We ran into an error while trying to create the ') + error.device.dtype + ' device.\n' + error.reason, error.trace.formatted);
this.dialogService.errorReport(
T('Error creating VM.'),
T('We ran into an error while trying to create the ') + error.device.dtype + ' device.\n' + error.reason,
error.trace.formatted,
);
new EntityUtils().handleWSError(this, err, this.dialogService);
},
);
......@@ -1152,11 +1160,17 @@ export class VMWizardComponent {
this.ws.call('vm.delete', [vm_res.id, { zvols: false, force: false }]).subscribe(
() => {
this.loader.close();
this.dialogService.errorReport(T('Error creating VM.'), T('Error while creating the ') + error.device.dtype + ' device.\n' + error.reason, error.trace.formatted);
this.dialogService.errorReport(
T('Error creating VM.'),
T('Error while creating the ') + error.device.dtype + ' device.\n' + error.reason, error.trace.formatted,
);
},
(err) => {
this.loader.close();
this.dialogService.errorReport(T('Error creating VM.'), T('Error while creating the ') + error.device.dtype + ' device.\n' + error.reason, error.trace.formatted);
this.dialogService.errorReport(
T('Error creating VM.'),
T('Error while creating the ') + error.device.dtype + ' device.\n' + error.reason, error.trace.formatted,
);
new EntityUtils().handleWSError(this, err, this.dialogService);
},
);
......
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