@open-amt-cloud-toolkit/ui-toolkit-angular 2.0.2 → 2.0.5

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 ADDED
@@ -0,0 +1,21 @@
1
+ ![codecov.io](https://codecov.io/github/open-amt-cloud-toolkit/ui-toolkit-angular/coverage.svg?branch=main)
2
+
3
+ # Angular UI Components
4
+
5
+ ## Prerequisites
6
+
7
+ To succesfully deploy the UI Toolkit using Angular, the following software must be installed on your development system:
8
+
9
+ - [Node.js\* LTS 14.x.x or newer](https://nodejs.org/en/)
10
+ - [git](https://git-scm.com/downloads)
11
+ - [Visual Studio Code](https://code.visualstudio.com/) or any other IDE of choice
12
+ - [Angular CLI](https://angular.io/cli)
13
+
14
+ ## Add Angular UI Toolkit
15
+
16
+ 1. Run the following command to add the Angular UI Toolkit and install the required dependencies:
17
+
18
+ ```bash
19
+ npm install @open-amt-cloud-toolkit/ui-toolkit-angular
20
+ ```
21
+
package/dist ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@open-amt-cloud-toolkit/ui-toolkit-angular",
3
+ "version": "2.0.5",
4
+ "license": "Apache-2.0",
5
+ "bugs": {
6
+ "url": "https://github.com/open-amt-cloud-toolkit/ui-toolkit-angular/issues"
7
+ },
8
+ "homepage": "https://github.com/open-amt-cloud-toolkit/ui-toolkit-angular#readme",
9
+ "scripts": {
10
+ "prepublishOnly": "cp package.json dist",
11
+ "ng": "ng",
12
+ "start": "ng serve",
13
+ "build": "ng build kvm && ng build sol",
14
+ "test": "ng test",
15
+ "test-kvm": "ng test kvm --no-watch --no-progress --browsers=ChromeHeadlessCI",
16
+ "test-sol": "ng test sol --no-watch --no-progress --browsers=ChromeHeadlessCI",
17
+ "test-ci": "npm run test-kvm && npm run test-sol",
18
+ "lint": "ng lint",
19
+ "e2e": "ng e2e",
20
+ "build:kvm": "ng build kvm",
21
+ "build:sol": "ng build sol"
22
+ },
23
+ "dependencies": {
24
+ "@angular/common": "~11.2.14",
25
+ "@angular/compiler": "~11.2.14",
26
+ "@angular/core": "~11.2.14",
27
+ "@angular/platform-browser": "~11.2.14",
28
+ "@angular/platform-browser-dynamic": "~11.2.14",
29
+ "@angular/router": "~11.2.14",
30
+ "@open-amt-cloud-toolkit/ui-toolkit": "~2.0.5",
31
+ "rxjs": "~6.6.0",
32
+ "tslib": "^2.3.1",
33
+ "xterm": "^4.17.0",
34
+ "zone.js": "~0.11.5"
35
+ },
36
+ "devDependencies": {
37
+ "@angular-devkit/build-angular": "~0.1102.14",
38
+ "@angular/cdk": "^11.2.13",
39
+ "@angular/cli": "~11.2.14",
40
+ "@angular/compiler-cli": "~11.2.14",
41
+ "@types/jasmine": "~3.10.3",
42
+ "@types/node": "^14.0.0",
43
+ "codelyzer": "^6.0.0",
44
+ "jasmine-core": "~4.0.1",
45
+ "jasmine-spec-reporter": "~7.0.0",
46
+ "karma": "~6.3.17",
47
+ "karma-chrome-launcher": "~3.1.0",
48
+ "karma-coverage": "~2.2.0",
49
+ "karma-jasmine": "~4.0.0",
50
+ "karma-jasmine-html-reporter": "^1.5.0",
51
+ "ng-packagr": "^11.0.0",
52
+ "protractor": "~7.0.0",
53
+ "ts-node": "~10.7.0",
54
+ "tslint": "~6.1.0",
55
+ "typescript": "~4.1.0"
56
+ }
57
+ }
package/kvm/README.md CHANGED
@@ -1,26 +1,26 @@
1
- ![codecov.io](https://codecov.io/github/open-amt-cloud-toolkit/ui-toolkit-angular/coverage.svg?branch=main)
2
-
3
- # Kvm
4
-
5
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.14.
6
-
7
- ## Code scaffolding
8
-
9
- Run `ng generate component component-name --project kvm` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project kvm`.
10
- > Note: Don't forget to add `--project kvm` or else it will be added to the default project in your `angular.json` file.
11
-
12
- ## Build
13
-
14
- Run `ng build kvm` to build the project. The build artifacts will be stored in the `dist/` directory.
15
-
16
- ## Publishing
17
-
18
- After building your library with `ng build kvm`, go to the dist folder `cd dist/kvm` and run `npm publish`.
19
-
20
- ## Running unit tests
21
-
22
- Run `ng test kvm` to execute the unit tests via [Karma](https://karma-runner.github.io).
23
-
24
- ## Further help
25
-
26
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
1
+ ![codecov.io](https://codecov.io/github/open-amt-cloud-toolkit/ui-toolkit-angular/coverage.svg?branch=main)
2
+
3
+ # Kvm
4
+
5
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.14.
6
+
7
+ ## Code scaffolding
8
+
9
+ Run `ng generate component component-name --project kvm` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project kvm`.
10
+ > Note: Don't forget to add `--project kvm` or else it will be added to the default project in your `angular.json` file.
11
+
12
+ ## Build
13
+
14
+ Run `ng build kvm` to build the project. The build artifacts will be stored in the `dist/` directory.
15
+
16
+ ## Publishing
17
+
18
+ After building your library with `ng build kvm`, go to the dist folder `cd dist/kvm` and run `npm publish`.
19
+
20
+ ## Running unit tests
21
+
22
+ Run `ng test kvm` to execute the unit tests via [Karma](https://karma-runner.github.io).
23
+
24
+ ## Further help
25
+
26
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
@@ -1,233 +1,233 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@open-amt-cloud-toolkit/ui-toolkit/core'), require('rxjs'), require('rxjs/operators'), require('@angular/platform-browser'), require('@angular/common/http')) :
3
- typeof define === 'function' && define.amd ? define('kvm', ['exports', '@angular/core', '@open-amt-cloud-toolkit/ui-toolkit/core', 'rxjs', 'rxjs/operators', '@angular/platform-browser', '@angular/common/http'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.kvm = {}, global.ng.core, global['@open-amt-cloud-toolkit']['ui-toolkit'].core, global.rxjs, global.rxjs.operators, global.ng.platformBrowser, global.ng.common.http));
5
- }(this, (function (exports, i0, core, rxjs, operators, platformBrowser, http) { 'use strict';
6
-
7
- var _c0 = ["canvas"];
8
- var _c1 = ["device"];
9
- var KvmComponent = /** @class */ (function () {
10
- function KvmComponent() {
11
- var _this = this;
12
- // //setting a width and height for the canvas
13
- this.width = 400;
14
- this.height = 400;
15
- this.mpsServer = '';
16
- this.authToken = '';
17
- this.deviceId = '';
18
- this.deviceStatus = new i0.EventEmitter();
19
- this.deviceConnection = new i0.EventEmitter();
20
- this.selectedEncoding = new i0.EventEmitter();
21
- this.powerState = 0;
22
- this.selected = 1;
23
- this.mouseMove = null;
24
- this.encodings = [
25
- { value: 1, viewValue: 'RLE 8' },
26
- { value: 2, viewValue: 'RLE 16' }
27
- ];
28
- this.onConnectionStateChange = function (redirector, state) {
29
- _this.deviceStatus.emit(state);
30
- };
31
- this.reset = function () {
32
- _this.redirector = null;
33
- _this.module = null;
34
- _this.dataProcessor = null;
35
- _this.height = 400;
36
- _this.width = 400;
37
- _this.instantiate();
38
- };
39
- this.stopKvm = function () {
40
- _this.redirector.stop();
41
- _this.keyboardHelper.UnGrabKeyInput();
42
- _this.reset();
43
- };
44
- }
45
- KvmComponent.prototype.ngOnInit = function () {
46
- var _this = this;
47
- this.logger = new core.ConsoleLogger(1);
48
- this.deviceConnection.subscribe(function (data) {
49
- if (data) {
50
- _this.init();
51
- }
52
- else {
53
- _this.stopKvm();
54
- }
55
- });
56
- this.selectedEncoding.subscribe(function (data) {
57
- _this.selected = data;
58
- _this.onEncodingChange();
59
- });
60
- };
61
- KvmComponent.prototype.ngAfterViewInit = function () {
62
- this.init();
63
- };
64
- KvmComponent.prototype.instantiate = function () {
65
- var _this = this;
66
- var _a, _b;
67
- this.context = (_a = this.canvas) === null || _a === void 0 ? void 0 : _a.nativeElement.getContext('2d');
68
- this.redirector = new core.AMTKvmDataRedirector(this.logger, core.Protocol.KVM, new FileReader(), this.deviceId, 16994, '', '', 0, 0, this.authToken, this.mpsServer);
69
- this.module = new core.AMTDesktop(this.logger, this.context);
70
- this.dataProcessor = new core.DataProcessor(this.logger, this.redirector, this.module);
71
- this.mouseHelper = new core.MouseHelper(this.module, this.redirector, 200);
72
- this.keyboardHelper = new core.KeyBoardHelper(this.module, this.redirector);
73
- this.redirector.onProcessData = this.module.processData.bind(this.module);
74
- this.redirector.onStart = this.module.start.bind(this.module);
75
- this.redirector.onNewState = this.module.onStateChange.bind(this.module);
76
- this.redirector.onSendKvmData = this.module.onSendKvmData.bind(this.module);
77
- this.redirector.onStateChanged = this.onConnectionStateChange.bind(this);
78
- this.redirector.onError = this.onRedirectorError.bind(this);
79
- this.module.onSend = this.redirector.send.bind(this.redirector);
80
- this.module.onProcessData = this.dataProcessor.processData.bind(this.dataProcessor);
81
- this.module.bpp = this.selected;
82
- this.mouseMove = rxjs.fromEvent((_b = this.canvas) === null || _b === void 0 ? void 0 : _b.nativeElement, 'mousemove');
83
- this.mouseMove.pipe(operators.throttleTime(200)).subscribe(function (event) {
84
- if (_this.mouseHelper != null) {
85
- _this.mouseHelper.mousemove(event);
86
- }
87
- });
88
- };
89
- KvmComponent.prototype.onRedirectorError = function () {
90
- this.reset();
91
- };
92
- KvmComponent.prototype.init = function () {
93
- var _this = this;
94
- this.instantiate();
95
- setTimeout(function () {
96
- _this.autoConnect();
97
- }, 4000);
98
- };
99
- KvmComponent.prototype.autoConnect = function () {
100
- if (this.redirector != null) {
101
- this.redirector.start(WebSocket);
102
- this.keyboardHelper.GrabKeyInput();
103
- }
104
- };
105
- KvmComponent.prototype.onEncodingChange = function () {
106
- var _this = this;
107
- this.stopKvm();
108
- rxjs.timer(1000).subscribe(function () {
109
- _this.autoConnect();
110
- });
111
- };
112
- KvmComponent.prototype.onMouseup = function (event) {
113
- if (this.mouseHelper != null) {
114
- this.mouseHelper.mouseup(event);
115
- }
116
- };
117
- KvmComponent.prototype.onMousedown = function (event) {
118
- if (this.mouseHelper != null) {
119
- this.mouseHelper.mousedown(event);
120
- }
121
- };
122
- KvmComponent.prototype.onMousemove = function (event) {
123
- if (this.mouseHelper != null) {
124
- this.mouseHelper.mousemove(event);
125
- }
126
- };
127
- KvmComponent.prototype.ngOnDestroy = function () {
128
- this.stopKvm();
129
- };
130
- return KvmComponent;
131
- }());
132
- KvmComponent.ɵfac = function KvmComponent_Factory(t) { return new (t || KvmComponent)(); };
133
- KvmComponent.ɵcmp = i0.ɵɵdefineComponent({ type: KvmComponent, selectors: [["amt-kvm"]], viewQuery: function KvmComponent_Query(rf, ctx) {
134
- if (rf & 1) {
135
- i0.ɵɵviewQuery(_c0, 1);
136
- i0.ɵɵviewQuery(_c1, 1);
137
- }
138
- if (rf & 2) {
139
- var _t = void 0;
140
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.canvas = _t.first);
141
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.device = _t.first);
142
- }
143
- }, inputs: { width: "width", height: "height", mpsServer: "mpsServer", authToken: "authToken", deviceId: "deviceId", deviceConnection: "deviceConnection", selectedEncoding: "selectedEncoding" }, outputs: { deviceStatus: "deviceStatus" }, decls: 3, vars: 2, consts: [["oncontextmenu", "return false", 1, "canvas", 3, "width", "height", "mouseup", "mousedown", "mousemove"], ["canvas", ""]], template: function KvmComponent_Template(rf, ctx) {
144
- if (rf & 1) {
145
- i0.ɵɵelementStart(0, "div");
146
- i0.ɵɵelementStart(1, "canvas", 0, 1);
147
- i0.ɵɵlistener("mouseup", function KvmComponent_Template_canvas_mouseup_1_listener($event) { return ctx.onMouseup($event); })("mousedown", function KvmComponent_Template_canvas_mousedown_1_listener($event) { return ctx.onMousedown($event); })("mousemove", function KvmComponent_Template_canvas_mousemove_1_listener($event) { return ctx.onMousemove($event); });
148
- i0.ɵɵelementEnd();
149
- i0.ɵɵelementEnd();
150
- }
151
- if (rf & 2) {
152
- i0.ɵɵadvance(1);
153
- i0.ɵɵproperty("width", ctx.width)("height", ctx.height);
154
- }
155
- }, styles: [".canvas[_ngcontent-%COMP%]{max-height:80%;max-width:100%}"] });
156
- (function () {
157
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KvmComponent, [{
158
- type: i0.Component,
159
- args: [{
160
- selector: 'amt-kvm',
161
- templateUrl: './kvm.component.html',
162
- styleUrls: ['./kvm.component.css']
163
- }]
164
- }], function () { return []; }, { canvas: [{
165
- type: i0.ViewChild,
166
- args: ['canvas', { static: false }]
167
- }], device: [{
168
- type: i0.ViewChild,
169
- args: ['device', { static: false }]
170
- }], width: [{
171
- type: i0.Input
172
- }], height: [{
173
- type: i0.Input
174
- }], mpsServer: [{
175
- type: i0.Input
176
- }], authToken: [{
177
- type: i0.Input
178
- }], deviceId: [{
179
- type: i0.Input
180
- }], deviceStatus: [{
181
- type: i0.Output
182
- }], deviceConnection: [{
183
- type: i0.Input
184
- }], selectedEncoding: [{
185
- type: i0.Input
186
- }] });
187
- })();
188
-
189
- var KvmModule = /** @class */ (function () {
190
- function KvmModule() {
191
- }
192
- return KvmModule;
193
- }());
194
- KvmModule.ɵfac = function KvmModule_Factory(t) { return new (t || KvmModule)(); };
195
- KvmModule.ɵmod = i0.ɵɵdefineNgModule({ type: KvmModule });
196
- KvmModule.ɵinj = i0.ɵɵdefineInjector({ imports: [[
197
- http.HttpClientModule,
198
- platformBrowser.BrowserModule,
199
- ]] });
200
- (function () {
201
- (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(KvmModule, { declarations: [KvmComponent], imports: [http.HttpClientModule,
202
- platformBrowser.BrowserModule], exports: [KvmComponent] });
203
- })();
204
- (function () {
205
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KvmModule, [{
206
- type: i0.NgModule,
207
- args: [{
208
- declarations: [KvmComponent],
209
- imports: [
210
- http.HttpClientModule,
211
- platformBrowser.BrowserModule,
212
- ],
213
- exports: [KvmComponent],
214
- schemas: []
215
- }]
216
- }], null, null);
217
- })();
218
-
219
- /*
220
- * Public API Surface of kvm
221
- */
222
-
223
- /**
224
- * Generated bundle index. Do not edit.
225
- */
226
-
227
- exports.KvmComponent = KvmComponent;
228
- exports.KvmModule = KvmModule;
229
-
230
- Object.defineProperty(exports, '__esModule', { value: true });
231
-
232
- })));
233
- //# sourceMappingURL=kvm.umd.js.map
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@open-amt-cloud-toolkit/ui-toolkit/core'), require('rxjs'), require('rxjs/operators'), require('@angular/platform-browser'), require('@angular/common/http')) :
3
+ typeof define === 'function' && define.amd ? define('kvm', ['exports', '@angular/core', '@open-amt-cloud-toolkit/ui-toolkit/core', 'rxjs', 'rxjs/operators', '@angular/platform-browser', '@angular/common/http'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.kvm = {}, global.ng.core, global['@open-amt-cloud-toolkit']['ui-toolkit'].core, global.rxjs, global.rxjs.operators, global.ng.platformBrowser, global.ng.common.http));
5
+ }(this, (function (exports, i0, core, rxjs, operators, platformBrowser, http) { 'use strict';
6
+
7
+ var _c0 = ["canvas"];
8
+ var _c1 = ["device"];
9
+ var KvmComponent = /** @class */ (function () {
10
+ function KvmComponent() {
11
+ var _this = this;
12
+ // //setting a width and height for the canvas
13
+ this.width = 400;
14
+ this.height = 400;
15
+ this.mpsServer = '';
16
+ this.authToken = '';
17
+ this.deviceId = '';
18
+ this.deviceStatus = new i0.EventEmitter();
19
+ this.deviceConnection = new i0.EventEmitter();
20
+ this.selectedEncoding = new i0.EventEmitter();
21
+ this.powerState = 0;
22
+ this.selected = 1;
23
+ this.mouseMove = null;
24
+ this.encodings = [
25
+ { value: 1, viewValue: 'RLE 8' },
26
+ { value: 2, viewValue: 'RLE 16' }
27
+ ];
28
+ this.onConnectionStateChange = function (redirector, state) {
29
+ _this.deviceStatus.emit(state);
30
+ };
31
+ this.reset = function () {
32
+ _this.redirector = null;
33
+ _this.module = null;
34
+ _this.dataProcessor = null;
35
+ _this.height = 400;
36
+ _this.width = 400;
37
+ _this.instantiate();
38
+ };
39
+ this.stopKvm = function () {
40
+ _this.redirector.stop();
41
+ _this.keyboardHelper.UnGrabKeyInput();
42
+ _this.reset();
43
+ };
44
+ }
45
+ KvmComponent.prototype.ngOnInit = function () {
46
+ var _this = this;
47
+ this.logger = new core.ConsoleLogger(1);
48
+ this.deviceConnection.subscribe(function (data) {
49
+ if (data) {
50
+ _this.init();
51
+ }
52
+ else {
53
+ _this.stopKvm();
54
+ }
55
+ });
56
+ this.selectedEncoding.subscribe(function (data) {
57
+ _this.selected = data;
58
+ _this.onEncodingChange();
59
+ });
60
+ };
61
+ KvmComponent.prototype.ngAfterViewInit = function () {
62
+ this.init();
63
+ };
64
+ KvmComponent.prototype.instantiate = function () {
65
+ var _this = this;
66
+ var _a, _b;
67
+ this.context = (_a = this.canvas) === null || _a === void 0 ? void 0 : _a.nativeElement.getContext('2d');
68
+ this.redirector = new core.AMTKvmDataRedirector(this.logger, core.Protocol.KVM, new FileReader(), this.deviceId, 16994, '', '', 0, 0, this.authToken, this.mpsServer);
69
+ this.module = new core.AMTDesktop(this.logger, this.context);
70
+ this.dataProcessor = new core.DataProcessor(this.logger, this.redirector, this.module);
71
+ this.mouseHelper = new core.MouseHelper(this.module, this.redirector, 200);
72
+ this.keyboardHelper = new core.KeyBoardHelper(this.module, this.redirector);
73
+ this.redirector.onProcessData = this.module.processData.bind(this.module);
74
+ this.redirector.onStart = this.module.start.bind(this.module);
75
+ this.redirector.onNewState = this.module.onStateChange.bind(this.module);
76
+ this.redirector.onSendKvmData = this.module.onSendKvmData.bind(this.module);
77
+ this.redirector.onStateChanged = this.onConnectionStateChange.bind(this);
78
+ this.redirector.onError = this.onRedirectorError.bind(this);
79
+ this.module.onSend = this.redirector.send.bind(this.redirector);
80
+ this.module.onProcessData = this.dataProcessor.processData.bind(this.dataProcessor);
81
+ this.module.bpp = this.selected;
82
+ this.mouseMove = rxjs.fromEvent((_b = this.canvas) === null || _b === void 0 ? void 0 : _b.nativeElement, 'mousemove');
83
+ this.mouseMove.pipe(operators.throttleTime(200)).subscribe(function (event) {
84
+ if (_this.mouseHelper != null) {
85
+ _this.mouseHelper.mousemove(event);
86
+ }
87
+ });
88
+ };
89
+ KvmComponent.prototype.onRedirectorError = function () {
90
+ this.reset();
91
+ };
92
+ KvmComponent.prototype.init = function () {
93
+ var _this = this;
94
+ this.instantiate();
95
+ setTimeout(function () {
96
+ _this.autoConnect();
97
+ }, 4000);
98
+ };
99
+ KvmComponent.prototype.autoConnect = function () {
100
+ if (this.redirector != null) {
101
+ this.redirector.start(WebSocket);
102
+ this.keyboardHelper.GrabKeyInput();
103
+ }
104
+ };
105
+ KvmComponent.prototype.onEncodingChange = function () {
106
+ var _this = this;
107
+ this.stopKvm();
108
+ rxjs.timer(1000).subscribe(function () {
109
+ _this.autoConnect();
110
+ });
111
+ };
112
+ KvmComponent.prototype.onMouseup = function (event) {
113
+ if (this.mouseHelper != null) {
114
+ this.mouseHelper.mouseup(event);
115
+ }
116
+ };
117
+ KvmComponent.prototype.onMousedown = function (event) {
118
+ if (this.mouseHelper != null) {
119
+ this.mouseHelper.mousedown(event);
120
+ }
121
+ };
122
+ KvmComponent.prototype.onMousemove = function (event) {
123
+ if (this.mouseHelper != null) {
124
+ this.mouseHelper.mousemove(event);
125
+ }
126
+ };
127
+ KvmComponent.prototype.ngOnDestroy = function () {
128
+ this.stopKvm();
129
+ };
130
+ return KvmComponent;
131
+ }());
132
+ KvmComponent.ɵfac = function KvmComponent_Factory(t) { return new (t || KvmComponent)(); };
133
+ KvmComponent.ɵcmp = i0.ɵɵdefineComponent({ type: KvmComponent, selectors: [["amt-kvm"]], viewQuery: function KvmComponent_Query(rf, ctx) {
134
+ if (rf & 1) {
135
+ i0.ɵɵviewQuery(_c0, 1);
136
+ i0.ɵɵviewQuery(_c1, 1);
137
+ }
138
+ if (rf & 2) {
139
+ var _t = void 0;
140
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.canvas = _t.first);
141
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.device = _t.first);
142
+ }
143
+ }, inputs: { width: "width", height: "height", mpsServer: "mpsServer", authToken: "authToken", deviceId: "deviceId", deviceConnection: "deviceConnection", selectedEncoding: "selectedEncoding" }, outputs: { deviceStatus: "deviceStatus" }, decls: 3, vars: 2, consts: [["oncontextmenu", "return false", 1, "canvas", 3, "width", "height", "mouseup", "mousedown", "mousemove"], ["canvas", ""]], template: function KvmComponent_Template(rf, ctx) {
144
+ if (rf & 1) {
145
+ i0.ɵɵelementStart(0, "div");
146
+ i0.ɵɵelementStart(1, "canvas", 0, 1);
147
+ i0.ɵɵlistener("mouseup", function KvmComponent_Template_canvas_mouseup_1_listener($event) { return ctx.onMouseup($event); })("mousedown", function KvmComponent_Template_canvas_mousedown_1_listener($event) { return ctx.onMousedown($event); })("mousemove", function KvmComponent_Template_canvas_mousemove_1_listener($event) { return ctx.onMousemove($event); });
148
+ i0.ɵɵelementEnd();
149
+ i0.ɵɵelementEnd();
150
+ }
151
+ if (rf & 2) {
152
+ i0.ɵɵadvance(1);
153
+ i0.ɵɵproperty("width", ctx.width)("height", ctx.height);
154
+ }
155
+ }, styles: [".canvas[_ngcontent-%COMP%]{max-height:80%;max-width:100%}"] });
156
+ (function () {
157
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KvmComponent, [{
158
+ type: i0.Component,
159
+ args: [{
160
+ selector: 'amt-kvm',
161
+ templateUrl: './kvm.component.html',
162
+ styleUrls: ['./kvm.component.css']
163
+ }]
164
+ }], function () { return []; }, { canvas: [{
165
+ type: i0.ViewChild,
166
+ args: ['canvas', { static: false }]
167
+ }], device: [{
168
+ type: i0.ViewChild,
169
+ args: ['device', { static: false }]
170
+ }], width: [{
171
+ type: i0.Input
172
+ }], height: [{
173
+ type: i0.Input
174
+ }], mpsServer: [{
175
+ type: i0.Input
176
+ }], authToken: [{
177
+ type: i0.Input
178
+ }], deviceId: [{
179
+ type: i0.Input
180
+ }], deviceStatus: [{
181
+ type: i0.Output
182
+ }], deviceConnection: [{
183
+ type: i0.Input
184
+ }], selectedEncoding: [{
185
+ type: i0.Input
186
+ }] });
187
+ })();
188
+
189
+ var KvmModule = /** @class */ (function () {
190
+ function KvmModule() {
191
+ }
192
+ return KvmModule;
193
+ }());
194
+ KvmModule.ɵfac = function KvmModule_Factory(t) { return new (t || KvmModule)(); };
195
+ KvmModule.ɵmod = i0.ɵɵdefineNgModule({ type: KvmModule });
196
+ KvmModule.ɵinj = i0.ɵɵdefineInjector({ imports: [[
197
+ http.HttpClientModule,
198
+ platformBrowser.BrowserModule,
199
+ ]] });
200
+ (function () {
201
+ (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(KvmModule, { declarations: [KvmComponent], imports: [http.HttpClientModule,
202
+ platformBrowser.BrowserModule], exports: [KvmComponent] });
203
+ })();
204
+ (function () {
205
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KvmModule, [{
206
+ type: i0.NgModule,
207
+ args: [{
208
+ declarations: [KvmComponent],
209
+ imports: [
210
+ http.HttpClientModule,
211
+ platformBrowser.BrowserModule,
212
+ ],
213
+ exports: [KvmComponent],
214
+ schemas: []
215
+ }]
216
+ }], null, null);
217
+ })();
218
+
219
+ /*
220
+ * Public API Surface of kvm
221
+ */
222
+
223
+ /**
224
+ * Generated bundle index. Do not edit.
225
+ */
226
+
227
+ exports.KvmComponent = KvmComponent;
228
+ exports.KvmModule = KvmModule;
229
+
230
+ Object.defineProperty(exports, '__esModule', { value: true });
231
+
232
+ })));
233
+ //# sourceMappingURL=kvm.umd.js.map
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@open-amt-cloud-toolkit/ui-toolkit/core"),require("rxjs"),require("rxjs/operators"),require("@angular/platform-browser"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("kvm",["exports","@angular/core","@open-amt-cloud-toolkit/ui-toolkit/core","rxjs","rxjs/operators","@angular/platform-browser","@angular/common/http"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).kvm={},e.ng.core,e["@open-amt-cloud-toolkit"]["ui-toolkit"].core,e.rxjs,e.rxjs.operators,e.ng.platformBrowser,e.ng.common.http)}(this,(function(e,t,o,n,i,r,s){"use strict";var u=["canvas"],d=["device"],a=function(){function e(){var e=this;this.width=400,this.height=400,this.mpsServer="",this.authToken="",this.deviceId="",this.deviceStatus=new t.EventEmitter,this.deviceConnection=new t.EventEmitter,this.selectedEncoding=new t.EventEmitter,this.powerState=0,this.selected=1,this.mouseMove=null,this.encodings=[{value:1,viewValue:"RLE 8"},{value:2,viewValue:"RLE 16"}],this.onConnectionStateChange=function(t,o){e.deviceStatus.emit(o)},this.reset=function(){e.redirector=null,e.module=null,e.dataProcessor=null,e.height=400,e.width=400,e.instantiate()},this.stopKvm=function(){e.redirector.stop(),e.keyboardHelper.UnGrabKeyInput(),e.reset()}}return e.prototype.ngOnInit=function(){var e=this;this.logger=new o.ConsoleLogger(1),this.deviceConnection.subscribe((function(t){t?e.init():e.stopKvm()})),this.selectedEncoding.subscribe((function(t){e.selected=t,e.onEncodingChange()}))},e.prototype.ngAfterViewInit=function(){this.init()},e.prototype.instantiate=function(){var e,t,r=this;this.context=null===(e=this.canvas)||void 0===e?void 0:e.nativeElement.getContext("2d"),this.redirector=new o.AMTKvmDataRedirector(this.logger,o.Protocol.KVM,new FileReader,this.deviceId,16994,"","",0,0,this.authToken,this.mpsServer),this.module=new o.AMTDesktop(this.logger,this.context),this.dataProcessor=new o.DataProcessor(this.logger,this.redirector,this.module),this.mouseHelper=new o.MouseHelper(this.module,this.redirector,200),this.keyboardHelper=new o.KeyBoardHelper(this.module,this.redirector),this.redirector.onProcessData=this.module.processData.bind(this.module),this.redirector.onStart=this.module.start.bind(this.module),this.redirector.onNewState=this.module.onStateChange.bind(this.module),this.redirector.onSendKvmData=this.module.onSendKvmData.bind(this.module),this.redirector.onStateChanged=this.onConnectionStateChange.bind(this),this.redirector.onError=this.onRedirectorError.bind(this),this.module.onSend=this.redirector.send.bind(this.redirector),this.module.onProcessData=this.dataProcessor.processData.bind(this.dataProcessor),this.module.bpp=this.selected,this.mouseMove=n.fromEvent(null===(t=this.canvas)||void 0===t?void 0:t.nativeElement,"mousemove"),this.mouseMove.pipe(i.throttleTime(200)).subscribe((function(e){null!=r.mouseHelper&&r.mouseHelper.mousemove(e)}))},e.prototype.onRedirectorError=function(){this.reset()},e.prototype.init=function(){var e=this;this.instantiate(),setTimeout((function(){e.autoConnect()}),4e3)},e.prototype.autoConnect=function(){null!=this.redirector&&(this.redirector.start(WebSocket),this.keyboardHelper.GrabKeyInput())},e.prototype.onEncodingChange=function(){var e=this;this.stopKvm(),n.timer(1e3).subscribe((function(){e.autoConnect()}))},e.prototype.onMouseup=function(e){null!=this.mouseHelper&&this.mouseHelper.mouseup(e)},e.prototype.onMousedown=function(e){null!=this.mouseHelper&&this.mouseHelper.mousedown(e)},e.prototype.onMousemove=function(e){null!=this.mouseHelper&&this.mouseHelper.mousemove(e)},e.prototype.ngOnDestroy=function(){this.stopKvm()},e}();a.ɵfac=function(e){return new(e||a)},a.ɵcmp=t.ɵɵdefineComponent({type:a,selectors:[["amt-kvm"]],viewQuery:function(e,o){if(1&e&&(t.ɵɵviewQuery(u,1),t.ɵɵviewQuery(d,1)),2&e){var n=void 0;t.ɵɵqueryRefresh(n=t.ɵɵloadQuery())&&(o.canvas=n.first),t.ɵɵqueryRefresh(n=t.ɵɵloadQuery())&&(o.device=n.first)}},inputs:{width:"width",height:"height",mpsServer:"mpsServer",authToken:"authToken",deviceId:"deviceId",deviceConnection:"deviceConnection",selectedEncoding:"selectedEncoding"},outputs:{deviceStatus:"deviceStatus"},decls:3,vars:2,consts:[["oncontextmenu","return false",1,"canvas",3,"width","height","mouseup","mousedown","mousemove"],["canvas",""]],template:function(e,o){1&e&&(t.ɵɵelementStart(0,"div"),t.ɵɵelementStart(1,"canvas",0,1),t.ɵɵlistener("mouseup",(function(e){return o.onMouseup(e)}))("mousedown",(function(e){return o.onMousedown(e)}))("mousemove",(function(e){return o.onMousemove(e)})),t.ɵɵelementEnd(),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(1),t.ɵɵproperty("width",o.width)("height",o.height))},styles:[".canvas[_ngcontent-%COMP%]{max-height:80%;max-width:100%}"]}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(a,[{type:t.Component,args:[{selector:"amt-kvm",templateUrl:"./kvm.component.html",styleUrls:["./kvm.component.css"]}]}],(function(){return[]}),{canvas:[{type:t.ViewChild,args:["canvas",{static:!1}]}],device:[{type:t.ViewChild,args:["device",{static:!1}]}],width:[{type:t.Input}],height:[{type:t.Input}],mpsServer:[{type:t.Input}],authToken:[{type:t.Input}],deviceId:[{type:t.Input}],deviceStatus:[{type:t.Output}],deviceConnection:[{type:t.Input}],selectedEncoding:[{type:t.Input}]});var c=function(){};c.ɵfac=function(e){return new(e||c)},c.ɵmod=t.ɵɵdefineNgModule({type:c}),c.ɵinj=t.ɵɵdefineInjector({imports:[[s.HttpClientModule,r.BrowserModule]]}),("undefined"==typeof ngJitMode||ngJitMode)&&t.ɵɵsetNgModuleScope(c,{declarations:[a],imports:[s.HttpClientModule,r.BrowserModule],exports:[a]}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(c,[{type:t.NgModule,args:[{declarations:[a],imports:[s.HttpClientModule,r.BrowserModule],exports:[a],schemas:[]}]}],null,null),e.KvmComponent=a,e.KvmModule=c,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@open-amt-cloud-toolkit/ui-toolkit/core"),require("rxjs"),require("rxjs/operators"),require("@angular/platform-browser"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("kvm",["exports","@angular/core","@open-amt-cloud-toolkit/ui-toolkit/core","rxjs","rxjs/operators","@angular/platform-browser","@angular/common/http"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).kvm={},e.ng.core,e["@open-amt-cloud-toolkit"]["ui-toolkit"].core,e.rxjs,e.rxjs.operators,e.ng.platformBrowser,e.ng.common.http)}(this,(function(e,t,o,n,i,r,s){"use strict";var u=["canvas"],d=["device"],a=function(){function e(){var e=this;this.width=400,this.height=400,this.mpsServer="",this.authToken="",this.deviceId="",this.deviceStatus=new t.EventEmitter,this.deviceConnection=new t.EventEmitter,this.selectedEncoding=new t.EventEmitter,this.powerState=0,this.selected=1,this.mouseMove=null,this.encodings=[{value:1,viewValue:"RLE 8"},{value:2,viewValue:"RLE 16"}],this.onConnectionStateChange=function(t,o){e.deviceStatus.emit(o)},this.reset=function(){e.redirector=null,e.module=null,e.dataProcessor=null,e.height=400,e.width=400,e.instantiate()},this.stopKvm=function(){e.redirector.stop(),e.keyboardHelper.UnGrabKeyInput(),e.reset()}}return e.prototype.ngOnInit=function(){var e=this;this.logger=new o.ConsoleLogger(1),this.deviceConnection.subscribe((function(t){t?e.init():e.stopKvm()})),this.selectedEncoding.subscribe((function(t){e.selected=t,e.onEncodingChange()}))},e.prototype.ngAfterViewInit=function(){this.init()},e.prototype.instantiate=function(){var e,t,r=this;this.context=null===(e=this.canvas)||void 0===e?void 0:e.nativeElement.getContext("2d"),this.redirector=new o.AMTKvmDataRedirector(this.logger,o.Protocol.KVM,new FileReader,this.deviceId,16994,"","",0,0,this.authToken,this.mpsServer),this.module=new o.AMTDesktop(this.logger,this.context),this.dataProcessor=new o.DataProcessor(this.logger,this.redirector,this.module),this.mouseHelper=new o.MouseHelper(this.module,this.redirector,200),this.keyboardHelper=new o.KeyBoardHelper(this.module,this.redirector),this.redirector.onProcessData=this.module.processData.bind(this.module),this.redirector.onStart=this.module.start.bind(this.module),this.redirector.onNewState=this.module.onStateChange.bind(this.module),this.redirector.onSendKvmData=this.module.onSendKvmData.bind(this.module),this.redirector.onStateChanged=this.onConnectionStateChange.bind(this),this.redirector.onError=this.onRedirectorError.bind(this),this.module.onSend=this.redirector.send.bind(this.redirector),this.module.onProcessData=this.dataProcessor.processData.bind(this.dataProcessor),this.module.bpp=this.selected,this.mouseMove=n.fromEvent(null===(t=this.canvas)||void 0===t?void 0:t.nativeElement,"mousemove"),this.mouseMove.pipe(i.throttleTime(200)).subscribe((function(e){null!=r.mouseHelper&&r.mouseHelper.mousemove(e)}))},e.prototype.onRedirectorError=function(){this.reset()},e.prototype.init=function(){var e=this;this.instantiate(),setTimeout((function(){e.autoConnect()}),4e3)},e.prototype.autoConnect=function(){null!=this.redirector&&(this.redirector.start(WebSocket),this.keyboardHelper.GrabKeyInput())},e.prototype.onEncodingChange=function(){var e=this;this.stopKvm(),n.timer(1e3).subscribe((function(){e.autoConnect()}))},e.prototype.onMouseup=function(e){null!=this.mouseHelper&&this.mouseHelper.mouseup(e)},e.prototype.onMousedown=function(e){null!=this.mouseHelper&&this.mouseHelper.mousedown(e)},e.prototype.onMousemove=function(e){null!=this.mouseHelper&&this.mouseHelper.mousemove(e)},e.prototype.ngOnDestroy=function(){this.stopKvm()},e}();a.ɵfac=function(e){return new(e||a)},a.ɵcmp=t.ɵɵdefineComponent({type:a,selectors:[["amt-kvm"]],viewQuery:function(e,o){if(1&e&&(t.ɵɵviewQuery(u,1),t.ɵɵviewQuery(d,1)),2&e){var n=void 0;t.ɵɵqueryRefresh(n=t.ɵɵloadQuery())&&(o.canvas=n.first),t.ɵɵqueryRefresh(n=t.ɵɵloadQuery())&&(o.device=n.first)}},inputs:{width:"width",height:"height",mpsServer:"mpsServer",authToken:"authToken",deviceId:"deviceId",deviceConnection:"deviceConnection",selectedEncoding:"selectedEncoding"},outputs:{deviceStatus:"deviceStatus"},decls:3,vars:2,consts:[["oncontextmenu","return false",1,"canvas",3,"width","height","mouseup","mousedown","mousemove"],["canvas",""]],template:function(e,o){1&e&&(t.ɵɵelementStart(0,"div"),t.ɵɵelementStart(1,"canvas",0,1),t.ɵɵlistener("mouseup",(function(e){return o.onMouseup(e)}))("mousedown",(function(e){return o.onMousedown(e)}))("mousemove",(function(e){return o.onMousemove(e)})),t.ɵɵelementEnd(),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(1),t.ɵɵproperty("width",o.width)("height",o.height))},styles:[".canvas[_ngcontent-%COMP%]{max-height:80%;max-width:100%}"]}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(a,[{type:t.Component,args:[{selector:"amt-kvm",templateUrl:"./kvm.component.html",styleUrls:["./kvm.component.css"]}]}],(function(){return[]}),{canvas:[{type:t.ViewChild,args:["canvas",{static:!1}]}],device:[{type:t.ViewChild,args:["device",{static:!1}]}],width:[{type:t.Input}],height:[{type:t.Input}],mpsServer:[{type:t.Input}],authToken:[{type:t.Input}],deviceId:[{type:t.Input}],deviceStatus:[{type:t.Output}],deviceConnection:[{type:t.Input}],selectedEncoding:[{type:t.Input}]});var c=function(){};c.ɵfac=function(e){return new(e||c)},c.ɵmod=t.ɵɵdefineNgModule({type:c}),c.ɵinj=t.ɵɵdefineInjector({imports:[[s.HttpClientModule,r.BrowserModule]]}),("undefined"==typeof ngJitMode||ngJitMode)&&t.ɵɵsetNgModuleScope(c,{declarations:[a],imports:[s.HttpClientModule,r.BrowserModule],exports:[a]}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(c,[{type:t.NgModule,args:[{declarations:[a],imports:[s.HttpClientModule,r.BrowserModule],exports:[a],schemas:[]}]}],null,null),e.KvmComponent=a,e.KvmModule=c,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=kvm.umd.min.js.map
@@ -1,5 +1,5 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public-api';
5
5
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia3ZtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMva3ZtL3NyYy9rdm0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==