@c8y/ng1-modules 1018.38.0 → 1018.47.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/NOTICES CHANGED
@@ -41494,6 +41494,30 @@ THE SOFTWARE.
41494
41494
 
41495
41495
  -----
41496
41496
 
41497
+ The following software may be included in this product: xterm-addon-fit. A copy of the source code may be downloaded from https://github.com/xtermjs/xterm.js. This software contains the following license and notice below:
41498
+
41499
+ Copyright (c) 2019, The xterm.js authors (https://github.com/xtermjs/xterm.js)
41500
+
41501
+ Permission is hereby granted, free of charge, to any person obtaining a copy
41502
+ of this software and associated documentation files (the "Software"), to deal
41503
+ in the Software without restriction, including without limitation the rights
41504
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
41505
+ copies of the Software, and to permit persons to whom the Software is
41506
+ furnished to do so, subject to the following conditions:
41507
+
41508
+ The above copyright notice and this permission notice shall be included in
41509
+ all copies or substantial portions of the Software.
41510
+
41511
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41512
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41513
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41514
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41515
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
41516
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
41517
+ THE SOFTWARE.
41518
+
41519
+ -----
41520
+
41497
41521
  The following software may be included in this product: xxhashjs. A copy of the source code may be downloaded from https://github.com/pierrec/js-xxhash. This software contains the following license and notice below:
41498
41522
 
41499
41523
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1 +1 @@
1
- "use strict";!function(){function t(c){t.$inject=["$injector","c8yModal"];var i,a=new WeakMap,f={},u={},p={};function s(t,e,r){var o=f[t],n=_.isArray(e)?e:e.$inject;void 0===n&&(n=c.annotate(e));var i=_.includes(n,"config");if(o)throw new Error('Computed property "'.concat(t,'" already registered'));if(i){if(p[t])throw new Error('Computed property factory "'.concat(t,'" already registered'));p[t]={config:r,property:e}}f[t]={config:r,property:e}}function e(o,t){var n=p[t];if(!n)throw new Error('Computed property factory "'.concat(t,'" is not registered'));return{create:function(t,e){if(u[t])throw new Error('Computed property "'.concat(t,'" already registered'));return u[t]={getter:o.invoke(n.property,void 0,{config:e}),config:n.config},!0},attach:function(t,e,r){d(t,e,{getter:o.invoke(n.property,void 0,{config:r})})}}}function r(r){_.forEach(f,function(e,t){u[t]||(u[t]={_lazy:!0,getter:function(){var t=this._getter;return t||(this._getter=r.invoke(e.property,void 0,{config:!1}),t=this._getter),t},config:e.config})})}function g(t,e){if(_.isArray(e))return function(e,t){var c=_.keys(p),a=_.union(_.keys(u),c);_(t).filter("computed").map(function(t){var e=_.last(t.id.split("!!")),r=(t.config||{})._id||String(Math.random()).substr(2),o=t.config||{},n=_.includes(a,e),i=e+(_.includes(c,e)?"_".concat(r):"");return(t.config=o)._id=r,n&&(t.keyPath=[i]),{key:e,keyPath:i,isFactory:_.includes(c,e),config:o,exists:n}}).filter("exists").forEach(function(t){t.isFactory?i(t.key).attach(e,t.keyPath,t.config):g(e,t.key)})}(t,e),t;var r=e;if(r){var o=u[r];if(!o)throw new Error('Computed property "'.concat(r,'" is not registered.'));d(t,r,o)}else!function(i){_.forEach(u,function(e,r){var t=function(t){return t&&d(i,r,e)},o=(e.config||{}).attachIf,n=(o=o||_.constant(!0))(i);_.isFunction(_.get(n,"then"))?n.then(t):t(n)})}(t);return t}function d(t,e,r){if(_.isObjectLike(t)){if(!_.has(t,e)){var o=r._lazy?r.getter():r.getter,n=o.detach||_.noop,i=a.get(t);i||(i=[],a.set(t,i)),i.push(function(t){n(t),delete t[e]}),Object.defineProperty(t,e,{enumerable:!1,configurable:!0,get:function(){return o(this)}})}}else console.warn("[Computed properties] Managed object is not an object")}function l(e){var r=this,t=a.get(e);_.forEach(t,function(t){try{t.call(r,e)}catch(t){console.error("Error detaching computed property",t)}}),a.delete(e)}function t(t,n){var o=_.partial(r,t);return{register:function(t,e,r){s(t,e,r),o()},attach:g,detach:l,factory:i=_.partial(e,t),init:o,edit:function(t){var e=_.last(t.id.split("!!")),r=p[e];if(!r)throw new Error("".concat(e," is not a factory computed property."));var o=_.get(r,"config.configTemplateUrl");return n({templateUrl:":::PLUGIN_PATH:::/ui/properties/computedPropertyConfigModal.html",controller:"ComputedPropertyConfigCtrl",size:"lg",resolve:{options:function(){return{configTemplateUrl:o,computedProperty:e,configSchema:_.isObjectLike(t.configSchema)&&t.configSchema,config:angular.copy(t.config)||{},prop:t}}}})},listFactories:function(){return _.map(p,function(t,e){return{id:e,config:_.clone(t.config)}})}}}return{register:s,$get:t}}function e(t){t.init()}e.$inject=["c8yComputedProperties"],t.$inject=["$injector"],angular.module("c8y.ui").provider("c8yComputedProperties",t).run(e)}();
1
+ "use strict";!function(){function t(c){t.$inject=["$injector","c8yModal"];var i,a=new WeakMap,f={},u={},p={};function s(t,e,r){var o=f[t],n=_.isArray(e)?e:e.$inject;void 0===n&&(n=c.annotate(e));var i=_.includes(n,"config");if(o)throw new Error('Computed property "'.concat(t,'" already registered'));if(i){if(p[t])throw new Error('Computed property factory "'.concat(t,'" already registered'));p[t]={config:r,property:e}}f[t]={config:r,property:e}}function e(o,t){var n=p[t];if(!n)throw new Error('Computed property factory "'.concat(t,'" is not registered'));return{create:function(t,e){if(u[t])throw new Error('Computed property "'.concat(t,'" already registered'));return u[t]={getter:o.invoke(n.property,void 0,{config:e}),config:n.config},!0},attach:function(t,e,r){d(t,e,{getter:o.invoke(n.property,void 0,{config:r})})}}}function r(r){_.forEach(f,function(e,t){u[t]||(u[t]={_lazy:!0,getter:function(){var t=this._getter;return t||(this._getter=r.invoke(e.property,void 0,{config:!1}),t=this._getter),t},config:e.config})})}function g(t,e){if(_.isArray(e))return function(e,t){var c=_.keys(p),a=_.union(_.keys(u),c);_(t).filter("computed").map(function(t){var e=_.last(t.id.split("!!")),r=(t.config||{})._id||String(Math.random()).substr(2),o=t.config||{},n=_.includes(a,e),i=e+(_.includes(c,e)?"_".concat(r):"");return(t.config=o)._id=r,n&&(t.keyPath=[i]),{key:e,keyPath:i,isFactory:_.includes(c,e),config:o,exists:n}}).filter("exists").forEach(function(t){t.isFactory?i(t.key).attach(e,t.keyPath,t.config):g(e,t.key)})}(t,e),t;var r=e;if(r){var o=u[r];if(!o)throw new Error('Computed property "'.concat(r,'" is not registered.'));d(t,r,o)}else!function(i){_.forEach(u,function(e,r){var t=function(t){return t&&d(i,r,e)},o=(e.config||{}).attachIf,n=(o=o||_.constant(!0))(i);_.isFunction(_.get(n,"then"))?n.then(t):t(n)})}(t);return t}function d(t,e,r){if(_.isObjectLike(t)){if(!_.has(t,e)){var o=r._lazy?r.getter():r.getter,n=o.detach||_.noop,i=a.get(t);i||(i=[],a.set(t,i)),i.push(function(t){n(t),delete t[e]}),Object.defineProperty(t,e,{enumerable:!1,configurable:!0,get:function(){return o(this)}})}}else console.warn("[Computed properties] Managed object is not an object")}function l(e){var r=this,t=a.get(e);_.forEach(t,function(t){try{t.call(r,e)}catch(t){console.error("Error detaching computed property",t)}}),a.delete(e)}function t(t,n){var o=_.partial(r,t);return{register:function(t,e,r){s(t,e,r),o()},attach:g,detach:l,factory:i=_.partial(e,t),init:o,edit:function(t){var e=_.last(t.id.split("!!")),r=p[e];if(!r)throw new Error("".concat(e," is not a factory computed property."));var o=_.get(r,"config.configTemplateUrl");return n({templateUrl:":::PLUGIN_PATH:::/ui/properties/computedPropertyConfigModal.html",controller:"ComputedPropertyConfigCtrl",size:"sm",resolve:{options:function(){return{configTemplateUrl:o,computedProperty:e,configSchema:_.isObjectLike(t.configSchema)&&t.configSchema,config:angular.copy(t.config)||{},prop:t}}}})},listFactories:function(){return _.map(p,function(t,e){return{id:e,config:_.clone(t.config)}})}}}return{register:s,$get:t}}function e(t){t.init()}e.$inject=["c8yComputedProperties"],t.$inject=["$injector"],angular.module("c8y.ui").provider("c8yComputedProperties",t).run(e)}();
@@ -1,38 +1,43 @@
1
- <div class="modal-header">
2
- <h3 id="modal-title" translate>Computed property configuration</h3>
3
- </div>
4
- <div class="modal-body" id="modal-body">
5
- <h4>
1
+ <div class="c8y-viewport-modal">
2
+ <div class="modal-header dialog-header">
6
3
  <i c8y-icon="bolt"></i>
7
- {{ computedProperty }}
8
- </h4>
4
+ <div id="modal-title-property" class="h4" translate>Computed property configuration</div>
5
+ </div>
6
+ <div class="modal-inner-scroll">
7
+ <p class="text-center bg-level-0 text-medium text-16 p-t-16 p-b-16 sticky-top separator-bottom"
8
+ style="z-index: 110;">
9
+ {{ computedProperty}}
10
+ </p>
11
+ <div class="modal-body no-card-context p-t-16" id="modal-body-property">
9
12
 
10
- <form name="configForm" novalidate>
11
- <div ng-if="configTemplateUrl" ng-include="configTemplateUrl"></div>
12
- <c8y-schema-form
13
- ng-if="configSchema"
14
- schema="configSchema"
15
- form="['*']"
16
- model="config"
17
- ></c8y-schema-form>
18
- </form>
19
- </div>
20
- <div class="modal-footer">
21
- <button
22
- title="{{ 'Cancel' | translate }}"
23
- type="button"
24
- class="btn btn-default"
25
- ng-click="$dismiss()"
26
- >
27
- {{ 'Cancel' | translate }}
28
- </button>
29
- <button
30
- title="{{ 'Save' | translate }}"
31
- type="button"
32
- class="btn btn-primary"
33
- ng-click="$close(config)"
34
- ng-disabled="configForm.$invalid"
35
- >
36
- {{ 'Save' | translate }}
37
- </button>
13
+ <form name="configForm" novalidate>
14
+ <div ng-if="configTemplateUrl" ng-include="configTemplateUrl"></div>
15
+ <c8y-schema-form
16
+ ng-if="configSchema"
17
+ schema="configSchema"
18
+ form="['*']"
19
+ model="config"
20
+ ></c8y-schema-form>
21
+ </form>
22
+ </div>
23
+ </div>
24
+ <div class="modal-footer">
25
+ <button
26
+ class="btn btn-default"
27
+ type="button"
28
+ title="{{ 'Cancel' | translate }}"
29
+ ng-click="$dismiss()"
30
+ >
31
+ {{ 'Cancel' | translate }}
32
+ </button>
33
+ <button
34
+ class="btn btn-primary"
35
+ type="button"
36
+ title="{{ 'Save' | translate }}"
37
+ ng-click="$close(config)"
38
+ ng-disabled="configForm.$invalid"
39
+ >
40
+ {{ 'Save' | translate }}
41
+ </button>
42
+ </div>
38
43
  </div>
@@ -22,13 +22,14 @@
22
22
 
23
23
  <div class="form-group">
24
24
  <label for="returnTypeField" translate>Return type</label>
25
- <select
26
- id="returnTypeField"
27
- class="form-control"
28
- ng-model="config.resultType"
29
- ng-options="resultType.value as (resultType.label | translate) for resultType in resultTypes.values()"
30
- >
31
- </select>
25
+ <div class="c8y-select-wrapper">
26
+ <select
27
+ id="returnTypeField"
28
+ class="form-control"
29
+ ng-model="config.resultType"
30
+ ng-options="resultType.value as (resultType.label | translate) for resultType in resultTypes.values()"
31
+ ></select>
32
+ </div>
32
33
  </div>
33
34
  </ng-form>
34
35
  </div>
@@ -6,18 +6,18 @@
6
6
  <div class="form-group m-16">
7
7
  <div class="input-group input-group-search">
8
8
  <input
9
- type="search"
10
9
  class="form-control"
11
- placeholder="{{ 'Filter properties' | translate }}"
10
+ type="search"
12
11
  ng-model="search"
12
+ placeholder="{{ 'Filter properties' | translate }}"
13
13
  />
14
14
  <span class="input-group-addon">
15
15
  <i c8y-icon="search" ng-show="search.length === 0 || !search"></i>
16
16
  <i
17
17
  c8y-icon="times"
18
18
  class="text-muted"
19
- ng-show="search.length > 0"
20
19
  ng-click="search = ''"
20
+ ng-show="search.length > 0"
21
21
  ></i>
22
22
  </span>
23
23
  </div>
@@ -39,8 +39,8 @@
39
39
 
40
40
  <div
41
41
  class="modal-inner-scroll container-fluid"
42
- id="modal-body"
43
42
  style="max-height: calc(100vh - 340px)"
43
+ id="modal-body"
44
44
  >
45
45
  <div class="row">
46
46
  <div
@@ -49,21 +49,24 @@
49
49
  >
50
50
  <div class="col-xs-2">
51
51
  <span ng-switch="selectSingle">
52
- <label ng-switch-when="true" class="c8y-radio">
52
+ <label class="c8y-radio" ng-switch-when="true">
53
53
  <input
54
- name="property"
55
54
  type="radio"
55
+ aria-label="{{ property.label }}"
56
+ id="radio-{{ property.keyPath.join('.') }}"
57
+ name="property"
56
58
  ng-model="properties.selected"
57
59
  ng-value="property"
58
60
  />
59
61
  <span></span>
60
62
  </label>
61
- <label ng-switch-default class="c8y-checkbox">
63
+ <label class="c8y-checkbox" ng-switch-default>
62
64
  <input
63
65
  type="checkbox"
64
- ng-model="property.__active"
66
+ aria-label="{{ property.label }}"
67
+ id="checkbox-{{ property.keyPath.join('.') }}"
65
68
  ng-change="onSelectProperty(property)"
66
- aria-label="{{ 'Complex property' | translate }}"
69
+ ng-model="property.__active"
67
70
  />
68
71
  <span></span>
69
72
  </label>
@@ -71,22 +74,22 @@
71
74
  </div>
72
75
  <div
73
76
  class="col-xs-5 text-truncate"
74
- title="{{ property.label | translate }}"
75
77
  ng-class="{ strong: isComplexProperty(property) }"
78
+ title="{{ property.label | translate }}"
76
79
  >
77
80
  <span>
78
81
  <button
79
82
  class="btn btn-dot"
80
83
  type="button"
81
- aria-label="{{
82
- 'Complex property. Subproperties are listed below.`tooltip`' | translate
83
- }}"
84
84
  uib-tooltip="{{
85
85
  'Complex property. Subproperties are listed below.`tooltip`' | translate
86
86
  }}"
87
+ tooltip-append-to-body="true"
87
88
  tooltip-placement="right"
88
89
  tooltip-popup-delay="500"
89
- tooltip-append-to-body="true"
90
+ aria-label="{{
91
+ 'Complex property. Subproperties are listed below.`tooltip`' | translate
92
+ }}"
90
93
  ng-if="isComplexProperty(property) && isAtLeastOneSubpropertyListed(property)"
91
94
  >
92
95
  <i c8y-icon="tags" class="text-info"></i>
@@ -94,25 +97,25 @@
94
97
  <button
95
98
  class="btn btn-dot"
96
99
  type="button"
97
- aria-label="{{ 'Complex property.`tooltip`' | translate }}"
98
100
  uib-tooltip="{{ 'Complex property.`tooltip`' | translate }}"
99
- tooltip-placement="right"
100
101
  tooltip-append-to-body="true"
102
+ tooltip-placement="right"
103
+ aria-label="{{ 'Complex property.`tooltip`' | translate }}"
101
104
  ng-if="isComplexProperty(property) && !isAtLeastOneSubpropertyListed(property)"
102
105
  >
103
- <i class="text-info" c8y-icon="tag"></i>
106
+ <i c8y-icon="tag" class="text-info"></i>
104
107
  </button>
105
108
  <button
106
109
  class="btn btn-dot"
107
110
  type="button"
108
- aria-label="{{ 'Computed property.`tooltip`' | translate }}"
109
111
  uib-tooltip="{{ 'Computed property.`tooltip`' | translate }}"
112
+ tooltip-append-to-body="true"
110
113
  tooltip-placement="right"
111
114
  tooltip-popup-delay="500"
112
- tooltip-append-to-body="true"
115
+ aria-label="{{ 'Computed property.`tooltip`' | translate }}"
113
116
  ng-show="property.computed"
114
117
  >
115
- <i class="text-primary-light" c8y-icon="bolt"></i>
118
+ <i c8y-icon="bolt" class="text-primary-light"></i>
116
119
  </button>
117
120
  </span>
118
121
  {{ property.label | translate }}
@@ -137,8 +140,8 @@
137
140
  class="btn btn-primary"
138
141
  type="button"
139
142
  title="{{ 'Select' | translate }}"
140
- ng-disabled="selectIsDisabled()"
141
143
  ng-click="close()"
144
+ ng-disabled="selectIsDisabled()"
142
145
  >
143
146
  {{ 'Select' | translate }}
144
147
  </button>
@@ -2,7 +2,7 @@
2
2
  ng-controller="DataPointWidgetConfigCtrl"
3
3
  ng-init="disableLocalStorage = true"
4
4
  class="row no-card-context d-flex"
5
- style="height: calc(100vh - 406px);"
5
+ style="height: calc(100vh - 422px);"
6
6
  >
7
7
  <div class="col-md-5 bg-level-1 a-s-stretch inner-scroll">
8
8
  <div class="p-l-24 bg-inherit p-t-8">
@@ -2,7 +2,7 @@
2
2
  ng-controller="DataPointWidgetConfigCtrl"
3
3
  ng-init="disableLocalStorage = true"
4
4
  class="row no-card-context d-flex"
5
- style="height: calc(100vh - 406px);"
5
+ style="height: calc(100vh - 422px);"
6
6
  >
7
7
  <div class="col-md-5 bg-level-1 a-s-stretch inner-scroll">
8
8
  <div class="p-l-24 bg-inherit p-t-8">
@@ -2,7 +2,7 @@
2
2
  <div
3
3
  ng-controller="listConfigCtrl"
4
4
  class="no-card-context row m-l-0 m-r-0"
5
- style="height: calc(100vh - 406px)"
5
+ style="height: calc(100vh - 422px)"
6
6
  >
7
7
  <div class="col-md-6 p-l-24 inner-scroll bg-level-1">
8
8
  <c8y-data-point-list
@@ -19,32 +19,50 @@
19
19
  </div>
20
20
  <div class="form-group p-t-8">
21
21
  <label class="c8y-checkbox">
22
- <input type="checkbox" ng-model="config.options.kpi" />
22
+ <input
23
+ type="checkbox"
24
+ ng-model="config.options.kpi"
25
+ />
23
26
  <span></span>
24
27
  <span>{{ 'Label' | translate }}</span>
25
28
  </label>
26
29
  <label class="c8y-checkbox">
27
- <input type="checkbox" ng-model="config.options.target" />
30
+ <input
31
+ type="checkbox"
32
+ ng-model="config.options.target"
33
+ />
28
34
  <span></span>
29
35
  <span>{{ 'Target' | translate }}</span>
30
36
  </label>
31
37
  <label class="c8y-checkbox">
32
- <input type="checkbox" ng-model="config.options.current" />
38
+ <input
39
+ type="checkbox"
40
+ ng-model="config.options.current"
41
+ />
33
42
  <span></span>
34
43
  <span>{{ 'Current' | translate }}</span>
35
44
  </label>
36
45
  <label class="c8y-checkbox">
37
- <input type="checkbox" ng-model="config.options.diff" />
46
+ <input
47
+ type="checkbox"
48
+ ng-model="config.options.diff"
49
+ />
38
50
  <span></span>
39
51
  <span>{{ 'Diff' | translate }}</span>
40
52
  </label>
41
53
  <label class="c8y-checkbox">
42
- <input type="checkbox" ng-model="config.options.diffPercentage" />
54
+ <input
55
+ type="checkbox"
56
+ ng-model="config.options.diffPercentage"
57
+ />
43
58
  <span></span>
44
59
  <span>{{ 'Diff %' | translate }}</span>
45
60
  </label>
46
61
  <label class="c8y-checkbox">
47
- <input type="checkbox" ng-model="config.options.asset" />
62
+ <input
63
+ type="checkbox"
64
+ ng-model="config.options.asset"
65
+ />
48
66
  <span></span>
49
67
  <span>{{ 'Asset' | translate }}</span>
50
68
  </label>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1018.38.0",
3
+ "version": "1018.47.0",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -46,7 +46,8 @@
46
46
  "payment": "2.2.1",
47
47
  "tv4": "1.3.0",
48
48
  "ui-select": "0.19.8",
49
- "xterm": "3.14.5",
49
+ "xterm": "5.1.0",
50
+ "xterm-addon-fit": "0.7.0",
50
51
  "zip-js": "0.0.2",
51
52
  "dompurify": "2.2.9"
52
53
  },
@@ -1,29 +1,30 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
 
4
- <head>
5
- <title>Terminal</title>
4
+ <head>
5
+ <title>Terminal</title>
6
6
  <meta charset="utf-8">
7
7
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
8
8
 
9
- <script src="../remoteAccessClients.service.js"></script>
9
+ <script src="../remoteAccessClients.service.js"></script>
10
10
 
11
- <script>
12
- var terminalSize = { cols: 132, rows: 43 };
13
- var clientService = new RemoteAccessClientsService(window.location, window.localStorage);
11
+ <script>
12
+ var terminalSize = { cols: 132, rows: 43 };
13
+ var clientService = new RemoteAccessClientsService(window.location, window.localStorage);
14
14
 
15
- clientService.loadCss('style.css');
16
- clientService.loadCss('xterm.css');
17
- clientService.loadJs('xterm.js');
18
- clientService.loadJs('text.min.js');
19
- clientService.loadJs('telnet-negotiator.js');
20
- clientService.loadJs('shell-adapter.js');
21
- clientService.loadJs('index.js');
22
- </script>
23
- </head>
15
+ clientService.loadCss('style.css');
16
+ clientService.loadCss('xterm.css');
17
+ clientService.loadJs('xterm.js');
18
+ clientService.loadJs('xterm-addon-fit.js');
19
+ clientService.loadJs('text.min.js');
20
+ clientService.loadJs('telnet-negotiator.js');
21
+ clientService.loadJs('shell-adapter.js');
22
+ clientService.loadJs('index.js');
23
+ </script>
24
+ </head>
24
25
 
25
- <body>
26
- <div id="terminal"></div>
27
- </body>
26
+ <body>
27
+ <div id="terminal"></div>
28
+ </body>
28
29
 
29
30
  </html>
@@ -1 +1 @@
1
- "use strict";!function(){var o,c,r=!1;window.onload=function(){var e=document.getElementById("terminal"),t=new Terminal({fontSize:18,fontFamily:"consolas, monospace",cursorBlink:!0,cols:terminalSize.cols,rows:terminalSize.rows}),i=new ShellAdapter;i.setTermType("xterm-256color");var n=clientService.getParams();n?(clientService.setConnectionStatus(clientService.STATUSES.CONNECTING),document.title=unescape(n.title),o=n.wsProtocol+"//"+n.host+"/"+n.path,t.open(e),t.focus(),setTimeout(function(){(c=new WebSocket(o,"binary")).binaryType="arraybuffer",c.onopen=function(){t.writeln("Websocket connection was established successfully, waiting for device...  \r\n")},c.onclose=function(){t.writeln(""),t.writeln("\r\nDevice disconnected.  \r\n"),t.writeln("\r\nWebsocket connection was closed.  \r\n"),clientService.setConnectionStatus(clientService.STATUSES.ERROR)},c.onmessage=function(e){e.data&&clientService.getConnectionStatus()===clientService.STATUSES.CONNECTING&&clientService.setConnectionStatus(clientService.STATUSES.CONNECTED),r||(r=!0,t.writeln("Device connection was established successfully.  \r\n"));var n=i.filterReceiveData(e.data);n.dataToSend.length&&c.send(n.dataToSend),n.dataToDisplay.length&&t.write(n.dataToDisplay)},t.on("data",function(e){if(r){var n=i.filterSendData(e);n.length&&c.send(n)}}),window.onbeforeunload=function(){for(var e="exit\n",n=[],t=0;t<e.length;t++)n.push(e.charCodeAt(t));c.send(new Uint8Array(n))}})):(t.writeln(""),t.writeln("\r\nConnection parameters could not be retrieved. Please close this window and try again  \r\n"),clientService.setConnectionStatus(clientService.STATUSES.ERROR))}}();
1
+ "use strict";!function(){var c,r,a=!1;window.onload=function(){var e=document.getElementById("terminal"),t=new Terminal({fontSize:18,fontFamily:"consolas, monospace",cursorBlink:!0,cols:terminalSize.cols,rows:terminalSize.rows}),n=new FitAddon.FitAddon;t.loadAddon(n);var i=new ShellAdapter;i.setTermType("xterm-256color");var o=clientService.getParams();o?(clientService.setConnectionStatus(clientService.STATUSES.CONNECTING),document.title=unescape(o.title),c=o.wsProtocol+"//"+o.host+"/"+o.path,t.open(e),n.fit(),t.focus(),setTimeout(function(){(r=new WebSocket(c,"binary")).binaryType="arraybuffer",r.onopen=function(){t.writeln("Websocket connection was established successfully, waiting for device...  \r\n")},r.onclose=function(){t.writeln(""),t.writeln("\r\nDevice disconnected.  \r\n"),t.writeln("\r\nWebsocket connection was closed.  \r\n"),clientService.setConnectionStatus(clientService.STATUSES.ERROR)},r.onmessage=function(e){e.data&&clientService.getConnectionStatus()===clientService.STATUSES.CONNECTING&&clientService.setConnectionStatus(clientService.STATUSES.CONNECTED),a||(a=!0,t.writeln("Device connection was established successfully.  \r\n"));var n=i.filterReceiveData(e.data);n.dataToSend.length&&r.send(n.dataToSend),n.dataToDisplay.length&&t.write(n.dataToDisplay)},t.onData(function(e){if(a){var n=i.filterSendData(e);n.length&&r.send(n)}}),window.onbeforeunload=function(){for(var e="exit\n",n=[],t=0;t<e.length;t++)n.push(e.charCodeAt(t));r.send(new Uint8Array(n))}})):(t.writeln(""),t.writeln("\r\nConnection parameters could not be retrieved. Please close this window and try again  \r\n"),clientService.setConnectionStatus(clientService.STATUSES.ERROR))}}();
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "name": "Remote access",
3
- "ngModules": [
4
- "c8y.remoteAccess"
5
- ],
3
+ "ngModules": ["c8y.remoteAccess"],
6
4
  "category": "Remote access",
7
5
  "description": "Configure remote access and handle remote sessions to devices.",
8
6
  "js": [
@@ -48,19 +46,23 @@
48
46
  },
49
47
  "clients/terminal/*",
50
48
  {
51
- "cwd": "node_modules/xterm/dist",
52
- "files": [
53
- "xterm.css",
54
- "xterm.js",
55
- "addons/fit/fit.js"
56
- ],
49
+ "cwd": "node_modules/xterm/css",
50
+ "files": ["xterm.css"],
51
+ "output": "clients/terminal"
52
+ },
53
+ {
54
+ "cwd": "node_modules/xterm/lib",
55
+ "files": ["xterm.js"],
56
+ "output": "clients/terminal"
57
+ },
58
+ {
59
+ "cwd": "node_modules/xterm-addon-fit/lib",
60
+ "files": ["xterm-addon-fit.js"],
57
61
  "output": "clients/terminal"
58
62
  },
59
63
  {
60
64
  "cwd": "node_modules/fast-text-encoding",
61
- "files": [
62
- "text.min.js"
63
- ],
65
+ "files": ["text.min.js"],
64
66
  "output": "clients/terminal"
65
67
  }
66
68
  ]
@@ -1,5 +1,8 @@
1
- <div ng-controller="ScadaWidgetConfigCtrl as ctrl" class="p-t-8">
2
- <div class="form-group">
1
+ <div
2
+ ng-controller="ScadaWidgetConfigCtrl as ctrl"
3
+ class="p-t-8"
4
+ >
5
+ <div>
3
6
  <label>
4
7
  <span translate>SVG</span>
5
8
  <button
@@ -14,7 +17,10 @@
14
17
  ></button>
15
18
  </label>
16
19
 
17
- <div class="alert alert-info text-left" ng-show="svgTooltipVisible">
20
+ <div
21
+ class="alert alert-info text-left"
22
+ ng-show="svgTooltipVisible"
23
+ >
18
24
  <p translate>
19
25
  For placeholder to be recognized it needs to be used at least once in curly braces with no
20
26
  other expression, for example,
@@ -59,44 +65,54 @@
59
65
  </div>
60
66
 
61
67
  <div class="form-group">
62
- <label translate>Select code sanitization option</label>
68
+ <label for="sanitization" translate>Select code sanitization option</label>
63
69
  <div class="c8y-select-wrapper">
64
70
  <select
65
71
  class="form-control"
72
+ id="sanitization"
66
73
  ng-model="config.sanitization"
67
74
  ng-init="config.sanitization = config.sanitization || 'strict'"
68
75
  >
69
- <option value="strict" translate>strict`code sanitization`</option>
70
- <option value="lax" translate>lax`code sanitization`</option>
71
- <option value="none" translate>none`code sanitization`</option>
76
+ <option
77
+ value="strict"
78
+ translate
79
+ >strict`code sanitization`</option>
80
+ <option
81
+ value="lax"
82
+ translate
83
+ >lax`code sanitization`</option>
84
+ <option
85
+ value="none"
86
+ translate
87
+ >none`code sanitization`</option>
72
88
  </select>
73
89
  </div>
74
90
  </div>
75
-
76
- <file-picker
77
- files="ctrl.files"
78
- multiple="false"
79
- display-drop-zone="false"
80
- on-file-selected="ctrl.onSelectFile(ctrl.files[0].file)"
81
- ></file-picker>
82
- <input type="hidden" />
83
- <span id="helpBlock" class="help-block m-b-16" translate>SVG content will be sanitized.</span>
91
+ <div class="form-group">
92
+ <file-picker
93
+ files="ctrl.files"
94
+ multiple="false"
95
+ display-drop-zone="false"
96
+ on-file-selected="ctrl.onSelectFile(ctrl.files[0].file)"
97
+ ></file-picker>
98
+ <input type="hidden" />
99
+ </div>
84
100
  </div>
85
- <div
86
- c8y-scada-mapping
87
- name="mapping"
88
- ng-model="config.mapping"
89
- device="ctrl.device"
90
- devices="ctrl.devices"
91
- device-ids="config.deviceIds"
92
- on-device-ids-change="ctrl.onDeviceIdsChange()"
93
- class="table-responsive"
94
- ></div>
95
-
96
- <div class="form-group">
97
- <label>{{ 'Preview' | translate }}</label>
98
- <span ng-show="ctrl.loading" class="m-l-4">
99
- <i c8y-icon="spinner" class="icon-spin"></i>
101
+ <div class="form-group p-t-16">
102
+ <label class="input-group">{{ 'Preview' | translate }}</label>
103
+ <span
104
+ id="helpBlock"
105
+ class="help-block m-b-8"
106
+ translate
107
+ >SVG content will be sanitized.</span>
108
+ <span
109
+ ng-show="ctrl.loading"
110
+ class="m-l-4"
111
+ >
112
+ <i
113
+ c8y-icon="spinner"
114
+ class="icon-spin"
115
+ ></i>
100
116
  </span>
101
117
  <div ng-switch="!!(ctrl.device && forms.componentForm.mapping.$valid && config.mapping)">
102
118
  <div
@@ -107,11 +123,24 @@
107
123
  device="ctrl.device"
108
124
  devices="ctrl.devices"
109
125
  device-ids="config.deviceIds"
110
- style="height: 200px"
111
126
  ></div>
112
- <div ng-switch-default class="alert alert-info" translate>
113
- You need to select a device and fill all mappings to be able to preview an SVG.
127
+ <div
128
+ ng-switch-default
129
+ class="alert alert-info"
130
+ translate
131
+ >
132
+ Select a device and fill all mappings to preview an SVG.
114
133
  </div>
115
134
  </div>
116
135
  </div>
136
+ <div
137
+ c8y-scada-mapping
138
+ name="mapping"
139
+ ng-model="config.mapping"
140
+ device="ctrl.device"
141
+ devices="ctrl.devices"
142
+ device-ids="config.deviceIds"
143
+ on-device-ids-change="ctrl.onDeviceIdsChange()"
144
+ ></div>
145
+
117
146
  </div>
@@ -1,102 +1,113 @@
1
- <table class="table">
2
- <colgroup>
3
- <col width="20%">
4
- <col width="20%">
5
- <col width="20%">
6
- <col width="20%">
7
- <col width="148px">
8
- </colgroup>
9
- <thead>
10
- <tr>
11
- <th>
12
- <label translate>Placeholder</label>
13
- </th>
14
- <th>
15
- <label translate>Target</label>
16
- </th>
17
- <th>
18
- <label translate>Mapped to</label>
19
- </th>
20
- <th>
21
- <label translate>Current value</label>
22
- </th>
23
- <th></th>
24
- </tr>
25
- </thead>
26
- <tbody>
27
- <tr
28
- ng-repeat="mapping in mappings | orderBy:'placeholder'"
29
- class="property"
30
- ng-class="{ danger: hasError[mapping.placeholder] }"
31
- >
32
- <td class="text-truncate" title="{{ mapping.placeholder }}">
33
- {{ mapping.placeholder }}
34
- </td>
35
- <td class="form-group-sm">
36
- <span ng-show="devices.length == 1">
37
- {{ devices[0].name }}
38
- </span>
39
- <div class="c8y-select-wrapper" ng-show="devices.length > 1">
40
- <select
41
- class="form-control"
42
- ng-options="device.id as device.name for device in devices"
43
- ng-model="deviceIds[mapping.placeholder]"
44
- ng-change="onDeviceIdsChange()"
45
- required
46
- >
47
- </select>
48
- <span></span>
1
+ <div class="svg-mappings">
2
+ <label>{{ 'Mappings' | translate }}</label>
3
+ <ul class="c8y-list__group c8y-list__group--strip">
4
+ <li class="c8y-list__item" ng-repeat="mapping in mappings | orderBy:'placeholder'">
5
+ <div class="c8y-list__item__block d-block">
6
+ <div class="c8y-list__item__body">
7
+ <div class="row">
8
+ <div class="col-md-4">
9
+ <label class="text-label-small d-block" translate>Placeholder</label>
10
+ <div class="text-medium">
11
+ <i
12
+ c8y-icon="exclamation-circle"
13
+ class="m-r-4 text-danger"
14
+ ng-show="hasError[mapping.placeholder]"
15
+ ></i>
16
+ <span title="{{ mapping.placeholder }}">
17
+ {{ mapping.placeholder }}
18
+ </span>
19
+ </div>
20
+ </div>
21
+ <div class="col-md-8">
22
+ <label class="text-label-small d-block" translate>Target</label>
23
+ <div class="form-group-sm form-group">
24
+ <span ng-show="!devices.length">---</span>
25
+ <span
26
+ class="text-truncate"
27
+ title="{{ devices[0].name }}"
28
+ ng-show="devices.length == 1"
29
+ >
30
+ {{ devices[0].name }}
31
+ </span>
32
+ <div class="c8y-select-wrapper" ng-show="devices.length > 1">
33
+ <select
34
+ class="form-control"
35
+ ng-change="onDeviceIdsChange()"
36
+ ng-model="deviceIds[mapping.placeholder]"
37
+ ng-options="device.id as device.name for device in devices"
38
+ required
39
+ ></select>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ <div class="col-md-4" ng-switch="!!mapping.config.configSchema">
44
+ <label class="text-label-small d-block" translate>Mapped to</label>
45
+ <button
46
+ class="btn btn-sm btn-default text-truncate"
47
+ type="button"
48
+ title=" {{ humanizeValue(mapping) }}"
49
+ ng-click="editComputedProperty(mapping)"
50
+ ng-switch-when="true"
51
+ >
52
+ <i c8y-icon="bolt"></i>
53
+ <span>
54
+ {{ humanizeValue(mapping) }}
55
+ </span>
56
+ </button>
57
+ <div class="form-control-static">
58
+ <span class="text-truncate" title="{{ humanizeValue(mapping) }}" ng-switch-default>
59
+ {{ humanizeValue(mapping) }}
60
+ </span>
61
+ </div>
62
+ </div>
63
+ <div class="col-md-4">
64
+ <label class="text-label-small d-block" translate>Current value</label>
65
+ <div class="form-control-static" title="{{ propertyValueFor(mapping) }}">
66
+ <span class="text-truncate text-monospace">
67
+ {{ propertyValueFor(mapping) }}
68
+ </span>
69
+ </div>
70
+ </div>
71
+ <div class="col-md-4">
72
+ <label class="text-label-small d-block" translate>Actions</label>
73
+ <button
74
+ class="btn btn-default btn-sm"
75
+ type="button"
76
+ uib-tooltip="{{ 'Clear mapping' | translate }}"
77
+ tooltip-append-to-body="true"
78
+ tooltip-popup-delay="500"
79
+ aria-label="{{ 'Clear mapping' | translate }}"
80
+ ng-click="clearMapping(mapping)"
81
+ ng-disabled="!mapping.config"
82
+ >
83
+ <i c8y-icon="delete-document"></i>
84
+ </button>
85
+ <button
86
+ class="btn btn-default btn-sm"
87
+ type="button"
88
+ uib-tooltip="{{ 'Assign fieldbus property' | translate }}"
89
+ tooltip-append-to-body="true"
90
+ tooltip-popup-delay="500"
91
+ aria-label="{{ 'Assign fieldbus property' | translate }}"
92
+ ng-click="setFieldbusMapping(mapping)"
93
+ >
94
+ <i c8y-icon="tasks"></i>
95
+ </button>
96
+ <button
97
+ class="btn btn-default btn-sm"
98
+ type="button"
99
+ uib-tooltip="{{ 'Assign device property' | translate }}"
100
+ tooltip-append-to-body="true"
101
+ tooltip-popup-delay="500"
102
+ aria-label="{{ 'Assign device property' | translate }}"
103
+ ng-click="setMapping(mapping)"
104
+ >
105
+ <i c8y-icon="edit"></i>
106
+ </button>
107
+ </div>
108
+ </div>
49
109
  </div>
50
- </td>
51
- <td
52
- ng-switch="!!mapping.config.configSchema"
53
- class="text-truncate"
54
- title="{{ humanizeValue(mapping) }}"
55
- >
56
- <a
57
- ng-switch-when="true"
58
- class="btn btn-xs btn-default"
59
- href=""
60
- ng-click="editComputedProperty(mapping)"
61
- >
62
- <i c8y-icon="bolt"></i>
63
- {{ humanizeValue(mapping) }}
64
- </a>
65
- <span ng-switch-default>{{ humanizeValue(mapping) }}</span>
66
- </td>
67
- <td class="text-truncate">
68
- <span title=" {{ propertyValueFor(mapping) }}">
69
- {{ propertyValueFor(mapping) }}
70
- </span>
71
- </td>
72
- <td>
73
- <div class="d-flex flex-end">
74
- <button
75
- type="button"
76
- class="btn btn-danger btn-xs showOnHover pull-right"
77
- title="{{ 'Clear mapping' | translate }}"
78
- ng-click="clearMapping(mapping)"
79
- >
80
- <i c8y-icon="scissors"></i>
81
- </button>
82
- <button
83
- type="button"
84
- class="btn btn-primary btn-xs showOnHover pull-right"
85
- title="{{ 'Assign fieldbus property' | translate }}"
86
- ng-click="setFieldbusMapping(mapping)"
87
- >
88
- <i c8y-icon="tasks"></i>
89
- </button>
90
- <button
91
- type="button"
92
- class="btn btn-primary btn-xs showOnHover pull-right"
93
- title="{{ 'Assign device property' | translate }}"
94
- ng-click="setMapping(mapping)"
95
- >
96
- <i c8y-icon="pencil"></i>
97
- </button>
98
- </div>
99
- </td>
100
- </tr>
101
- </tbody>
102
- </table>
110
+ </div>
111
+ </li>
112
+ </ul>
113
+ </div>