@c8y/ngx-components 1023.6.3 → 1023.7.0

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 (117) hide show
  1. package/fesm2022/c8y-ngx-components-ai-agent-chat.mjs.map +1 -1
  2. package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs +1 -1
  3. package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs.map +1 -1
  4. package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs.map +1 -1
  5. package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
  6. package/fesm2022/c8y-ngx-components-app-logs.mjs.map +1 -1
  7. package/fesm2022/c8y-ngx-components-asset-properties.mjs +2 -2
  8. package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
  9. package/fesm2022/c8y-ngx-components-asset-property-grid.component-B1q7kXRu.mjs.map +1 -1
  10. package/fesm2022/c8y-ngx-components-assets-navigator.mjs.map +1 -1
  11. package/fesm2022/c8y-ngx-components-auth-configuration.mjs.map +1 -1
  12. package/fesm2022/c8y-ngx-components-bookmarks.mjs.map +1 -1
  13. package/fesm2022/c8y-ngx-components-branding-shared-lazy-add-branding-modal.mjs.map +1 -1
  14. package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs.map +1 -1
  15. package/fesm2022/c8y-ngx-components-cockpit-config.mjs.map +1 -1
  16. package/fesm2022/c8y-ngx-components-computed-asset-properties-alarm-count-config.component-Bl18pHcM.mjs.map +1 -1
  17. package/fesm2022/c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-C5QMFdX1.mjs.map +1 -1
  18. package/fesm2022/c8y-ngx-components-computed-asset-properties-event-count-config.component-C-Lc5Ble.mjs.map +1 -1
  19. package/fesm2022/c8y-ngx-components-computed-asset-properties-last-measurement-config.component-BXfM7hTQ.mjs.map +1 -1
  20. package/fesm2022/c8y-ngx-components-context-dashboard-cockpit-home-dashboard.mjs.map +1 -1
  21. package/fesm2022/c8y-ngx-components-context-dashboard-dashboard-general-settings.component-DN-f35bA.mjs.map +1 -1
  22. package/fesm2022/c8y-ngx-components-context-dashboard.mjs +1 -1
  23. package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
  24. package/fesm2022/c8y-ngx-components-dashboard-details-advanced-tab-dashboard-details-advanced-tab.component-m7YeEj9R.mjs.map +1 -1
  25. package/fesm2022/c8y-ngx-components-dashboard-manager.mjs.map +1 -1
  26. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
  27. package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
  28. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
  29. package/fesm2022/c8y-ngx-components-device-grid.mjs.map +1 -1
  30. package/fesm2022/c8y-ngx-components-device-profile.mjs.map +1 -1
  31. package/fesm2022/c8y-ngx-components-device-protocol-object-mappings.mjs.map +1 -1
  32. package/fesm2022/c8y-ngx-components-device-protocols.mjs.map +1 -1
  33. package/fesm2022/c8y-ngx-components-device-provisioned-certificates.mjs.map +1 -1
  34. package/fesm2022/c8y-ngx-components-device-shell.mjs.map +1 -1
  35. package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
  36. package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs.map +1 -1
  37. package/fesm2022/c8y-ngx-components-ecosystem-license-confirm.mjs.map +1 -1
  38. package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
  39. package/fesm2022/c8y-ngx-components-ecosystem.mjs.map +1 -1
  40. package/fesm2022/c8y-ngx-components-editor.mjs.map +1 -1
  41. package/fesm2022/c8y-ngx-components-events-events-timeline.mjs +1 -1
  42. package/fesm2022/c8y-ngx-components-events-events-timeline.mjs.map +1 -1
  43. package/fesm2022/c8y-ngx-components-file-preview.mjs.map +1 -1
  44. package/fesm2022/c8y-ngx-components-files-repository.mjs.map +1 -1
  45. package/fesm2022/c8y-ngx-components-global-context.mjs +12 -12
  46. package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
  47. package/fesm2022/c8y-ngx-components-icon-selector.mjs.map +1 -1
  48. package/fesm2022/c8y-ngx-components-interval-picker.mjs.map +1 -1
  49. package/fesm2022/c8y-ngx-components-location.mjs.map +1 -1
  50. package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
  51. package/fesm2022/c8y-ngx-components-messaging-management.mjs +1 -1
  52. package/fesm2022/c8y-ngx-components-messaging-management.mjs.map +1 -1
  53. package/fesm2022/c8y-ngx-components-operations-bulk-operation-list-item.mjs.map +1 -1
  54. package/fesm2022/c8y-ngx-components-operations-bulk-operation-scheduler.mjs.map +1 -1
  55. package/fesm2022/c8y-ngx-components-operations-bulk-operation-stepper.mjs.map +1 -1
  56. package/fesm2022/c8y-ngx-components-operations-bulk-operations-list.mjs.map +1 -1
  57. package/fesm2022/c8y-ngx-components-operations-bulk-operations-stepper-container.mjs.map +1 -1
  58. package/fesm2022/c8y-ngx-components-operations-bulk-single-operations-list.mjs.map +1 -1
  59. package/fesm2022/c8y-ngx-components-operations-create-bulk-operation-details.mjs.map +1 -1
  60. package/fesm2022/c8y-ngx-components-operations-device-selector.mjs.map +1 -1
  61. package/fesm2022/c8y-ngx-components-operations-operation-details.mjs.map +1 -1
  62. package/fesm2022/c8y-ngx-components-operations-operation-summary.mjs.map +1 -1
  63. package/fesm2022/c8y-ngx-components-operations-operations-list-item-details.mjs.map +1 -1
  64. package/fesm2022/c8y-ngx-components-operations-operations-list.mjs +1 -1
  65. package/fesm2022/c8y-ngx-components-operations-operations-list.mjs.map +1 -1
  66. package/fesm2022/c8y-ngx-components-operations-operations-timeline.mjs.map +1 -1
  67. package/fesm2022/c8y-ngx-components-operations-status-filter.mjs.map +1 -1
  68. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-device-profile.mjs.map +1 -1
  69. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-firmware.mjs.map +1 -1
  70. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs.map +1 -1
  71. package/fesm2022/c8y-ngx-components-operations-stepper-frames.mjs.map +1 -1
  72. package/fesm2022/c8y-ngx-components-platform-configuration.mjs.map +1 -1
  73. package/fesm2022/c8y-ngx-components-protocol-lpwan.mjs.map +1 -1
  74. package/fesm2022/c8y-ngx-components-protocol-opcua.mjs.map +1 -1
  75. package/fesm2022/c8y-ngx-components-register-device.mjs.map +1 -1
  76. package/fesm2022/c8y-ngx-components-remote-access-configurations.mjs +1 -1
  77. package/fesm2022/c8y-ngx-components-remote-access-shared.mjs.map +1 -1
  78. package/fesm2022/c8y-ngx-components-remote-access-vnc-vnc-viewer.mjs.map +1 -1
  79. package/fesm2022/c8y-ngx-components-replace-device-replace-device-wizard.mjs.map +1 -1
  80. package/fesm2022/c8y-ngx-components-report-dashboard.mjs.map +1 -1
  81. package/fesm2022/c8y-ngx-components-reports.mjs.map +1 -1
  82. package/fesm2022/c8y-ngx-components-repository-configuration.mjs.map +1 -1
  83. package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
  84. package/fesm2022/c8y-ngx-components-repository-shared.mjs.map +1 -1
  85. package/fesm2022/c8y-ngx-components-repository-software.mjs.map +1 -1
  86. package/fesm2022/c8y-ngx-components-search.mjs.map +1 -1
  87. package/fesm2022/c8y-ngx-components-sensor-phone-sensor-phone-modal.mjs.map +1 -1
  88. package/fesm2022/c8y-ngx-components-static-assets-modal.mjs +1 -1
  89. package/fesm2022/c8y-ngx-components-static-assets-modal.mjs.map +1 -1
  90. package/fesm2022/c8y-ngx-components-static-assets.mjs.map +1 -1
  91. package/fesm2022/c8y-ngx-components-sub-assets.mjs.map +1 -1
  92. package/fesm2022/c8y-ngx-components-tenants.mjs.map +1 -1
  93. package/fesm2022/c8y-ngx-components-time-context.mjs +1 -1
  94. package/fesm2022/c8y-ngx-components-time-context.mjs.map +1 -1
  95. package/fesm2022/c8y-ngx-components-tracking.mjs.map +1 -1
  96. package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs.map +1 -1
  97. package/fesm2022/c8y-ngx-components-user-roles.mjs.map +1 -1
  98. package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
  99. package/fesm2022/c8y-ngx-components-widgets-implementations-asset-notes.mjs +1 -1
  100. package/fesm2022/c8y-ngx-components-widgets-implementations-cockpit-welcome.mjs.map +1 -1
  101. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
  102. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
  103. package/fesm2022/c8y-ngx-components-widgets-implementations-device-control-message.mjs.map +1 -1
  104. package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +1 -1
  105. package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
  106. package/fesm2022/c8y-ngx-components-widgets-implementations-image.mjs.map +1 -1
  107. package/fesm2022/c8y-ngx-components-widgets-implementations-info-gauge.mjs.map +1 -1
  108. package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs.map +1 -1
  109. package/fesm2022/c8y-ngx-components-widgets-implementations-linear-gauge.mjs.map +1 -1
  110. package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs.map +1 -1
  111. package/fesm2022/c8y-ngx-components-widgets-implementations-markdown.mjs.map +1 -1
  112. package/fesm2022/c8y-ngx-components-widgets-implementations-quick-links.mjs +4 -4
  113. package/fesm2022/c8y-ngx-components-widgets-implementations-quick-links.mjs.map +1 -1
  114. package/fesm2022/c8y-ngx-components-widgets-implementations-three-d-rotation.mjs.map +1 -1
  115. package/fesm2022/c8y-ngx-components.mjs +2 -2
  116. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  117. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"c8y-ngx-components-app-logs.mjs","sources":["../../app-logs/app-logs.service.ts","../../app-logs/app-logs-auto-refresh.component.ts","../../app-logs/app-logs-auto-refresh.component.html","../../app-logs/app-logs-auto-refresh.module.ts","../../app-logs/c8y-ngx-components-app-logs.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { LogsJSON } from './logs.model';\nimport { ApplicationService } from '@c8y/client';\nimport { Observable, from } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\ninterface AppLogsRequestParams {\n dateFrom?;\n dateTo?;\n limit?;\n}\n\n@Injectable()\nexport class AppLogsService {\n constructor(private application: ApplicationService) {}\n\n getLogs$(\n appId: string,\n instanceName: string,\n params: AppLogsRequestParams = {}\n ): Observable<LogsJSON> {\n const formattedDateFrom = params.dateFrom ? this.formatDate(params.dateFrom) : null;\n const formattedDateTo = params.dateTo ? this.formatDate(params.dateTo) : null;\n const modifiedParams = {\n ...params,\n ...(formattedDateFrom && { dateFrom: formattedDateFrom }),\n ...(formattedDateTo && { dateTo: formattedDateTo })\n };\n\n return from(this.application.getInstanceLog(appId, instanceName, modifiedParams)).pipe(\n map(res => res.data)\n );\n }\n\n formatDate(dateToFormat: string): string {\n return new Date(dateToFormat).toISOString();\n }\n}\n","import { Component, Input, Output, ViewChild, EventEmitter, ElementRef } from '@angular/core';\nimport { LogsJSON } from './logs.model';\nimport { AppLogsService } from './app-logs.service';\nimport { Observable, fromEvent, Subject, of, interval, NEVER, Subscription } from 'rxjs';\nimport {\n filter,\n catchError,\n tap,\n debounce,\n switchMap,\n takeUntil,\n finalize,\n delay,\n repeat,\n merge,\n scan\n} from 'rxjs/operators';\nimport { NgStyle, NgClass } from '@angular/common';\nimport { C8yTranslatePipe } from '@c8y/ngx-components';\n\n@Component({\n selector: 'c8y-app-logs-auto-refresh',\n templateUrl: './app-logs-auto-refresh.component.html',\n imports: [NgStyle, NgClass, C8yTranslatePipe]\n})\nexport class AppLogsAutoRefreshComponent {\n cancel$: Subject<boolean> = new Subject<boolean>();\n isAutoRefreshDisabled = false;\n logsToOutput: LogsJSON = this.getEmptyLogsJson();\n isAutoRefreshOn = true;\n\n @Input() selectedInstance: any;\n @Input() mo: any;\n @Input() set buttonsDisabled(areDisabled: boolean) {\n this.isAutoRefreshDisabled = areDisabled;\n if (areDisabled && this.isAutoRefreshOn) {\n this.isAutoRefreshOn = false;\n this.cancel$.next(false);\n }\n }\n @Output() onNewLogs = new EventEmitter<LogsJSON>();\n @Output() isRealtimeEnabled = new EventEmitter<boolean>();\n @ViewChild('autoRefresh', { static: true }) button: ElementRef;\n\n private subscription: Subscription;\n\n constructor(private appLogsService: AppLogsService) {}\n\n ngAfterViewInit() {\n const clicks$ = fromEvent(this.button.nativeElement, 'click').pipe(\n merge(this.cancel$),\n debounce(() => interval(300)),\n scan(this.toggleState, false),\n tap(isAutoRefreshOn => this.setButtonState(isAutoRefreshOn)),\n switchMap(isOn => (isOn ? this.watchForNewLogs() : NEVER))\n );\n this.subscription = clicks$.subscribe();\n }\n\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n private toggleState = currentState => !currentState;\n\n private setButtonState(isAutoRefreshOn: boolean) {\n this.isAutoRefreshOn = isAutoRefreshOn;\n this.isRealtimeEnabled.emit(isAutoRefreshOn);\n }\n\n private watchForNewLogs() {\n return this.startPolling().pipe(\n takeUntil(this.cancel$.pipe(filter(isAutoRefreshOn => isAutoRefreshOn === false))),\n finalize(() => {\n this.isAutoRefreshOn = false;\n })\n );\n }\n\n private startPolling() {\n return of(1).pipe(\n switchMap(() => this.getNewLogs().pipe(catchError(() => of(this.getEmptyLogsJson())))),\n tap(logs => this.updateLogsToOutput(logs)),\n delay(10000),\n repeat()\n );\n }\n\n private getNewLogs(): Observable<LogsJSON> {\n return this.appLogsService.getLogs$(this.getAppId(), this.getInstanceName());\n }\n\n private getAppId(): string {\n return this.mo.applicationId;\n }\n private getInstanceName(): string {\n return this.selectedInstance.name;\n }\n\n private updateLogsToOutput(newLogs) {\n const { dateFrom, dateTo } = newLogs;\n if (dateFrom && dateTo) {\n this.logsToOutput = { ...newLogs };\n this.onNewLogs.emit(this.logsToOutput);\n }\n }\n\n private getEmptyLogsJson(): LogsJSON {\n return {\n dateFrom: null,\n dateTo: null,\n logs: '',\n truncated: false\n };\n }\n}\n","<button #autoRefresh\n type=\"button\"\n class=\"btn btn-link c8y-realtime\"\n [ngStyle]=\"{'width': 'auto'}\"\n title=\"{{'Toggle auto refresh' | translate}}\"\n [disabled]=\"isAutoRefreshDisabled\"\n>\n <span class=\"c8y-pulse\" [ngClass]=\"isAutoRefreshOn ? 'active' : 'inactive'\"></span>\n {{'Auto refresh' | translate}}\n</button>","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@c8y/ngx-components';\nimport { ButtonsModule } from 'ngx-bootstrap/buttons';\nimport { AppLogsAutoRefreshComponent } from './app-logs-auto-refresh.component';\nimport { AppLogsService } from './app-logs.service';\n\n@NgModule({\n exports: [AppLogsAutoRefreshComponent],\n imports: [CommonModule, ButtonsModule, AppLogsAutoRefreshComponent],\n providers: [AppLogsService]\n})\nexport class AppLogsAutoRefreshModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.AppLogsService"],"mappings":";;;;;;;;;MAaa,cAAc,CAAA;AACzB,IAAA,WAAA,CAAoB,WAA+B,EAAA;QAA/B,IAAA,CAAA,WAAW,GAAX,WAAW;IAAuB;AAEtD,IAAA,QAAQ,CACN,KAAa,EACb,YAAoB,EACpB,SAA+B,EAAE,EAAA;QAEjC,MAAM,iBAAiB,GAAG,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI;QACnF,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI;AAC7E,QAAA,MAAM,cAAc,GAAG;AACrB,YAAA,GAAG,MAAM;YACT,IAAI,iBAAiB,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;YACzD,IAAI,eAAe,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE;SACnD;AAED,QAAA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QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,aAFxB,CAAC,cAAc,CAAC,EAAA,OAAA,EAAA,CADjB,YAAY,EAAE,aAAa,CAAA,EAAA,CAAA,CAAA;;4FAG1B,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBALpC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,2BAA2B,CAAC;AACtC,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,2BAA2B,CAAC;oBACnE,SAAS,EAAE,CAAC,cAAc;AAC3B,iBAAA;;;ACVD;;AAEG;;;;"}
1
+ {"version":3,"file":"c8y-ngx-components-app-logs.mjs","sources":["../../app-logs/app-logs.service.ts","../../app-logs/app-logs-auto-refresh.component.ts","../../app-logs/app-logs-auto-refresh.component.html","../../app-logs/app-logs-auto-refresh.module.ts","../../app-logs/c8y-ngx-components-app-logs.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { LogsJSON } from './logs.model';\nimport { ApplicationService } from '@c8y/client';\nimport { Observable, from } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\ninterface AppLogsRequestParams {\n dateFrom?;\n dateTo?;\n limit?;\n}\n\n@Injectable()\nexport class AppLogsService {\n constructor(private application: ApplicationService) {}\n\n getLogs$(\n appId: string,\n instanceName: string,\n params: AppLogsRequestParams = {}\n ): Observable<LogsJSON> {\n const formattedDateFrom = params.dateFrom ? this.formatDate(params.dateFrom) : null;\n const formattedDateTo = params.dateTo ? this.formatDate(params.dateTo) : null;\n const modifiedParams = {\n ...params,\n ...(formattedDateFrom && { dateFrom: formattedDateFrom }),\n ...(formattedDateTo && { dateTo: formattedDateTo })\n };\n\n return from(this.application.getInstanceLog(appId, instanceName, modifiedParams)).pipe(\n map(res => res.data)\n );\n }\n\n formatDate(dateToFormat: string): string {\n return new Date(dateToFormat).toISOString();\n }\n}\n","import { Component, Input, Output, ViewChild, EventEmitter, ElementRef } from '@angular/core';\nimport { LogsJSON } from './logs.model';\nimport { AppLogsService } from './app-logs.service';\nimport { Observable, fromEvent, Subject, of, interval, NEVER, Subscription } from 'rxjs';\nimport {\n filter,\n catchError,\n tap,\n debounce,\n switchMap,\n takeUntil,\n finalize,\n delay,\n repeat,\n merge,\n scan\n} from 'rxjs/operators';\nimport { NgStyle, NgClass } from '@angular/common';\nimport { C8yTranslatePipe } from '@c8y/ngx-components';\n\n@Component({\n selector: 'c8y-app-logs-auto-refresh',\n templateUrl: './app-logs-auto-refresh.component.html',\n imports: [NgStyle, NgClass, C8yTranslatePipe]\n})\nexport class AppLogsAutoRefreshComponent {\n cancel$: Subject<boolean> = new Subject<boolean>();\n isAutoRefreshDisabled = false;\n logsToOutput: LogsJSON = this.getEmptyLogsJson();\n isAutoRefreshOn = true;\n\n @Input() selectedInstance: any;\n @Input() mo: any;\n @Input() set buttonsDisabled(areDisabled: boolean) {\n this.isAutoRefreshDisabled = areDisabled;\n if (areDisabled && this.isAutoRefreshOn) {\n this.isAutoRefreshOn = false;\n this.cancel$.next(false);\n }\n }\n @Output() onNewLogs = new EventEmitter<LogsJSON>();\n @Output() isRealtimeEnabled = new EventEmitter<boolean>();\n @ViewChild('autoRefresh', { static: true }) button: ElementRef;\n\n private subscription: Subscription;\n\n constructor(private appLogsService: AppLogsService) {}\n\n ngAfterViewInit() {\n const clicks$ = fromEvent(this.button.nativeElement, 'click').pipe(\n merge(this.cancel$),\n debounce(() => interval(300)),\n scan(this.toggleState, false),\n tap(isAutoRefreshOn => this.setButtonState(isAutoRefreshOn)),\n switchMap(isOn => (isOn ? this.watchForNewLogs() : NEVER))\n );\n this.subscription = clicks$.subscribe();\n }\n\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n private toggleState = currentState => !currentState;\n\n private setButtonState(isAutoRefreshOn: boolean) {\n this.isAutoRefreshOn = isAutoRefreshOn;\n this.isRealtimeEnabled.emit(isAutoRefreshOn);\n }\n\n private watchForNewLogs() {\n return this.startPolling().pipe(\n takeUntil(this.cancel$.pipe(filter(isAutoRefreshOn => isAutoRefreshOn === false))),\n finalize(() => {\n this.isAutoRefreshOn = false;\n })\n );\n }\n\n private startPolling() {\n return of(1).pipe(\n switchMap(() => this.getNewLogs().pipe(catchError(() => of(this.getEmptyLogsJson())))),\n tap(logs => this.updateLogsToOutput(logs)),\n delay(10000),\n repeat()\n );\n }\n\n private getNewLogs(): Observable<LogsJSON> {\n return this.appLogsService.getLogs$(this.getAppId(), this.getInstanceName());\n }\n\n private getAppId(): string {\n return this.mo.applicationId;\n }\n private getInstanceName(): string {\n return this.selectedInstance.name;\n }\n\n private updateLogsToOutput(newLogs) {\n const { dateFrom, dateTo } = newLogs;\n if (dateFrom && dateTo) {\n this.logsToOutput = { ...newLogs };\n this.onNewLogs.emit(this.logsToOutput);\n }\n }\n\n private getEmptyLogsJson(): LogsJSON {\n return {\n dateFrom: null,\n dateTo: null,\n logs: '',\n truncated: false\n };\n }\n}\n","<button #autoRefresh\n type=\"button\"\n class=\"btn btn-link c8y-realtime\"\n [ngStyle]=\"{'width': 'auto'}\"\n title=\"{{'Toggle auto refresh' | translate}}\"\n [disabled]=\"isAutoRefreshDisabled\"\n>\n <span class=\"c8y-pulse\" [ngClass]=\"isAutoRefreshOn ? 'active' : 'inactive'\"></span>\n {{'Auto refresh' | translate}}\n</button>","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@c8y/ngx-components';\nimport { ButtonsModule } from 'ngx-bootstrap/buttons';\nimport { AppLogsAutoRefreshComponent } from './app-logs-auto-refresh.component';\nimport { AppLogsService } from './app-logs.service';\n\n@NgModule({\n exports: [AppLogsAutoRefreshComponent],\n imports: [CommonModule, ButtonsModule, AppLogsAutoRefreshComponent],\n providers: [AppLogsService]\n})\nexport class AppLogsAutoRefreshModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.AppLogsService"],"mappings":";;;;;;;;;MAaa,cAAc,CAAA;AACzB,IAAA,WAA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AAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,YAHzB,YAAY,EAAE,aAAa,EAAE,2BAA2B,aADxD,2BAA2B,CAAA,EAAA,CAAA,CAAA;AAI1B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,aAFxB,CAAC,cAAc,CAAC,EAAA,OAAA,EAAA,CADjB,YAAY,EAAE,aAAa,CAAA,EAAA,CAAA,CAAA;;4FAG1B,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBALpC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,2BAA2B,CAAC;AACtC,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,2BAA2B,CAAC;oBACnE,SAAS,EAAE,CAAC,cAAc;AAC3B,iBAAA;;;ACVD;;AAEG;;;;"}
@@ -1394,7 +1394,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
1394
1394
  type: Input
1395
1395
  }], asset: [{
1396
1396
  type: Input
1397
- }] } });
1397
+ }], hosts: [{ type: i0.ViewChildren, args: ['host', { ...{ read: ViewContainerRef }, isSignal: true }] }], configForms: [{ type: i0.ViewChildren, args: ['configForm', { ...{ read: NgForm }, isSignal: true }] }] } });
1398
1398
 
1399
1399
  /**
1400
1400
  * Pipe to get the title for the collapse/expand button of a tree node.
@@ -2600,7 +2600,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
2600
2600
  CdkDropList,
2601
2601
  CdkDrag
2602
2602
  ], template: "<div\n class=\"tree-container bg-inherit\"\n [attr.aria-label]=\"'Asset property list' | translate\"\n role=\"tree\"\n>\n @if (config.showHeader || config.filterable) {\n <div class=\"select-all-container bg-inherit sticky-top separator-bottom\">\n @if (config.filterable) {\n <div\n class=\"form-group m-b-0 p-16 d-flex\"\n [ngClass]=\"{ 'separator-bottom': config.showHeader }\"\n >\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n [attr.aria-label]=\"'Filter properties' | translate\"\n placeholder=\"{{ 'Filter properties' | translate }}\"\n role=\"searchbox\"\n type=\"search\"\n autocomplete=\"off\"\n [(ngModel)]=\"filterText\"\n (input)=\"onFilter()\"\n [disabled]=\"!dataSource.data.length\"\n #filter\n />\n @if (filter.value.length === 0) {\n <span\n class=\"input-group-addon\"\n [attr.aria-hidden]=\"true\"\n >\n <i\n class=\"dlt-c8y-icon-search\"\n [c8yIcon]=\"'search'\"\n ></i>\n </span>\n }\n @if (filter.value.length > 0) {\n <span\n class=\"input-group-addon\"\n [attr.aria-hidden]=\"true\"\n >\n <i\n class=\"text-muted dlt-c8y-icon-times\"\n [c8yIcon]=\"'times'\"\n [attr.aria-label]=\"'Clear filter' | translate\"\n tabindex=\"0\"\n role=\"button\"\n (click)=\"clearFilter()\"\n ></i>\n </span>\n }\n </div>\n </div>\n }\n @if (config.showHeader && dataSource.data.length) {\n <div class=\"d-flex a-i-center overflow-hidden\">\n <div\n class=\"flex-no-shrink d-flex a-i-center\"\n [ngClass]=\"{\n 'p-l-40': !hasExpandableNodes && config.expansionMode !== 'nonCollapsible',\n 'p-r-8': config.selectMode !== 'none' && config.expansionMode === 'nonCollapsible'\n }\"\n >\n @if (config.expansionMode !== 'nonCollapsible' && hasExpandableNodes) {\n @let collapseAllButtonTitle =\n (areAllNodesExpanded ? collapseAllLabel : expandAllLabel) | translate;\n <button\n class=\"collapse-btn btn-dot flex-no-shrink\"\n [title]=\"collapseAllButtonTitle\"\n [attr.aria-label]=\"collapseAllButtonTitle\"\n type=\"button\"\n [ngClass]=\"{ active: areAllNodesExpanded }\"\n (click)=\"toggleExpandCollapseAll()\"\n >\n <i [c8yIcon]=\"'chevron-right'\"></i>\n </button>\n }\n </div>\n @if (config.selectMode === 'multi') {\n <c8y-list-item-checkbox\n class=\"p-l-4 p-r-4\"\n [ngModel]=\"allSelected\"\n [indeterminate]=\"indeterminate\"\n (onSelect)=\"selectAll($event)\"\n ></c8y-list-item-checkbox>\n }\n <div\n class=\"p-t-40\"\n [ngClass]=\"{\n 'p-l-24': config.selectMode === 'single',\n 'p-l-8': config.selectMode === 'none' && config.expansionMode === 'nonCollapsible'\n }\"\n ></div>\n <div class=\"content-flex-30 fit-w m-t-4 m-b-4 m-0\">\n <div class=\"col-6 d-flex a-i-center m-l-0 m-r-0\">\n <span class=\"flex-no-shrink p-l-4 p-r-8\">\n <div class=\"c8y-icon\"></div>\n </span>\n <span class=\"text-medium m-l-8\">\n {{ 'Property' | translate }}\n </span>\n </div>\n @if (config.showKey) {\n <div [ngClass]=\"{ 'col-3': config.showValue, 'col-6': !config.showValue }\">\n <span class=\"text-medium\">{{ 'Key' | translate }}</span>\n </div>\n }\n @if (config.showValue) {\n <div [ngClass]=\"{ 'col-3': config.showKey, 'col-6': !config.showKey }\">\n <span class=\"text-medium\">{{ 'Value' | translate }}</span>\n </div>\n }\n </div>\n @if (assetPropertyAction) {\n <div\n class=\"m-l-8 p-l-24 asset-property-list__actions\"\n [ngClass]=\"{\n 'p-r-40': config.allowAddingCustomProperties,\n 'p-r-8': !config.allowAddingCustomProperties\n }\"\n ></div>\n }\n </div>\n }\n </div>\n }\n\n @if (dataSource.data.length) {\n <cdk-tree\n role=\"presentation\"\n #tree\n [dataSource]=\"dataSource\"\n [levelAccessor]=\"getLevel\"\n cdkDropList\n cdkDropListOrientation=\"vertical\"\n (cdkDropListDropped)=\"drop($event)\"\n [cdkDropListDisabled]=\"!config.allowDragAndDrop || dataSource.data.length < 2\"\n >\n <!-- Tree Node Definition -->\n <cdk-tree-node\n class=\"c8y-list__item--dense\"\n [attr.tabindex]=\"0\"\n [attr.aria-level]=\"getLevel(node) + 1\"\n [attr.aria-expanded]=\"hasChild(node) ? isNodeExpanded(node) : null\"\n [attr.aria-selected]=\"config.selectMode !== 'none' ? node.property.active : null\"\n role=\"treeitem\"\n *cdkTreeNodeDef=\"let node\"\n cdkTreeNodePadding\n [cdkTreeNodePaddingIndent]=\"TREE_NODE_INDENT\"\n [ngClass]=\"{\n nonCollapsible: config.expansionMode === 'nonCollapsible',\n nonSelectable: config.selectMode === 'none'\n }\"\n cdkDrag\n cdkDragLockAxis=\"y\"\n [cdkDragDisabled]=\"cdkDragDisabled\"\n >\n <div class=\"d-flex p-relative overflow-visible bg-inherit fit-h\">\n @if (config.allowDragAndDrop && dataSource.data.length > 1) {\n <div\n class=\"drag-handle-wrapper\"\n [ngClass]=\"{ 'drag-handle-disabled': cdkDragDisabled }\"\n >\n <button\n class=\"drag-handle btn-clean\"\n [title]=\"\n (cdkDragDisabled ? dragHandleDisabledLabel : dragHandleEnabledLabel) | translate\n \"\n [attr.aria-label]=\"\n (cdkDragDisabled ? dragHandleDisabledLabel : dragHandleEnabledLabel) | translate\n \"\n tabindex=\"-1\"\n type=\"button\"\n [disabled]=\"cdkDragDisabled\"\n >\n <i [c8yIcon]=\"'drag-reorder'\"></i>\n </button>\n </div>\n }\n <!-- Toggle Button for expandable nodes -->\n @if (config.expansionMode !== 'nonCollapsible' && hasChild(node)) {\n @let collapseButtonTitle =\n isNodeExpanded(node) | c8yAssetPropertyCollapseButtonTitle: node;\n <button\n class=\"collapse-btn btn-dot flex-no-shrink\"\n [title]=\"collapseButtonTitle\"\n [attr.aria-label]=\"collapseButtonTitle\"\n [attr.aria-expanded]=\"isNodeExpanded(node)\"\n type=\"button\"\n (click)=\"toggleNode(node)\"\n [ngClass]=\"{ active: isNodeExpanded(node) }\"\n >\n <i [c8yIcon]=\"'chevron-right'\"></i>\n </button>\n }\n <!-- Placeholder for non-expandable nodes to maintain alignment -->\n @if (!hasChild(node) || config.expansionMode === 'nonCollapsible') {\n <div\n class=\"flex-no-shrink\"\n [ngClass]=\"{\n 'p-r-40': config.expansionMode !== 'nonCollapsible',\n 'p-r-8': config.expansionMode === 'nonCollapsible'\n }\"\n ></div>\n }\n <!-- Selection Controls -->\n @if (config.selectMode !== 'none') {\n <div class=\"d-contents\">\n @if (config.selectMode === 'single') {\n <c8y-list-item-radio\n class=\"p-l-4 p-r-4\"\n type=\"radio\"\n [selected]=\"node.property.active\"\n (onSelect)=\"onSelectSingle($event, node)\"\n ></c8y-list-item-radio>\n } @else if (config.selectMode === 'multi') {\n <c8y-list-item-checkbox\n class=\"p-l-4 p-r-4\"\n [ngModel]=\"node.property.active\"\n [indeterminate]=\"node.indeterminate\"\n (onSelect)=\"onSelectMulti($event, node)\"\n ></c8y-list-item-checkbox>\n }\n </div>\n }\n <div class=\"content-flex-30 fit-w bg-inherit m-0 min-width-0\">\n <div\n class=\"d-flex a-i-center bg-inherit m-0 flex-grow\"\n [style.max-width]=\"getColumnMaxWidth(node)\"\n >\n <c8y-li-icon\n class=\"p-r-4 p-l-4\"\n [icon]=\"node.property | c8yAssetPropertyIcon\"\n tooltip=\"{{ node.property | c8yAssetPropertyIconTooltip }}\"\n container=\"body\"\n [delay]=\"500\"\n [ngClass]=\"{\n 'p-l-4': config.selectMode !== 'none',\n 'p-l-8': config.selectMode === 'none'\n }\"\n ></c8y-li-icon>\n\n <span class=\"p-r-8 min-width-0 d-flex a-i-center\">\n @if (isContextMismatch(node)) {\n @let tooltipText =\n 'Property configured for a different asset. Reconfigure to match current asset.'\n | translate;\n <button\n class=\"btn-clean m-r-4\"\n [attr.aria-label]=\"tooltipText\"\n [tooltip]=\"tooltipText\"\n placement=\"top\"\n type=\"button\"\n [container]=\"'body'\"\n >\n <i\n class=\"status critical stroked-icon\"\n c8yIcon=\"exclamation-circle\"\n ></i>\n </button>\n }\n\n <div\n class=\"text-truncate\"\n title=\"{{\n node.property.label || node.property.title || node.property.name | translate\n }}\"\n [ngClass]=\"{\n 'text-muted': node.property.temporary,\n 'text-danger': isContextMismatch(node)\n }\"\n >\n {{ node.property.label || node.property.title || node.property.name | translate }}\n </div>\n </span>\n </div>\n @if (config.showKey) {\n <div\n class=\"d-flex a-i-center\"\n [ngClass]=\"{ 'col-3': config.showValue, 'col-6': !config.showValue }\"\n >\n <span\n class=\"d-inline-block tag tag--default a-s-center text-truncate\"\n title=\"{{\n node.property.keyPath?.join('.') || (node.property?.name | translate)\n }}\"\n >\n {{ node.property.keyPath?.join('.') || (node.property?.name | translate) }}\n </span>\n </div>\n }\n @if (asset && config.showValue) {\n <div\n class=\"d-flex a-i-center\"\n [ngClass]=\"{ 'col-3': config.showKey, 'col-6': !config.showKey }\"\n >\n @let value = node.property | c8yAssetPropertyValue: asset | async;\n <span\n class=\"tag tag--info d-inline-block a-s-center text-truncate\"\n title=\"{{ value }}\"\n >\n {{ value }}\n </span>\n </div>\n }\n </div>\n @if (assetPropertyAction || node.property.temporary) {\n <div\n class=\"m-l-8 showOnHover d-flex a-i-center j-c-end asset-property-list__actions\"\n [ngClass]=\"{\n 'p-l-32': !node.property.temporary && config.allowAddingCustomProperties,\n 'has-computed': node.property.computed && node.property.config\n }\"\n >\n @if (node.property.computed && node.property.config) {\n <button\n class=\"btn btn-dot m-l-auto\"\n title=\"{{ 'Configure' | translate }}\"\n (click)=\"editProperty(node.property)\"\n >\n <i [c8yIcon]=\"'cog'\"></i>\n </button>\n }\n @if (node.property.temporary) {\n <button\n class=\"btn btn-dot btn-dot--danger\"\n [attr.aria-label]=\"'Remove' | translate\"\n tooltip=\"{{ 'Remove' | translate }}\"\n container=\"body\"\n type=\"button\"\n [ngClass]=\"{ 'm-l-auto': !node.property.computed || !node.property.config }\"\n [delay]=\"500\"\n (click)=\"removeProperty(node.property)\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n }\n <ng-container\n *ngTemplateOutlet=\"\n assetPropertyAction?.template;\n context: {\n $implicit: node.property\n }\n \"\n ></ng-container>\n </div>\n }\n </div>\n </cdk-tree-node>\n </cdk-tree>\n } @else {\n <c8y-ui-empty-state\n icon=\"list\"\n title=\"{{ 'No properties to display' | translate }}\"\n subtitle=\"{{ 'Select an asset to see the available properties.' | translate }}\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n }\n @if (config.allowAddingCustomProperties) {\n <div class=\"sticky-bottom bg-inherit separator-top p-16\">\n <button\n class=\"btn btn-default btn-sm m-l-8\"\n (click)=\"addProperty()\"\n data-cy=\"asset-property-item-add-button\"\n >\n <i [c8yIcon]=\"'plus'\"></i>\n {{ 'Add property' | translate }}\n </button>\n </div>\n }\n</div>\n" }]
2603
- }], ctorParameters: () => [], propDecorators: { config: [{
2603
+ }], ctorParameters: () => [], propDecorators: { tree: [{ type: i0.ViewChild, args: ['tree', { isSignal: true }] }], config: [{
2604
2604
  type: Input
2605
2605
  }], asset: [{
2606
2606
  type: Input