Commit b32018cf authored by Denys Butenko's avatar Denys Butenko
Browse files

Merge branch 'master' into NAS-110075-untilDestroy

# Conflicts:
#	src/app/pages/applications/chart-releases/chart-releases.component.ts
#	src/app/pages/common/entity/entity-form/services/field-relation.service.ts
#	src/app/pages/plugins/plugin-add/plugin-add.component.ts
#	src/app/pages/system/alertservice/alertservice-list/alertservice-list.component.ts
#	src/app/pages/system/failover/failover.component.ts
parents 307df31a b0bb1c90
Showing with 102 additions and 77 deletions
+102 -77
......@@ -3,7 +3,7 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"freenas-material-ui": {
"truenas-scale-ui": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
......@@ -99,18 +99,18 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "freenas-material-ui:build"
"browserTarget": "truenas-scale-ui:build"
},
"configurations": {
"production": {
"browserTarget": "freenas-material-ui:build:production"
"browserTarget": "truenas-scale-ui:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "freenas-material-ui:build"
"browserTarget": "truenas-scale-ui:build"
}
},
"test": {
......@@ -161,7 +161,7 @@
}
}
},
"defaultProject": "freenas-material-ui",
"defaultProject": "truenas-scale-ui",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
......
......@@ -36,7 +36,7 @@ export class AdminLayoutComponent implements OnInit, AfterViewChecked {
isSidenotOpen = false;
consoleMsg = '';
hostname: string;
consoleMSgList: any[] = [];
consoleMSgList: string[] = [];
product_type = window.localStorage['product_type'] as ProductType;
logoPath = 'assets/images/light-logo.svg';
logoTextPath = 'assets/images/light-logo-text.svg';
......
......@@ -22,15 +22,15 @@ export class AuthLayoutComponent implements OnInit {
const palette = Object.keys(theme) as (keyof Theme)[];
palette.splice(0, 6);
const admin_layout_el = (<any>document).getElementsByTagName('APP-AUTH-LAYOUT')[0];
const admin_layout_el = document.getElementsByTagName('APP-AUTH-LAYOUT')[0] as HTMLElement;
palette.forEach((color) => {
admin_layout_el.style.setProperty('--' + color, theme[color]);
(<any>document).documentElement.style.setProperty('--' + color, theme[color]);
admin_layout_el.style.setProperty('--' + color, theme[color] as string);
document.documentElement.style.setProperty('--' + color, theme[color] as string);
});
admin_layout_el.style.setProperty('--primary', theme['primary']);
admin_layout_el.style.setProperty('--accent', theme['accent']);
(<any>document).documentElement.style.setProperty('--primary', theme['primary']);
(<any>document).documentElement.style.setProperty('--accent', theme['accent']);
document.documentElement.style.setProperty('--primary', theme['primary']);
document.documentElement.style.setProperty('--accent', theme['accent']);
}
}
......@@ -374,9 +374,8 @@ export class DisplayObject {
} else {
blurValue -= 15;
}
// document.querySelector('.wallpaper').style.filter = "blur(" + blurValue + "px)";
// document.querySelector('.panel').style.filter = "blur(" + blurValue + "px)";
(<any>document).querySelector('.desktop').style.filter = 'blur(' + blurValue + 'px)';
document.querySelector<HTMLElement>('.desktop').style.filter = 'blur(' + blurValue + 'px)';
}
refocus(): void {
......
......@@ -57,7 +57,7 @@ export class ChassisView {
disabledOpacity = 0.25;
chassisOpacity = 0.25;
initialized = false;
loader: any;
loader: PIXI.loaders.Loader;
autoPosition = true;
protected utils: ThemeUtils;
......
......@@ -50,7 +50,7 @@ export class LayoutObject {
return this._containerSelector;
}
set containerSelector(value: string) {
this.container = (<any>document).querySelector(value);
this.container = document.querySelector(value);
this._containerSelector = value;
}
......
......@@ -26,15 +26,12 @@ export class CardComponent extends ViewControllerComponent {
* addHeaderTitle(title: string);
*/
// @ViewChild('display', { static: true}) display; // Already created in base class by default
primaryAction?: any; /* ViewFabButton */
header = false;
headerTitle?: string;
// public headerOptions?: any; /*ViewControl*/
@ViewChild('headerOptions', { static: true }) headerOptions: any;
footer = true;
@ViewChild('footerControls', { static: true }) footerControls: any;
constructor() {
super();
......
......@@ -71,7 +71,7 @@ export class WidgetCpuComponent extends WidgetComponent implements AfterViewInit
legendIndex: number;
labels: string[] = [];
protected currentTheme: any;
protected currentTheme: Theme;
private utils: ThemeUtils;
constructor(
......@@ -362,7 +362,7 @@ export class WidgetCpuComponent extends WidgetComponent implements AfterViewInit
color = this.stripVar(this.currentTheme[cssVar]);
}
const bgRGB = this.utils.convertToRGB(this.currentTheme[color]).rgb;
const bgRGB = this.utils.convertToRGB((this.currentTheme as any)[color]).rgb;
ds.backgroundColor = this.rgbToString(bgRGB as any, 0.85);
ds.borderColor = this.rgbToString(bgRGB as any);
......
......@@ -181,7 +181,7 @@ export class WidgetPoolComponent extends WidgetComponent implements AfterViewIni
title: string = this.path.length > 0 && this.poolState && this.currentSlide !== '0' ? this.poolState.name : 'Pool';
voldataavail = false;
displayValue: any;
diskSize: any;
diskSize: string;
diskSizeLabel: string;
poolHealth: PoolDiagnosis = {
isHealthy: true,
......
......@@ -50,7 +50,6 @@ export class WidgetSysInfoComponent extends WidgetComponent implements OnDestroy
buildDate: string;
loader = false;
product_type = window.localStorage['product_type'] as ProductType;
systemLogo: any;
isFN = false;
isUpdateRunning = false;
is_ha: boolean;
......
......@@ -18,22 +18,18 @@ export interface AnimationConfig {
animationTarget: DisplayObject; // Support DisplayObject
animation: string; // eg. fadeIn, slideOut etc
finishState: string; // In || Out || Start || Stop
finishPosition?: any; // XY? Haven't decided how this one will work yet
}
export interface GroupAnimationConfig {
animationTargets: DisplayObject[]; // Supports DisplayObjects only
animation: string; // eg. fadeIn, slideOut etc
finishState: string; // In || Out || Start || Stop
finishPosition?: any; // XY? Haven't decided how this one will work yet
staggered?: boolean;
}
@UntilDestroy()
@Injectable()
export class AnimationService {
private doc: any; // Document Object
private colorLoopActive: any;
private activeAnimations: any = {};
constructor(private core: CoreService) {
......@@ -267,7 +263,7 @@ export class AnimationService {
}
private scrollTo(destination: string): void {
const rawScrollTarget = (<any>document).querySelector(destination);
const rawScrollTarget = document.querySelector(destination);
rawScrollTarget.scrollIntoView(); // native method works but without a smooth transition
}
......
......@@ -114,7 +114,7 @@ export class InteractionManagerService {
let tracker: DisplayObject;
if (config.moveHandle) {
const moveHandle = (<any>document).querySelector(config.moveHandle);
const moveHandle = document.querySelector(config.moveHandle);
tracker = new DisplayObject(el, observable, this.messageBus, moveHandle);
} else {
tracker = new DisplayObject(el, observable, this.messageBus);
......
export enum AlertServiceType {
AwsSns = 'AWSSNS',
Mail = 'Mail',
InfluxDb = 'InfluxDB',
Mattermost = 'Mattermost',
OpsGenie = 'OpsGenie',
PagerDuty = 'PagerDuty',
Slack = 'Slack',
SnmpTrap = 'SNMPTrap',
Telegram = 'Telegram',
VictorOps = 'VictorOps',
}
import { RelationAction } from 'app/pages/common/entity/entity-form/models/relation-action.enum';
import { RelationConnection } from 'app/pages/common/entity/entity-form/models/relation-connection.enum';
import { T } from '../../../translate-marker';
import { Validators } from '@angular/forms';
......@@ -34,7 +36,7 @@ export default {
the client and the server to sync users and groups.'),
nfs_srv_v4_v3owner_relation: [
{
action: 'DISABLE',
action: RelationAction.Disable,
when: [{
name: 'v4',
value: false,
......@@ -65,8 +67,8 @@ export default {
This assumes group membership is configured correctly\
on the NFS server.'),
nfs_srv_16_relation: [{
action: 'DISABLE',
connective: 'AND',
action: RelationAction.Disable,
connective: RelationConnection.And,
when: [{
name: 'v4',
value: true,
......
import { RelationAction } from 'app/pages/common/entity/entity-form/models/relation-action.enum';
import { T } from '../../../translate-marker';
import { Validators } from '@angular/forms';
......@@ -29,7 +30,7 @@ export default {
v3_username_placeholder: T('Username'),
v3_username_tooltip: T('Enter a username to register with this service.'),
v3_username_relation: [{
action: 'HIDE',
action: RelationAction.Hide,
when: [{ name: 'v3', value: false }],
}],
......@@ -40,7 +41,7 @@ export default {
{ label: 'SHA', value: 'SHA' },
],
v3_authtype_relation: [{
action: 'HIDE',
action: RelationAction.Hide,
when: [{ name: 'v3', value: false }],
}],
......@@ -48,14 +49,14 @@ export default {
v3_password_tooltip: T('Enter a password of at least eight characters.'),
v3_password_validation: [Validators.minLength(8), Validators.required],
v3_password_relation: [{
action: 'HIDE',
action: RelationAction.Hide,
when: [{ name: 'v3', value: false }],
}],
v3_password2_placeholder: T('Confirm Password'),
v3_password2_validation: [],
v3_password2_relation: [{
action: 'HIDE',
action: RelationAction.Hide,
when: [{ name: 'v3', value: false }],
}],
......@@ -67,7 +68,7 @@ export default {
{ label: 'DES', value: 'DES' },
],
v3_privproto_relation: [{
action: 'HIDE',
action: RelationAction.Hide,
when: [{ name: 'v3', value: false }],
}],
......@@ -76,13 +77,13 @@ export default {
is used when this is left empty.'),
v3_privpassphrase_validation: [Validators.minLength(8)],
v3_privpassphrase_relation: [{
action: 'HIDE',
action: RelationAction.Hide,
when: [{ name: 'v3', value: false }],
}],
v3_privpassphrase2_placeholder: T('Confirm Privacy Passphrase'),
v3_privpassphrase2_relation: [{
action: 'HIDE',
action: RelationAction.Hide,
when: [{ name: 'v3', value: false }],
}],
......
import { AlertLevel } from 'app/enums/alert-level.enum';
import { AlertServiceType } from 'app/enums/alert-service-type.enum';
export interface AlertService {
attributes: { [attribute: string]: string | number | boolean };
enabled: boolean;
id: number;
level: AlertLevel;
name: string;
type: AlertServiceType;
type__title: string;
}
......@@ -3,6 +3,7 @@ import { ProductType } from 'app/enums/product-type.enum';
import { ServiceName } from 'app/enums/service-name.enum';
import { Acl } from 'app/interfaces/acl.interface';
import { AdvancedConfig } from 'app/interfaces/advanced-config.interface';
import { AlertService } from 'app/interfaces/alert-service.interface';
import { Alert } from 'app/interfaces/alert.interface';
import { ApiTimestamp } from 'app/interfaces/api-date.interface';
import { LoginParams } from 'app/interfaces/auth.interface';
......@@ -70,7 +71,7 @@ export type ApiDirectory = {
// Alert Service
'alertservice.update': { params: any; response: any };
'alertservice.create': { params: any; response: any };
'alertservice.query': { params: any; response: any };
'alertservice.query': { params: QueryParams<AlertService>; response: AlertService[] };
'alertservice.test': { params: any; response: any };
// Api Key
......
import { Component } from '@angular/core';
import { Validators } from '@angular/forms';
import { AbstractControl, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { Option } from 'app/interfaces/option.interface';
import { QueryFilter } from 'app/interfaces/query-api.interface';
import { User } from 'app/interfaces/user.interface';
import { FieldSets } from 'app/pages/common/entity/entity-form/classes/field-sets';
import { RelationAction } from 'app/pages/common/entity/entity-form/models/relation-action.enum';
import { FieldConfig } from 'app/pages/common/entity/entity-form/models/field-config.interface';
import { Observable } from 'rxjs';
import helptext from '../../../../helptext/account/user-form';
import {
......@@ -171,7 +174,7 @@ export class UserFormComponent implements FormConfiguration {
options: [],
relation: [
{
action: 'DISABLE',
action: RelationAction.Disable,
when: [{
name: 'group_create',
value: true,
......@@ -296,11 +299,11 @@ export class UserFormComponent implements FormConfiguration {
},
];
private shells: any;
private shell: any;
private group: any;
private groups: any;
private password_disabled: any;
private shells: Option[];
private shell: FieldConfig;
private group: FieldConfig;
private groups: FieldConfig;
private password_disabled: AbstractControl;
constructor(protected router: Router,
protected ws: WebSocketService,
......
......@@ -10,11 +10,11 @@
</mat-tab>
<mat-tab label="{{ 'Manage Catalogs' | translate}}"
ix-auto ix-auto-type="tab" ix-auto-identifier="manage-catalog">
<app-manage-catalogs (updateTab)="updateTab($event)"></app-manage-catalogs>
<app-manage-catalogs></app-manage-catalogs>
</mat-tab>
<mat-tab label="{{ 'Manage Docker Images' | translate}}"
ix-auto ix-auto-type="tab" ix-auto-identifier="manage-docker-images">
<app-docker-images (updateTab)="updateTab($event)"></app-docker-images>
<app-docker-images></app-docker-images>
</mat-tab>
</mat-tab-group>
</div>
......
......@@ -49,7 +49,7 @@ export class ChartReleasesComponent implements OnInit {
protected utils: CommonUtils;
private refreshForm: Subscription;
settingsEvent: Subject<CoreEvent>;
private chartReleaseChangedListener: any;
private chartReleaseChangedListener: Subscription;
private selectedAppName: String;
private podList: any[] = [];
......@@ -472,36 +472,39 @@ export class ChartReleasesComponent implements OnInit {
bulkDelete(names: string[]): void {
const name = names.join(',');
this.translate.get(helptext.charts.delete_dialog.msg).pipe(untilDestroyed(this)).subscribe((msg) => {
this.dialogService.confirm(helptext.charts.delete_dialog.title, msg + name + '?')
.pipe(untilDestroyed(this)).subscribe((res: any) => {
if (res) {
this.dialogRef = this.mdDialog.open(EntityJobComponent, {
data: {
title: (
helptext.charts.delete_dialog.job),
},
disableClose: true,
});
this.dialogRef.componentInstance.setCall('core.bulk', ['chart.release.delete', names.map((item) => [item])]);
this.dialogRef.componentInstance.submit();
this.dialogRef.componentInstance.success.pipe(untilDestroyed(this)).subscribe((res: any) => {
this.dialogService.closeAllDialogs();
let message = '';
for (let i = 0; i < res.result.length; i++) {
if (res.result[i].error != null) {
message = message + '<li>' + res.result[i].error + '</li>';
}
}
this.dialogService.confirm({
title: helptext.charts.delete_dialog.title,
message: msg + name + '?',
}).pipe(untilDestroyed(this)).subscribe((wasConfirmed) => {
if (!wasConfirmed) {
return;
}
if (message !== '') {
message = '<ul>' + message + '</ul>';
this.dialogService.errorReport(helptext.bulkActions.title, message);
}
this.modalService.close('slide-in-form');
this.refreshChartReleases();
});
this.dialogRef = this.mdDialog.open(EntityJobComponent, {
data: {
title: helptext.charts.delete_dialog.job,
},
disableClose: true,
});
this.dialogRef.componentInstance.setCall('core.bulk', ['chart.release.delete', names.map((item) => [item])]);
this.dialogRef.componentInstance.submit();
this.dialogRef.componentInstance.success.subscribe((res: any) => {
this.dialogService.closeAllDialogs();
let message = '';
for (let i = 0; i < res.result.length; i++) {
if (res.result[i].error != null) {
message = message + '<li>' + res.result[i].error + '</li>';
}
}
if (message !== '') {
message = '<ul>' + message + '</ul>';
this.dialogService.errorReport(helptext.bulkActions.title, message);
}
this.modalService.close('slide-in-form');
this.refreshChartReleases();
});
});
});
}
......
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