@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
803 lines • 111 kB
JavaScript
import * as i0 from '@angular/core';
import { Injectable, Optional, Inject, Input, Component, EventEmitter, Output, NgModule } from '@angular/core';
import * as i1 from '@c8y/ngx-components';
import { NavigatorNode, gettext, Permissions, ListGroupComponent, ListItemComponent, C8yTranslatePipe, ListItemIconComponent, C8yTranslateDirective, PluginLoadedPipe, EmptyStateComponent, IconDirective, ListItemRadioComponent, TitleComponent, BreadcrumbComponent, BreadcrumbItemComponent, ProductExperienceDirective, CoreModule, hookRoute, hookNavigator, hookStepper, Steppers } from '@c8y/ngx-components';
import * as i2 from '@c8y/ngx-components/ecosystem/shared';
import * as i2$1 from '@c8y/ngx-components/assets-navigator';
import { ASSET_NAVIGATOR_CONFIG, AssetSelectorComponent, AssetSelectorModule } from '@c8y/ngx-components/assets-navigator';
import { EcosystemModule } from '@c8y/ngx-components/ecosystem';
import { IconSelectorWrapperComponent, IconSelectorModule } from '@c8y/ngx-components/icon-selector';
import { PopoverDirective, PopoverModule } from 'ngx-bootstrap/popover';
import { TooltipDirective, TooltipModule } from 'ngx-bootstrap/tooltip';
import * as i3 from '@c8y/client';
import { isUndefined, uniqBy, startCase } from 'lodash-es';
import { take, map, filter } from 'rxjs/operators';
import * as i5 from '@angular/forms';
import { FormsModule } from '@angular/forms';
import { NgIf, AsyncPipe, NgFor } from '@angular/common';
import * as i2$2 from '@angular/cdk/stepper';
const DEFAULT_HOME_DASHBOARD_NAME = 'home-cockpit1';
const USER_HOME_DASHBOARD_NAME = 'home-cockpit-user';
const DEFAULT_CONFIG = {
rootNodes: [],
features: {
alarms: true,
dataExplorer: true,
groups: true,
reports: true,
exports: true,
dataPointLibrary: true,
globalSmartRules: true,
smartRules: true,
subassets: true,
search: true,
dashboardManager: true
},
hideNavigator: false,
homeDashboardName: DEFAULT_HOME_DASHBOARD_NAME,
userSpecificHomeDashboard: false,
icon: {
class: 'c8y-cockpit'
},
htmlWidgetDisableSanitization: false,
htmlWidgetDefaultToAdvancedMode: false
};
var HomeDashboardType;
(function (HomeDashboardType) {
/**
* Shared by all Cockpit apps
*/
HomeDashboardType[HomeDashboardType["DEFAULT"] = 0] = "DEFAULT";
/**
* Only for the current Cockpit.
*/
HomeDashboardType[HomeDashboardType["APP"] = 1] = "APP";
/**
* Only for the current user.
*/
HomeDashboardType[HomeDashboardType["USER"] = 2] = "USER";
})(HomeDashboardType || (HomeDashboardType = {}));
const COCKPIT_CONFIG_PATH = 'cockpit-application-configuration';
class CockpitConfigGuard {
constructor(permissions, appState, ecosystemService) {
this.permissions = permissions;
this.appState = appState;
this.ecosystemService = ecosystemService;
this.configNode = new NavigatorNode({
path: `/${COCKPIT_CONFIG_PATH}`,
parent: gettext('Configuration'),
label: gettext('Application configuration'),
icon: 'imac-settings',
preventDuplicates: true
});
}
get() {
if (this.canActivate()) {
return this.configNode;
}
return;
}
canActivate() {
return (this.permissions.hasRole(Permissions.ROLE_APPLICATION_MANAGEMENT_ADMIN) &&
this.ecosystemService.isOwner(this.appState.currentApplication.value));
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitConfigGuard, deps: [{ token: i1.Permissions }, { token: i1.AppStateService }, { token: i2.EcosystemService }], target: i0.ɵɵFactoryTarget.Injectable }); }
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitConfigGuard, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitConfigGuard, decorators: [{
type: Injectable,
args: [{
providedIn: 'root'
}]
}], ctorParameters: () => [{ type: i1.Permissions }, { type: i1.AppStateService }, { type: i2.EcosystemService }] });
class CockpitConfigService {
get excludedFeatureKeys() {
return Object.keys(this.currentConfig.features).filter(key => !this.currentConfig.features[key]);
}
constructor(navigatorService, tabsService, searchService, assetNodeService, inventoryService, appState, applicationService, optionsService, permissions, moduleConfig) {
this.navigatorService = navigatorService;
this.tabsService = tabsService;
this.searchService = searchService;
this.assetNodeService = assetNodeService;
this.inventoryService = inventoryService;
this.appState = appState;
this.applicationService = applicationService;
this.optionsService = optionsService;
this.permissions = permissions;
this.moduleConfig = moduleConfig;
this.currentConfig = DEFAULT_CONFIG;
this.nodes = [];
this.navigationFactory = {
get: () => this.nodes
};
this.DEFAULT_NODE_PRIORITY = 2000;
this.registerFilterForFeatures();
this.init();
}
init() {
if (this.optionsService.hideNavigator !== undefined) {
this.currentConfig.hideNavigator = this.optionsService.hideNavigator;
}
this.appState.currentApplicationConfig.subscribe(config => {
if (config) {
this.currentConfig = { ...DEFAULT_CONFIG, ...config };
}
});
this.appState.currentApplicationConfig.pipe(take(1)).subscribe(() => {
this.setRootNodes();
});
}
/**
* Save and apply new cockpit configuration
* @param config - New cockpit configuration
*/
async saveConfig(config) {
this.currentConfig = config;
await this.storeApplicationConfig(this.currentConfig);
await this.updateApplication(this.currentConfig);
}
/**
* Update current application using the provided configuration
* @param config - Cockpit configuration
*/
async updateApplication(config) {
if (!config.appTitle && !config.icon) {
return;
}
const application = this.appState.currentApplication.value;
const updatedApp = {
...application,
name: config.appTitle || application.name
};
const manifest = {
...updatedApp.manifest,
name: updatedApp.name,
icon: config.icon || { class: 'c8y-cockpit' }
};
await this.applicationService.update({
id: updatedApp.id,
name: updatedApp.name,
manifest
});
this.appState.currentApplication.next(updatedApp);
}
refresh() {
this.optionsService.hideNavigator = this.currentConfig.hideNavigator;
this.navigatorService.refresh();
this.searchService.refresh();
}
async setRootNodes() {
this.addNodesToFactories();
this.nodes.length = 0;
for (const node of this.currentConfig.rootNodes) {
try {
const { data } = await this.inventoryService.detail(node.id);
if (data) {
this.nodes.push(this.assetNodeService.createAssetNode({
mo: data,
hideDevices: node.hideDevices,
priority: isUndefined(this.moduleConfig?.rootNodePriority)
? this.DEFAULT_NODE_PRIORITY
: this.moduleConfig.rootNodePriority
}));
}
}
catch (error) {
// do nothing
}
}
this.nodes = uniqBy(this.nodes, 'path');
this.refresh();
}
getAppDashboardName() {
return `${DEFAULT_HOME_DASHBOARD_NAME.substring(0, DEFAULT_HOME_DASHBOARD_NAME.length - 1)}_${this.appState.state.app.id}`;
}
async storeApplicationConfig(config) {
await this.appState.updateCurrentApplicationConfig(config);
}
addNodesToFactories() {
const nodeInFactories = this.navigatorService.factories.find(fatcory => fatcory === this.navigationFactory);
if (!nodeInFactories) {
this.navigatorService.factories.push(this.navigationFactory);
}
}
registerFilterForFeatures() {
this.navigatorService.items$ = this.navigatorService.items$.pipe(map(nodes => this.setHiddenAttrLock(nodes)), map(nodes => this.filterNavigatorNode(nodes)));
this.tabsService.items$ = this.tabsService.items$.pipe(map(tabs => this.filterTabs(tabs)));
this.searchService.items$ = this.searchService.items$.pipe(map(search => (this.currentConfig.features.search ? search : [])));
}
setHiddenAttrLock(nodes) {
nodes.forEach(node => {
Object.keys(this.currentConfig.features).forEach(key => {
const childNode = node.find(startCase(key).toLowerCase());
if (childNode) {
if (!this.permissions.hasRole(Permissions.ROLE_APPLICATION_MANAGEMENT_ADMIN) &&
childNode.lockHiddenAttr === undefined &&
childNode.hidden === true) {
childNode.lockHiddenAttr = childNode.hidden;
}
}
});
});
return nodes;
}
filterTabs(tabs) {
return tabs.filter(tab => !this.excludedFeatureKeys.some(key => tab.featureId === key));
}
filterNavigatorNode(nodes) {
if (!this.currentConfig) {
return nodes;
}
const disabledFeatures = this.excludedFeatureKeys;
const filteredNodes = nodes.filter(node => !disabledFeatures.some(key => node.featureId === key));
this.showAllChildrenNodes(nodes);
this.hideChildrenNodesThatAreDisabled(nodes, disabledFeatures);
return filteredNodes;
}
hideChildrenNodesThatAreDisabled(nodes, disabledFeatures) {
nodes.forEach(node => disabledFeatures.forEach(key => {
const childNode = node.find(key, 'featureId');
if (childNode) {
childNode.hidden = true;
}
}));
}
showAllChildrenNodes(nodes) {
nodes.forEach(node => {
Object.keys(this.currentConfig.features).forEach(key => {
const childNode = node.find(startCase(key).toLowerCase());
if (childNode) {
if (childNode.lockHiddenAttr === true) {
return;
}
childNode.hidden = false;
}
});
});
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitConfigService, deps: [{ token: i1.NavigatorService }, { token: i1.TabsService }, { token: i1.SearchService }, { token: i2$1.AssetNodeService }, { token: i3.InventoryService }, { token: i1.AppStateService }, { token: i3.ApplicationService }, { token: i1.OptionsService }, { token: i1.Permissions }, { token: ASSET_NAVIGATOR_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitConfigService, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitConfigService, decorators: [{
type: Injectable,
args: [{
providedIn: 'root'
}]
}], ctorParameters: () => [{ type: i1.NavigatorService }, { type: i1.TabsService }, { type: i1.SearchService }, { type: i2$1.AssetNodeService }, { type: i3.InventoryService }, { type: i1.AppStateService }, { type: i3.ApplicationService }, { type: i1.OptionsService }, { type: i1.Permissions }, { type: undefined, decorators: [{
type: Optional
}, {
type: Inject,
args: [ASSET_NAVIGATOR_CONFIG]
}] }] });
class MiscConfigComponent {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MiscConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: MiscConfigComponent, isStandalone: true, selector: "c8y-misc-config", inputs: { config: "config" }, ngImport: i0, template: "<c8y-list-group class=\"separator-top\">\n <c8y-li>\n <div class=\"d-flex a-i-center\">\n <p>{{ 'Always collapse navigator on start up' | translate }}</p>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Collapse navigator on start up' | translate }}\"\n >\n <input data-cy=\"c8y-misc-config--collapse-button\" type=\"checkbox\" [(ngModel)]=\"config.hideNavigator\" name=\"hideNavigator\" />\n <span></span>\n </label>\n </div>\n </c8y-li>\n</c8y-list-group>\n", dependencies: [{ kind: "component", type: ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MiscConfigComponent, decorators: [{
type: Component,
args: [{ selector: 'c8y-misc-config', imports: [ListGroupComponent, ListItemComponent, FormsModule, C8yTranslatePipe], template: "<c8y-list-group class=\"separator-top\">\n <c8y-li>\n <div class=\"d-flex a-i-center\">\n <p>{{ 'Always collapse navigator on start up' | translate }}</p>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Collapse navigator on start up' | translate }}\"\n >\n <input data-cy=\"c8y-misc-config--collapse-button\" type=\"checkbox\" [(ngModel)]=\"config.hideNavigator\" name=\"hideNavigator\" />\n <span></span>\n </label>\n </div>\n </c8y-li>\n</c8y-list-group>\n" }]
}], propDecorators: { config: [{
type: Input
}] } });
class FeatureConfigComponent {
constructor() {
this.onUpdate = new EventEmitter();
}
updateFeatures() {
this.onUpdate.emit();
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FeatureConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FeatureConfigComponent, isStandalone: true, selector: "c8y-feature-config", inputs: { config: "config" }, outputs: { onUpdate: "onUpdate" }, ngImport: i0, template: "<c8y-list-group>\n <c8y-li data-cy=\"feature-config--feature-list\" *ngIf=\"'SearchModule' | c8yPluginLoaded | async\">\n <c8y-li-icon icon=\"search\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Global search' | translate }}</p>\n <p>\n <small translate>Display the global search in the main header.</small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Global search' | translate }}\"\n >\n <input\n name=\"search\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.search\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\">\n <c8y-li-icon icon=\"c8y-group\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Groups' | translate }}</p>\n <p>\n <small translate>Display top level groups under the Groups navigator menu.</small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Groups' | translate }}\"\n >\n <input\n name=\"groups\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.groups\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\" *ngIf=\"'CockpitAlarmsModule' | c8yPluginLoaded | async\">\n <c8y-li-icon icon=\"bell\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Alarms' | translate }}</p>\n <p>\n <small translate>Display a link to the global alarms list in the navigator menu.</small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Global Alarms view' | translate }}\"\n >\n <input\n name=\"alarms\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.alarms\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\">\n <c8y-li-icon icon=\"c8y-data-explorer\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Data explorer' | translate }}</p>\n <p>\n <small translate>\n Display the data explorer in the navigator menu and on the group tabs.\n </small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Data explorer' | translate }}\"\n >\n <input\n name=\"dataExplorer\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.dataExplorer\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\" *ngIf=\"'ReportDashboardModule' | c8yPluginLoaded | async\">\n <c8y-li-icon icon=\"c8y-reports\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Reports' | translate }}</p>\n <p>\n <small translate>Display a link to the Reports list in the navigator menu.</small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Reports' | translate }}\"\n >\n <input\n name=\"reports\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.reports\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\" *ngIf=\"'exportsProviders' | c8yPluginLoaded | async\">\n <c8y-li-icon icon=\"graph-report\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Exports' | translate }}</p>\n <p>\n <small translate>\n Display a link to the Exports list under the Configuration navigator menu.\n </small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Exports' | translate }}\"\n >\n <input\n name=\"exports\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.exports\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\" *ngIf=\"'DatapointLibraryModule' | c8yPluginLoaded | async\">\n <c8y-li-icon icon=\"c8y-data-points\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Data point library' | translate }}</p>\n <p>\n <small translate>\n Display a link to the Data point library under the Configuration navigator menu.\n </small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Data point library' | translate }}\"\n >\n <input\n name=\"dataPointLibrary\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.dataPointLibrary\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\">\n <c8y-li-icon icon=\"c8y-smart-rules\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Global smart rules' | translate }}</p>\n <p>\n <small translate>\n Display a link to the Global smart rules under the Configuration navigator menu.\n </small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Global smart rules' | translate }}\"\n >\n <input\n name=\"globalSmartRules\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.globalSmartRules\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\">\n <c8y-li-icon icon=\"c8y-group-open\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Subassets view' | translate }}</p>\n <p><small translate>Display the \"Subassets\" tab on groups.</small></p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Subassets view' | translate }}\"\n >\n <input\n name=\"subassets\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.subassets\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\">\n <c8y-li-icon icon=\"c8y-smart-rules\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Smart rules for devices and groups' | translate }}</p>\n <p>\n <small translate>Display the smart rules tab on groups and devices.</small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Smart rules for devices and groups' | translate }}\"\n >\n <input\n name=\"smartRules\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.smartRules\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\" *ngIf=\"'DashboardManagerModule' | c8yPluginLoaded | async\">\n <c8y-li-icon icon=\"management1\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Dashboard manager' | translate }}</p>\n <p>\n <small translate>\n Display a link to the Dashboard manager under the Configuration navigator menu.\n </small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Dashboard manager' | translate }}\"\n >\n <input\n name=\"dashboardManager\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.dashboardManager\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n</c8y-list-group>\n", dependencies: [{ kind: "component", type: ListGroupComponent, selector: "c8y-list-group" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: PluginLoadedPipe, name: "c8yPluginLoaded" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FeatureConfigComponent, decorators: [{
type: Component,
args: [{ selector: 'c8y-feature-config', imports: [
ListGroupComponent,
NgIf,
ListItemComponent,
ListItemIconComponent,
C8yTranslateDirective,
FormsModule,
C8yTranslatePipe,
AsyncPipe,
PluginLoadedPipe
], template: "<c8y-list-group>\n <c8y-li data-cy=\"feature-config--feature-list\" *ngIf=\"'SearchModule' | c8yPluginLoaded | async\">\n <c8y-li-icon icon=\"search\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Global search' | translate }}</p>\n <p>\n <small translate>Display the global search in the main header.</small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Global search' | translate }}\"\n >\n <input\n name=\"search\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.search\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\">\n <c8y-li-icon icon=\"c8y-group\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Groups' | translate }}</p>\n <p>\n <small translate>Display top level groups under the Groups navigator menu.</small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Groups' | translate }}\"\n >\n <input\n name=\"groups\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.groups\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\" *ngIf=\"'CockpitAlarmsModule' | c8yPluginLoaded | async\">\n <c8y-li-icon icon=\"bell\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Alarms' | translate }}</p>\n <p>\n <small translate>Display a link to the global alarms list in the navigator menu.</small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Global Alarms view' | translate }}\"\n >\n <input\n name=\"alarms\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.alarms\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\">\n <c8y-li-icon icon=\"c8y-data-explorer\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Data explorer' | translate }}</p>\n <p>\n <small translate>\n Display the data explorer in the navigator menu and on the group tabs.\n </small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Data explorer' | translate }}\"\n >\n <input\n name=\"dataExplorer\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.dataExplorer\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\" *ngIf=\"'ReportDashboardModule' | c8yPluginLoaded | async\">\n <c8y-li-icon icon=\"c8y-reports\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Reports' | translate }}</p>\n <p>\n <small translate>Display a link to the Reports list in the navigator menu.</small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Reports' | translate }}\"\n >\n <input\n name=\"reports\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.reports\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\" *ngIf=\"'exportsProviders' | c8yPluginLoaded | async\">\n <c8y-li-icon icon=\"graph-report\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Exports' | translate }}</p>\n <p>\n <small translate>\n Display a link to the Exports list under the Configuration navigator menu.\n </small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Exports' | translate }}\"\n >\n <input\n name=\"exports\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.exports\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\" *ngIf=\"'DatapointLibraryModule' | c8yPluginLoaded | async\">\n <c8y-li-icon icon=\"c8y-data-points\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Data point library' | translate }}</p>\n <p>\n <small translate>\n Display a link to the Data point library under the Configuration navigator menu.\n </small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Data point library' | translate }}\"\n >\n <input\n name=\"dataPointLibrary\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.dataPointLibrary\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\">\n <c8y-li-icon icon=\"c8y-smart-rules\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Global smart rules' | translate }}</p>\n <p>\n <small translate>\n Display a link to the Global smart rules under the Configuration navigator menu.\n </small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Global smart rules' | translate }}\"\n >\n <input\n name=\"globalSmartRules\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.globalSmartRules\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\">\n <c8y-li-icon icon=\"c8y-group-open\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Subassets view' | translate }}</p>\n <p><small translate>Display the \"Subassets\" tab on groups.</small></p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Subassets view' | translate }}\"\n >\n <input\n name=\"subassets\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.subassets\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\">\n <c8y-li-icon icon=\"c8y-smart-rules\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Smart rules for devices and groups' | translate }}</p>\n <p>\n <small translate>Display the smart rules tab on groups and devices.</small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Smart rules for devices and groups' | translate }}\"\n >\n <input\n name=\"smartRules\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.smartRules\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li data-cy=\"feature-config--feature-list\" *ngIf=\"'DashboardManagerModule' | c8yPluginLoaded | async\">\n <c8y-li-icon icon=\"management1\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div>\n <p>{{ 'Dashboard manager' | translate }}</p>\n <p>\n <small translate>\n Display a link to the Dashboard manager under the Configuration navigator menu.\n </small>\n </p>\n </div>\n <label\n class=\"c8y-switch c8y-switch--inline m-l-auto\"\n title=\"{{ 'Dashboard manager' | translate }}\"\n >\n <input\n name=\"dashboardManager\"\n type=\"checkbox\"\n [(ngModel)]=\"config.features.dashboardManager\"\n (change)=\"updateFeatures()\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n</c8y-list-group>\n" }]
}], propDecorators: { config: [{
type: Input
}], onUpdate: [{
type: Output
}] } });
class RootNodeConfigComponent {
constructor() {
this.disabled = false;
this.onUpdate = new EventEmitter();
}
/**
* Removes one of the root nodes.
* @param node The node to remove.
*/
removeNavigatorNode(node) {
const index = this.config.rootNodes.indexOf(node);
if (index > -1) {
const newNodes = this.config.rootNodes.filter((_, i) => i !== index);
this.config.rootNodes = newNodes;
this.onUpdate.emit();
}
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RootNodeConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: RootNodeConfigComponent, isStandalone: true, selector: "c8y-root-node-config", inputs: { config: "config", disabled: "disabled" }, outputs: { onUpdate: "onUpdate" }, ngImport: i0, template: "<div class=\"col-sm-6\">\n <label title=\"{{ 'Current top level nodes' | translate }}\" translate>\n Current top level nodes\n </label>\n <c8y-list-group class=\"separator-top\">\n <c8y-li *ngIf=\"config.rootNodes.length === 0\">\n <c8y-ui-empty-state\n [icon]=\"'folder-open'\"\n [title]=\"'No top level nodes set.' | translate\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n </c8y-li>\n <c8y-li *ngFor=\"let node of config.rootNodes; let index = index\">\n <c8y-li-icon icon=\"c8y-group\"></c8y-li-icon>\n <div class=\"content-flex-30\">\n <div class=\"col-6\">\n <div class=\"text-truncate\" title=\"{{ node.name }}\">\n {{ node.name }}\n </div>\n </div>\n <div class=\"col-4\">\n <label class=\"c8y-switch c8y-switch--inline d-flex\" title=\"{{ 'Hide devices' | translate }}\">\n <input\n type=\"checkbox\"\n [(ngModel)]=\"node.hideDevices\"\n name=\"node.{{ index }}.hideDevices\"\n (change)=\"onUpdate.emit()\"\n [disabled]=\"disabled\"\n />\n <span></span>\n <small class=\"text-truncate a-s-center l-h-1\">{{ 'Hide devices' | translate }}</small>\n </label>\n </div>\n <div class=\"col-2 text-right\">\n <div class=\"d-flex fit-w\">\n <button\n class=\"btn-dot btn-dot--danger m-l-auto\"\n type=\"button\"\n [attr.aria-label]=\"'Remove' | translate\"\n tooltip=\"{{ 'Remove' | translate }}\"\n [disabled]=\"disabled\"\n [delay]=\"500\"\n (click)=\"removeNavigatorNode(node)\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n </div>\n </div>\n </div>\n </c8y-li>\n </c8y-list-group>\n</div>\n\n<div class=\"col-sm-6 col-md-5\" style=\"height: calc(100vh - 430px)\">\n <label title=\"{{ 'Select top level nodes' | translate }}\" translate>Select top level nodes</label>\n <c8y-asset-selector\n [config]=\"{ groupsOnly: true, multi: true, groupsSelectable: true }\"\n [(ngModel)]=\"config.rootNodes\"\n [disabled]=\"disabled\"\n (onSelected)=\"onUpdate.emit()\"\n name=\"rootNodes\"\n class=\"border-top d-block\"\n ></c8y-asset-selector>\n</div>\n", dependencies: [{ kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: ListGroupComponent, selector: "c8y-list-group" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "component", type: AssetSelectorComponent, selector: "c8y-asset-selector", inputs: ["config", "active", "index", "asset", "selectedDevice", "selected", "rootNode", "selectedItems", "container", "isNodeSelectable", "disabled"], outputs: ["onSelected", "onClearSelected", "onRowSelected", "onLoad"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RootNodeConfigComponent, decorators: [{
type: Component,
args: [{ selector: 'c8y-root-node-config', imports: [
C8yTranslateDirective,
ListGroupComponent,
NgIf,
ListItemComponent,
EmptyStateComponent,
NgFor,
ListItemIconComponent,
FormsModule,
TooltipDirective,
IconDirective,
AssetSelectorComponent,
C8yTranslatePipe
], template: "<div class=\"col-sm-6\">\n <label title=\"{{ 'Current top level nodes' | translate }}\" translate>\n Current top level nodes\n </label>\n <c8y-list-group class=\"separator-top\">\n <c8y-li *ngIf=\"config.rootNodes.length === 0\">\n <c8y-ui-empty-state\n [icon]=\"'folder-open'\"\n [title]=\"'No top level nodes set.' | translate\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n </c8y-li>\n <c8y-li *ngFor=\"let node of config.rootNodes; let index = index\">\n <c8y-li-icon icon=\"c8y-group\"></c8y-li-icon>\n <div class=\"content-flex-30\">\n <div class=\"col-6\">\n <div class=\"text-truncate\" title=\"{{ node.name }}\">\n {{ node.name }}\n </div>\n </div>\n <div class=\"col-4\">\n <label class=\"c8y-switch c8y-switch--inline d-flex\" title=\"{{ 'Hide devices' | translate }}\">\n <input\n type=\"checkbox\"\n [(ngModel)]=\"node.hideDevices\"\n name=\"node.{{ index }}.hideDevices\"\n (change)=\"onUpdate.emit()\"\n [disabled]=\"disabled\"\n />\n <span></span>\n <small class=\"text-truncate a-s-center l-h-1\">{{ 'Hide devices' | translate }}</small>\n </label>\n </div>\n <div class=\"col-2 text-right\">\n <div class=\"d-flex fit-w\">\n <button\n class=\"btn-dot btn-dot--danger m-l-auto\"\n type=\"button\"\n [attr.aria-label]=\"'Remove' | translate\"\n tooltip=\"{{ 'Remove' | translate }}\"\n [disabled]=\"disabled\"\n [delay]=\"500\"\n (click)=\"removeNavigatorNode(node)\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n </div>\n </div>\n </div>\n </c8y-li>\n </c8y-list-group>\n</div>\n\n<div class=\"col-sm-6 col-md-5\" style=\"height: calc(100vh - 430px)\">\n <label title=\"{{ 'Select top level nodes' | translate }}\" translate>Select top level nodes</label>\n <c8y-asset-selector\n [config]=\"{ groupsOnly: true, multi: true, groupsSelectable: true }\"\n [(ngModel)]=\"config.rootNodes\"\n [disabled]=\"disabled\"\n (onSelected)=\"onUpdate.emit()\"\n name=\"rootNodes\"\n class=\"border-top d-block\"\n ></c8y-asset-selector>\n</div>\n" }]
}], propDecorators: { config: [{
type: Input
}], disabled: [{
type: Input
}], onUpdate: [{
type: Output
}] } });
class HomeDashboardConfigComponent {
/**
* @ignore
*/
constructor(cockpitConfigService) {
this.cockpitConfigService = cockpitConfigService;
/**
* The types of dashboard that can be configured.
*/
this.homeDashboardTypes = HomeDashboardType;
}
/**
* @ignore
*/
dashboardChange(selected, type) {
if (!selected) {
return;
}
switch (type) {
case this.homeDashboardTypes.DEFAULT: {
this.config.homeDashboardName = DEFAULT_HOME_DASHBOARD_NAME;
this.config.userSpecificHomeDashboard = false;
break;
}
case this.homeDashboardTypes.APP: {
this.config.homeDashboardName = this.cockpitConfigService.getAppDashboardName();
this.config.userSpecificHomeDashboard = false;
break;
}
case this.homeDashboardTypes.USER: {
this.config.homeDashboardName = USER_HOME_DASHBOARD_NAME;
this.config.userSpecificHomeDashboard = true;
break;
}
}
}
/**
* @ignore
*/
verifySelected(type) {
if (type === this.homeDashboardTypes.USER) {
return this.config.userSpecificHomeDashboard;
}
if (type === this.homeDashboardTypes.DEFAULT) {
return this.config.homeDashboardName === DEFAULT_HOME_DASHBOARD_NAME;
}
return this.config.homeDashboardName === this.cockpitConfigService.getAppDashboardName();
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HomeDashboardConfigComponent, deps: [{ token: CockpitConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: HomeDashboardConfigComponent, isStandalone: true, selector: "c8y-home-dashboard-config", inputs: { config: "config" }, ngImport: i0, template: "<c8y-list-group>\n <c8y-li data-cy=\"home-dashboard-config--dashboard-list\">\n <c8y-li-radio\n (onSelect)=\"dashboardChange($event, homeDashboardTypes.DEFAULT)\"\n [selected]=\"verifySelected(homeDashboardTypes.DEFAULT)\"\n ></c8y-li-radio>\n <p translate>Default home dashboard</p>\n <small translate>Changes done in the home dashboard are reflected across the platform.</small>\n </c8y-li>\n <c8y-li data-cy=\"home-dashboard-config--dashboard-list\">\n <c8y-li-radio\n (onSelect)=\"dashboardChange($event, homeDashboardTypes.APP)\"\n [selected]=\"verifySelected(homeDashboardTypes.APP)\"\n ></c8y-li-radio>\n <p translate>Custom home dashboard</p>\n <small translate>\n Changes done to the home dashboard are reflected only in the current application.\n </small>\n </c8y-li>\n <c8y-li data-cy=\"home-dashboard-config--dashboard-list\">\n <c8y-li-radio\n (onSelect)=\"dashboardChange($event, homeDashboardTypes.USER)\"\n [selected]=\"verifySelected(homeDashboardTypes.USER)\"\n ></c8y-li-radio>\n <p translate>User home dashboard</p>\n <small translate>\n Changes done to the home dashboard are reflected only for the current user. NOTE: This user\n needs to have inventory write permission.\n </small>\n </c8y-li>\n</c8y-list-group>\n", dependencies: [{ kind: "component", type: ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: ListItemRadioComponent, selector: "c8y-list-item-radio, c8y-li-radio", inputs: ["selected", "name", "disabled", "value"], outputs: ["onSelect"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HomeDashboardConfigComponent, decorators: [{
type: Component,
args: [{ selector: 'c8y-home-dashboard-config', imports: [ListGroupComponent, ListItemComponent, ListItemRadioComponent, C8yTranslateDirective], template: "<c8y-list-group>\n <c8y-li data-cy=\"home-dashboard-config--dashboard-list\">\n <c8y-li-radio\n (onSelect)=\"dashboardChange($event, homeDashboardTypes.DEFAULT)\"\n [selected]=\"verifySelected(homeDashboardTypes.DEFAULT)\"\n ></c8y-li-radio>\n <p translate>Default home dashboard</p>\n <small translate>Changes done in the home dashboard are reflected across the platform.</small>\n </c8y-li>\n <c8y-li data-cy=\"home-dashboard-config--dashboard-list\">\n <c8y-li-radio\n (onSelect)=\"dashboardChange($event, homeDashboardTypes.APP)\"\n [selected]=\"verifySelected(homeDashboardTypes.APP)\"\n ></c8y-li-radio>\n <p translate>Custom home dashboard</p>\n <small translate>\n Changes done to the home dashboard are reflected only in the current application.\n </small>\n </c8y-li>\n <c8y-li data-cy=\"home-dashboard-config--dashboard-list\">\n <c8y-li-radio\n (onSelect)=\"dashboardChange($event, homeDashboardTypes.USER)\"\n [selected]=\"verifySelected(homeDashboardTypes.USER)\"\n ></c8y-li-radio>\n <p translate>User home dashboard</p>\n <small translate>\n Changes done to the home dashboard are reflected only for the current user. NOTE: This user\n needs to have inventory write permission.\n </small>\n </c8y-li>\n</c8y-list-group>\n" }]
}], ctorParameters: () => [{ type: CockpitConfigService }], propDecorators: { config: [{
type: Input
}] } });
class CockpitConfigurationComponent {
constructor(cockpitConfigService, alertService, appState) {
this.cockpitConfigService = cockpitConfigService;
this.alertService = alertService;
this.appState = appState;
/**
* The currently used configuration.
*/
this.config = DEFAULT_CONFIG;
this.rootNodeDisabled = false;
}
/**
* @ignore
*/
ngOnInit() {
this.config = this.cockpitConfigService.currentConfig;
}
/**
* Stores the configuration and shows a success message.
*/
async save() {
try {
await this.cockpitConfigService.saveConfig(this.config);
this.alertService.success(gettext('Cockpit configuration saved.'));
}
catch (ex) {
this.alertService.addServerFailure(ex);
}
}
/**
* @ignore
*/
iconSelectionChange(icon) {
this.config.icon = { class: icon };
this.appState.currentApplication.next({
...this.appState.currentApplication.value,
...{ config: this.config }
});
}
/**
* Updates the features to directly reflect the results of the change.
*/
updateFeatures() {
this.cockpitConfigService.currentConfig = this.config;
this.cockpitConfigService.refresh();
}
/**
* Updates the root nodes to directly reflect the results of the change.
*/
async updateRootNodes() {
this.rootNodeDisabled = true;
this.cockpitConfigService.currentConfig = this.config;
await this.cockpitConfigService.setRootNodes();
this.rootNodeDisabled = false;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitConfigurationComponent, deps: [{ token: CockpitConfigService }, { token: i1.AlertService }, { token: i1.AppStateService }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CockpitConfigurationComponent, isStandalone: true, selector: "c8y-cockpit-configuration", ngImport: i0, template: "<c8y-title>{{ 'Application configuration' | translate }}</c8y-title>\n<c8y-breadcrumb>\n <c8y-breadcrumb-item\n [icon]=\"'c8y-tools'\"\n [label]=\"'Configuration' | translate\"\n ></c8y-breadcrumb-item>\n <c8y-breadcrumb-item\n [icon]=\"'c8y-tools'\"\n [label]=\"'Application configuration' | translate\"\n ></c8y-breadcrumb-item>\n</c8y-breadcrumb>\n<div class=\"row\">\n <div class=\"col-lg-12 col-lg-max\">\n <form #configForm=\"ngForm\">\n <div class=\"card card--fullpage\">\n <div class=\"card-header separator\">\n <div class=\"card-title\">\n {{ config.appTitle || ('Cockpit' | translate) }} {{ 'configuration' | translate }}\n </div>\n </div>\n\n <div class=\"inner-scroll\">\n <div class=\"card-block p-t-0 p-b-0\">\n <fieldset class=\"row separator-bottom p-t-24 p-b-24\">\n <div class=\"col-xs-12 col-sm-3 col-md-2 text-left-xs text-right-sm\">\n <div\n class=\"h4 text-medium d-inline-block m-r-4\"\n translate\n >\n Title, icon, and navigator collapse\n </div>\n </div>\n <div class=\"col-xs-12 col-sm-9 col-md-8 p-l-16\">\n <div class=\"d-flex a-i-start gap-16\">\n <div class=\"form-group d-inline-block\">\n <label>{{ 'Icon' | translate }}</label>\n <c8y-icon-selector-wrapper\n [selectedIcon]=\"config?.icon?.class || 'c8y-cockpit'\"\n [iconSize]=\"24\"\n (onSelect)=\"iconSelectionChange($event)\"\n ></c8y-icon-selector-wrapper>\n </div>\n <div class=\"form-group flex-grow\">\n <label\n for=\"confAppTitle\"\n translate\n >\n Change application title\n </label>\n <input\n class=\"form-control\"\n id=\"confAppTitle\"\n placeholder=\"{{ 'e.g. Cockpit' | translate }} \"\n type=\"text\"\n maxlength=\"254\"\n [(ngModel)]=\"config.appTitle\"\n [ngModelOptions]=\"{ standalone: true }\"\n />\n </div>\n </div>\n\n <c8y-misc-config [config]=\"config\"></c8y-misc-config>\n </div>\n </fieldset>\n <fieldset class=\"row separator-bottom p-t-24 p-b-24\">\n <div class=\"col-xs-12 col-sm-3 col-md-2 text-left-xs text-right-sm\">\n <div class=\"d-inline-flex m-b-16\">\n <div\n class=\"h4 text-medium m-r-4\"\n translate\n >\n Features\n </div>\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{\n 'Define which are the enabled features in the current application.'\n | translate\n }}\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </div>\n </div>\n <div class=\"col-xs-12 col-sm-9 col-md-8\">\n <c8y-feature-config\n [config]=\"config\"\n (onUpdate)=\"updateFeatures()\"\n ></c8y-feature-config>\n </div>\n </fieldset>\n <fieldset class=\"row separator-bottom p-t-24 p-b-24\">\n <div class=\"col-xs-12 col-sm-3 col-md-2 text-left-xs text-right-sm\">\n <div class=\"d-inline-flex m-b-16\">\n <div\n class=\"h4 text-medium m-r-8\"\n translate\n >\n Top level nodes\n </div>\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{\n 'Select which nodes to display in the top level of the navigator menu. By default, only Groups is shown.'\n | translate\n }}\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </div>\n </div>\n <div class=\"col-xs-12 col-sm-10 col-md-10\">\n <div class=\"row\">\n <c8y-root-node-config\n [config]=\"config\"\n (onUpdate)=\"updateRootNodes()\"\n [disabled]=\"rootNodeDisabled\"\n ></c8y-root-node-config>\n </div>\n </div>\n </fieldset>\n\n <fieldset\n class=\"row separator-bottom p-t-24 p-b-24\"\n *ngIf=\"'CockpitDashboardModule' | c8yPluginLoaded | async\"\n >\n <div class=\"col-xs-12 col-sm-3 col-md-2 text-left-xs text-right-sm\">\n <div class=\"d-inline-flex m-b-16\">\n <div\n class=\"h4 text-medium m-r-8\"\n translate\n >\n Home dashboard\n </div>\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{\n 'The homepage of this application. By default, it is a customizable dashboard displaying the most important alarms and shortcuts to frequently used features.'\n | translate\n }}\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </div>\n </div>\n <div class=\"col-xs-12 col-sm-9 col-md-8\">\n <c8y-home-dashboard-config [config]=\"config\"></c8y-home-dashboard-config>\n </div>\n </fieldset>\n\n <fieldset\n class=\"row p-t-24 p-b-24\"\n *ngIf=\"'htmlWidgetProviders' | c8yPluginLoaded | async\"\n >\n <div class=\"col-xs-12 col-sm-3 col-md-2 text-left-xs text-right-sm\">\n <div class=\"d-inline-flex m-b-16\">\n <div\n class=\"h4 text-medium m-r-8\"\n translate\n >\n HTML widget\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-sm-9 col-md-8\">\n <c8y-li>\n <c8y-li-icon icon=\"code1\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div class=\"p-r-16\">\n <p> {{ 'Disable sanitization' | translate }}</p>\n <p>\n <small translate>\n By default, every unsecure HTML is removed from the HTML widget. You can disable\n this behavior in this application and allow unsecure HTML to be used.\n </small>\n </p>\n </div>\n <label class=\"c8y-switch c8y-switch--inline m-l-auto\">\n <input\n [attr.aria-label]=\"'Disable sanitization' | translate\"\n name=\"htmlWidgetDisableSanitization\"\n type=\"checkbox\"\n [(ngModel)]=\"config.htmlWidgetDisableSanitization\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li class=\"\">\n <c8y-li-icon icon=\"settings\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div class=\"p-r-16\">\n <p>{{ 'Enforce advanced mode' | translate }}</p>\n <p>\n <small translate>\n If set to true, the HTML widget configuration will always be opened in the advanced mode\n (web component mode).\n </small>\n </p>\n </div>\n <label class=\"c8y-switch c8y-switch--inline m-l-auto\">\n <input\n [attr.aria-label]=\"'Enforce advanced mode' | translate\"\n name=\"htmlWidgetDefaultToAdvancedMode\"\n type=\"checkbox\"\n [(ngModel)]=\"config.htmlWidgetDefaultToAdvancedMode\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n </div>\n </fieldset>\n </div>\n </div>\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-primary\"\n title=\"{{ 'Save' | translate }}\"\n type=\"submit\"\n [disabled]=\"!configForm.form.valid\"\n (click)=\"save()\"\n [actionName]=\"'cockpitConfigurationSaved'\"\n [actionData]=\"{ config: config }\"\n c8yProductExperience\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n </div>\n </form>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "component", type: BreadcrumbComponent, selector: "c8y-breadcrumb" }, { kind: "component", type: BreadcrumbItemComponent, selector: "c8y-breadcrumb-item", inputs: ["icon", "translate", "label", "path", "injector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: IconSelectorWrapperComponent, selector: "c8y-icon-selector-wrapper", inputs: ["canRemoveIcon", "selectedIcon", "iconSize"], outputs: ["onSelect"] }, { kind: "component", type: MiscConfigComponent, selector: "c8y-misc-config", inputs: ["config"] }, { kind: "directive", type: PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "component", type: FeatureConfigComponent, selector: "c8y-feature-config", inputs: ["config"], outputs: ["onUpdate"] }, { kind: "component", type: RootNodeConfigComponent, selector: "c8y-root-node-config", inputs: ["config", "disabled"], outputs: ["onUpdate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: HomeDashboardConfigComponent, selector: "c8y-home-dashboard-config", inputs: ["config"] }, { kind: "component", type: ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "directive", type: ProductExperienceDirective, selector: "[c8yProductExperience]", inputs: ["actionName", "actionData", "inherit", "suppressDataOverriding"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: PluginLoadedPipe, name: "c8yPluginLoaded" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitConfigurationComponent, decorators: [{
type: Component,
args: [{ selector: 'c8y-cockpit-configuration', imports: [
TitleComponent,
BreadcrumbComponent,
BreadcrumbItemComponent,
FormsModule,
C8yTranslateDirective,
IconSelectorWrapperComponent,
MiscConfigComponent,
PopoverDirective,
FeatureConfigComponent,
RootNodeConfigComponent,
NgIf,
HomeDashboardConfigComponent,
ListItemComponent,
ListItemIconComponent,
ProductExperienceDirective,
C8yTranslatePipe,
AsyncPipe,
PluginLoadedPipe
], template: "<c8y-title>{{ 'Application configuration' | translate }}</c8y-title>\n<c8y-breadcrumb>\n <c8y-breadcrumb-item\n [icon]=\"'c8y-tools'\"\n [label]=\"'Configuration' | translate\"\n ></c8y-breadcrumb-item>\n <c8y-breadcrumb-item\n [icon]=\"'c8y-tools'\"\n [label]=\"'Application configuration' | translate\"\n ></c8y-breadcrumb-item>\n</c8y-breadcrumb>\n<div class=\"row\">\n <div class=\"col-lg-12 col-lg-max\">\n <form #configForm=\"ngForm\">\n <div class=\"card card--fullpage\">\n <div class=\"card-header separator\">\n <div class=\"card-title\">\n {{ config.appTitle || ('Cockpit' | translate) }} {{ 'configuration' | translate }}\n </div>\n </div>\n\n <div class=\"inner-scroll\">\n <div class=\"card-block p-t-0 p-b-0\">\n <fieldset class=\"row separator-bottom p-t-24 p-b-24\">\n <div class=\"col-xs-12 col-sm-3 col-md-2 text-left-xs text-right-sm\">\n <div\n class=\"h4 text-medium d-inline-block m-r-4\"\n translate\n >\n Title, icon, and navigator collapse\n </div>\n </div>\n <div class=\"col-xs-12 col-sm-9 col-md-8 p-l-16\">\n <div class=\"d-flex a-i-start gap-16\">\n <div class=\"form-group d-inline-block\">\n <label>{{ 'Icon' | translate }}</label>\n <c8y-icon-selector-wrapper\n [selectedIcon]=\"config?.icon?.class || 'c8y-cockpit'\"\n [iconSize]=\"24\"\n (onSelect)=\"iconSelectionChange($event)\"\n ></c8y-icon-selector-wrapper>\n </div>\n <div class=\"form-group flex-grow\">\n <label\n for=\"confAppTitle\"\n translate\n >\n Change application title\n </label>\n <input\n class=\"form-control\"\n id=\"confAppTitle\"\n placeholder=\"{{ 'e.g. Cockpit' | translate }} \"\n type=\"text\"\n maxlength=\"254\"\n [(ngModel)]=\"config.appTitle\"\n [ngModelOptions]=\"{ standalone: true }\"\n />\n </div>\n </div>\n\n <c8y-misc-config [config]=\"config\"></c8y-misc-config>\n </div>\n </fieldset>\n <fieldset class=\"row separator-bottom p-t-24 p-b-24\">\n <div class=\"col-xs-12 col-sm-3 col-md-2 text-left-xs text-right-sm\">\n <div class=\"d-inline-flex m-b-16\">\n <div\n class=\"h4 text-medium m-r-4\"\n translate\n >\n Features\n </div>\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{\n 'Define which are the enabled features in the current application.'\n | translate\n }}\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </div>\n </div>\n <div class=\"col-xs-12 col-sm-9 col-md-8\">\n <c8y-feature-config\n [config]=\"config\"\n (onUpdate)=\"updateFeatures()\"\n ></c8y-feature-config>\n </div>\n </fieldset>\n <fieldset class=\"row separator-bottom p-t-24 p-b-24\">\n <div class=\"col-xs-12 col-sm-3 col-md-2 text-left-xs text-right-sm\">\n <div class=\"d-inline-flex m-b-16\">\n <div\n class=\"h4 text-medium m-r-8\"\n translate\n >\n Top level nodes\n </div>\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{\n 'Select which nodes to display in the top level of the navigator menu. By default, only Groups is shown.'\n | translate\n }}\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </div>\n </div>\n <div class=\"col-xs-12 col-sm-10 col-md-10\">\n <div class=\"row\">\n <c8y-root-node-config\n [config]=\"config\"\n (onUpdate)=\"updateRootNodes()\"\n [disabled]=\"rootNodeDisabled\"\n ></c8y-root-node-config>\n </div>\n </div>\n </fieldset>\n\n <fieldset\n class=\"row separator-bottom p-t-24 p-b-24\"\n *ngIf=\"'CockpitDashboardModule' | c8yPluginLoaded | async\"\n >\n <div class=\"col-xs-12 col-sm-3 col-md-2 text-left-xs text-right-sm\">\n <div class=\"d-inline-flex m-b-16\">\n <div\n class=\"h4 text-medium m-r-8\"\n translate\n >\n Home dashboard\n </div>\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{\n 'The homepage of this application. By default, it is a customizable dashboard displaying the most important alarms and shortcuts to frequently used features.'\n | translate\n }}\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </div>\n </div>\n <div class=\"col-xs-12 col-sm-9 col-md-8\">\n <c8y-home-dashboard-config [config]=\"config\"></c8y-home-dashboard-config>\n </div>\n </fieldset>\n\n <fieldset\n class=\"row p-t-24 p-b-24\"\n *ngIf=\"'htmlWidgetProviders' | c8yPluginLoaded | async\"\n >\n <div class=\"col-xs-12 col-sm-3 col-md-2 text-left-xs text-right-sm\">\n <div class=\"d-inline-flex m-b-16\">\n <div\n class=\"h4 text-medium m-r-8\"\n translate\n >\n HTML widget\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-sm-9 col-md-8\">\n <c8y-li>\n <c8y-li-icon icon=\"code1\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div class=\"p-r-16\">\n <p> {{ 'Disable sanitization' | translate }}</p>\n <p>\n <small translate>\n By default, every unsecure HTML is removed from the HTML widget. You can disable\n this behavior in this application and allow unsecure HTML to be used.\n </small>\n </p>\n </div>\n <label class=\"c8y-switch c8y-switch--inline m-l-auto\">\n <input\n [attr.aria-label]=\"'Disable sanitization' | translate\"\n name=\"htmlWidgetDisableSanitization\"\n type=\"checkbox\"\n [(ngModel)]=\"config.htmlWidgetDisableSanitization\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n <c8y-li class=\"\">\n <c8y-li-icon icon=\"settings\"></c8y-li-icon>\n <div class=\"d-flex a-i-center\">\n <div class=\"p-r-16\">\n <p>{{ 'Enforce advanced mode' | translate }}</p>\n <p>\n <small translate>\n If set to true, the HTML widget configuration will always be opened in the advanced mode\n (web component mode).\n </small>\n </p>\n </div>\n <label class=\"c8y-switch c8y-switch--inline m-l-auto\">\n <input\n [attr.aria-label]=\"'Enforce advanced mode' | translate\"\n name=\"htmlWidgetDefaultToAdvancedMode\"\n type=\"checkbox\"\n [(ngModel)]=\"config.htmlWidgetDefaultToAdvancedMode\"\n />\n <span></span>\n </label>\n </div>\n </c8y-li>\n </div>\n </fieldset>\n </div>\n </div>\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-primary\"\n title=\"{{ 'Save' | translate }}\"\n type=\"submit\"\n [disabled]=\"!configForm.form.valid\"\n (click)=\"save()\"\n [actionName]=\"'cockpitConfigurationSaved'\"\n [actionData]=\"{ config: config }\"\n c8yProductExperience\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n </div>\n </form>\n </div>\n</div>\n" }]
}], ctorParameters: () => [{ type: CockpitConfigService }, { type: i1.AlertService }, { type: i1.AppStateService }] });
class CockpitSetupStep {
constructor(stepper, step, setup, appState, alert, applicationService, cockpitConfigService) {
this.stepper = stepper;
this.step = step;
this.setup = setup;
this.appState = appState;
this.alert = alert;
this.applicationService = applicationService;
this.cockpitConfigService = cockpitConfigService;
this.config = DEFAULT_CONFIG;
this.pending = false;
}
async next() {
this.pending = true;
try {
const newConfig = { ...this.setup.data$.value, ...this.config };
await this.appState.updateCurrentApplicationConfig(newConfig);
this.cockpitConfigService.updateApplication(newConfig);
this.setup.stepCompleted(this.stepper.selectedIndex);
this.setup.data$.next(newConfig);
this.stepper.next();
}
catch (ex) {
this.alert.addServerFailure(ex);
}
finally {
this.pending = false;
}
}
back() {
this.stepper.previous();
}
}
class CockpitSetupStepperButtonsComponent {
constructor() {
this.onNext = new EventEmitter();
this.onBack = new EventEmitter();
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitSetupStepperButtonsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CockpitSetupStepperButtonsComponent, isStandalone: true, selector: "c8y-cockpit-setup-stepper-buttons", inputs: { index: "index" }, outputs: { onNext: "onNext", onBack: "onBack" }, ngImport: i0, template: "<div class=\"card-footer separator d-flex j-c-center\">\n <button\n class=\"btn btn-default\"\n type=\"button\"\n (click)=\"onBack.emit()\"\n *ngIf=\"index !== 0\"\n translate\n >\n Previous\n </button>\n <button data-cy=\"c8y-cockpit-setup-stepper-buttons--save-continue-button\" class=\"btn btn-primary\" type=\"submit\" (click)=\"onNext.emit()\" translate>\n Continue\n </button>\n</div>\n", dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitSetupStepperButtonsComponent, decorators: [{
type: Component,
args: [{ selector: 'c8y-cockpit-setup-stepper-buttons', imports: [NgIf, C8yTranslateDirective], template: "<div class=\"card-footer separator d-flex j-c-center\">\n <button\n class=\"btn btn-default\"\n type=\"button\"\n (click)=\"onBack.emit()\"\n *ngIf=\"index !== 0\"\n translate\n >\n Previous\n </button>\n <button data-cy=\"c8y-cockpit-setup-stepper-buttons--save-continue-button\" class=\"btn btn-primary\" type=\"submit\" (click)=\"onNext.emit()\" translate>\n Continue\n </button>\n</div>\n" }]
}], propDecorators: { index: [{
type: Input
}], onNext: [{
type: Output
}], onBack: [{
type: Output
}] } });
class CockpitSetupStep1Component extends CockpitSetupStep {
constructor(stepper, step, setup, appState, alert, appService, cockpitConfigService) {
super(stepper, step, setup, appState, alert, appService, cockpitConfigService);
this.stepper = stepper;
this.step = step;
this.setup = setup;
this.appState = appState;
this.alert = alert;
this.appService = appService;
this.cockpitConfigService = cockpitConfigService;
this.app$ = this.appState.currentApplication.pipe(filter(app => !!app));
}
iconSelectionChange(icon) {
this.config.icon = { class: icon };
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitSetupStep1Component, deps: [{ token: i1.C8yStepper }, { token: i2$2.CdkStep }, { token: i1.SetupComponent }, { token: i1.AppStateService }, { token: i1.AlertService }, { token: i3.ApplicationService }, { token: CockpitConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CockpitSetupStep1Component, isStandalone: true, selector: "c8y-cockpit-setup-step1", host: { classAttribute: "d-contents" }, usesInheritance: true, ngImport: i0, template: "<form\n class=\"d-contents\"\n name=\"form\"\n #stepForm=\"ngForm\"\n>\n <div class=\"container-fluid flex-no-shrink fit-w\">\n <div class=\"row separator-bottom\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3 p-t-24 p-l-16 p-r-16\">\n <h3\n data-cy=\"c8y-cockpit-setup-step1--step1-header-title\"\n class=\"text-medium l-h-base\"\n translate\n >\n Title, icon, and navigator collapse\n </h3>\n <p\n class=\"lead text-normal\"\n translate\n >\n Change the icon, the title, and set the initial navigator state.\n </p>\n </div>\n </div>\n </div>\n <div class=\"inner-scroll flex-grow\">\n <div class=\"container-fluid fit-w\">\n <div class=\"row\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3\">\n <div class=\"d-flex a-i-start gap-16 p-t-16\">\n <div class=\"form-group d-inline-block\">\n <label>{{ 'Icon' | translate }}</label>\n <c8y-icon-selector-wrapper\n [selectedIcon]=\"(app$ | async)?.config?.icon?.class || 'c8y-cockpit'\"\n [iconSize]=\"24\"\n (onSelect)=\"iconSelectionChange($event)\"\n ></c8y-icon-selector-wrapper>\n </div>\n <div class=\"form-group flex-grow\">\n <label\n for=\"confAppTitle\"\n translate\n >\n Change application title\n </label>\n <input\n class=\"form-control\"\n id=\"confAppTitle\"\n placeholder=\"{{ 'e.g. Cockpit' | translate }} \"\n type=\"text\"\n maxlength=\"254\"\n [(ngModel)]=\"config.appTitle\"\n [ngModelOptions]=\"{ standalone: true }\"\n />\n </div>\n </div>\n\n <c8y-misc-config [config]=\"config\"></c8y-misc-config>\n </div>\n </div>\n </div>\n </div>\n <c8y-cockpit-setup-stepper-buttons\n [index]=\"stepper.selectedIndex\"\n (onNext)=\"next()\"\n (onBack)=\"back()\"\n ></c8y-cockpit-setup-stepper-buttons>\n</form>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: IconSelectorWrapperComponent, selector: "c8y-icon-selector-wrapper", inputs: ["canRemoveIcon", "selectedIcon", "iconSize"], outputs: ["onSelect"] }, { kind: "component", type: MiscConfigComponent, selector: "c8y-misc-config", inputs: ["config"] }, { kind: "component", type: CockpitSetupStepperButtonsComponent, selector: "c8y-cockpit-setup-stepper-buttons", inputs: ["index"], outputs: ["onNext", "onBack"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitSetupStep1Component, decorators: [{
type: Component,
args: [{ selector: 'c8y-cockpit-setup-step1', host: { class: 'd-contents' }, imports: [
FormsModule,
C8yTranslateDirective,
IconSelectorWrapperComponent,
MiscConfigComponent,
CockpitSetupStepperButtonsComponent,
C8yTranslatePipe,
AsyncPipe
], template: "<form\n class=\"d-contents\"\n name=\"form\"\n #stepForm=\"ngForm\"\n>\n <div class=\"container-fluid flex-no-shrink fit-w\">\n <div class=\"row separator-bottom\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3 p-t-24 p-l-16 p-r-16\">\n <h3\n data-cy=\"c8y-cockpit-setup-step1--step1-header-title\"\n class=\"text-medium l-h-base\"\n translate\n >\n Title, icon, and navigator collapse\n </h3>\n <p\n class=\"lead text-normal\"\n translate\n >\n Change the icon, the title, and set the initial navigator state.\n </p>\n </div>\n </div>\n </div>\n <div class=\"inner-scroll flex-grow\">\n <div class=\"container-fluid fit-w\">\n <div class=\"row\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3\">\n <div class=\"d-flex a-i-start gap-16 p-t-16\">\n <div class=\"form-group d-inline-block\">\n <label>{{ 'Icon' | translate }}</label>\n <c8y-icon-selector-wrapper\n [selectedIcon]=\"(app$ | async)?.config?.icon?.class || 'c8y-cockpit'\"\n [iconSize]=\"24\"\n (onSelect)=\"iconSelectionChange($event)\"\n ></c8y-icon-selector-wrapper>\n </div>\n <div class=\"form-group flex-grow\">\n <label\n for=\"confAppTitle\"\n translate\n >\n Change application title\n </label>\n <input\n class=\"form-control\"\n id=\"confAppTitle\"\n placeholder=\"{{ 'e.g. Cockpit' | translate }} \"\n type=\"text\"\n maxlength=\"254\"\n [(ngModel)]=\"config.appTitle\"\n [ngModelOptions]=\"{ standalone: true }\"\n />\n </div>\n </div>\n\n <c8y-misc-config [config]=\"config\"></c8y-misc-config>\n </div>\n </div>\n </div>\n </div>\n <c8y-cockpit-setup-stepper-buttons\n [index]=\"stepper.selectedIndex\"\n (onNext)=\"next()\"\n (onBack)=\"back()\"\n ></c8y-cockpit-setup-stepper-buttons>\n</form>\n" }]
}], ctorParameters: () => [{ type: i1.C8yStepper }, { type: i2$2.CdkStep }, { type: i1.SetupComponent }, { type: i1.AppStateService }, { type: i1.AlertService }, { type: i3.ApplicationService }, { type: CockpitConfigService }] });
class CockpitSetupStep2Component extends CockpitSetupStep {
constructor(stepper, step, setup, appState, alert, appService, cockpitConfigService) {
super(stepper, step, setup, appState, alert, appService, cockpitConfigService);
this.stepper = stepper;
this.step = step;
this.setup = setup;
this.appState = appState;
this.alert = alert;
this.appService = appService;
this.cockpitConfigService = cockpitConfigService;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitSetupStep2Component, deps: [{ token: i1.C8yStepper }, { token: i2$2.CdkStep }, { token: i1.SetupComponent }, { token: i1.AppStateService }, { token: i1.AlertService }, { token: i3.ApplicationService }, { token: CockpitConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CockpitSetupStep2Component, isStandalone: true, selector: "c8y-cockpit-setup-step2", host: { classAttribute: "d-contents" }, usesInheritance: true, ngImport: i0, template: "<form #stepForm=\"ngForm\" name=\"form\" class=\"d-contents\">\n <div class=\"container-fluid flex-no-shrink fit-w\">\n <div class=\"row separator-bottom\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3 p-t-24 p-l-16 p-r-16\">\n <h3 translate class=\"text-medium l-h-base\" data-cy=\"c8y-cockpit-setup-step2--step2-header-title\">Features</h3>\n <p class=\"lead text-normal\" translate>\n Define which are the enabled features in the current application.\n </p>\n </div>\n </div>\n </div>\n <div class=\"inner-scroll flex-grow\">\n <div class=\"container-fluid fit-w\">\n <div class=\"row\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3\">\n <c8y-feature-config [config]=\"config\"></c8y-feature-config>\n </div>\n </div>\n </div>\n </div>\n <c8y-cockpit-setup-stepper-buttons\n [index]=\"stepper.selectedIndex\"\n (onNext)=\"next()\"\n (onBack)=\"back()\"\n >\n </c8y-cockpit-setup-stepper-buttons>\n</form>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: FeatureConfigComponent, selector: "c8y-feature-config", inputs: ["config"], outputs: ["onUpdate"] }, { kind: "component", type: CockpitSetupStepperButtonsComponent, selector: "c8y-cockpit-setup-stepper-buttons", inputs: ["index"], outputs: ["onNext", "onBack"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitSetupStep2Component, decorators: [{
type: Component,
args: [{ selector: 'c8y-cockpit-setup-step2', host: { class: 'd-contents' }, imports: [
FormsModule,
C8yTranslateDirective,
FeatureConfigComponent,
CockpitSetupStepperButtonsComponent
], template: "<form #stepForm=\"ngForm\" name=\"form\" class=\"d-contents\">\n <div class=\"container-fluid flex-no-shrink fit-w\">\n <div class=\"row separator-bottom\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3 p-t-24 p-l-16 p-r-16\">\n <h3 translate class=\"text-medium l-h-base\" data-cy=\"c8y-cockpit-setup-step2--step2-header-title\">Features</h3>\n <p class=\"lead text-normal\" translate>\n Define which are the enabled features in the current application.\n </p>\n </div>\n </div>\n </div>\n <div class=\"inner-scroll flex-grow\">\n <div class=\"container-fluid fit-w\">\n <div class=\"row\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3\">\n <c8y-feature-config [config]=\"config\"></c8y-feature-config>\n </div>\n </div>\n </div>\n </div>\n <c8y-cockpit-setup-stepper-buttons\n [index]=\"stepper.selectedIndex\"\n (onNext)=\"next()\"\n (onBack)=\"back()\"\n >\n </c8y-cockpit-setup-stepper-buttons>\n</form>\n" }]
}], ctorParameters: () => [{ type: i1.C8yStepper }, { type: i2$2.CdkStep }, { type: i1.SetupComponent }, { type: i1.AppStateService }, { type: i1.AlertService }, { type: i3.ApplicationService }, { type: CockpitConfigService }] });
class CockpitSetupStep3Component extends CockpitSetupStep {
constructor(stepper, step, setup, appState, alert, appService, cockpitConfigService) {
super(stepper, step, setup, appState, alert, appService, cockpitConfigService);
this.stepper = stepper;
this.step = step;
this.setup = setup;
this.appState = appState;
this.alert = alert;
this.appService = appService;
this.cockpitConfigService = cockpitConfigService;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitSetupStep3Component, deps: [{ token: i1.C8yStepper }, { token: i2$2.CdkStep }, { token: i1.SetupComponent }, { token: i1.AppStateService }, { token: i1.AlertService }, { token: i3.ApplicationService }, { token: CockpitConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CockpitSetupStep3Component, isStandalone: true, selector: "c8y-cockpit-setup-step3", host: { classAttribute: "d-contents" }, usesInheritance: true, ngImport: i0, template: "<form #stepForm=\"ngForm\" name=\"form\" class=\"d-contents\">\n <div class=\"container-fluid flex-no-shrink fit-w\">\n <div class=\"row separator-bottom\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3 p-t-24 p-l-16 p-r-16\">\n <h3 translate class=\"text-medium l-h-base\" data-cy=\"c8y-cockpit-setup-step3--step3-header-title\">Top level nodes</h3>\n <p class=\"lead text-normal\" translate>\n Select which nodes to display in the top level of the navigator menu. By default, only\n Groups is shown.\n </p>\n </div>\n </div>\n </div>\n <div class=\"inner-scroll flex-grow\">\n <div class=\"container-fluid fit-w p-t-16\">\n <div class=\"row\">\n <div class=\"col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2\">\n <c8y-root-node-config [config]=\"config\"></c8y-root-node-config>\n </div>\n </div>\n </div>\n </div>\n <c8y-cockpit-setup-stepper-buttons\n [index]=\"stepper.selectedIndex\"\n (onNext)=\"next()\"\n (onBack)=\"back()\"\n >\n </c8y-cockpit-setup-stepper-buttons>\n</form>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: RootNodeConfigComponent, selector: "c8y-root-node-config", inputs: ["config", "disabled"], outputs: ["onUpdate"] }, { kind: "component", type: CockpitSetupStepperButtonsComponent, selector: "c8y-cockpit-setup-stepper-buttons", inputs: ["index"], outputs: ["onNext", "onBack"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitSetupStep3Component, decorators: [{
type: Component,
args: [{ selector: 'c8y-cockpit-setup-step3', host: { class: 'd-contents' }, imports: [
FormsModule,
C8yTranslateDirective,
RootNodeConfigComponent,
CockpitSetupStepperButtonsComponent
], template: "<form #stepForm=\"ngForm\" name=\"form\" class=\"d-contents\">\n <div class=\"container-fluid flex-no-shrink fit-w\">\n <div class=\"row separator-bottom\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3 p-t-24 p-l-16 p-r-16\">\n <h3 translate class=\"text-medium l-h-base\" data-cy=\"c8y-cockpit-setup-step3--step3-header-title\">Top level nodes</h3>\n <p class=\"lead text-normal\" translate>\n Select which nodes to display in the top level of the navigator menu. By default, only\n Groups is shown.\n </p>\n </div>\n </div>\n </div>\n <div class=\"inner-scroll flex-grow\">\n <div class=\"container-fluid fit-w p-t-16\">\n <div class=\"row\">\n <div class=\"col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2\">\n <c8y-root-node-config [config]=\"config\"></c8y-root-node-config>\n </div>\n </div>\n </div>\n </div>\n <c8y-cockpit-setup-stepper-buttons\n [index]=\"stepper.selectedIndex\"\n (onNext)=\"next()\"\n (onBack)=\"back()\"\n >\n </c8y-cockpit-setup-stepper-buttons>\n</form>\n" }]
}], ctorParameters: () => [{ type: i1.C8yStepper }, { type: i2$2.CdkStep }, { type: i1.SetupComponent }, { type: i1.AppStateService }, { type: i1.AlertService }, { type: i3.ApplicationService }, { type: CockpitConfigService }] });
class CockpitSetupStep4Component extends CockpitSetupStep {
constructor(stepper, step, setup, appState, alert, appService, cockpitConfigService) {
super(stepper, step, setup, appState, alert, appService, cockpitConfigService);
this.stepper = stepper;
this.step = step;
this.setup = setup;
this.appState = appState;
this.alert = alert;
this.appService = appService;
this.cockpitConfigService = cockpitConfigService;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitSetupStep4Component, deps: [{ token: i1.C8yStepper }, { token: i2$2.CdkStep }, { token: i1.SetupComponent }, { token: i1.AppStateService }, { token: i1.AlertService }, { token: i3.ApplicationService }, { token: CockpitConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CockpitSetupStep4Component, isStandalone: true, selector: "c8y-cockpit-setup-step4", host: { classAttribute: "d-contents" }, usesInheritance: true, ngImport: i0, template: "<form #stepForm=\"ngForm\" name=\"form\" class=\"d-contents\">\n <div class=\"container-fluid flex-no-shrink fit-w\">\n <div class=\"row separator-bottom\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3 p-t-24 p-l-16 p-r-16\">\n <h3 translate class=\"text-medium l-h-base\" data-cy=\"c8y-cockpit-setup-step4--step4-header-title\">Home dashboard</h3>\n <p class=\"lead text-normal\" translate>\n The homepage of this application. By default, it is a customizable dashboard displaying\n the most important alarms and shortcuts to frequently used features.\n </p>\n </div>\n </div>\n </div>\n <div class=\"inner-scroll flex-grow\">\n <div class=\"container-fluid fit-w\">\n <div class=\"row\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3\">\n <c8y-home-dashboard-config [config]=\"config\"></c8y-home-dashboard-config>\n </div>\n </div>\n </div>\n </div>\n <c8y-cockpit-setup-stepper-buttons\n [index]=\"stepper.selectedIndex\"\n (onNext)=\"next()\"\n (onBack)=\"back()\"\n ></c8y-cockpit-setup-stepper-buttons>\n</form>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: HomeDashboardConfigComponent, selector: "c8y-home-dashboard-config", inputs: ["config"] }, { kind: "component", type: CockpitSetupStepperButtonsComponent, selector: "c8y-cockpit-setup-stepper-buttons", inputs: ["index"], outputs: ["onNext", "onBack"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitSetupStep4Component, decorators: [{
type: Component,
args: [{ selector: 'c8y-cockpit-setup-step4', host: { class: 'd-contents' }, imports: [
FormsModule,
C8yTranslateDirective,
HomeDashboardConfigComponent,
CockpitSetupStepperButtonsComponent
], template: "<form #stepForm=\"ngForm\" name=\"form\" class=\"d-contents\">\n <div class=\"container-fluid flex-no-shrink fit-w\">\n <div class=\"row separator-bottom\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3 p-t-24 p-l-16 p-r-16\">\n <h3 translate class=\"text-medium l-h-base\" data-cy=\"c8y-cockpit-setup-step4--step4-header-title\">Home dashboard</h3>\n <p class=\"lead text-normal\" translate>\n The homepage of this application. By default, it is a customizable dashboard displaying\n the most important alarms and shortcuts to frequently used features.\n </p>\n </div>\n </div>\n </div>\n <div class=\"inner-scroll flex-grow\">\n <div class=\"container-fluid fit-w\">\n <div class=\"row\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3\">\n <c8y-home-dashboard-config [config]=\"config\"></c8y-home-dashboard-config>\n </div>\n </div>\n </div>\n </div>\n <c8y-cockpit-setup-stepper-buttons\n [index]=\"stepper.selectedIndex\"\n (onNext)=\"next()\"\n (onBack)=\"back()\"\n ></c8y-cockpit-setup-stepper-buttons>\n</form>\n" }]
}], ctorParameters: () => [{ type: i1.C8yStepper }, { type: i2$2.CdkStep }, { type: i1.SetupComponent }, { type: i1.AppStateService }, { type: i1.AlertService }, { type: i3.ApplicationService }, { type: CockpitConfigService }] });
class CockpitConfigModule {
constructor(service) {
this.service = service;
// only for DI, not used but needed.
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitConfigModule, deps: [{ token: CockpitConfigService }], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: CockpitConfigModule, imports: [CoreModule,
AssetSelectorModule,
PopoverModule,
TooltipModule,
EcosystemModule,
IconSelectorModule,
PluginLoadedPipe,
CockpitConfigurationComponent,
CockpitSetupStep1Component,
CockpitSetupStep2Component,
CockpitSetupStep3Component,
CockpitSetupStep4Component,
FeatureConfigComponent,
RootNodeConfigComponent,
HomeDashboardConfigComponent,
MiscConfigComponent,
CockpitSetupStepperButtonsComponent] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitConfigModule, providers: [
CockpitConfigGuard,
hookRoute({
path: COCKPIT_CONFIG_PATH,
component: CockpitConfigurationComponent,
canActivate: [CockpitConfigGuard]
}),
hookNavigator(CockpitConfigGuard),
hookStepper([
{
stepperId: Steppers.SETUP,
component: CockpitSetupStep1Component,
label: gettext('Title, icon, and navigator collapse'),
setupId: 'cockpitMisc',
priority: 40
},
{
stepperId: Steppers.SETUP,
component: CockpitSetupStep2Component,
label: gettext('Features'),
setupId: 'cockpitFeatures',
priority: 30
},
{
stepperId: Steppers.SETUP,
component: CockpitSetupStep3Component,
label: gettext('Top level nodes'),
setupId: 'cockpitTopLevelNodes',
priority: 20
},
{
stepperId: Steppers.SETUP,
component: CockpitSetupStep4Component,
label: gettext('Home dashboard'),
setupId: 'cockpitHomeDashboard',
priority: 10
}
])
], imports: [CoreModule,
AssetSelectorModule,
PopoverModule,
TooltipModule,
EcosystemModule,
IconSelectorModule,
CockpitConfigurationComponent,
CockpitSetupStep1Component,
CockpitSetupStep2Component,
CockpitSetupStep3Component,
CockpitSetupStep4Component,
FeatureConfigComponent,
RootNodeConfigComponent,
HomeDashboardConfigComponent,
MiscConfigComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CockpitConfigModule, decorators: [{
type: NgModule,
args: [{
imports: [
CoreModule,
AssetSelectorModule,
PopoverModule,
TooltipModule,
EcosystemModule,
IconSelectorModule,
PluginLoadedPipe,
CockpitConfigurationComponent,
CockpitSetupStep1Component,
CockpitSetupStep2Component,
CockpitSetupStep3Component,
CockpitSetupStep4Component,
FeatureConfigComponent,
RootNodeConfigComponent,
HomeDashboardConfigComponent,
MiscConfigComponent,
CockpitSetupStepperButtonsComponent
],
providers: [
CockpitConfigGuard,
hookRoute({
path: COCKPIT_CONFIG_PATH,
component: CockpitConfigurationComponent,
canActivate: [CockpitConfigGuard]
}),
hookNavigator(CockpitConfigGuard),
hookStepper([
{
stepperId: Steppers.SETUP,
component: CockpitSetupStep1Component,
label: gettext('Title, icon, and navigator collapse'),
setupId: 'cockpitMisc',
priority: 40
},
{
stepperId: Steppers.SETUP,
component: CockpitSetupStep2Component,
label: gettext('Features'),
setupId: 'cockpitFeatures',
priority: 30
},
{
stepperId: Steppers.SETUP,
component: CockpitSetupStep3Component,
label: gettext('Top level nodes'),
setupId: 'cockpitTopLevelNodes',
priority: 20
},
{
stepperId: Steppers.SETUP,
component: CockpitSetupStep4Component,
label: gettext('Home dashboard'),
setupId: 'cockpitHomeDashboard',
priority: 10
}
])
]
}]
}], ctorParameters: () => [{ type: CockpitConfigService }] });
/**
* Generated bundle index. Do not edit.
*/
export { COCKPIT_CONFIG_PATH, CockpitConfigGuard, CockpitConfigModule, CockpitConfigService, CockpitConfigurationComponent, CockpitSetupStep1Component, CockpitSetupStep2Component, CockpitSetupStep3Component, CockpitSetupStep4Component, DEFAULT_CONFIG, DEFAULT_HOME_DASHBOARD_NAME, FeatureConfigComponent, HomeDashboardConfigComponent, HomeDashboardType, MiscConfigComponent, RootNodeConfigComponent, USER_HOME_DASHBOARD_NAME };
//# sourceMappingURL=c8y-ngx-components-cockpit-config.mjs.map