@c8y/ngx-components 1024.18.1 → 1024.18.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/fesm2022/c8y-ngx-components-actility-device-registration.mjs +1 -1
  2. package/fesm2022/c8y-ngx-components-actility-device-registration.mjs.map +1 -1
  3. package/fesm2022/c8y-ngx-components-asset-properties.mjs +67 -20
  4. package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
  5. package/fesm2022/c8y-ngx-components-assets-navigator.mjs +75 -13
  6. package/fesm2022/c8y-ngx-components-assets-navigator.mjs.map +1 -1
  7. package/fesm2022/c8y-ngx-components-branding-shared-lazy-add-branding-modal.mjs +2 -4
  8. package/fesm2022/c8y-ngx-components-branding-shared-lazy-add-branding-modal.mjs.map +1 -1
  9. package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs +6 -8
  10. package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs.map +1 -1
  11. package/fesm2022/c8y-ngx-components-context-dashboard.mjs +98 -19
  12. package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
  13. package/fesm2022/c8y-ngx-components-dashboard-manager.mjs +4 -4
  14. package/fesm2022/c8y-ngx-components-dashboard-manager.mjs.map +1 -1
  15. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +7 -7
  16. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
  17. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +5 -3
  18. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
  19. package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -1
  20. package/fesm2022/c8y-ngx-components-echart.mjs +52 -7
  21. package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
  22. package/fesm2022/c8y-ngx-components-ecosystem.mjs +1 -1
  23. package/fesm2022/c8y-ngx-components-ecosystem.mjs.map +1 -1
  24. package/fesm2022/c8y-ngx-components-file-preview.mjs +2 -2
  25. package/fesm2022/c8y-ngx-components-file-preview.mjs.map +1 -1
  26. package/fesm2022/c8y-ngx-components-icon-selector.mjs +6 -6
  27. package/fesm2022/c8y-ngx-components-icon-selector.mjs.map +1 -1
  28. package/fesm2022/c8y-ngx-components-loriot-device-registration.mjs +1 -1
  29. package/fesm2022/c8y-ngx-components-loriot-device-registration.mjs.map +1 -1
  30. package/fesm2022/c8y-ngx-components-operation-picker.mjs +2 -2
  31. package/fesm2022/c8y-ngx-components-operation-picker.mjs.map +1 -1
  32. package/fesm2022/c8y-ngx-components-register-device.mjs +4 -4
  33. package/fesm2022/c8y-ngx-components-register-device.mjs.map +1 -1
  34. package/fesm2022/c8y-ngx-components-remote-access-configurations.mjs +2 -3
  35. package/fesm2022/c8y-ngx-components-remote-access-configurations.mjs.map +1 -1
  36. package/fesm2022/c8y-ngx-components-remote-access-shared.mjs +2 -2
  37. package/fesm2022/c8y-ngx-components-remote-access-shared.mjs.map +1 -1
  38. package/fesm2022/c8y-ngx-components-remote-access-ssh-remote-access-ssh-endpoint-modal.mjs +2 -2
  39. package/fesm2022/c8y-ngx-components-remote-access-ssh-remote-access-ssh-endpoint-modal.mjs.map +1 -1
  40. package/fesm2022/c8y-ngx-components-remote-access-vnc-remote-access-vnc-endpoint-modal.mjs +2 -4
  41. package/fesm2022/c8y-ngx-components-remote-access-vnc-remote-access-vnc-endpoint-modal.mjs.map +1 -1
  42. package/fesm2022/c8y-ngx-components-remote-access-vnc-vnc-viewer.mjs +2 -3
  43. package/fesm2022/c8y-ngx-components-remote-access-vnc-vnc-viewer.mjs.map +1 -1
  44. package/fesm2022/c8y-ngx-components-sigfox-device-registration.mjs +1 -1
  45. package/fesm2022/c8y-ngx-components-sigfox-device-registration.mjs.map +1 -1
  46. package/fesm2022/c8y-ngx-components-static-assets-modal.mjs +2 -2
  47. package/fesm2022/c8y-ngx-components-static-assets-modal.mjs.map +1 -1
  48. package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs +3 -4
  49. package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs.map +1 -1
  50. package/fesm2022/c8y-ngx-components-widgets-definitions-scada.mjs +10 -1
  51. package/fesm2022/c8y-ngx-components-widgets-definitions-scada.mjs.map +1 -1
  52. package/fesm2022/c8y-ngx-components-widgets-implementations-asset-table.mjs +4 -4
  53. package/fesm2022/c8y-ngx-components-widgets-implementations-asset-table.mjs.map +1 -1
  54. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +18 -3
  55. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
  56. package/fesm2022/c8y-ngx-components-widgets-implementations-scada.mjs +1 -1
  57. package/fesm2022/c8y-ngx-components-widgets-implementations-scada.mjs.map +1 -1
  58. package/fesm2022/c8y-ngx-components.mjs +59 -19
  59. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  60. package/locales/de.po +3 -2
  61. package/locales/es.po +3 -3
  62. package/locales/fr.po +3 -3
  63. package/locales/ja_JP.po +2 -2
  64. package/locales/ko.po +3 -3
  65. package/locales/locales.pot +1 -1
  66. package/locales/nl.po +3 -3
  67. package/locales/pl.po +2 -3
  68. package/locales/pt_BR.po +2 -3
  69. package/locales/zh_CN.po +2 -2
  70. package/locales/zh_TW.po +3 -3
  71. package/package.json +1 -1
  72. package/types/c8y-ngx-components-asset-properties.d.ts +9 -1
  73. package/types/c8y-ngx-components-asset-properties.d.ts.map +1 -1
  74. package/types/c8y-ngx-components-assets-navigator.d.ts +30 -3
  75. package/types/c8y-ngx-components-assets-navigator.d.ts.map +1 -1
  76. package/types/c8y-ngx-components-branding-shared-lazy-add-branding-modal.d.ts.map +1 -1
  77. package/types/c8y-ngx-components-context-dashboard.d.ts +44 -1
  78. package/types/c8y-ngx-components-context-dashboard.d.ts.map +1 -1
  79. package/types/c8y-ngx-components-echart-models.d.ts +9 -0
  80. package/types/c8y-ngx-components-echart-models.d.ts.map +1 -1
  81. package/types/c8y-ngx-components-echart.d.ts +32 -5
  82. package/types/c8y-ngx-components-echart.d.ts.map +1 -1
  83. package/types/c8y-ngx-components-remote-access-vnc-remote-access-vnc-endpoint-modal.d.ts.map +1 -1
  84. package/types/c8y-ngx-components-widgets-implementations-datapoints-graph.d.ts +6 -0
  85. package/types/c8y-ngx-components-widgets-implementations-datapoints-graph.d.ts.map +1 -1
  86. package/types/c8y-ngx-components.d.ts +50 -2
  87. package/types/c8y-ngx-components.d.ts.map +1 -1
@@ -7,7 +7,6 @@ import * as i2$1 from '@angular/router';
7
7
  import { RouterLinkWithHref } from '@angular/router';
8
8
  import * as i1 from '@c8y/ngx-components/remote-access/data';
9
9
  import { canActivateRemoteAccess } from '@c8y/ngx-components/remote-access/data';
10
- import * as i3 from '@angular/common';
11
10
  import { NgIf } from '@angular/common';
12
11
  import * as i1$1 from 'ngx-bootstrap/modal';
13
12
  import { IconDeviceGridColumn } from '@c8y/ngx-components/device-grid';
@@ -84,11 +83,11 @@ class RemoteAccessPickProtocolModalComponent {
84
83
  this._resolve(protocol);
85
84
  }
86
85
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: RemoteAccessPickProtocolModalComponent, deps: [{ token: i1$1.BsModalRef }], target: i0.ɵɵFactoryTarget.Component }); }
87
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.19", type: RemoteAccessPickProtocolModalComponent, isStandalone: true, selector: "c8y-remote-access-pick-protocol-modal", ngImport: i0, template: "<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n [labels]=\"{ cancel: 'Cancel' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div class=\"p-24\">\n <c8y-li *ngFor=\"let provider of protocolProviders\">\n <c8y-li-icon>\n <i [c8yIcon]=\"provider.protocolIcon\"></i>\n </c8y-li-icon>\n <c8y-li-body>\n <div class=\"d-flex j-c-between\">\n <div>\n <p>{{ provider.protocolLabel | translate }}</p>\n <p>\n <small>{{ provider.protocolDescription | translate }}</small>\n </p>\n </div>\n <div>\n <button\n class=\"btn btn-primary\"\n (click)=\"selectProtocol(provider)\"\n [attr.data-cy]=\"'remoteAccessPickProtocolModal--select-' + provider.protocolName\"\n >\n <span translate>Select</span>\n </button>\n </div>\n </div>\n </c8y-li-body>\n </c8y-li>\n </div>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i2.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "component", type: i2.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i2.ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "component", type: i2.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
86
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: RemoteAccessPickProtocolModalComponent, isStandalone: true, selector: "c8y-remote-access-pick-protocol-modal", ngImport: i0, template: "<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n [labels]=\"{ cancel: 'Cancel' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div>\n @for (provider of protocolProviders; track provider.protocolName) {\n <c8y-li>\n <c8y-li-icon>\n <i [c8yIcon]=\"provider.protocolIcon\"></i>\n </c8y-li-icon>\n <c8y-li-body>\n <div class=\"d-flex j-c-between\">\n <div>\n <p>{{ provider.protocolLabel | translate }}</p>\n <p>\n <small>{{ provider.protocolDescription | translate }}</small>\n </p>\n </div>\n <div>\n <button\n class=\"btn btn-primary\"\n (click)=\"selectProtocol(provider)\"\n [attr.data-cy]=\"'remoteAccessPickProtocolModal--select-' + provider.protocolName\"\n >\n <span translate>Select</span>\n </button>\n </div>\n </div>\n </c8y-li-body>\n </c8y-li>\n }\n </div>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i2.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: i2.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "flushBody", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "component", type: i2.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i2.ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "component", type: i2.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
88
87
  }
89
88
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: RemoteAccessPickProtocolModalComponent, decorators: [{
90
89
  type: Component,
91
- args: [{ selector: 'c8y-remote-access-pick-protocol-modal', standalone: true, imports: [CoreModule], changeDetection: ChangeDetectionStrategy.Eager, template: "<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n [labels]=\"{ cancel: 'Cancel' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div class=\"p-24\">\n <c8y-li *ngFor=\"let provider of protocolProviders\">\n <c8y-li-icon>\n <i [c8yIcon]=\"provider.protocolIcon\"></i>\n </c8y-li-icon>\n <c8y-li-body>\n <div class=\"d-flex j-c-between\">\n <div>\n <p>{{ provider.protocolLabel | translate }}</p>\n <p>\n <small>{{ provider.protocolDescription | translate }}</small>\n </p>\n </div>\n <div>\n <button\n class=\"btn btn-primary\"\n (click)=\"selectProtocol(provider)\"\n [attr.data-cy]=\"'remoteAccessPickProtocolModal--select-' + provider.protocolName\"\n >\n <span translate>Select</span>\n </button>\n </div>\n </div>\n </c8y-li-body>\n </c8y-li>\n </div>\n</c8y-modal>\n" }]
90
+ args: [{ selector: 'c8y-remote-access-pick-protocol-modal', standalone: true, imports: [CoreModule], changeDetection: ChangeDetectionStrategy.Eager, template: "<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n [labels]=\"{ cancel: 'Cancel' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div>\n @for (provider of protocolProviders; track provider.protocolName) {\n <c8y-li>\n <c8y-li-icon>\n <i [c8yIcon]=\"provider.protocolIcon\"></i>\n </c8y-li-icon>\n <c8y-li-body>\n <div class=\"d-flex j-c-between\">\n <div>\n <p>{{ provider.protocolLabel | translate }}</p>\n <p>\n <small>{{ provider.protocolDescription | translate }}</small>\n </p>\n </div>\n <div>\n <button\n class=\"btn btn-primary\"\n (click)=\"selectProtocol(provider)\"\n [attr.data-cy]=\"'remoteAccessPickProtocolModal--select-' + provider.protocolName\"\n >\n <span translate>Select</span>\n </button>\n </div>\n </div>\n </c8y-li-body>\n </c8y-li>\n }\n </div>\n</c8y-modal>\n" }]
92
91
  }], ctorParameters: () => [{ type: i1$1.BsModalRef }] });
93
92
 
94
93
  class RemoteAccessConfigurationListComponent {
@@ -1 +1 @@
1
- {"version":3,"file":"c8y-ngx-components-remote-access-configurations.mjs","sources":["../../remote-access/configurations/remote-access-configuration-list/remote-access-connect-button/remote-access-connect-button.component.ts","../../remote-access/configurations/remote-access-configuration-list/remote-access-connect-button/remote-access-connect-button.component.html","../../remote-access/configurations/remote-access-pick-protocol-modal/remote-access-pick-protocol-modal.component.ts","../../remote-access/configurations/remote-access-pick-protocol-modal/remote-access-pick-protocol-modal.component.html","../../remote-access/configurations/remote-access-configuration-list/remote-access-configuration-list.component.ts","../../remote-access/configurations/remote-access-configuration-list/remote-access-configuration-list.component.html","../../remote-access/configurations/index.ts","../../remote-access/configurations/c8y-ngx-components-remote-access-configurations.ts"],"sourcesContent":["import { NgIf } from '@angular/common';\nimport { Component, effect, input, Optional, signal, ChangeDetectionStrategy } from '@angular/core';\nimport { RouterLinkWithHref } from '@angular/router';\nimport { C8yTranslatePipe, CellRendererContext, IconDirective } from '@c8y/ngx-components';\nimport {\n RemoteAccessProtocolProvider,\n RemoteAccessService\n} from '@c8y/ngx-components/remote-access/data';\n\n@Component({\n selector: 'c8y-remote-access-connect-button',\n templateUrl: './remote-access-connect-button.component.html',\n standalone: true,\n imports: [RouterLinkWithHref, IconDirective, NgIf, C8yTranslatePipe],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class RemoteAccessConnectButtonComponent {\n deviceId = input<string>(null);\n configurationId = input<string>(null);\n protocol = input<string>(null);\n\n connectHref: ReturnType<RemoteAccessConnectButtonComponent['getEndpointHref']>;\n\n private protocolProviders: RemoteAccessProtocolProvider[] = [];\n\n constructor(\n private remoteAccess: RemoteAccessService,\n @Optional() private context?: CellRendererContext\n ) {\n this.protocolProviders = this.remoteAccess.getProtocolProviders();\n this.connectHref = this.getEndpointHref();\n }\n\n getEndpointHref() {\n const resultSignal = signal<string>(null);\n\n effect(\n async () => {\n let deviceId = this.deviceId();\n let configurationId = this.configurationId();\n let protocol = this.protocol();\n if (this.context) {\n if (!deviceId) {\n deviceId = (<any>this.context.property)?.target;\n }\n if (!configurationId) {\n configurationId = this.context.item.id;\n }\n if (!protocol) {\n protocol = this.context.item.protocol;\n }\n }\n if (!deviceId || !configurationId || !protocol) {\n resultSignal.set(null);\n return;\n }\n\n const provider = this.protocolProviders.find(p => p.protocolName === protocol);\n if (!provider || !provider.connectEndpointHref) {\n resultSignal.set(null);\n return;\n }\n const href = await provider.connectEndpointHref(\n deviceId,\n this.context.item || { id: configurationId }\n );\n resultSignal.set(href);\n },\n { allowSignalWrites: true }\n );\n\n return resultSignal.asReadonly();\n }\n}\n","<a\n *ngIf=\"connectHref() as endpointHref\"\n [title]=\"'Connect' | translate\"\n [routerLink]=\"endpointHref\"\n [attr.data-cy]=\"'remoteAccessConnectButton'\"\n>\n <i [c8yIcon]=\"'connected'\"></i>\n</a>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { CoreModule } from '@c8y/ngx-components';\nimport { RemoteAccessProtocolProvider } from '@c8y/ngx-components/remote-access/data';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\n\n@Component({\n selector: 'c8y-remote-access-pick-protocol-modal',\n templateUrl: './remote-access-pick-protocol-modal.component.html',\n standalone: true,\n imports: [CoreModule],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class RemoteAccessPickProtocolModalComponent {\n title = gettext('Select a protocol');\n result = new Promise<RemoteAccessProtocolProvider>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n\n // set via initialState\n protocolProviders: RemoteAccessProtocolProvider[] = [];\n\n private _resolve: (value: RemoteAccessProtocolProvider) => void;\n private _reject: (reason?: any) => void;\n\n constructor(private bsModalRef: BsModalRef) {}\n\n cancel() {\n this._reject();\n }\n\n selectProtocol(protocol: RemoteAccessProtocolProvider) {\n this.bsModalRef.hide();\n this._resolve(protocol);\n }\n}\n","<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n [labels]=\"{ cancel: 'Cancel' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div class=\"p-24\">\n <c8y-li *ngFor=\"let provider of protocolProviders\">\n <c8y-li-icon>\n <i [c8yIcon]=\"provider.protocolIcon\"></i>\n </c8y-li-icon>\n <c8y-li-body>\n <div class=\"d-flex j-c-between\">\n <div>\n <p>{{ provider.protocolLabel | translate }}</p>\n <p>\n <small>{{ provider.protocolDescription | translate }}</small>\n </p>\n </div>\n <div>\n <button\n class=\"btn btn-primary\"\n (click)=\"selectProtocol(provider)\"\n [attr.data-cy]=\"'remoteAccessPickProtocolModal--select-' + provider.protocolName\"\n >\n <span translate>Select</span>\n </button>\n </div>\n </div>\n </c8y-li-body>\n </c8y-li>\n </div>\n</c8y-modal>\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport {\n ActionBarItemComponent,\n ActionControl,\n AlertService,\n BuiltInActionType,\n C8yTranslateDirective,\n C8yTranslatePipe,\n Column,\n ContextRouteService,\n DataGridModule,\n DisplayOptions,\n EmptyComponent,\n EmptyStateComponent,\n IconDirective,\n ModalService,\n Pagination,\n Status,\n TitleComponent\n} from '@c8y/ngx-components';\nimport {\n RemoteAccessConfiguration,\n RemoteAccessProtocolProvider,\n RemoteAccessService\n} from '@c8y/ngx-components/remote-access/data';\nimport { RemoteAccessConnectButtonComponent } from './remote-access-connect-button/remote-access-connect-button.component';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { RemoteAccessPickProtocolModalComponent } from '../remote-access-pick-protocol-modal/remote-access-pick-protocol-modal.component';\nimport { IconDeviceGridColumn } from '@c8y/ngx-components/device-grid';\nimport { TranslateService } from '@ngx-translate/core';\nimport { IManagedObject } from '@c8y/client';\n\n@Component({\n selector: 'c8y-remote-access-configuration-list',\n templateUrl: './remote-access-configuration-list.component.html',\n standalone: true,\n imports: [\n DataGridModule,\n TitleComponent,\n C8yTranslateDirective,\n ActionBarItemComponent,\n IconDirective,\n EmptyStateComponent,\n C8yTranslatePipe\n ],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class RemoteAccessConfigurationListComponent implements OnInit {\n rows: RemoteAccessConfiguration[] = [];\n columns: Column[] = [\n new IconDeviceGridColumn(\n {\n headerCellRendererComponent: EmptyComponent\n },\n context => {\n const provider = this.protocolProviders.find(p => p.protocolName === context.item.protocol);\n return provider?.protocolIcon || 'laptop';\n }\n ),\n {\n name: 'name',\n header: gettext('Endpoint'),\n path: 'name'\n },\n {\n name: 'hostname',\n header: gettext('Host'),\n path: 'hostname'\n },\n {\n name: 'port',\n header: gettext('Port'),\n path: 'port'\n },\n {\n name: 'protocol',\n header: gettext('Protocol'),\n path: 'protocol'\n },\n {\n name: 'connect',\n header: gettext('Connect'),\n cellRendererComponent: RemoteAccessConnectButtonComponent\n }\n ];\n actionControls: ActionControl[] = [\n {\n type: BuiltInActionType.Edit,\n callback: async (entry: RemoteAccessConfiguration) => {\n const provider = this.getProtocolProviderForConfiguration(entry);\n\n try {\n let result: RemoteAccessConfiguration;\n if (provider.editEndpoint) {\n result = await provider.editEndpoint(this.deviceId, entry);\n } else {\n result = await this.defaultEditEndpoint(this.deviceId, entry);\n }\n\n if (!result) {\n return;\n }\n\n this.alert.success(gettext('Endpoint saved.'));\n } catch (e) {\n console.warn(e);\n this.alert.danger(gettext('Failed to save endpoint.'), e);\n }\n this.reload();\n }\n },\n {\n type: BuiltInActionType.Delete,\n callback: async (entry: RemoteAccessConfiguration) => {\n const result = await this.modalService.confirm(\n gettext('Delete endpoint'),\n this.translateService.instant(\n gettext(\n `You are about to delete endpoint \"{{ endpointName }}\". Do you want to proceed?`\n ),\n { endpointName: entry.name }\n ),\n Status.DANGER,\n { cancel: gettext('Cancel'), ok: gettext('Delete') }\n );\n if (!result) {\n return;\n }\n\n const provider = this.getProtocolProviderForConfiguration(entry);\n\n try {\n await provider.removeEndpoint(this.deviceId, entry);\n this.alert.success(gettext('Endpoint deleted.'));\n } catch (e) {\n console.warn(e);\n this.alert.danger(gettext('Failed to delete endpoint.'), e);\n }\n this.reload();\n }\n }\n ];\n deviceId: string;\n pagination: Pagination = {\n pageSize: 10,\n currentPage: 1\n };\n displayOptions: DisplayOptions = {\n bordered: false,\n striped: true,\n filter: true,\n gridHeader: true,\n hover: true\n };\n protocolProviders: RemoteAccessProtocolProvider[] = [];\n gridTitle = gettext('Remote access endpoints');\n\n private device: IManagedObject;\n\n constructor(\n private remoteAccess: RemoteAccessService,\n private activatedRoute: ActivatedRoute,\n private modalService: ModalService,\n private alert: AlertService,\n private bsModalService: BsModalService,\n private translateService: TranslateService,\n private ctx: ContextRouteService\n ) {\n this.device = this.ctx.getContextData(this.activatedRoute)?.contextData as IManagedObject;\n this.deviceId = this.device?.id as string;\n this.protocolProviders = this.remoteAccess.getSupportedProtocolProvidersFor(this.device);\n const connectColum = this.columns.find(c => c.name === 'connect');\n if (connectColum) {\n (<any>connectColum).target = this.deviceId;\n }\n }\n\n ngOnInit() {\n this.reload();\n }\n\n async reload() {\n const configurations = await this.remoteAccess.listConfigurations(this.deviceId);\n const supportedProtocols = this.remoteAccess.getSupportedProtocolProvidersFor(this.device);\n const supportedProtocolsNames = supportedProtocols.map(p => p.protocolName);\n this.rows = configurations.filter(c =>\n supportedProtocolsNames.includes(c.protocol.toUpperCase())\n );\n }\n\n async addEndpoint() {\n let provider: RemoteAccessProtocolProvider = null;\n if (this.protocolProviders.length > 1) {\n try {\n const modalRef = this.bsModalService.show(RemoteAccessPickProtocolModalComponent, {\n initialState: { protocolProviders: this.protocolProviders }\n });\n provider = await modalRef.content.result;\n } catch (e) {\n // modal closed\n return;\n }\n } else if (this.protocolProviders.length === 1) {\n provider = this.protocolProviders[0];\n } else {\n return;\n }\n\n try {\n let addModalResult: RemoteAccessConfiguration = null;\n if (provider.addEndpoint) {\n addModalResult = await provider.addEndpoint(this.deviceId);\n } else {\n addModalResult = await this.defaultAddEndpoint(this.deviceId, provider);\n }\n if (!addModalResult) {\n return;\n }\n this.alert.success(gettext('Endpoint added.'));\n } catch (e) {\n console.warn(e);\n this.alert.danger(gettext('Failed to add endpoint.'), e);\n }\n this.reload();\n }\n\n getProtocolProviderForConfiguration(configuration: RemoteAccessConfiguration) {\n return this.protocolProviders.find(p => p.protocolName === configuration.protocol);\n }\n\n async defaultEditEndpoint(deviceId: string, configuration: RemoteAccessConfiguration) {\n const modalResult = await this.openBasicEndpointModal(configuration);\n if (!modalResult) {\n return modalResult;\n }\n\n return this.remoteAccess.updateConfiguration(deviceId, modalResult);\n }\n\n async defaultAddEndpoint(deviceId: string, provider: RemoteAccessProtocolProvider) {\n let defaultConfig = { protocol: provider.protocolName };\n if (provider.getDefaultEndpointConfiguration) {\n const defaultConfigFromProvider = await provider.getDefaultEndpointConfiguration();\n defaultConfig = { ...defaultConfig, ...defaultConfigFromProvider };\n }\n const modalResult = await this.openBasicEndpointModal(defaultConfig);\n if (!modalResult) {\n return modalResult;\n }\n\n return this.remoteAccess.addConfiguration(deviceId, modalResult);\n }\n\n async openBasicEndpointModal(\n currentConfiguration: Partial<RemoteAccessConfiguration>\n ): Promise<RemoteAccessConfiguration | null> {\n const { RemoteAccessBasicEndpointModalComponent } = await import(\n '@c8y/ngx-components/remote-access/shared'\n );\n\n try {\n const modalRef = this.bsModalService.show(RemoteAccessBasicEndpointModalComponent, {\n initialState: { currentValue: currentConfiguration }\n });\n return (await modalRef.content.result) as RemoteAccessConfiguration;\n } catch (e) {\n // modal closed\n return null;\n }\n }\n}\n","<c8y-title>{{ 'Remote access' | translate }}</c8y-title>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n (click)=\"addEndpoint()\"\n [disabled]=\"!protocolProviders?.length\"\n [attr.data-cy]=\"'remoteAccessConfigurationList--add-endpoint'\"\n >\n <i [c8yIcon]=\"'plus-circle'\"></i>\n <span translate>Add endpoint</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"content-fullpage d-flex d-col border-top\">\n <c8y-data-grid\n [title]=\"gridTitle\"\n [rows]=\"rows\"\n [columns]=\"columns\"\n [pagination]=\"pagination\"\n (onReload)=\"reload()\"\n [actionControls]=\"actionControls\"\n [displayOptions]=\"displayOptions\"\n >\n <c8y-ui-empty-state\n [icon]=\"'window-restore'\"\n [title]=\"'No endpoints configured.' | translate\"\n [subtitle]=\"'Click below to add your first endpoint.' | translate\"\n [horizontal]=\"false\"\n >\n <button\n class=\"btn btn-default\"\n (click)=\"addEndpoint()\"\n translate\n >\n Add endpoint\n </button>\n </c8y-ui-empty-state>\n </c8y-data-grid>\n</div>\n","import { hookRoute, ViewContext } from '@c8y/ngx-components';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { RemoteAccessConfigurationListComponent } from './remote-access-configuration-list/remote-access-configuration-list.component';\nimport { canActivateRemoteAccess } from '@c8y/ngx-components/remote-access/data';\n\nexport * from './remote-access-configuration-list/remote-access-configuration-list.component';\n\nexport const remoteAccessConfigurationListProviders = [\n hookRoute({\n component: RemoteAccessConfigurationListComponent,\n label: gettext('Remote access'),\n path: 'remote_access',\n icon: 'window-restore',\n context: ViewContext.Device,\n canActivate: [canActivateRemoteAccess]\n })\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i3","i4"],"mappings":";;;;;;;;;;;;;;;MAgBa,kCAAkC,CAAA;IAS7C,WAAA,CACU,YAAiC,EACrB,OAA6B,EAAA;QADzC,IAAA,CAAA,YAAY,GAAZ,YAAY;QACA,IAAA,CAAA,OAAO,GAAP,OAAO;AAV7B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAS,IAAI,+EAAC;AAC9B,QAAA,IAAA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ources":["../../remote-access/configurations/remote-access-configuration-list/remote-access-connect-button/remote-access-connect-button.component.ts","../../remote-access/configurations/remote-access-configuration-list/remote-access-connect-button/remote-access-connect-button.component.html","../../remote-access/configurations/remote-access-pick-protocol-modal/remote-access-pick-protocol-modal.component.ts","../../remote-access/configurations/remote-access-pick-protocol-modal/remote-access-pick-protocol-modal.component.html","../../remote-access/configurations/remote-access-configuration-list/remote-access-configuration-list.component.ts","../../remote-access/configurations/remote-access-configuration-list/remote-access-configuration-list.component.html","../../remote-access/configurations/index.ts","../../remote-access/configurations/c8y-ngx-components-remote-access-configurations.ts"],"sourcesContent":["import { NgIf } from '@angular/common';\nimport { Component, effect, input, Optional, signal, ChangeDetectionStrategy } from '@angular/core';\nimport { RouterLinkWithHref } from '@angular/router';\nimport { C8yTranslatePipe, CellRendererContext, IconDirective } from '@c8y/ngx-components';\nimport {\n RemoteAccessProtocolProvider,\n RemoteAccessService\n} from '@c8y/ngx-components/remote-access/data';\n\n@Component({\n selector: 'c8y-remote-access-connect-button',\n templateUrl: './remote-access-connect-button.component.html',\n standalone: true,\n imports: [RouterLinkWithHref, IconDirective, NgIf, C8yTranslatePipe],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class RemoteAccessConnectButtonComponent {\n deviceId = input<string>(null);\n configurationId = input<string>(null);\n protocol = input<string>(null);\n\n connectHref: ReturnType<RemoteAccessConnectButtonComponent['getEndpointHref']>;\n\n private protocolProviders: RemoteAccessProtocolProvider[] = [];\n\n constructor(\n private remoteAccess: RemoteAccessService,\n @Optional() private context?: CellRendererContext\n ) {\n this.protocolProviders = this.remoteAccess.getProtocolProviders();\n this.connectHref = this.getEndpointHref();\n }\n\n getEndpointHref() {\n const resultSignal = signal<string>(null);\n\n effect(\n async () => {\n let deviceId = this.deviceId();\n let configurationId = this.configurationId();\n let protocol = this.protocol();\n if (this.context) {\n if (!deviceId) {\n deviceId = (<any>this.context.property)?.target;\n }\n if (!configurationId) {\n configurationId = this.context.item.id;\n }\n if (!protocol) {\n protocol = this.context.item.protocol;\n }\n }\n if (!deviceId || !configurationId || !protocol) {\n resultSignal.set(null);\n return;\n }\n\n const provider = this.protocolProviders.find(p => p.protocolName === protocol);\n if (!provider || !provider.connectEndpointHref) {\n resultSignal.set(null);\n return;\n }\n const href = await provider.connectEndpointHref(\n deviceId,\n this.context.item || { id: configurationId }\n );\n resultSignal.set(href);\n },\n { allowSignalWrites: true }\n );\n\n return resultSignal.asReadonly();\n }\n}\n","<a\n *ngIf=\"connectHref() as endpointHref\"\n [title]=\"'Connect' | translate\"\n [routerLink]=\"endpointHref\"\n [attr.data-cy]=\"'remoteAccessConnectButton'\"\n>\n <i [c8yIcon]=\"'connected'\"></i>\n</a>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { CoreModule } from '@c8y/ngx-components';\nimport { RemoteAccessProtocolProvider } from '@c8y/ngx-components/remote-access/data';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\n\n@Component({\n selector: 'c8y-remote-access-pick-protocol-modal',\n templateUrl: './remote-access-pick-protocol-modal.component.html',\n standalone: true,\n imports: [CoreModule],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class RemoteAccessPickProtocolModalComponent {\n title = gettext('Select a protocol');\n result = new Promise<RemoteAccessProtocolProvider>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n\n // set via initialState\n protocolProviders: RemoteAccessProtocolProvider[] = [];\n\n private _resolve: (value: RemoteAccessProtocolProvider) => void;\n private _reject: (reason?: any) => void;\n\n constructor(private bsModalRef: BsModalRef) {}\n\n cancel() {\n this._reject();\n }\n\n selectProtocol(protocol: RemoteAccessProtocolProvider) {\n this.bsModalRef.hide();\n this._resolve(protocol);\n }\n}\n","<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n [labels]=\"{ cancel: 'Cancel' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div>\n @for (provider of protocolProviders; track provider.protocolName) {\n <c8y-li>\n <c8y-li-icon>\n <i [c8yIcon]=\"provider.protocolIcon\"></i>\n </c8y-li-icon>\n <c8y-li-body>\n <div class=\"d-flex j-c-between\">\n <div>\n <p>{{ provider.protocolLabel | translate }}</p>\n <p>\n <small>{{ provider.protocolDescription | translate }}</small>\n </p>\n </div>\n <div>\n <button\n class=\"btn btn-primary\"\n (click)=\"selectProtocol(provider)\"\n [attr.data-cy]=\"'remoteAccessPickProtocolModal--select-' + provider.protocolName\"\n >\n <span translate>Select</span>\n </button>\n </div>\n </div>\n </c8y-li-body>\n </c8y-li>\n }\n </div>\n</c8y-modal>\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport {\n ActionBarItemComponent,\n ActionControl,\n AlertService,\n BuiltInActionType,\n C8yTranslateDirective,\n C8yTranslatePipe,\n Column,\n ContextRouteService,\n DataGridModule,\n DisplayOptions,\n EmptyComponent,\n EmptyStateComponent,\n IconDirective,\n ModalService,\n Pagination,\n Status,\n TitleComponent\n} from '@c8y/ngx-components';\nimport {\n RemoteAccessConfiguration,\n RemoteAccessProtocolProvider,\n RemoteAccessService\n} from '@c8y/ngx-components/remote-access/data';\nimport { RemoteAccessConnectButtonComponent } from './remote-access-connect-button/remote-access-connect-button.component';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { RemoteAccessPickProtocolModalComponent } from '../remote-access-pick-protocol-modal/remote-access-pick-protocol-modal.component';\nimport { IconDeviceGridColumn } from '@c8y/ngx-components/device-grid';\nimport { TranslateService } from '@ngx-translate/core';\nimport { IManagedObject } from '@c8y/client';\n\n@Component({\n selector: 'c8y-remote-access-configuration-list',\n templateUrl: './remote-access-configuration-list.component.html',\n standalone: true,\n imports: [\n DataGridModule,\n TitleComponent,\n C8yTranslateDirective,\n ActionBarItemComponent,\n IconDirective,\n EmptyStateComponent,\n C8yTranslatePipe\n ],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class RemoteAccessConfigurationListComponent implements OnInit {\n rows: RemoteAccessConfiguration[] = [];\n columns: Column[] = [\n new IconDeviceGridColumn(\n {\n headerCellRendererComponent: EmptyComponent\n },\n context => {\n const provider = this.protocolProviders.find(p => p.protocolName === context.item.protocol);\n return provider?.protocolIcon || 'laptop';\n }\n ),\n {\n name: 'name',\n header: gettext('Endpoint'),\n path: 'name'\n },\n {\n name: 'hostname',\n header: gettext('Host'),\n path: 'hostname'\n },\n {\n name: 'port',\n header: gettext('Port'),\n path: 'port'\n },\n {\n name: 'protocol',\n header: gettext('Protocol'),\n path: 'protocol'\n },\n {\n name: 'connect',\n header: gettext('Connect'),\n cellRendererComponent: RemoteAccessConnectButtonComponent\n }\n ];\n actionControls: ActionControl[] = [\n {\n type: BuiltInActionType.Edit,\n callback: async (entry: RemoteAccessConfiguration) => {\n const provider = this.getProtocolProviderForConfiguration(entry);\n\n try {\n let result: RemoteAccessConfiguration;\n if (provider.editEndpoint) {\n result = await provider.editEndpoint(this.deviceId, entry);\n } else {\n result = await this.defaultEditEndpoint(this.deviceId, entry);\n }\n\n if (!result) {\n return;\n }\n\n this.alert.success(gettext('Endpoint saved.'));\n } catch (e) {\n console.warn(e);\n this.alert.danger(gettext('Failed to save endpoint.'), e);\n }\n this.reload();\n }\n },\n {\n type: BuiltInActionType.Delete,\n callback: async (entry: RemoteAccessConfiguration) => {\n const result = await this.modalService.confirm(\n gettext('Delete endpoint'),\n this.translateService.instant(\n gettext(\n `You are about to delete endpoint \"{{ endpointName }}\". Do you want to proceed?`\n ),\n { endpointName: entry.name }\n ),\n Status.DANGER,\n { cancel: gettext('Cancel'), ok: gettext('Delete') }\n );\n if (!result) {\n return;\n }\n\n const provider = this.getProtocolProviderForConfiguration(entry);\n\n try {\n await provider.removeEndpoint(this.deviceId, entry);\n this.alert.success(gettext('Endpoint deleted.'));\n } catch (e) {\n console.warn(e);\n this.alert.danger(gettext('Failed to delete endpoint.'), e);\n }\n this.reload();\n }\n }\n ];\n deviceId: string;\n pagination: Pagination = {\n pageSize: 10,\n currentPage: 1\n };\n displayOptions: DisplayOptions = {\n bordered: false,\n striped: true,\n filter: true,\n gridHeader: true,\n hover: true\n };\n protocolProviders: RemoteAccessProtocolProvider[] = [];\n gridTitle = gettext('Remote access endpoints');\n\n private device: IManagedObject;\n\n constructor(\n private remoteAccess: RemoteAccessService,\n private activatedRoute: ActivatedRoute,\n private modalService: ModalService,\n private alert: AlertService,\n private bsModalService: BsModalService,\n private translateService: TranslateService,\n private ctx: ContextRouteService\n ) {\n this.device = this.ctx.getContextData(this.activatedRoute)?.contextData as IManagedObject;\n this.deviceId = this.device?.id as string;\n this.protocolProviders = this.remoteAccess.getSupportedProtocolProvidersFor(this.device);\n const connectColum = this.columns.find(c => c.name === 'connect');\n if (connectColum) {\n (<any>connectColum).target = this.deviceId;\n }\n }\n\n ngOnInit() {\n this.reload();\n }\n\n async reload() {\n const configurations = await this.remoteAccess.listConfigurations(this.deviceId);\n const supportedProtocols = this.remoteAccess.getSupportedProtocolProvidersFor(this.device);\n const supportedProtocolsNames = supportedProtocols.map(p => p.protocolName);\n this.rows = configurations.filter(c =>\n supportedProtocolsNames.includes(c.protocol.toUpperCase())\n );\n }\n\n async addEndpoint() {\n let provider: RemoteAccessProtocolProvider = null;\n if (this.protocolProviders.length > 1) {\n try {\n const modalRef = this.bsModalService.show(RemoteAccessPickProtocolModalComponent, {\n initialState: { protocolProviders: this.protocolProviders }\n });\n provider = await modalRef.content.result;\n } catch (e) {\n // modal closed\n return;\n }\n } else if (this.protocolProviders.length === 1) {\n provider = this.protocolProviders[0];\n } else {\n return;\n }\n\n try {\n let addModalResult: RemoteAccessConfiguration = null;\n if (provider.addEndpoint) {\n addModalResult = await provider.addEndpoint(this.deviceId);\n } else {\n addModalResult = await this.defaultAddEndpoint(this.deviceId, provider);\n }\n if (!addModalResult) {\n return;\n }\n this.alert.success(gettext('Endpoint added.'));\n } catch (e) {\n console.warn(e);\n this.alert.danger(gettext('Failed to add endpoint.'), e);\n }\n this.reload();\n }\n\n getProtocolProviderForConfiguration(configuration: RemoteAccessConfiguration) {\n return this.protocolProviders.find(p => p.protocolName === configuration.protocol);\n }\n\n async defaultEditEndpoint(deviceId: string, configuration: RemoteAccessConfiguration) {\n const modalResult = await this.openBasicEndpointModal(configuration);\n if (!modalResult) {\n return modalResult;\n }\n\n return this.remoteAccess.updateConfiguration(deviceId, modalResult);\n }\n\n async defaultAddEndpoint(deviceId: string, provider: RemoteAccessProtocolProvider) {\n let defaultConfig = { protocol: provider.protocolName };\n if (provider.getDefaultEndpointConfiguration) {\n const defaultConfigFromProvider = await provider.getDefaultEndpointConfiguration();\n defaultConfig = { ...defaultConfig, ...defaultConfigFromProvider };\n }\n const modalResult = await this.openBasicEndpointModal(defaultConfig);\n if (!modalResult) {\n return modalResult;\n }\n\n return this.remoteAccess.addConfiguration(deviceId, modalResult);\n }\n\n async openBasicEndpointModal(\n currentConfiguration: Partial<RemoteAccessConfiguration>\n ): Promise<RemoteAccessConfiguration | null> {\n const { RemoteAccessBasicEndpointModalComponent } = await import(\n '@c8y/ngx-components/remote-access/shared'\n );\n\n try {\n const modalRef = this.bsModalService.show(RemoteAccessBasicEndpointModalComponent, {\n initialState: { currentValue: currentConfiguration }\n });\n return (await modalRef.content.result) as RemoteAccessConfiguration;\n } catch (e) {\n // modal closed\n return null;\n }\n }\n}\n","<c8y-title>{{ 'Remote access' | translate }}</c8y-title>\n\n<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n (click)=\"addEndpoint()\"\n [disabled]=\"!protocolProviders?.length\"\n [attr.data-cy]=\"'remoteAccessConfigurationList--add-endpoint'\"\n >\n <i [c8yIcon]=\"'plus-circle'\"></i>\n <span translate>Add endpoint</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"content-fullpage d-flex d-col border-top\">\n <c8y-data-grid\n [title]=\"gridTitle\"\n [rows]=\"rows\"\n [columns]=\"columns\"\n [pagination]=\"pagination\"\n (onReload)=\"reload()\"\n [actionControls]=\"actionControls\"\n [displayOptions]=\"displayOptions\"\n >\n <c8y-ui-empty-state\n [icon]=\"'window-restore'\"\n [title]=\"'No endpoints configured.' | translate\"\n [subtitle]=\"'Click below to add your first endpoint.' | translate\"\n [horizontal]=\"false\"\n >\n <button\n class=\"btn btn-default\"\n (click)=\"addEndpoint()\"\n translate\n >\n Add endpoint\n </button>\n </c8y-ui-empty-state>\n </c8y-data-grid>\n</div>\n","import { hookRoute, ViewContext } from '@c8y/ngx-components';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { RemoteAccessConfigurationListComponent } from './remote-access-configuration-list/remote-access-configuration-list.component';\nimport { canActivateRemoteAccess } from '@c8y/ngx-components/remote-access/data';\n\nexport * from './remote-access-configuration-list/remote-access-configuration-list.component';\n\nexport const remoteAccessConfigurationListProviders = [\n hookRoute({\n component: RemoteAccessConfigurationListComponent,\n label: gettext('Remote access'),\n path: 'remote_access',\n icon: 'window-restore',\n context: ViewContext.Device,\n canActivate: [canActivateRemoteAccess]\n })\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i3","i4"],"mappings":";;;;;;;;;;;;;;MAgBa,kCAAkC,CAAA;IAS7C,WAAA,CACU,YAAiC,EACrB,OAA6B,EAAA;QADzC,IAAA,CAAA,YAAY,GAAZ,YAAY;QACA,IAAA,CAAA,OAAO,GAAP,OAAO;AAV7B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAS,IAAI,+EAAC;AAC9B,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAAS,IAAI,sFAAC;AACrC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAS,IAAI,+EAAC;QAItB,IAAA,CAAA,iBAAiB,GAAmC,EAAE;QAM5D,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,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EAAA,WAAA,EAAA,IAAA,EACtB,aAAa,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACb,mBAAmB,+GACnB,gBAAgB,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,KAAA,EAAA,CAAA,CAAA;;4FAIP,sCAAsC,EAAA,UAAA,EAAA,CAAA;kBAflD,SAAS;+BACE,sCAAsC,EAAA,UAAA,EAEpC,IAAI,EAAA,OAAA,EACP;wBACP,cAAc;wBACd,cAAc;wBACd,qBAAqB;wBACrB,sBAAsB;wBACtB,aAAa;wBACb,mBAAmB;wBACnB;qBACD,EAAA,eAAA,EACgB,uBAAuB,CAAC,KAAK,EAAA,QAAA,EAAA,woCAAA,EAAA;;;AExCzC,MAAM,sCAAsC,GAAG;AACpD,IAAA,SAAS,CAAC;AACR,QAAA,SAAS,EAAE,sCAAsC;AACjD,QAAA,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC;AAC/B,QAAA,IAAI,EAAE,eAAe;AACrB,QAAA,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,WAAW,CAAC,MAAM;QAC3B,WAAW,EAAE,CAAC,uBAAuB;KACtC;;;ACfH;;AAEG;;;;"}
@@ -43,11 +43,11 @@ class RemoteAccessBasicEndpointModalComponent {
43
43
  this._resolve(this.form.value);
44
44
  }
45
45
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: RemoteAccessBasicEndpointModalComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
46
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.19", type: RemoteAccessBasicEndpointModalComponent, isStandalone: true, selector: "c8y-remote-access-basic-endpoint-modal", ngImport: i0, template: "<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [disabled]=\"form.invalid\"\n [labels]=\"{ cancel: 'Cancel', ok: 'Save' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div\n class=\"p-24\"\n [formGroup]=\"form\"\n >\n <c8y-form-group>\n <label\n for=\"name\"\n translate\n >\n Name\n </label>\n <input\n class=\"form-control\"\n id=\"name\"\n [placeholder]=\"'e.g. {{ example }}' | translate : { example: 'My remote access endpoint' }\"\n name=\"name\"\n type=\"text\"\n formControlName=\"name\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--name'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"protocol\"\n translate\n >\n Protocol\n </label>\n <input\n class=\"form-control\"\n id=\"protocol\"\n readonly\n name=\"protocol\"\n type=\"text\"\n formControlName=\"protocol\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"hostname\"\n translate\n >\n Host\n </label>\n <input\n class=\"form-control\"\n id=\"hostname\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '127.0.0.1' } }}\"\n name=\"hostname\"\n type=\"text\"\n formControlName=\"hostname\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--hostname'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"port\"\n translate\n >\n Port\n </label>\n <input\n class=\"form-control\"\n id=\"port\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '8080' } }}\"\n name=\"port\"\n type=\"number\"\n formControlName=\"port\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--port'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i2.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: i2.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "directive", type: i1.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: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i2.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i2.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage", "additionalMessages"] }, { kind: "directive", type: i2.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
46
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.19", type: RemoteAccessBasicEndpointModalComponent, isStandalone: true, selector: "c8y-remote-access-basic-endpoint-modal", ngImport: i0, template: "<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [disabled]=\"form.invalid\"\n [labels]=\"{ cancel: 'Cancel', ok: 'Save' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div [formGroup]=\"form\">\n <c8y-form-group>\n <label\n for=\"name\"\n translate\n >\n Name\n </label>\n <input\n class=\"form-control\"\n id=\"name\"\n name=\"name\"\n type=\"text\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 'My remote access endpoint' }\"\n formControlName=\"name\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--name'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"protocol\"\n translate\n >\n Protocol\n </label>\n <input\n class=\"form-control\"\n id=\"protocol\"\n name=\"protocol\"\n type=\"text\"\n readonly\n formControlName=\"protocol\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"hostname\"\n translate\n >\n Host\n </label>\n <input\n class=\"form-control\"\n id=\"hostname\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '127.0.0.1' } }}\"\n name=\"hostname\"\n type=\"text\"\n formControlName=\"hostname\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--hostname'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"port\"\n translate\n >\n Port\n </label>\n <input\n class=\"form-control\"\n id=\"port\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '8080' } }}\"\n name=\"port\"\n type=\"number\"\n formControlName=\"port\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--port'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i2.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: i2.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "flushBody", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "directive", type: i1.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: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i2.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i2.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage", "additionalMessages"] }, { kind: "directive", type: i2.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
47
47
  }
48
48
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: RemoteAccessBasicEndpointModalComponent, decorators: [{
49
49
  type: Component,
50
- args: [{ selector: 'c8y-remote-access-basic-endpoint-modal', standalone: true, imports: [CoreModule], changeDetection: ChangeDetectionStrategy.Eager, template: "<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [disabled]=\"form.invalid\"\n [labels]=\"{ cancel: 'Cancel', ok: 'Save' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div\n class=\"p-24\"\n [formGroup]=\"form\"\n >\n <c8y-form-group>\n <label\n for=\"name\"\n translate\n >\n Name\n </label>\n <input\n class=\"form-control\"\n id=\"name\"\n [placeholder]=\"'e.g. {{ example }}' | translate : { example: 'My remote access endpoint' }\"\n name=\"name\"\n type=\"text\"\n formControlName=\"name\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--name'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"protocol\"\n translate\n >\n Protocol\n </label>\n <input\n class=\"form-control\"\n id=\"protocol\"\n readonly\n name=\"protocol\"\n type=\"text\"\n formControlName=\"protocol\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"hostname\"\n translate\n >\n Host\n </label>\n <input\n class=\"form-control\"\n id=\"hostname\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '127.0.0.1' } }}\"\n name=\"hostname\"\n type=\"text\"\n formControlName=\"hostname\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--hostname'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"port\"\n translate\n >\n Port\n </label>\n <input\n class=\"form-control\"\n id=\"port\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '8080' } }}\"\n name=\"port\"\n type=\"number\"\n formControlName=\"port\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--port'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n</c8y-modal>\n" }]
50
+ args: [{ selector: 'c8y-remote-access-basic-endpoint-modal', standalone: true, imports: [CoreModule], changeDetection: ChangeDetectionStrategy.Eager, template: "<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [disabled]=\"form.invalid\"\n [labels]=\"{ cancel: 'Cancel', ok: 'Save' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div [formGroup]=\"form\">\n <c8y-form-group>\n <label\n for=\"name\"\n translate\n >\n Name\n </label>\n <input\n class=\"form-control\"\n id=\"name\"\n name=\"name\"\n type=\"text\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 'My remote access endpoint' }\"\n formControlName=\"name\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--name'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"protocol\"\n translate\n >\n Protocol\n </label>\n <input\n class=\"form-control\"\n id=\"protocol\"\n name=\"protocol\"\n type=\"text\"\n readonly\n formControlName=\"protocol\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"hostname\"\n translate\n >\n Host\n </label>\n <input\n class=\"form-control\"\n id=\"hostname\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '127.0.0.1' } }}\"\n name=\"hostname\"\n type=\"text\"\n formControlName=\"hostname\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--hostname'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"port\"\n translate\n >\n Port\n </label>\n <input\n class=\"form-control\"\n id=\"port\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '8080' } }}\"\n name=\"port\"\n type=\"number\"\n formControlName=\"port\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--port'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n</c8y-modal>\n" }]
51
51
  }], ctorParameters: () => [{ type: i1.FormBuilder }] });
52
52
 
53
53
  const types = [
@@ -1 +1 @@
1
- {"version":3,"file":"c8y-ngx-components-remote-access-shared.mjs","sources":["../../remote-access/shared/remote-access-basic-endpoint-modal/remote-access-basic-endpoint-modal.component.ts","../../remote-access/shared/remote-access-basic-endpoint-modal/remote-access-basic-endpoint-modal.component.html","../../remote-access/shared/ssh-key-input/ssh-key-input.component.ts","../../remote-access/shared/ssh-key-input/ssh-key-input.component.html","../../remote-access/shared/c8y-ngx-components-remote-access-shared.ts"],"sourcesContent":["import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { FormBuilder, Validators } from '@angular/forms';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { CoreModule } from '@c8y/ngx-components';\nimport { RemoteAccessConfiguration } from '@c8y/ngx-components/remote-access/data';\n\n@Component({\n selector: 'c8y-remote-access-basic-endpoint-modal',\n templateUrl: './remote-access-basic-endpoint-modal.component.html',\n standalone: true,\n imports: [CoreModule],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class RemoteAccessBasicEndpointModalComponent implements OnInit {\n title = gettext('Remote access endpoint');\n form: ReturnType<typeof this.initForm>;\n\n currentValue: Partial<RemoteAccessConfiguration>;\n\n result = new Promise<ReturnType<typeof this.initForm>['value']>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n\n private _resolve: (value: ReturnType<typeof this.initForm>['value']) => void;\n private _reject: (reason?: any) => void;\n\n constructor(private formBuilder: FormBuilder) {\n this.form = this.initForm();\n }\n\n ngOnInit() {\n if (this.currentValue) {\n const { credentials, ...rest } = this.currentValue;\n const credentialsType = credentials?.type || 'NONE';\n const patchedValue = { ...rest, credentialsType };\n this.form.patchValue(patchedValue);\n }\n }\n\n initForm() {\n return this.formBuilder.group({\n id: ['', []],\n name: ['', [Validators.required, Validators.minLength(1)]],\n hostname: ['', [Validators.required, Validators.minLength(1)]],\n port: [undefined as number, [Validators.required, Validators.min(1), Validators.max(65535)]],\n protocol: ['', [Validators.required, Validators.minLength(1)]],\n credentialsType: ['NONE' as 'NONE' | 'PASS_ONLY', [Validators.required]],\n attrs: [undefined]\n });\n }\n\n cancel() {\n this._reject();\n }\n\n save() {\n this._resolve(this.form.value);\n }\n}\n","<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [disabled]=\"form.invalid\"\n [labels]=\"{ cancel: 'Cancel', ok: 'Save' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div\n class=\"p-24\"\n [formGroup]=\"form\"\n >\n <c8y-form-group>\n <label\n for=\"name\"\n translate\n >\n Name\n </label>\n <input\n class=\"form-control\"\n id=\"name\"\n [placeholder]=\"'e.g. {{ example }}' | translate : { example: 'My remote access endpoint' }\"\n name=\"name\"\n type=\"text\"\n formControlName=\"name\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--name'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"protocol\"\n translate\n >\n Protocol\n </label>\n <input\n class=\"form-control\"\n id=\"protocol\"\n readonly\n name=\"protocol\"\n type=\"text\"\n formControlName=\"protocol\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"hostname\"\n translate\n >\n Host\n </label>\n <input\n class=\"form-control\"\n id=\"hostname\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '127.0.0.1' } }}\"\n name=\"hostname\"\n type=\"text\"\n formControlName=\"hostname\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--hostname'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"port\"\n translate\n >\n Port\n </label>\n <input\n class=\"form-control\"\n id=\"port\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '8080' } }}\"\n name=\"port\"\n type=\"number\"\n formControlName=\"port\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--port'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n</c8y-modal>\n","import { NgIf } from '@angular/common';\nimport { Component, forwardRef, Input, OnChanges, OnInit, SimpleChanges, ChangeDetectionStrategy } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { C8yTranslatePipe, DropAreaComponent, DroppedFile } from '@c8y/ngx-components';\n\nconst types = [\n {\n name: 'PRIVATE',\n value: 'private',\n placeholder:\n '-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAK...VQvopm2xw==----- END RSA PRIVATE KEY-----'\n },\n {\n name: 'PUBLIC',\n value: 'public',\n placeholder: 'ssh-rsa AAAAB3NzaC...1kc3MAAACB== user@example.com'\n },\n {\n name: 'CERTIFICATE',\n value: 'certificate',\n placeholder: 'ssh-rsa-cert-v01@openssh.com AAAAHHNz...Y9gBU= user@example.com'\n }\n] as const;\n\n@Component({\n selector: 'c8y-ssh-key-input',\n templateUrl: './ssh-key-input.component.html',\n standalone: true,\n imports: [C8yTranslatePipe, NgIf, DropAreaComponent, FormsModule],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SshKeyInputComponent),\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class SshKeyInputComponent implements OnInit, OnChanges, ControlValueAccessor {\n @Input() keyType: (typeof types)[number]['value'] = types[0].value;\n readonly = false;\n\n placeholder: string;\n\n value = '';\n\n onChange: (value: string) => void;\n onTouch: () => void;\n\n writeValue(obj: string): void {\n this.value = obj;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouch = fn;\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.readonly = isDisabled;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.keyType) {\n this.reassignPlaceholder();\n }\n }\n\n ngOnInit() {\n this.reassignPlaceholder();\n }\n\n async onKeyFileSelected(event: DroppedFile[]) {\n const file = event[0];\n const content = await file.readAsText();\n this.newValue(content);\n }\n\n newValue(value: string) {\n this.value = value;\n this.onChange(value);\n this.onTouch();\n }\n\n private reassignPlaceholder() {\n const type = types.find(t => t.value === this.keyType);\n if (type) {\n this.placeholder = type.placeholder;\n }\n }\n}\n","<div class=\"form-group\">\n <div class=\"tight-grid\">\n <div class=\"col-xs-8\">\n <input\n [placeholder]=\"'e.g. {{ example }}' | translate : { example: placeholder }\"\n type=\"text\"\n class=\"form-control\"\n [ngModel]=\"value\"\n (ngModelChange)=\"newValue($event)\"\n [readonly]=\"readonly\"\n [ngModelOptions]=\"{standalone: true}\"\n />\n </div>\n <div class=\"col-xs-4\" *ngIf=\"!readonly\">\n <c8y-drop-area class=\"drop-area-sm\" (dropped)=\"onKeyFileSelected($event)\" [maxAllowedFiles]=\"1\" [icon]=\"'upload'\"></c8y-drop-area>\n </div>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAaa,uCAAuC,CAAA;AAclD,IAAA,WAAA,CAAoB,WAAwB,EAAA;QAAxB,IAAA,CAAA,WAAW,GAAX,WAAW;AAb/B,QAAA,IAAA,CAAA,KAAK,GAAG,OAAO,CAAC,wBAAwB,CAAC;QAKzC,IAAA,CAAA,MAAM,GAAG,IAAI,OAAO,CAA4C,CAAC,OAAO,EAAE,MAAM,KAAI;AAClF,YAAA,IAAI,CAAC,QAAQ,GAAG,OAAO;AACvB,YAAA,IAAI,CAAC,OAAO,GAAG,MAAM;AACvB,QAAA,CAAC,CAAC;AAMA,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE;IAC7B;IAEA,QAAQ,GAAA;AACN,QAAA,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY;AAClD,YAAA,MAAM,eAAe,GAAG,WAAW,EAAE,IAAI,IAAI,MAAM;YACnD,MAAM,YAAY,GAAG,EAAE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A,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,WAAW,0mBAAtD,gBAAgB,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,KAAA,EAAA,CAAA,CAAA;;4FAUf,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAdhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAAA,UAAA,EAEjB,IAAI,EAAA,OAAA,EACP,CAAC,gBAAgB,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,CAAC,EAAA,SAAA,EACtD;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,0BAA0B,CAAC;AACnD,4BAAA,KAAK,EAAE;AACR;qBACF,EAAA,eAAA,EACgB,uBAAuB,CAAC,KAAK,EAAA,QAAA,EAAA,2oBAAA,EAAA;;sBAG7C;;;AEvCH;;AAEG;;;;"}
1
+ {"version":3,"file":"c8y-ngx-components-remote-access-shared.mjs","sources":["../../remote-access/shared/remote-access-basic-endpoint-modal/remote-access-basic-endpoint-modal.component.ts","../../remote-access/shared/remote-access-basic-endpoint-modal/remote-access-basic-endpoint-modal.component.html","../../remote-access/shared/ssh-key-input/ssh-key-input.component.ts","../../remote-access/shared/ssh-key-input/ssh-key-input.component.html","../../remote-access/shared/c8y-ngx-components-remote-access-shared.ts"],"sourcesContent":["import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { FormBuilder, Validators } from '@angular/forms';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { CoreModule } from '@c8y/ngx-components';\nimport { RemoteAccessConfiguration } from '@c8y/ngx-components/remote-access/data';\n\n@Component({\n selector: 'c8y-remote-access-basic-endpoint-modal',\n templateUrl: './remote-access-basic-endpoint-modal.component.html',\n standalone: true,\n imports: [CoreModule],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class RemoteAccessBasicEndpointModalComponent implements OnInit {\n title = gettext('Remote access endpoint');\n form: ReturnType<typeof this.initForm>;\n\n currentValue: Partial<RemoteAccessConfiguration>;\n\n result = new Promise<ReturnType<typeof this.initForm>['value']>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n\n private _resolve: (value: ReturnType<typeof this.initForm>['value']) => void;\n private _reject: (reason?: any) => void;\n\n constructor(private formBuilder: FormBuilder) {\n this.form = this.initForm();\n }\n\n ngOnInit() {\n if (this.currentValue) {\n const { credentials, ...rest } = this.currentValue;\n const credentialsType = credentials?.type || 'NONE';\n const patchedValue = { ...rest, credentialsType };\n this.form.patchValue(patchedValue);\n }\n }\n\n initForm() {\n return this.formBuilder.group({\n id: ['', []],\n name: ['', [Validators.required, Validators.minLength(1)]],\n hostname: ['', [Validators.required, Validators.minLength(1)]],\n port: [undefined as number, [Validators.required, Validators.min(1), Validators.max(65535)]],\n protocol: ['', [Validators.required, Validators.minLength(1)]],\n credentialsType: ['NONE' as 'NONE' | 'PASS_ONLY', [Validators.required]],\n attrs: [undefined]\n });\n }\n\n cancel() {\n this._reject();\n }\n\n save() {\n this._resolve(this.form.value);\n }\n}\n","<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [disabled]=\"form.invalid\"\n [labels]=\"{ cancel: 'Cancel', ok: 'Save' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div [formGroup]=\"form\">\n <c8y-form-group>\n <label\n for=\"name\"\n translate\n >\n Name\n </label>\n <input\n class=\"form-control\"\n id=\"name\"\n name=\"name\"\n type=\"text\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 'My remote access endpoint' }\"\n formControlName=\"name\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--name'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"protocol\"\n translate\n >\n Protocol\n </label>\n <input\n class=\"form-control\"\n id=\"protocol\"\n name=\"protocol\"\n type=\"text\"\n readonly\n formControlName=\"protocol\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"hostname\"\n translate\n >\n Host\n </label>\n <input\n class=\"form-control\"\n id=\"hostname\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '127.0.0.1' } }}\"\n name=\"hostname\"\n type=\"text\"\n formControlName=\"hostname\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--hostname'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"port\"\n translate\n >\n Port\n </label>\n <input\n class=\"form-control\"\n id=\"port\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '8080' } }}\"\n name=\"port\"\n type=\"number\"\n formControlName=\"port\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--port'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n</c8y-modal>\n","import { NgIf } from '@angular/common';\nimport { Component, forwardRef, Input, OnChanges, OnInit, SimpleChanges, ChangeDetectionStrategy } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { C8yTranslatePipe, DropAreaComponent, DroppedFile } from '@c8y/ngx-components';\n\nconst types = [\n {\n name: 'PRIVATE',\n value: 'private',\n placeholder:\n '-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAK...VQvopm2xw==----- END RSA PRIVATE KEY-----'\n },\n {\n name: 'PUBLIC',\n value: 'public',\n placeholder: 'ssh-rsa AAAAB3NzaC...1kc3MAAACB== user@example.com'\n },\n {\n name: 'CERTIFICATE',\n value: 'certificate',\n placeholder: 'ssh-rsa-cert-v01@openssh.com AAAAHHNz...Y9gBU= user@example.com'\n }\n] as const;\n\n@Component({\n selector: 'c8y-ssh-key-input',\n templateUrl: './ssh-key-input.component.html',\n standalone: true,\n imports: [C8yTranslatePipe, NgIf, DropAreaComponent, FormsModule],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SshKeyInputComponent),\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class SshKeyInputComponent implements OnInit, OnChanges, ControlValueAccessor {\n @Input() keyType: (typeof types)[number]['value'] = types[0].value;\n readonly = false;\n\n placeholder: string;\n\n value = '';\n\n onChange: (value: string) => void;\n onTouch: () => void;\n\n writeValue(obj: string): void {\n this.value = obj;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouch = fn;\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.readonly = isDisabled;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.keyType) {\n this.reassignPlaceholder();\n }\n }\n\n ngOnInit() {\n this.reassignPlaceholder();\n }\n\n async onKeyFileSelected(event: DroppedFile[]) {\n const file = event[0];\n const content = await file.readAsText();\n this.newValue(content);\n }\n\n newValue(value: string) {\n this.value = value;\n this.onChange(value);\n this.onTouch();\n }\n\n private reassignPlaceholder() {\n const type = types.find(t => t.value === this.keyType);\n if (type) {\n this.placeholder = type.placeholder;\n }\n }\n}\n","<div class=\"form-group\">\n <div class=\"tight-grid\">\n <div class=\"col-xs-8\">\n <input\n [placeholder]=\"'e.g. {{ example }}' | translate : { example: placeholder }\"\n type=\"text\"\n class=\"form-control\"\n [ngModel]=\"value\"\n (ngModelChange)=\"newValue($event)\"\n [readonly]=\"readonly\"\n [ngModelOptions]=\"{standalone: true}\"\n />\n </div>\n <div class=\"col-xs-4\" *ngIf=\"!readonly\">\n <c8y-drop-area class=\"drop-area-sm\" (dropped)=\"onKeyFileSelected($event)\" [maxAllowedFiles]=\"1\" [icon]=\"'upload'\"></c8y-drop-area>\n </div>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */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AK,EAAE;AACR;qBACF,EAAA,eAAA,EACgB,uBAAuB,CAAC,KAAK,EAAA,QAAA,EAAA,2oBAAA,EAAA;;sBAG7C;;;AEvCH;;AAEG;;;;"}
@@ -110,11 +110,11 @@ class RemoteAccessSshEndpointModalComponent {
110
110
  this._resolve(this.form.value);
111
111
  }
112
112
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: RemoteAccessSshEndpointModalComponent, deps: [{ token: i1.FormBuilder }, { token: i2.RemoteAccessService }], target: i0.ɵɵFactoryTarget.Component }); }
113
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: RemoteAccessSshEndpointModalComponent, isStandalone: true, selector: "c8y-remote-access-ssh-endpoint-modal", ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/prefer-control-flow -- pre-existing legacy *ngIf/*ngFor in this modal; not migrating as part of the DM-6421 host-key change -->\n<ng-template #keyPairPopoverContent>\n <small translate\n >Supported formats: OpenSSHv1, OpenSSHv2, PEM, SSH2.<br />Supported algorithms: RSA, DSA, ECDSA,\n ED25519.</small\n >\n</ng-template>\n\n<ng-template #certificatePopoverContent>\n <small translate\n >Supported formats: OpenSSHv1, OpenSSHv2, PEM, SSH2.<br />Supported algorithms: RSA, DSA.</small\n >\n</ng-template>\n\n<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [disabled]=\"form.invalid\"\n [labels]=\"{ cancel: 'Cancel', ok: 'Save' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div\n class=\"p-24\"\n [formGroup]=\"form\"\n >\n <c8y-form-group>\n <label\n for=\"name\"\n translate\n >\n Name\n </label>\n <input\n class=\"form-control\"\n id=\"name\"\n name=\"name\"\n type=\"text\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 'My remote access endpoint' }\"\n formControlName=\"name\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--name'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"protocol\"\n translate\n >\n Protocol\n </label>\n <input\n class=\"form-control\"\n id=\"protocol\"\n name=\"protocol\"\n type=\"text\"\n readonly\n formControlName=\"protocol\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"hostname\"\n translate\n >\n Host\n </label>\n <input\n class=\"form-control\"\n id=\"hostname\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '127.0.0.1' } }}\"\n name=\"hostname\"\n type=\"text\"\n formControlName=\"hostname\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--hostname'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"port\"\n translate\n >\n Port\n </label>\n <input\n class=\"form-control\"\n id=\"port\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '22' } }}\"\n name=\"port\"\n type=\"number\"\n formControlName=\"port\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--port'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <div>\n <c8y-form-group>\n <label\n for=\"credentialsType\"\n translate\n >\n Sign-in method\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"credentialsType\"\n formControlName=\"credentialsType\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--credentials-type'\"\n >\n <option\n *ngFor=\"let type of credentialTypes\"\n [value]=\"type.value\"\n >\n {{ type.label | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n\n <div class=\"tight-grid\">\n <div class=\"col-md-6\">\n <c8y-form-group>\n <label\n for=\"username\"\n translate\n >\n Username\n </label>\n <input\n class=\"form-control\"\n id=\"username\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: 'my_username' } }}\"\n name=\"username\"\n type=\"username\"\n autocomplete=\"off\"\n formControlName=\"username\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n <div\n class=\"col-md-6\"\n *ngIf=\"form.value.credentialsType === 'USER_PASS'\"\n >\n <c8y-form-group>\n <label\n for=\"password\"\n translate\n >\n Password\n </label>\n <input\n class=\"form-control\"\n id=\"password\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: 'my_password' } }}\"\n name=\"password\"\n type=\"password\"\n autocomplete=\"off\"\n formControlName=\"password\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n </div>\n\n <div *ngIf=\"form.value.credentialsType === 'KEY_PAIR'\">\n <div\n class=\"form-group\"\n ng-if=\"!vm.keyPairAvailable() || vm.changingKeyPair\"\n >\n <button\n class=\"btn btn-default p-l-16\"\n [title]=\"'Generate public and private keys' | translate\"\n type=\"button\"\n [ngClass]=\"{ 'btn-pending': generating }\"\n ng-disabled=\"vm.generating\"\n (click)=\"generateKeys()\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--generate-keys'\"\n >\n <i [c8yIcon]=\"'key'\"></i>\n {{ 'Generate public and private keys' | translate }}\n </button>\n </div>\n\n <c8y-form-group>\n <label for=\"privateKey\">\n {{ 'Private key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"keyPairPopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"privateKey\"\n formControlName=\"privateKey\"\n [keyType]=\"'private'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n\n <c8y-form-group>\n <label for=\"publicKey\">\n {{ 'Public key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"keyPairPopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n <button\n class=\"m-l-16 btn-link interact\"\n [title]=\"'Download key' | translate\"\n type=\"button\"\n (click)=\"downloadPublicKey()\"\n *ngIf=\"form.value.publicKey\"\n >\n <i [c8yIcon]=\"'download'\"></i>\n {{ 'Download key' | translate }}\n </button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"publicKey\"\n formControlName=\"publicKey\"\n [keyType]=\"'public'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n </div>\n\n <div *ngIf=\"form.value.credentialsType === 'CERTIFICATE'\">\n <c8y-form-group>\n <label for=\"privateKey\">\n {{ 'Private key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"certificatePopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"privateKey\"\n formControlName=\"privateKey\"\n [keyType]=\"'private'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n\n <c8y-form-group>\n <label for=\"certificate\">\n {{ 'Certificate' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"certificatePopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"certificate\"\n formControlName=\"certificate\"\n [keyType]=\"'certificate'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n </div>\n\n <div>\n <c8y-form-group>\n <label for=\"hostKey\">\n {{ 'Host key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"keyPairPopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"hostKey\"\n formControlName=\"hostKey\"\n [keyType]=\"'public'\"\n ></c8y-ssh-key-input>\n </div>\n <c8y-messages></c8y-messages>\n @if (hostKeyAutosaveEnabled() && hostKeyEmpty()) {\n <div class=\"alert alert-warning m-t-8\">\n <strong>\n {{\n 'If left empty, the server host key is trusted automatically on the first connection.'\n | translate\n }}\n </strong>\n </div>\n }\n </c8y-form-group>\n </div>\n </div>\n </div>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i3.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i3.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.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: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i3.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i3.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage", "additionalMessages"] }, { kind: "directive", type: i3.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: SshKeyInputComponent, selector: "c8y-ssh-key-input", inputs: ["keyType"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i5.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "pipe", type: i3.C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
113
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: RemoteAccessSshEndpointModalComponent, isStandalone: true, selector: "c8y-remote-access-ssh-endpoint-modal", ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/prefer-control-flow -- pre-existing legacy *ngIf/*ngFor in this modal; not migrating as part of the DM-6421 host-key change -->\n<ng-template #keyPairPopoverContent>\n <small translate\n >Supported formats: OpenSSHv1, OpenSSHv2, PEM, SSH2.<br />Supported algorithms: RSA, DSA, ECDSA,\n ED25519.</small\n >\n</ng-template>\n\n<ng-template #certificatePopoverContent>\n <small translate\n >Supported formats: OpenSSHv1, OpenSSHv2, PEM, SSH2.<br />Supported algorithms: RSA, DSA.</small\n >\n</ng-template>\n\n<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [disabled]=\"form.invalid\"\n [labels]=\"{ cancel: 'Cancel', ok: 'Save' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div [formGroup]=\"form\">\n <c8y-form-group>\n <label\n for=\"name\"\n translate\n >\n Name\n </label>\n <input\n class=\"form-control\"\n id=\"name\"\n name=\"name\"\n type=\"text\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 'My remote access endpoint' }\"\n formControlName=\"name\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--name'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"protocol\"\n translate\n >\n Protocol\n </label>\n <input\n class=\"form-control\"\n id=\"protocol\"\n name=\"protocol\"\n type=\"text\"\n readonly\n formControlName=\"protocol\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"hostname\"\n translate\n >\n Host\n </label>\n <input\n class=\"form-control\"\n id=\"hostname\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '127.0.0.1' } }}\"\n name=\"hostname\"\n type=\"text\"\n formControlName=\"hostname\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--hostname'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"port\"\n translate\n >\n Port\n </label>\n <input\n class=\"form-control\"\n id=\"port\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '22' } }}\"\n name=\"port\"\n type=\"number\"\n formControlName=\"port\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--port'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <div>\n <c8y-form-group>\n <label\n for=\"credentialsType\"\n translate\n >\n Sign-in method\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"credentialsType\"\n formControlName=\"credentialsType\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--credentials-type'\"\n >\n <option\n *ngFor=\"let type of credentialTypes\"\n [value]=\"type.value\"\n >\n {{ type.label | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n\n <div class=\"tight-grid\">\n <div class=\"col-md-6\">\n <c8y-form-group>\n <label\n for=\"username\"\n translate\n >\n Username\n </label>\n <input\n class=\"form-control\"\n id=\"username\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: 'my_username' } }}\"\n name=\"username\"\n type=\"username\"\n autocomplete=\"off\"\n formControlName=\"username\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n <div\n class=\"col-md-6\"\n *ngIf=\"form.value.credentialsType === 'USER_PASS'\"\n >\n <c8y-form-group>\n <label\n for=\"password\"\n translate\n >\n Password\n </label>\n <input\n class=\"form-control\"\n id=\"password\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: 'my_password' } }}\"\n name=\"password\"\n type=\"password\"\n autocomplete=\"off\"\n formControlName=\"password\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n </div>\n\n <div *ngIf=\"form.value.credentialsType === 'KEY_PAIR'\">\n <div\n class=\"form-group\"\n ng-if=\"!vm.keyPairAvailable() || vm.changingKeyPair\"\n >\n <button\n class=\"btn btn-default p-l-16\"\n [title]=\"'Generate public and private keys' | translate\"\n type=\"button\"\n [ngClass]=\"{ 'btn-pending': generating }\"\n ng-disabled=\"vm.generating\"\n (click)=\"generateKeys()\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--generate-keys'\"\n >\n <i [c8yIcon]=\"'key'\"></i>\n {{ 'Generate public and private keys' | translate }}\n </button>\n </div>\n\n <c8y-form-group>\n <label for=\"privateKey\">\n {{ 'Private key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"keyPairPopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"privateKey\"\n formControlName=\"privateKey\"\n [keyType]=\"'private'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n\n <c8y-form-group>\n <label for=\"publicKey\">\n {{ 'Public key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"keyPairPopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n <button\n class=\"m-l-16 btn-link interact\"\n [title]=\"'Download key' | translate\"\n type=\"button\"\n (click)=\"downloadPublicKey()\"\n *ngIf=\"form.value.publicKey\"\n >\n <i [c8yIcon]=\"'download'\"></i>\n {{ 'Download key' | translate }}\n </button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"publicKey\"\n formControlName=\"publicKey\"\n [keyType]=\"'public'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n </div>\n\n <div *ngIf=\"form.value.credentialsType === 'CERTIFICATE'\">\n <c8y-form-group>\n <label for=\"privateKey\">\n {{ 'Private key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"certificatePopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"privateKey\"\n formControlName=\"privateKey\"\n [keyType]=\"'private'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n\n <c8y-form-group>\n <label for=\"certificate\">\n {{ 'Certificate' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"certificatePopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"certificate\"\n formControlName=\"certificate\"\n [keyType]=\"'certificate'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n </div>\n\n <div>\n <c8y-form-group>\n <label for=\"hostKey\">\n {{ 'Host key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"keyPairPopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"hostKey\"\n formControlName=\"hostKey\"\n [keyType]=\"'public'\"\n ></c8y-ssh-key-input>\n </div>\n <c8y-messages></c8y-messages>\n @if (hostKeyAutosaveEnabled() && hostKeyEmpty()) {\n <div class=\"alert alert-warning m-t-8\">\n <strong>\n {{\n 'If left empty, the server host key is trusted automatically on the first connection.'\n | translate\n }}\n </strong>\n </div>\n }\n </c8y-form-group>\n </div>\n </div>\n </div>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i3.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i3.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "flushBody", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.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: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i3.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i3.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage", "additionalMessages"] }, { kind: "directive", type: i3.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: SshKeyInputComponent, selector: "c8y-ssh-key-input", inputs: ["keyType"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i5.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "pipe", type: i3.C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
114
114
  }
115
115
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: RemoteAccessSshEndpointModalComponent, decorators: [{
116
116
  type: Component,
117
- args: [{ selector: 'c8y-remote-access-ssh-endpoint-modal', standalone: true, imports: [CoreModule, NgForOf, NgClass, SshKeyInputComponent, PopoverModule], changeDetection: ChangeDetectionStrategy.Eager, template: "<!-- eslint-disable @angular-eslint/template/prefer-control-flow -- pre-existing legacy *ngIf/*ngFor in this modal; not migrating as part of the DM-6421 host-key change -->\n<ng-template #keyPairPopoverContent>\n <small translate\n >Supported formats: OpenSSHv1, OpenSSHv2, PEM, SSH2.<br />Supported algorithms: RSA, DSA, ECDSA,\n ED25519.</small\n >\n</ng-template>\n\n<ng-template #certificatePopoverContent>\n <small translate\n >Supported formats: OpenSSHv1, OpenSSHv2, PEM, SSH2.<br />Supported algorithms: RSA, DSA.</small\n >\n</ng-template>\n\n<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [disabled]=\"form.invalid\"\n [labels]=\"{ cancel: 'Cancel', ok: 'Save' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div\n class=\"p-24\"\n [formGroup]=\"form\"\n >\n <c8y-form-group>\n <label\n for=\"name\"\n translate\n >\n Name\n </label>\n <input\n class=\"form-control\"\n id=\"name\"\n name=\"name\"\n type=\"text\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 'My remote access endpoint' }\"\n formControlName=\"name\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--name'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"protocol\"\n translate\n >\n Protocol\n </label>\n <input\n class=\"form-control\"\n id=\"protocol\"\n name=\"protocol\"\n type=\"text\"\n readonly\n formControlName=\"protocol\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"hostname\"\n translate\n >\n Host\n </label>\n <input\n class=\"form-control\"\n id=\"hostname\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '127.0.0.1' } }}\"\n name=\"hostname\"\n type=\"text\"\n formControlName=\"hostname\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--hostname'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"port\"\n translate\n >\n Port\n </label>\n <input\n class=\"form-control\"\n id=\"port\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '22' } }}\"\n name=\"port\"\n type=\"number\"\n formControlName=\"port\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--port'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <div>\n <c8y-form-group>\n <label\n for=\"credentialsType\"\n translate\n >\n Sign-in method\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"credentialsType\"\n formControlName=\"credentialsType\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--credentials-type'\"\n >\n <option\n *ngFor=\"let type of credentialTypes\"\n [value]=\"type.value\"\n >\n {{ type.label | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n\n <div class=\"tight-grid\">\n <div class=\"col-md-6\">\n <c8y-form-group>\n <label\n for=\"username\"\n translate\n >\n Username\n </label>\n <input\n class=\"form-control\"\n id=\"username\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: 'my_username' } }}\"\n name=\"username\"\n type=\"username\"\n autocomplete=\"off\"\n formControlName=\"username\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n <div\n class=\"col-md-6\"\n *ngIf=\"form.value.credentialsType === 'USER_PASS'\"\n >\n <c8y-form-group>\n <label\n for=\"password\"\n translate\n >\n Password\n </label>\n <input\n class=\"form-control\"\n id=\"password\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: 'my_password' } }}\"\n name=\"password\"\n type=\"password\"\n autocomplete=\"off\"\n formControlName=\"password\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n </div>\n\n <div *ngIf=\"form.value.credentialsType === 'KEY_PAIR'\">\n <div\n class=\"form-group\"\n ng-if=\"!vm.keyPairAvailable() || vm.changingKeyPair\"\n >\n <button\n class=\"btn btn-default p-l-16\"\n [title]=\"'Generate public and private keys' | translate\"\n type=\"button\"\n [ngClass]=\"{ 'btn-pending': generating }\"\n ng-disabled=\"vm.generating\"\n (click)=\"generateKeys()\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--generate-keys'\"\n >\n <i [c8yIcon]=\"'key'\"></i>\n {{ 'Generate public and private keys' | translate }}\n </button>\n </div>\n\n <c8y-form-group>\n <label for=\"privateKey\">\n {{ 'Private key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"keyPairPopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"privateKey\"\n formControlName=\"privateKey\"\n [keyType]=\"'private'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n\n <c8y-form-group>\n <label for=\"publicKey\">\n {{ 'Public key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"keyPairPopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n <button\n class=\"m-l-16 btn-link interact\"\n [title]=\"'Download key' | translate\"\n type=\"button\"\n (click)=\"downloadPublicKey()\"\n *ngIf=\"form.value.publicKey\"\n >\n <i [c8yIcon]=\"'download'\"></i>\n {{ 'Download key' | translate }}\n </button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"publicKey\"\n formControlName=\"publicKey\"\n [keyType]=\"'public'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n </div>\n\n <div *ngIf=\"form.value.credentialsType === 'CERTIFICATE'\">\n <c8y-form-group>\n <label for=\"privateKey\">\n {{ 'Private key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"certificatePopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"privateKey\"\n formControlName=\"privateKey\"\n [keyType]=\"'private'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n\n <c8y-form-group>\n <label for=\"certificate\">\n {{ 'Certificate' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"certificatePopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"certificate\"\n formControlName=\"certificate\"\n [keyType]=\"'certificate'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n </div>\n\n <div>\n <c8y-form-group>\n <label for=\"hostKey\">\n {{ 'Host key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"keyPairPopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"hostKey\"\n formControlName=\"hostKey\"\n [keyType]=\"'public'\"\n ></c8y-ssh-key-input>\n </div>\n <c8y-messages></c8y-messages>\n @if (hostKeyAutosaveEnabled() && hostKeyEmpty()) {\n <div class=\"alert alert-warning m-t-8\">\n <strong>\n {{\n 'If left empty, the server host key is trusted automatically on the first connection.'\n | translate\n }}\n </strong>\n </div>\n }\n </c8y-form-group>\n </div>\n </div>\n </div>\n</c8y-modal>\n" }]
117
+ args: [{ selector: 'c8y-remote-access-ssh-endpoint-modal', standalone: true, imports: [CoreModule, NgForOf, NgClass, SshKeyInputComponent, PopoverModule], changeDetection: ChangeDetectionStrategy.Eager, template: "<!-- eslint-disable @angular-eslint/template/prefer-control-flow -- pre-existing legacy *ngIf/*ngFor in this modal; not migrating as part of the DM-6421 host-key change -->\n<ng-template #keyPairPopoverContent>\n <small translate\n >Supported formats: OpenSSHv1, OpenSSHv2, PEM, SSH2.<br />Supported algorithms: RSA, DSA, ECDSA,\n ED25519.</small\n >\n</ng-template>\n\n<ng-template #certificatePopoverContent>\n <small translate\n >Supported formats: OpenSSHv1, OpenSSHv2, PEM, SSH2.<br />Supported algorithms: RSA, DSA.</small\n >\n</ng-template>\n\n<c8y-modal\n [title]=\"title\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [disabled]=\"form.invalid\"\n [labels]=\"{ cancel: 'Cancel', ok: 'Save' }\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'laptop'\"></span>\n </ng-container>\n <div [formGroup]=\"form\">\n <c8y-form-group>\n <label\n for=\"name\"\n translate\n >\n Name\n </label>\n <input\n class=\"form-control\"\n id=\"name\"\n name=\"name\"\n type=\"text\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 'My remote access endpoint' }\"\n formControlName=\"name\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--name'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"protocol\"\n translate\n >\n Protocol\n </label>\n <input\n class=\"form-control\"\n id=\"protocol\"\n name=\"protocol\"\n type=\"text\"\n readonly\n formControlName=\"protocol\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"hostname\"\n translate\n >\n Host\n </label>\n <input\n class=\"form-control\"\n id=\"hostname\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '127.0.0.1' } }}\"\n name=\"hostname\"\n type=\"text\"\n formControlName=\"hostname\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--hostname'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label\n for=\"port\"\n translate\n >\n Port\n </label>\n <input\n class=\"form-control\"\n id=\"port\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: '22' } }}\"\n name=\"port\"\n type=\"number\"\n formControlName=\"port\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--port'\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n\n <div>\n <c8y-form-group>\n <label\n for=\"credentialsType\"\n translate\n >\n Sign-in method\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control\"\n id=\"credentialsType\"\n formControlName=\"credentialsType\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--credentials-type'\"\n >\n <option\n *ngFor=\"let type of credentialTypes\"\n [value]=\"type.value\"\n >\n {{ type.label | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n\n <div class=\"tight-grid\">\n <div class=\"col-md-6\">\n <c8y-form-group>\n <label\n for=\"username\"\n translate\n >\n Username\n </label>\n <input\n class=\"form-control\"\n id=\"username\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: 'my_username' } }}\"\n name=\"username\"\n type=\"username\"\n autocomplete=\"off\"\n formControlName=\"username\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n <div\n class=\"col-md-6\"\n *ngIf=\"form.value.credentialsType === 'USER_PASS'\"\n >\n <c8y-form-group>\n <label\n for=\"password\"\n translate\n >\n Password\n </label>\n <input\n class=\"form-control\"\n id=\"password\"\n placeholder=\"{{'e.g. {{ example }}' | translate : { example: 'my_password' } }}\"\n name=\"password\"\n type=\"password\"\n autocomplete=\"off\"\n formControlName=\"password\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n </div>\n\n <div *ngIf=\"form.value.credentialsType === 'KEY_PAIR'\">\n <div\n class=\"form-group\"\n ng-if=\"!vm.keyPairAvailable() || vm.changingKeyPair\"\n >\n <button\n class=\"btn btn-default p-l-16\"\n [title]=\"'Generate public and private keys' | translate\"\n type=\"button\"\n [ngClass]=\"{ 'btn-pending': generating }\"\n ng-disabled=\"vm.generating\"\n (click)=\"generateKeys()\"\n [attr.data-cy]=\"'remoteAccessEndpointModal--generate-keys'\"\n >\n <i [c8yIcon]=\"'key'\"></i>\n {{ 'Generate public and private keys' | translate }}\n </button>\n </div>\n\n <c8y-form-group>\n <label for=\"privateKey\">\n {{ 'Private key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"keyPairPopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"privateKey\"\n formControlName=\"privateKey\"\n [keyType]=\"'private'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n\n <c8y-form-group>\n <label for=\"publicKey\">\n {{ 'Public key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"keyPairPopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n <button\n class=\"m-l-16 btn-link interact\"\n [title]=\"'Download key' | translate\"\n type=\"button\"\n (click)=\"downloadPublicKey()\"\n *ngIf=\"form.value.publicKey\"\n >\n <i [c8yIcon]=\"'download'\"></i>\n {{ 'Download key' | translate }}\n </button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"publicKey\"\n formControlName=\"publicKey\"\n [keyType]=\"'public'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n </div>\n\n <div *ngIf=\"form.value.credentialsType === 'CERTIFICATE'\">\n <c8y-form-group>\n <label for=\"privateKey\">\n {{ 'Private key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"certificatePopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"privateKey\"\n formControlName=\"privateKey\"\n [keyType]=\"'private'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n\n <c8y-form-group>\n <label for=\"certificate\">\n {{ 'Certificate' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"certificatePopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"certificate\"\n formControlName=\"certificate\"\n [keyType]=\"'certificate'\"\n ></c8y-ssh-key-input>\n </div>\n </c8y-form-group>\n </div>\n\n <div>\n <c8y-form-group>\n <label for=\"hostKey\">\n {{ 'Host key' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"keyPairPopoverContent\"\n type=\"button\"\n [container]=\"'body'\"\n [placement]=\"'right'\"\n [triggers]=\"'focus'\"\n ></button>\n </label>\n <div>\n <c8y-ssh-key-input\n id=\"hostKey\"\n formControlName=\"hostKey\"\n [keyType]=\"'public'\"\n ></c8y-ssh-key-input>\n </div>\n <c8y-messages></c8y-messages>\n @if (hostKeyAutosaveEnabled() && hostKeyEmpty()) {\n <div class=\"alert alert-warning m-t-8\">\n <strong>\n {{\n 'If left empty, the server host key is trusted automatically on the first connection.'\n | translate\n }}\n </strong>\n </div>\n }\n </c8y-form-group>\n </div>\n </div>\n </div>\n</c8y-modal>\n" }]
118
118
  }], ctorParameters: () => [{ type: i1.FormBuilder }, { type: i2.RemoteAccessService }] });
119
119
 
120
120
  /**