@device-management-toolkit/ui-toolkit-angular 9.1.4 → 10.1.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.
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Angular UI Components
2
2
 
3
- ![CodeQL](https://img.shields.io/github/actions/workflow/status/open-amt-cloud-toolkit/ui-toolkit-angular/codeql-analysis.yml?style=for-the-badge&label=CodeQL&logo=github)
4
- ![Build](https://img.shields.io/github/actions/workflow/status/open-amt-cloud-toolkit/ui-toolkit-angular/ci.yml?style=for-the-badge&logo=github)
5
- ![Codecov](https://img.shields.io/codecov/c/github/open-amt-cloud-toolkit/ui-toolkit-angular?style=for-the-badge&logo=codecov)
6
- [![OSSF-Scorecard Score](https://img.shields.io/ossf-scorecard/github.com/open-amt-cloud-toolkit/ui-toolkit-angular?style=for-the-badge&label=OSSF%20Score)](https://api.securityscorecards.dev/projects/github.com/open-amt-cloud-toolkit/ui-toolkit-angular)
3
+ ![CodeQL](https://img.shields.io/github/actions/workflow/status/device-management-toolkit/ui-toolkit-angular/codeql-analysis.yml?style=for-the-badge&label=CodeQL&logo=github)
4
+ ![Build](https://img.shields.io/github/actions/workflow/status/device-management-toolkit/ui-toolkit-angular/ci.yml?style=for-the-badge&logo=github)
5
+ ![Codecov](https://img.shields.io/codecov/c/github/device-management-toolkit/ui-toolkit-angular?style=for-the-badge&logo=codecov)
6
+ [![OSSF-Scorecard Score](https://img.shields.io/ossf-scorecard/github.com/device-management-toolkit/ui-toolkit-angular?style=for-the-badge&label=OSSF%20Score)](https://api.securityscorecards.dev/projects/github.com/device-management-toolkit/ui-toolkit-angular)
7
7
  [![Discord](https://img.shields.io/discord/1063200098680582154?style=for-the-badge&label=Discord&logo=discord&logoColor=white&labelColor=%235865F2&link=https%3A%2F%2Fdiscord.gg%2FDKHeUNEWVH)](https://discord.gg/DKHeUNEWVH)
8
8
 
9
9
  > IMPORTANT: For now, we are continuing to publish both @device-management-toolkit/ui-toolkit-angular and @open-amt-cloud-toolkit/ui-toolkit-angular npm packages to avoid a breaking change. Please update your package.json at your earliest convenience for when we cease to publish @open-amt-cloud-toolkit/ui-toolkit-angular. This is in effort to support the renaming of the toolkit.
@@ -1,26 +1,29 @@
1
1
  import * as i0 from '@angular/core';
2
- import { output, input, EventEmitter, Component } from '@angular/core';
2
+ import { inject, DestroyRef, output, input, effect, Component } from '@angular/core';
3
3
  import { Protocol, AMTRedirector, AMTIDER } from '@device-management-toolkit/ui-toolkit/core';
4
4
 
5
5
  class IDERComponent {
6
6
  constructor() {
7
+ this.destroyRef = inject(DestroyRef);
7
8
  this.deviceState = 0;
8
9
  this.deviceStatus = output();
9
10
  this.iderData = output();
10
- this.deviceConnection = input(new EventEmitter());
11
- this.cdrom = input(null);
12
- this.floppy = input(null);
13
- this.mpsServer = input('');
14
- this.authToken = input('');
15
- this.deviceId = input('');
11
+ this.deviceConnection = input(false, ...(ngDevMode ? [{ debugName: "deviceConnection" }] : []));
12
+ this.cdrom = input(null, ...(ngDevMode ? [{ debugName: "cdrom" }] : []));
13
+ this.floppy = input(null, ...(ngDevMode ? [{ debugName: "floppy" }] : []));
14
+ this.mpsServer = input('', ...(ngDevMode ? [{ debugName: "mpsServer" }] : []));
15
+ this.authToken = input('', ...(ngDevMode ? [{ debugName: "authToken" }] : []));
16
+ this.deviceId = input('', ...(ngDevMode ? [{ debugName: "deviceId" }] : []));
16
17
  this.onConnectionStateChange = (redirector, state) => {
17
18
  this.deviceStatus.emit(state);
18
19
  };
19
- }
20
- ngOnInit() {
21
- this.deviceConnection().subscribe((data) => {
22
- if (data) {
23
- this.init();
20
+ // React to deviceConnection changes
21
+ effect(() => {
22
+ const connected = this.deviceConnection();
23
+ if (connected) {
24
+ if (this.redirector == null) {
25
+ this.init();
26
+ }
24
27
  }
25
28
  else {
26
29
  this.stopIder();
@@ -91,7 +94,7 @@ class IDERComponent {
91
94
  });
92
95
  }
93
96
  stopIder() {
94
- if (this.redirector !== null) {
97
+ if (this.redirector != null) {
95
98
  this.redirector.stop();
96
99
  this.cleanup();
97
100
  }
@@ -105,13 +108,13 @@ class IDERComponent {
105
108
  this.ider.stop();
106
109
  }
107
110
  }
108
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: IDERComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
109
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.13", type: IDERComponent, isStandalone: true, selector: "amt-ider", inputs: { deviceConnection: { classPropertyName: "deviceConnection", publicName: "deviceConnection", isSignal: true, isRequired: false, transformFunction: null }, cdrom: { classPropertyName: "cdrom", publicName: "cdrom", isSignal: true, isRequired: false, transformFunction: null }, floppy: { classPropertyName: "floppy", publicName: "floppy", isSignal: true, isRequired: false, transformFunction: null }, mpsServer: { classPropertyName: "mpsServer", publicName: "mpsServer", isSignal: true, isRequired: false, transformFunction: null }, authToken: { classPropertyName: "authToken", publicName: "authToken", isSignal: true, isRequired: false, transformFunction: null }, deviceId: { classPropertyName: "deviceId", publicName: "deviceId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deviceStatus: "deviceStatus", iderData: "iderData" }, ngImport: i0, template: '', isInline: true }); }
111
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: IDERComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
112
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.2", type: IDERComponent, isStandalone: true, selector: "amt-ider", inputs: { deviceConnection: { classPropertyName: "deviceConnection", publicName: "deviceConnection", isSignal: true, isRequired: false, transformFunction: null }, cdrom: { classPropertyName: "cdrom", publicName: "cdrom", isSignal: true, isRequired: false, transformFunction: null }, floppy: { classPropertyName: "floppy", publicName: "floppy", isSignal: true, isRequired: false, transformFunction: null }, mpsServer: { classPropertyName: "mpsServer", publicName: "mpsServer", isSignal: true, isRequired: false, transformFunction: null }, authToken: { classPropertyName: "authToken", publicName: "authToken", isSignal: true, isRequired: false, transformFunction: null }, deviceId: { classPropertyName: "deviceId", publicName: "deviceId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deviceStatus: "deviceStatus", iderData: "iderData" }, ngImport: i0, template: '', isInline: true }); }
110
113
  }
111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: IDERComponent, decorators: [{
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: IDERComponent, decorators: [{
112
115
  type: Component,
113
116
  args: [{ selector: 'amt-ider', template: '' }]
114
- }] });
117
+ }], ctorParameters: () => [] });
115
118
 
116
119
  /*
117
120
  * Public API Surface of ider
@@ -1 +1 @@
1
- {"version":3,"file":"device-management-toolkit-ui-toolkit-angular-ider.mjs","sources":["../../ider/src/ider.component.ts","../../ider/src/public_api.ts","../../ider/src/device-management-toolkit-ui-toolkit-angular-ider.ts"],"sourcesContent":["import { EventEmitter, Component, OnInit, OnDestroy, input, output } from '@angular/core'\nimport { AMTRedirector, Protocol, AMTIDER, RedirectorConfig } from '@device-management-toolkit/ui-toolkit/core'\n\nexport interface IDERData {\n floppyRead: number\n floppyWrite: number\n cdromRead: number\n cdromWrite: number\n}\n\n@Component({\n selector: 'amt-ider',\n template: '',\n styles: []\n})\nexport class IDERComponent implements OnInit, OnDestroy {\n redirector: AMTRedirector | null\n ider: AMTIDER | null\n data: IDERData | null\n deviceState = 0\n\n readonly deviceStatus = output<number>()\n readonly iderData = output<IDERData>()\n\n readonly deviceConnection = input<EventEmitter<boolean>>(new EventEmitter<boolean>())\n public readonly cdrom = input<File | null>(null)\n public readonly floppy = input<File | null>(null)\n public mpsServer = input('')\n public authToken = input('')\n public deviceId = input('')\n\n ngOnInit(): void {\n this.deviceConnection().subscribe((data: boolean) => {\n if (data) {\n this.init()\n } else {\n this.stopIder()\n }\n })\n }\n\n init(): void {\n this.instantiate()\n setTimeout(() => {\n this.startIder()\n }, 4000)\n }\n\n startIder(): void {\n if (this.redirector != null) {\n this.redirector.start(WebSocket)\n }\n }\n\n instantiate(): void {\n const config: RedirectorConfig = {\n mode: 'ider',\n protocol: Protocol.IDER,\n fr: new FileReader(),\n host: this.deviceId(),\n port: 16994,\n user: '',\n pass: '',\n tls: 0,\n tls1only: 0,\n authToken: this.authToken(),\n server: this.mpsServer()\n }\n this.redirector = new AMTRedirector(config)\n this.ider = new AMTIDER(this.redirector, this.cdrom(), this.floppy())\n this.redirector.onNewState = this.ider.stateChange.bind(this.ider)\n this.redirector.onStateChanged = this.onConnectionStateChange.bind(this)\n this.redirector.onProcessData = this.ider.processData.bind(this.ider)\n this.ider.sectorStats = this.iderSectorStats.bind(this)\n }\n\n iderSectorStats(mode: number, dev: number, total: number, start: number, len: number): void {\n if (this.ider == null) {\n return\n }\n if (mode === 1) {\n if (dev === 0) {\n // Floppy\n this.ider.floppyRead += len * 512\n } else {\n // CD-ROM\n this.ider.cdromRead += len * 2048\n }\n } else {\n if (dev === 0) {\n // Floppy\n this.ider.floppyWrite += len * 512\n } else {\n // CD-ROM\n this.ider.cdromWrite += len * 2048\n }\n }\n this.iderData.emit({\n floppyRead: this.ider.floppyRead,\n cdromRead: this.ider.cdromRead,\n floppyWrite: this.ider.floppyWrite,\n cdromWrite: this.ider.cdromWrite\n })\n }\n\n onConnectionStateChange = (redirector: any, state: number): any => {\n this.deviceStatus.emit(state)\n }\n\n stopIder(): void {\n if (this.redirector !== null) {\n this.redirector.stop()\n this.cleanup()\n }\n }\n\n cleanup(): void {\n this.redirector = null\n this.ider = null\n }\n\n ngOnDestroy(): void {\n if (this.ider != null) {\n this.ider.stop()\n }\n }\n}\n","/*\n * Public API Surface of ider\n */\n\nexport * from './ider.component'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAea,aAAa,CAAA;AAL1B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A,IAAA,EAAA,CAAA,CAAA;;4FAGD,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,YACV,EAAE,EAAA;;;ACZd;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"device-management-toolkit-ui-toolkit-angular-ider.mjs","sources":["../../ider/src/ider.component.ts","../../ider/src/public_api.ts","../../ider/src/device-management-toolkit-ui-toolkit-angular-ider.ts"],"sourcesContent":["import { Component, OnDestroy, input, output, inject, DestroyRef, effect } from '@angular/core'\nimport { AMTRedirector, Protocol, AMTIDER, RedirectorConfig } from '@device-management-toolkit/ui-toolkit/core'\n\nexport interface IDERData {\n floppyRead: number\n floppyWrite: number\n cdromRead: number\n cdromWrite: number\n}\n\n@Component({\n selector: 'amt-ider',\n template: '',\n styles: []\n})\nexport class IDERComponent implements OnDestroy {\n private readonly destroyRef = inject(DestroyRef)\n\n redirector: AMTRedirector | null\n ider: AMTIDER | null\n data: IDERData | null\n deviceState = 0\n\n readonly deviceStatus = output<number>()\n readonly iderData = output<IDERData>()\n\n readonly deviceConnection = input<boolean>(false)\n public readonly cdrom = input<File | null>(null)\n public readonly floppy = input<File | null>(null)\n public mpsServer = input('')\n public authToken = input('')\n public deviceId = input('')\n\n constructor() {\n // React to deviceConnection changes\n effect(() => {\n const connected = this.deviceConnection()\n if (connected) {\n if (this.redirector == null) {\n this.init()\n }\n } else {\n this.stopIder()\n }\n })\n }\n\n init(): void {\n this.instantiate()\n setTimeout(() => {\n this.startIder()\n }, 4000)\n }\n\n startIder(): void {\n if (this.redirector != null) {\n this.redirector.start(WebSocket)\n }\n }\n\n instantiate(): void {\n const config: RedirectorConfig = {\n mode: 'ider',\n protocol: Protocol.IDER,\n fr: new FileReader(),\n host: this.deviceId(),\n port: 16994,\n user: '',\n pass: '',\n tls: 0,\n tls1only: 0,\n authToken: this.authToken(),\n server: this.mpsServer()\n }\n this.redirector = new AMTRedirector(config)\n this.ider = new AMTIDER(this.redirector, this.cdrom(), this.floppy())\n this.redirector.onNewState = this.ider.stateChange.bind(this.ider)\n this.redirector.onStateChanged = this.onConnectionStateChange.bind(this)\n this.redirector.onProcessData = this.ider.processData.bind(this.ider)\n this.ider.sectorStats = this.iderSectorStats.bind(this)\n }\n\n iderSectorStats(mode: number, dev: number, total: number, start: number, len: number): void {\n if (this.ider == null) {\n return\n }\n if (mode === 1) {\n if (dev === 0) {\n // Floppy\n this.ider.floppyRead += len * 512\n } else {\n // CD-ROM\n this.ider.cdromRead += len * 2048\n }\n } else {\n if (dev === 0) {\n // Floppy\n this.ider.floppyWrite += len * 512\n } else {\n // CD-ROM\n this.ider.cdromWrite += len * 2048\n }\n }\n this.iderData.emit({\n floppyRead: this.ider.floppyRead,\n cdromRead: this.ider.cdromRead,\n floppyWrite: this.ider.floppyWrite,\n cdromWrite: this.ider.cdromWrite\n })\n }\n\n onConnectionStateChange = (redirector: any, state: number): any => {\n this.deviceStatus.emit(state)\n }\n\n stopIder(): void {\n if (this.redirector != null) {\n this.redirector.stop()\n this.cleanup()\n }\n }\n\n cleanup(): void {\n this.redirector = null\n this.ider = null\n }\n\n ngOnDestroy(): void {\n if (this.ider != null) {\n this.ider.stop()\n }\n }\n}\n","/*\n * Public API Surface of ider\n */\n\nexport * from './ider.component'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAea,aAAa,CAAA;AAkBxB,IAAA,WAAA,GAAA;AAjBiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAKhD,IAAA,CAAA,WAAW,GAAG,CAAC;QAEN,IAAA,CAAA,YAAY,GAAG,MAAM,EAAU;QAC/B,IAAA,CAAA,QAAQ,GAAG,MAAM,EAAY;AAE7B,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAAU,KAAK,4DAAC;AACjC,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,C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import * as i0 from '@angular/core';
2
- import { inject, Renderer2, viewChild, input, output, EventEmitter, effect, Component } from '@angular/core';
2
+ import { inject, Renderer2, DestroyRef, viewChild, signal, input, output, effect, Component } from '@angular/core';
3
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
3
4
  import { Protocol, AMTKvmDataRedirector, AMTDesktop, DataProcessor, MouseHelper, KeyBoardHelper } from '@device-management-toolkit/ui-toolkit/core';
4
5
  import { fromEvent, timer } from 'rxjs';
5
6
  import { throttleTime } from 'rxjs/operators';
@@ -11,20 +12,31 @@ import { throttleTime } from 'rxjs/operators';
11
12
  class KVMComponent {
12
13
  constructor() {
13
14
  this.renderer = inject(Renderer2);
14
- this.canvas = viewChild('canvas');
15
+ this.destroyRef = inject(DestroyRef);
16
+ this.KEY_SEQUENCE_DELAY_MS = 10;
17
+ this.canvas = viewChild('canvas', ...(ngDevMode ? [{ debugName: "canvas" }] : []));
15
18
  this.device = viewChild.required('device');
16
- this.isFullscreen = input(false);
17
- //setting a width and height for the canvas
18
- this.width = 400;
19
- this.height = 400;
20
- this.mpsServer = input('');
21
- this.authToken = input('');
22
- this.deviceId = input('');
19
+ // Canvas properties
20
+ this.context = null;
21
+ this.width = signal(400, ...(ngDevMode ? [{ debugName: "width" }] : []));
22
+ this.height = signal(400, ...(ngDevMode ? [{ debugName: "height" }] : []));
23
+ // Input properties
24
+ this.isFullscreen = input(false, ...(ngDevMode ? [{ debugName: "isFullscreen" }] : []));
25
+ this.mpsServer = input('', ...(ngDevMode ? [{ debugName: "mpsServer" }] : []));
26
+ this.authToken = input('', ...(ngDevMode ? [{ debugName: "authToken" }] : []));
27
+ this.deviceId = input('', ...(ngDevMode ? [{ debugName: "deviceId" }] : []));
28
+ // Input/Output properties
23
29
  this.deviceStatus = output();
24
- this.deviceConnection = input(new EventEmitter());
25
- this.selectedEncoding = input(new EventEmitter());
26
- this.powerState = 0;
27
- this.selected = 1;
30
+ this.deviceConnection = input(false, ...(ngDevMode ? [{ debugName: "deviceConnection" }] : []));
31
+ this.selectedEncoding = input(1, ...(ngDevMode ? [{ debugName: "selectedEncoding" }] : []));
32
+ this.selectedHotkey = input('', ...(ngDevMode ? [{ debugName: "selectedHotkey" }] : []));
33
+ // Component state
34
+ this.module = null;
35
+ this.redirector = null;
36
+ this.dataProcessor = null;
37
+ this.mouseHelper = null;
38
+ this.keyboardHelper = null;
39
+ this.selected = signal(1, ...(ngDevMode ? [{ debugName: "selected" }] : []));
28
40
  this.encodings = [
29
41
  { value: 1, viewValue: 'RLE 8' },
30
42
  { value: 2, viewValue: 'RLE 16' }
@@ -32,39 +44,38 @@ class KVMComponent {
32
44
  this.onConnectionStateChange = (redirector, state) => {
33
45
  this.deviceStatus.emit(state);
34
46
  };
35
- this.reset = () => {
36
- this.redirector = null;
37
- this.module = null;
38
- this.dataProcessor = null;
39
- this.height = 400;
40
- this.width = 400;
41
- this.instantiate();
42
- };
43
- this.stopKvm = () => {
44
- this.redirector?.stop();
45
- this.keyboardHelper.UnGrabKeyInput();
46
- this.reset();
47
- };
48
47
  effect(() => {
49
48
  this.toggleFullscreen();
50
49
  });
51
- }
52
- ngOnInit() {
53
- this.deviceConnection().subscribe((data) => {
54
- if (data) {
50
+ // React to deviceConnection changes
51
+ effect(() => {
52
+ const connected = this.deviceConnection();
53
+ if (connected && this.redirector == null) {
54
+ console.log('KVMComponent: Device connected, initializing KVM...');
55
55
  this.init();
56
56
  }
57
- else {
57
+ else if (!connected) {
58
+ console.log('KVMComponent: Device disconnected, stopping KVM...');
58
59
  this.stopKvm();
59
60
  }
60
61
  });
61
- this.selectedEncoding().subscribe((data) => {
62
- this.selected = data;
62
+ // React to selectedEncoding changes
63
+ effect(() => {
64
+ if (this.selectedEncoding() === this.selected() || !this.deviceConnection())
65
+ return;
66
+ console.log('KVMComponent: Encoding changed to', this.selectedEncoding());
67
+ const encoding = this.selectedEncoding();
68
+ this.selected.set(encoding);
63
69
  this.onEncodingChange();
64
70
  });
65
- }
66
- ngAfterViewInit() {
67
- this.init();
71
+ // React to selectedHotkey changes
72
+ effect(() => {
73
+ const hotkey = this.selectedHotkey();
74
+ if (hotkey && this.deviceConnection() && this.keyboardHelper) {
75
+ console.log('KVMComponent: Hotkey triggered:', hotkey);
76
+ this.sendHotkey(hotkey);
77
+ }
78
+ });
68
79
  }
69
80
  toggleFullscreen() {
70
81
  const canvasElement = this.canvas()?.nativeElement;
@@ -82,13 +93,11 @@ class KVMComponent {
82
93
  }
83
94
  this.renderer.removeClass(canvasElement, 'fullscreen');
84
95
  }
85
- if (this.mouseHelper != null) {
86
- this.mouseHelper.resetOffsets();
87
- }
96
+ this.mouseHelper?.resetOffsets();
88
97
  }
89
98
  instantiate() {
90
99
  const canvas = this.canvas();
91
- this.context = canvas?.nativeElement.getContext('2d');
100
+ this.context = canvas?.nativeElement.getContext('2d') || null;
92
101
  const config = {
93
102
  mode: 'kvm',
94
103
  protocol: Protocol.KVM,
@@ -115,12 +124,11 @@ class KVMComponent {
115
124
  this.redirector.onError = this.onRedirectorError.bind(this);
116
125
  this.module.onSend = this.redirector.send.bind(this.redirector);
117
126
  this.module.onProcessData = this.dataProcessor.processData.bind(this.dataProcessor);
118
- this.module.bpp = this.selected;
119
- this.mouseMove = fromEvent(canvas?.nativeElement, 'mousemove');
120
- this.mouseMove.pipe(throttleTime(200)).subscribe((event) => {
121
- if (this.mouseHelper != null) {
122
- this.mouseHelper.mousemove(event);
123
- }
127
+ this.module.bpp = this.selected();
128
+ this.mouseMove$ = fromEvent(canvas?.nativeElement, 'mousemove')
129
+ .pipe(throttleTime(200), takeUntilDestroyed(this.destroyRef))
130
+ .subscribe((event) => {
131
+ this.mouseHelper?.mousemove(event);
124
132
  });
125
133
  }
126
134
  onRedirectorError() {
@@ -133,9 +141,9 @@ class KVMComponent {
133
141
  }, 4000);
134
142
  }
135
143
  autoConnect() {
136
- if (this.redirector != null) {
144
+ if (this.redirector) {
137
145
  this.redirector.start(WebSocket);
138
- this.keyboardHelper.GrabKeyInput();
146
+ this.keyboardHelper?.GrabKeyInput();
139
147
  }
140
148
  }
141
149
  onEncodingChange() {
@@ -144,28 +152,174 @@ class KVMComponent {
144
152
  this.autoConnect();
145
153
  });
146
154
  }
155
+ reset() {
156
+ this.redirector = null;
157
+ this.module = null;
158
+ this.dataProcessor = null;
159
+ this.height.set(400);
160
+ this.width.set(400);
161
+ this.instantiate();
162
+ }
163
+ stopKvm() {
164
+ this.redirector?.stop();
165
+ this.keyboardHelper?.UnGrabKeyInput();
166
+ this.reset();
167
+ }
147
168
  onMouseup(event) {
148
- if (this.mouseHelper != null) {
149
- this.mouseHelper.mouseup(event);
150
- }
169
+ this.mouseHelper?.mouseup(event);
151
170
  }
152
171
  onMousedown(event) {
153
- if (this.mouseHelper != null) {
154
- this.mouseHelper.mousedown(event);
155
- }
172
+ this.mouseHelper?.mousedown(event);
156
173
  }
157
174
  onMousemove(event) {
158
- if (this.mouseHelper != null) {
159
- this.mouseHelper.mousemove(event);
175
+ this.mouseHelper?.mousemove(event);
176
+ }
177
+ sendHotkey(hotKeyType) {
178
+ if (!this.keyboardHelper) {
179
+ console.warn('KVMComponent: Cannot send hotkey - keyboard helper not available');
180
+ return;
181
+ }
182
+ const keySequence = this.getKeySequence(hotKeyType);
183
+ if (keySequence?.keys) {
184
+ console.log('KVMComponent: Sending hotkey sequence for', hotKeyType);
185
+ // Send each key in the sequence with a small delay
186
+ keySequence.keys.forEach((key, index) => {
187
+ setTimeout(() => {
188
+ // Use the KeyboardHelper's existing handleKeyEvent method
189
+ // 0 = Up, 1 = Down (from the UpDown enum)
190
+ const upDown = key.down ? 1 : 0;
191
+ // Create a mock keyboard event with the key code
192
+ const mockEvent = {
193
+ keyCode: key.code,
194
+ preventDefault: () => { },
195
+ stopPropagation: () => { }
196
+ };
197
+ // Use the existing handleKeyEvent method
198
+ this.keyboardHelper.handleKeyEvent(upDown, mockEvent);
199
+ }, index * this.KEY_SEQUENCE_DELAY_MS); // delay between keys
200
+ });
201
+ }
202
+ }
203
+ getKeySequence(hotKeyType) {
204
+ // Based on the KeyBoardHelper, these are the key codes for various combinations
205
+ switch (hotKeyType) {
206
+ case 'ctrl-alt-del':
207
+ return {
208
+ keys: [
209
+ { code: 17, down: true }, // Ctrl down (JS keyCode)
210
+ { code: 18, down: true }, // Alt down (JS keyCode)
211
+ { code: 46, down: true }, // Delete down (JS keyCode)
212
+ { code: 46, down: false }, // Delete up (JS keyCode)
213
+ { code: 18, down: false }, // Alt up (JS keyCode)
214
+ { code: 17, down: false } // Ctrl up (JS keyCode)
215
+ ]
216
+ };
217
+ case 'alt-tab':
218
+ return {
219
+ keys: [
220
+ { code: 18, down: true }, // Alt down (JS keyCode)
221
+ { code: 9, down: true }, // Tab down (JS keyCode)
222
+ { code: 9, down: false }, // Tab up (JS keyCode)
223
+ { code: 18, down: false } // Alt up (JS keyCode)
224
+ ]
225
+ };
226
+ case 'alt-release':
227
+ return {
228
+ keys: [
229
+ { code: 18, down: false } // Alt up (JS keyCode)
230
+ ]
231
+ };
232
+ case 'windows':
233
+ return {
234
+ keys: [
235
+ { code: 0xffe7, down: true }, // Windows key down
236
+ { code: 0xffe7, down: false } // Windows key up
237
+ ]
238
+ };
239
+ case 'windows-l':
240
+ return {
241
+ keys: [
242
+ { code: 0xffe7, down: true }, // Windows down
243
+ { code: 108, down: true }, // L down
244
+ { code: 108, down: false }, // L up
245
+ { code: 0xffe7, down: false } // Windows up
246
+ ]
247
+ };
248
+ case 'windows-r':
249
+ return {
250
+ keys: [
251
+ { code: 0xffe7, down: true }, // Windows down
252
+ { code: 82, down: true }, // R down
253
+ { code: 82, down: false }, // R up
254
+ { code: 0xffe7, down: false } // Windows up
255
+ ]
256
+ };
257
+ case 'windows-up':
258
+ return {
259
+ keys: [
260
+ { code: 0xffe7, down: true }, // Windows down
261
+ { code: 0xff52, down: true }, // Up arrow down
262
+ { code: 0xff52, down: false }, // Up arrow up
263
+ { code: 0xffe7, down: false } // Windows up
264
+ ]
265
+ };
266
+ case 'windows-down':
267
+ return {
268
+ keys: [
269
+ { code: 0xffe7, down: true }, // Windows down
270
+ { code: 0xff54, down: true }, // Down arrow down
271
+ { code: 0xff54, down: false }, // Down arrow up
272
+ { code: 0xffe7, down: false } // Windows up
273
+ ]
274
+ };
275
+ case 'windows-left':
276
+ return {
277
+ keys: [
278
+ { code: 0xffe7, down: true }, // Windows down
279
+ { code: 0xff51, down: true }, // Left arrow down
280
+ { code: 0xff51, down: false }, // Left arrow up
281
+ { code: 0xffe7, down: false } // Windows up
282
+ ]
283
+ };
284
+ case 'windows-right':
285
+ return {
286
+ keys: [
287
+ { code: 0xffe7, down: true }, // Windows down
288
+ { code: 0xff53, down: true }, // Right arrow down
289
+ { code: 0xff53, down: false }, // Right arrow up
290
+ { code: 0xffe7, down: false } // Windows up
291
+ ]
292
+ };
293
+ case 'alt-f4':
294
+ return {
295
+ keys: [
296
+ { code: 0xffe9, down: true }, // Alt down
297
+ { code: 0xffc1, down: true }, // F4 down (F1 = 0xffbe, so F4 = 0xffc1)
298
+ { code: 0xffc1, down: false }, // F4 up
299
+ { code: 0xffe9, down: false } // Alt up
300
+ ]
301
+ };
302
+ case 'ctrl-w':
303
+ return {
304
+ keys: [
305
+ { code: 0xffe3, down: true }, // Ctrl down
306
+ { code: 87, down: true }, // W down
307
+ { code: 87, down: false }, // W up
308
+ { code: 0xffe3, down: false } // Ctrl up
309
+ ]
310
+ };
311
+ default:
312
+ return null;
160
313
  }
161
314
  }
162
315
  ngOnDestroy() {
316
+ this.mouseMove$?.unsubscribe();
163
317
  this.stopKvm();
164
318
  }
165
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: KVMComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
166
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.13", type: KVMComponent, isStandalone: true, selector: "amt-kvm", inputs: { isFullscreen: { classPropertyName: "isFullscreen", publicName: "isFullscreen", isSignal: true, isRequired: false, transformFunction: null }, mpsServer: { classPropertyName: "mpsServer", publicName: "mpsServer", isSignal: true, isRequired: false, transformFunction: null }, authToken: { classPropertyName: "authToken", publicName: "authToken", isSignal: true, isRequired: false, transformFunction: null }, deviceId: { classPropertyName: "deviceId", publicName: "deviceId", isSignal: true, isRequired: false, transformFunction: null }, deviceConnection: { classPropertyName: "deviceConnection", publicName: "deviceConnection", isSignal: true, isRequired: false, transformFunction: null }, selectedEncoding: { classPropertyName: "selectedEncoding", publicName: "selectedEncoding", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deviceStatus: "deviceStatus" }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, isSignal: true }, { propertyName: "device", first: true, predicate: ["device"], descendants: true, isSignal: true }], ngImport: i0, template: "<div>\n <canvas\n class=\"canvas\"\n #canvas\n [width]=\"width\"\n [height]=\"height\"\n oncontextmenu=\"return false\"\n (mouseup)=\"onMouseup($event)\"\n (mousedown)=\"onMousedown($event)\"\n (mousemove)=\"onMousemove($event)\"></canvas>\n</div>\n", styles: [".canvas{max-height:80%;max-width:100%}canvas.fullscreen{height:100vh!important}\n"] }); }
319
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: KVMComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
320
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.1.2", type: KVMComponent, isStandalone: true, selector: "amt-kvm", inputs: { isFullscreen: { classPropertyName: "isFullscreen", publicName: "isFullscreen", isSignal: true, isRequired: false, transformFunction: null }, mpsServer: { classPropertyName: "mpsServer", publicName: "mpsServer", isSignal: true, isRequired: false, transformFunction: null }, authToken: { classPropertyName: "authToken", publicName: "authToken", isSignal: true, isRequired: false, transformFunction: null }, deviceId: { classPropertyName: "deviceId", publicName: "deviceId", isSignal: true, isRequired: false, transformFunction: null }, deviceConnection: { classPropertyName: "deviceConnection", publicName: "deviceConnection", isSignal: true, isRequired: false, transformFunction: null }, selectedEncoding: { classPropertyName: "selectedEncoding", publicName: "selectedEncoding", isSignal: true, isRequired: false, transformFunction: null }, selectedHotkey: { classPropertyName: "selectedHotkey", publicName: "selectedHotkey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deviceStatus: "deviceStatus" }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, isSignal: true }, { propertyName: "device", first: true, predicate: ["device"], descendants: true, isSignal: true }], ngImport: i0, template: "<div>\n <canvas\n class=\"canvas\"\n #canvas\n [width]=\"width\"\n [height]=\"height\"\n oncontextmenu=\"return false\"\n (mouseup)=\"onMouseup($event)\"\n (mousedown)=\"onMousedown($event)\"\n (mousemove)=\"onMousemove($event)\"></canvas>\n</div>\n", styles: [".canvas{max-height:80%;max-width:100%}canvas.fullscreen{height:100vh!important}\n"] }); }
167
321
  }
168
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: KVMComponent, decorators: [{
322
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: KVMComponent, decorators: [{
169
323
  type: Component,
170
324
  args: [{ selector: 'amt-kvm', template: "<div>\n <canvas\n class=\"canvas\"\n #canvas\n [width]=\"width\"\n [height]=\"height\"\n oncontextmenu=\"return false\"\n (mouseup)=\"onMouseup($event)\"\n (mousedown)=\"onMousedown($event)\"\n (mousemove)=\"onMousemove($event)\"></canvas>\n</div>\n", styles: [".canvas{max-height:80%;max-width:100%}canvas.fullscreen{height:100vh!important}\n"] }]
171
325
  }], ctorParameters: () => [] });
@@ -1 +1 @@
1
- {"version":3,"file":"device-management-toolkit-ui-toolkit-angular-kvm.mjs","sources":["../../kvm/src/kvm.component.ts","../../kvm/src/kvm.component.html","../../kvm/src/public_api.ts","../../kvm/src/device-management-toolkit-ui-toolkit-angular-kvm.ts"],"sourcesContent":["/*********************************************************************\n * Copyright (c) Intel Corporation 2023\n * SPDX-License-Identifier: Apache-2.0\n **********************************************************************/\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n OnDestroy,\n OnInit,\n viewChild,\n input,\n output,\n EventEmitter,\n inject,\n Renderer2,\n computed,\n model,\n effect\n} from '@angular/core'\nimport {\n AMTDesktop,\n AMTKvmDataRedirector,\n RedirectorConfig,\n DataProcessor,\n IDataProcessor,\n KeyBoardHelper,\n MouseHelper,\n Protocol\n} from '@device-management-toolkit/ui-toolkit/core'\nimport { Observable, fromEvent, timer } from 'rxjs'\nimport { throttleTime } from 'rxjs/operators'\n\n@Component({\n selector: 'amt-kvm',\n templateUrl: './kvm.component.html',\n styleUrls: ['./kvm.component.css']\n})\nexport class KVMComponent implements OnInit, AfterViewInit, OnDestroy {\n renderer = inject(Renderer2)\n readonly canvas = viewChild<ElementRef>('canvas')\n readonly device = viewChild.required<string>('device')\n public context!: CanvasRenderingContext2D\n public isFullscreen = input(false)\n\n //setting a width and height for the canvas\n\n public width = 400\n public height = 400\n public mpsServer = input('')\n public authToken = input('')\n public deviceId = input('')\n\n readonly deviceStatus = output<number>()\n readonly deviceConnection = input(new EventEmitter<boolean>())\n readonly selectedEncoding = input(new EventEmitter<number>())\n\n module: AMTDesktop | null\n redirector: AMTKvmDataRedirector | null\n dataProcessor!: IDataProcessor | null\n mouseHelper!: MouseHelper\n keyboardHelper!: KeyBoardHelper\n powerState: any = 0\n selected = 1\n timeInterval!: any\n mouseMove: Observable<MouseEvent>\n encodings = [\n { value: 1, viewValue: 'RLE 8' },\n { value: 2, viewValue: 'RLE 16' }\n ]\n\n constructor() {\n effect(() => {\n this.toggleFullscreen()\n })\n }\n ngOnInit(): void {\n this.deviceConnection().subscribe((data: boolean) => {\n if (data) {\n this.init()\n } else {\n this.stopKvm()\n }\n })\n this.selectedEncoding().subscribe((data) => {\n this.selected = data\n this.onEncodingChange()\n })\n }\n\n ngAfterViewInit(): void {\n this.init()\n }\n\n toggleFullscreen(): void {\n const canvasElement = this.canvas()?.nativeElement\n if (!canvasElement) return\n\n if (this.isFullscreen()) {\n if (canvasElement.requestFullscreen) {\n canvasElement.requestFullscreen()\n }\n this.renderer.addClass(canvasElement, 'fullscreen')\n } else {\n if (document.exitFullscreen && document.fullscreenElement != null) {\n document.exitFullscreen()\n }\n this.renderer.removeClass(canvasElement, 'fullscreen')\n }\n if (this.mouseHelper != null) {\n this.mouseHelper.resetOffsets()\n }\n }\n\n instantiate(): void {\n const canvas = this.canvas()\n this.context = canvas?.nativeElement.getContext('2d')\n const config: RedirectorConfig = {\n mode: 'kvm',\n protocol: Protocol.KVM,\n fr: new FileReader(),\n host: this.deviceId(),\n port: 16994,\n user: '',\n pass: '',\n tls: 0,\n tls1only: 0,\n authToken: this.authToken(),\n server: this.mpsServer()\n }\n this.redirector = new AMTKvmDataRedirector(config)\n this.module = new AMTDesktop(this.context)\n this.dataProcessor = new DataProcessor(this.redirector, this.module)\n this.mouseHelper = new MouseHelper(this.module, this.redirector, 200)\n this.keyboardHelper = new KeyBoardHelper(this.module, this.redirector)\n this.redirector.onProcessData = this.module.processData.bind(this.module)\n this.redirector.onStart = this.module.start.bind(this.module)\n this.redirector.onNewState = this.module.onStateChange.bind(this.module)\n this.redirector.onSendKvmData = this.module.onSendKvmData.bind(this.module)\n this.redirector.onStateChanged = this.onConnectionStateChange.bind(this)\n this.redirector.onError = this.onRedirectorError.bind(this)\n this.module.onSend = this.redirector.send.bind(this.redirector)\n this.module.onProcessData = this.dataProcessor.processData.bind(this.dataProcessor)\n this.module.bpp = this.selected\n\n this.mouseMove = fromEvent(canvas?.nativeElement, 'mousemove')\n this.mouseMove.pipe(throttleTime(200)).subscribe((event: MouseEvent) => {\n if (this.mouseHelper != null) {\n this.mouseHelper.mousemove(event)\n }\n })\n }\n\n onConnectionStateChange = (redirector: any, state: number): any => {\n this.deviceStatus.emit(state)\n }\n\n onRedirectorError(): void {\n this.reset()\n }\n\n init(): void {\n this.instantiate()\n setTimeout(() => {\n this.autoConnect()\n }, 4000)\n }\n\n autoConnect(): void {\n if (this.redirector != null) {\n this.redirector.start(WebSocket)\n this.keyboardHelper.GrabKeyInput()\n }\n }\n\n onEncodingChange(): void {\n this.stopKvm()\n timer(1000).subscribe(() => {\n this.autoConnect()\n })\n }\n\n reset = (): void => {\n this.redirector = null\n this.module = null\n this.dataProcessor = null\n this.height = 400\n this.width = 400\n this.instantiate()\n }\n\n stopKvm = (): void => {\n this.redirector?.stop()\n this.keyboardHelper.UnGrabKeyInput()\n this.reset()\n }\n\n onMouseup(event: MouseEvent): void {\n if (this.mouseHelper != null) {\n this.mouseHelper.mouseup(event)\n }\n }\n\n onMousedown(event: MouseEvent): void {\n if (this.mouseHelper != null) {\n this.mouseHelper.mousedown(event)\n }\n }\n\n onMousemove(event: MouseEvent): void {\n if (this.mouseHelper != null) {\n this.mouseHelper.mousemove(event)\n }\n }\n\n ngOnDestroy(): void {\n this.stopKvm()\n }\n}\n","<div>\n <canvas\n class=\"canvas\"\n #canvas\n [width]=\"width\"\n [height]=\"height\"\n oncontextmenu=\"return false\"\n (mouseup)=\"onMouseup($event)\"\n (mousedown)=\"onMousedown($event)\"\n (mousemove)=\"onMousemove($event)\"></canvas>\n</div>\n","/*********************************************************************\n * Copyright (c) Intel Corporation 2023\n * SPDX-License-Identifier: Apache-2.0\n **********************************************************************/\n/*\n * Public API Surface of kvm\n */\n\nexport * from './kvm.component'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGwE;MAmC3D,YAAY,CAAA;AAiCvB,IAAA,WAAA,GAAA;AAhCA,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AACnB,QAAA,IAAA,CAAA,MAAM,GAAG,SAAS,CAAa,QAAQ,CAAC;AACxC,QAAA,IAAA,CAAA,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAS,QAAQ,CAAC;AAE/C,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CA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B,SAAS;+BACE,SAAS,EAAA,QAAA,EAAA,oRAAA,EAAA,MAAA,EAAA,CAAA,mFAAA,CAAA,EAAA;;;AElCrB;;;AAGwE;AACxE;;AAEG;;ACNH;;AAEG;;;;"}
1
+ {"version":3,"file":"device-management-toolkit-ui-toolkit-angular-kvm.mjs","sources":["../../kvm/src/kvm.component.ts","../../kvm/src/kvm.component.html","../../kvm/src/public_api.ts","../../kvm/src/device-management-toolkit-ui-toolkit-angular-kvm.ts"],"sourcesContent":["/*********************************************************************\n * Copyright (c) Intel Corporation 2023\n * SPDX-License-Identifier: Apache-2.0\n **********************************************************************/\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n OnDestroy,\n viewChild,\n input,\n output,\n inject,\n Renderer2,\n effect,\n signal,\n DestroyRef\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\nimport {\n AMTDesktop,\n AMTKvmDataRedirector,\n RedirectorConfig,\n DataProcessor,\n IDataProcessor,\n KeyBoardHelper,\n MouseHelper,\n Protocol\n} from '@device-management-toolkit/ui-toolkit/core'\nimport { fromEvent, timer, Subscription } from 'rxjs'\nimport { throttleTime } from 'rxjs/operators'\n\ninterface EncodingOption {\n value: number\n viewValue: string\n}\ninterface KeyObject {\n code: number\n down: boolean\n}\n\n@Component({\n selector: 'amt-kvm',\n templateUrl: './kvm.component.html',\n styleUrls: ['./kvm.component.css']\n})\nexport class KVMComponent implements OnDestroy {\n private readonly renderer = inject(Renderer2)\n private readonly destroyRef = inject(DestroyRef)\n private KEY_SEQUENCE_DELAY_MS = 10\n readonly canvas = viewChild<ElementRef>('canvas')\n readonly device = viewChild.required<string>('device')\n\n // Canvas properties\n public context: CanvasRenderingContext2D | null = null\n public width = signal(400)\n public height = signal(400)\n\n // Input properties\n public isFullscreen = input(false)\n public mpsServer = input('')\n public authToken = input('')\n public deviceId = input('')\n\n // Input/Output properties\n readonly deviceStatus = output<number>()\n readonly deviceConnection = input<boolean>(false)\n readonly selectedEncoding = input<number>(1)\n readonly selectedHotkey = input<string>('')\n\n // Component state\n module: AMTDesktop | null = null\n redirector: AMTKvmDataRedirector | null = null\n dataProcessor: IDataProcessor | null = null\n mouseHelper: MouseHelper | null = null\n keyboardHelper: KeyBoardHelper | null = null\n selected = signal(1)\n private mouseMove$?: Subscription\n\n readonly encodings: EncodingOption[] = [\n { value: 1, viewValue: 'RLE 8' },\n { value: 2, viewValue: 'RLE 16' }\n ]\n\n constructor() {\n effect(() => {\n this.toggleFullscreen()\n })\n\n // React to deviceConnection changes\n effect(() => {\n const connected = this.deviceConnection()\n if (connected && this.redirector == null) {\n console.log('KVMComponent: Device connected, initializing KVM...')\n this.init()\n } else if (!connected) {\n console.log('KVMComponent: Device disconnected, stopping KVM...')\n this.stopKvm()\n }\n })\n\n // React to selectedEncoding changes\n effect(() => {\n if (this.selectedEncoding() === this.selected() || !this.deviceConnection()) return\n console.log('KVMComponent: Encoding changed to', this.selectedEncoding())\n const encoding = this.selectedEncoding()\n this.selected.set(encoding)\n this.onEncodingChange()\n })\n\n // React to selectedHotkey changes\n effect(() => {\n const hotkey = this.selectedHotkey()\n if (hotkey && this.deviceConnection() && this.keyboardHelper) {\n console.log('KVMComponent: Hotkey triggered:', hotkey)\n this.sendHotkey(hotkey)\n }\n })\n }\n\n toggleFullscreen(): void {\n const canvasElement = this.canvas()?.nativeElement\n if (!canvasElement) return\n\n if (this.isFullscreen()) {\n if (canvasElement.requestFullscreen) {\n canvasElement.requestFullscreen()\n }\n this.renderer.addClass(canvasElement, 'fullscreen')\n } else {\n if (document.exitFullscreen && document.fullscreenElement != null) {\n document.exitFullscreen()\n }\n this.renderer.removeClass(canvasElement, 'fullscreen')\n }\n this.mouseHelper?.resetOffsets()\n }\n\n instantiate(): void {\n const canvas = this.canvas()\n this.context = canvas?.nativeElement.getContext('2d') || null\n const config: RedirectorConfig = {\n mode: 'kvm',\n protocol: Protocol.KVM,\n fr: new FileReader(),\n host: this.deviceId(),\n port: 16994,\n user: '',\n pass: '',\n tls: 0,\n tls1only: 0,\n authToken: this.authToken(),\n server: this.mpsServer()\n }\n this.redirector = new AMTKvmDataRedirector(config)\n this.module = new AMTDesktop(this.context)\n this.dataProcessor = new DataProcessor(this.redirector, this.module)\n this.mouseHelper = new MouseHelper(this.module, this.redirector, 200)\n this.keyboardHelper = new KeyBoardHelper(this.module, this.redirector)\n this.redirector.onProcessData = this.module.processData.bind(this.module)\n this.redirector.onStart = this.module.start.bind(this.module)\n this.redirector.onNewState = this.module.onStateChange.bind(this.module)\n this.redirector.onSendKvmData = this.module.onSendKvmData.bind(this.module)\n this.redirector.onStateChanged = this.onConnectionStateChange.bind(this)\n this.redirector.onError = this.onRedirectorError.bind(this)\n this.module.onSend = this.redirector.send.bind(this.redirector)\n this.module.onProcessData = this.dataProcessor.processData.bind(this.dataProcessor)\n this.module.bpp = this.selected()\n\n this.mouseMove$ = fromEvent<MouseEvent>(canvas?.nativeElement, 'mousemove')\n .pipe(throttleTime(200), takeUntilDestroyed(this.destroyRef))\n .subscribe((event: MouseEvent) => {\n this.mouseHelper?.mousemove(event)\n })\n }\n\n private onConnectionStateChange = (redirector: any, state: number): void => {\n this.deviceStatus.emit(state)\n }\n\n onRedirectorError(): void {\n this.reset()\n }\n\n init(): void {\n this.instantiate()\n setTimeout(() => {\n this.autoConnect()\n }, 4000)\n }\n\n autoConnect(): void {\n if (this.redirector) {\n this.redirector.start(WebSocket)\n this.keyboardHelper?.GrabKeyInput()\n }\n }\n\n private onEncodingChange(): void {\n this.stopKvm()\n timer(1000).subscribe(() => {\n this.autoConnect()\n })\n }\n\n reset(): void {\n this.redirector = null\n this.module = null\n this.dataProcessor = null\n this.height.set(400)\n this.width.set(400)\n this.instantiate()\n }\n\n stopKvm(): void {\n this.redirector?.stop()\n this.keyboardHelper?.UnGrabKeyInput()\n this.reset()\n }\n\n onMouseup(event: MouseEvent): void {\n this.mouseHelper?.mouseup(event)\n }\n\n onMousedown(event: MouseEvent): void {\n this.mouseHelper?.mousedown(event)\n }\n\n onMousemove(event: MouseEvent): void {\n this.mouseHelper?.mousemove(event)\n }\n\n sendHotkey(hotKeyType: string): void {\n if (!this.keyboardHelper) {\n console.warn('KVMComponent: Cannot send hotkey - keyboard helper not available')\n return\n }\n\n const keySequence = this.getKeySequence(hotKeyType)\n if (keySequence?.keys) {\n console.log('KVMComponent: Sending hotkey sequence for', hotKeyType)\n // Send each key in the sequence with a small delay\n keySequence.keys.forEach((key: KeyObject, index: number) => {\n setTimeout(() => {\n // Use the KeyboardHelper's existing handleKeyEvent method\n // 0 = Up, 1 = Down (from the UpDown enum)\n const upDown = key.down ? 1 : 0\n\n // Create a mock keyboard event with the key code\n const mockEvent = {\n keyCode: key.code,\n preventDefault: () => {},\n stopPropagation: () => {}\n } as KeyboardEvent\n\n // Use the existing handleKeyEvent method\n this.keyboardHelper!.handleKeyEvent(upDown, mockEvent)\n }, index * this.KEY_SEQUENCE_DELAY_MS) // delay between keys\n })\n }\n }\n\n private getKeySequence(hotKeyType: string): { keys: KeyObject[] } | null {\n // Based on the KeyBoardHelper, these are the key codes for various combinations\n switch (hotKeyType) {\n case 'ctrl-alt-del':\n return {\n keys: [\n { code: 17, down: true }, // Ctrl down (JS keyCode)\n { code: 18, down: true }, // Alt down (JS keyCode)\n { code: 46, down: true }, // Delete down (JS keyCode)\n { code: 46, down: false }, // Delete up (JS keyCode)\n { code: 18, down: false }, // Alt up (JS keyCode)\n { code: 17, down: false } // Ctrl up (JS keyCode)\n ]\n }\n case 'alt-tab':\n return {\n keys: [\n { code: 18, down: true }, // Alt down (JS keyCode)\n { code: 9, down: true }, // Tab down (JS keyCode)\n { code: 9, down: false }, // Tab up (JS keyCode)\n { code: 18, down: false } // Alt up (JS keyCode)\n ]\n }\n case 'alt-release':\n return {\n keys: [\n { code: 18, down: false } // Alt up (JS keyCode)\n ]\n }\n case 'windows':\n return {\n keys: [\n { code: 0xffe7, down: true }, // Windows key down\n { code: 0xffe7, down: false } // Windows key up\n ]\n }\n case 'windows-l':\n return {\n keys: [\n { code: 0xffe7, down: true }, // Windows down\n { code: 108, down: true }, // L down\n { code: 108, down: false }, // L up\n { code: 0xffe7, down: false } // Windows up\n ]\n }\n case 'windows-r':\n return {\n keys: [\n { code: 0xffe7, down: true }, // Windows down\n { code: 82, down: true }, // R down\n { code: 82, down: false }, // R up\n { code: 0xffe7, down: false } // Windows up\n ]\n }\n case 'windows-up':\n return {\n keys: [\n { code: 0xffe7, down: true }, // Windows down\n { code: 0xff52, down: true }, // Up arrow down\n { code: 0xff52, down: false }, // Up arrow up\n { code: 0xffe7, down: false } // Windows up\n ]\n }\n case 'windows-down':\n return {\n keys: [\n { code: 0xffe7, down: true }, // Windows down\n { code: 0xff54, down: true }, // Down arrow down\n { code: 0xff54, down: false }, // Down arrow up\n { code: 0xffe7, down: false } // Windows up\n ]\n }\n case 'windows-left':\n return {\n keys: [\n { code: 0xffe7, down: true }, // Windows down\n { code: 0xff51, down: true }, // Left arrow down\n { code: 0xff51, down: false }, // Left arrow up\n { code: 0xffe7, down: false } // Windows up\n ]\n }\n case 'windows-right':\n return {\n keys: [\n { code: 0xffe7, down: true }, // Windows down\n { code: 0xff53, down: true }, // Right arrow down\n { code: 0xff53, down: false }, // Right arrow up\n { code: 0xffe7, down: false } // Windows up\n ]\n }\n case 'alt-f4':\n return {\n keys: [\n { code: 0xffe9, down: true }, // Alt down\n { code: 0xffc1, down: true }, // F4 down (F1 = 0xffbe, so F4 = 0xffc1)\n { code: 0xffc1, down: false }, // F4 up\n { code: 0xffe9, down: false } // Alt up\n ]\n }\n case 'ctrl-w':\n return {\n keys: [\n { code: 0xffe3, down: true }, // Ctrl down\n { code: 87, down: true }, // W down\n { code: 87, down: false }, // W up\n { code: 0xffe3, down: false } // Ctrl up\n ]\n }\n default:\n return null\n }\n }\n\n ngOnDestroy(): void {\n this.mouseMove$?.unsubscribe()\n this.stopKvm()\n }\n}\n","<div>\n <canvas\n class=\"canvas\"\n #canvas\n [width]=\"width\"\n [height]=\"height\"\n oncontextmenu=\"return false\"\n (mouseup)=\"onMouseup($event)\"\n (mousedown)=\"onMousedown($event)\"\n (mousemove)=\"onMousemove($event)\"></canvas>\n</div>\n","/*********************************************************************\n * Copyright (c) Intel Corporation 2023\n * SPDX-License-Identifier: Apache-2.0\n **********************************************************************/\n/*\n * Public API Surface of kvm\n */\n\nexport * from './kvm.component'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;AAGwE;MA2C3D,YAAY,CAAA;AAsCvB,IAAA,WAAA,GAAA;AArCiB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACxC,IAAA,CAAA,qBAAqB,GAAG,EAAE;AACzB,QAAA,IAAA,CAAA,MAAM,GAAG,SAAS,CAAa,QAAQ,kDAAC;AACxC,QAAA,IAAA,CAAA,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAS,QAAQ,CAAC;;QAG/C,IAAA,CAAA,OAAO,GAAoC,IAAI;AAC/C,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,GAAG,iDAAC;AACnB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,GAAG,kDAAC;;AAGpB,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,KAAK,wDAAC;AAC3B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,EAAE,qDAAC;AACrB,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,EAAE,qDAAC;AACrB,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,EAAE,oDAAC;;QAGlB,IAAA,CAAA,YAAY,GAAG,MAAM,EAAU;AAC/B,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAAU,KAAK,4DAAC;AACxC,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAAS,CAAC,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