@c8y/ng1-modules 1018.500.18 → 1018.501.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function t
|
|
1
|
+
"use strict";!function(){function e(t,e,n,i){var c=this;function u(){t.detail(c.id).then(s),t.getCustomActions().then(r)}function o(){var e=c.getMappings(),t=Object.values(c.getResources());return!((e?Object.values(e):[]).length<t.length)&&e&&Object.values(e).every(function(e){return!0===e.skipIfEmpty})}function s(e){c.object=e,c.title=t.getName(e),c.skipIfEmptyAll=o()}function r(e){c.customActions=e}function a(){return e.getMappings(c.object)}_.assign(c,{$onChanges:function(e){e.id&&u()},updateMapping:function(e){return t.updateMapping(c.object.id,e).then(u)},getMappings:a,getResources:function(){return e.getResources(c.object)},getMainObject:function(){return e.getMainObject(c.object)},getMappingForResource:function(e){return _.get(a(),e)},setAllResources:function(){var e=c.getResources(),t=c.getMappings(),e=e?Object.values(e):[];t=t||{};e.forEach(function(e){void 0!==e.id&&null!==e.id&&(t[e.id]||(t[e.id]={resourceID:e.id}),t[e.id].skipIfEmpty=c.skipIfEmptyAll)}),t&&0<Object.entries(t).length&&c.updateMapping(t).then(function(){return n.success(i("Resource update complete."))})},isIgnoreEmptyValuesMasterToggleOn:o})}e.$inject=["c8yLwm2m","c8yObjectMappings","c8yAlert","gettext"],angular.module("c8y.lwm2m").component("c8yLwm2mDetail",{templateUrl:":::PLUGIN_PATH:::/lwm2mDetail.html",controller:e,controllerAs:"vm",bindings:{id:"<"}})}();
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
Name
|
|
26
26
|
</label>
|
|
27
27
|
<input
|
|
28
|
-
id="name"
|
|
29
28
|
class="form-control input-lg"
|
|
29
|
+
id="name"
|
|
30
30
|
ng-model="vm.getMainObject().name"
|
|
31
31
|
/>
|
|
32
32
|
</div>
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
Description
|
|
40
40
|
</label>
|
|
41
41
|
<textarea
|
|
42
|
-
id="description"
|
|
43
42
|
class="form-control"
|
|
43
|
+
id="description"
|
|
44
44
|
ng-model="vm.getMainObject().description"
|
|
45
45
|
></textarea>
|
|
46
46
|
</div>
|
|
@@ -82,24 +82,72 @@
|
|
|
82
82
|
</div>
|
|
83
83
|
</div>
|
|
84
84
|
</div>
|
|
85
|
+
<div class="card-header separator-top-bottom sticky-top">
|
|
86
|
+
<div class="card-title">
|
|
87
|
+
{{ 'Resources' | translate }}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
85
90
|
<div class="inner-scroll">
|
|
86
|
-
<div class="
|
|
87
|
-
<div
|
|
88
|
-
class="
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
<div class="sticky-top hidden-xs">
|
|
92
|
+
<div class="c8y-list__item">
|
|
93
|
+
<div class="c8y-list__item__block">
|
|
94
|
+
<div class="c8y-list__item__icon">
|
|
95
|
+
<i class="p-l-16 p-r-4"></i>
|
|
96
|
+
</div>
|
|
97
|
+
<div class="c8y-list__item__body text-medium">
|
|
98
|
+
<div class="content-flex-60">
|
|
99
|
+
<div class="col-4">
|
|
100
|
+
{{ 'Name' | translate }}
|
|
101
|
+
</div>
|
|
102
|
+
<div class="col-3">
|
|
103
|
+
{{ 'Functionalities' | translate }}
|
|
104
|
+
</div>
|
|
105
|
+
<div class="col-3 d-flex">
|
|
106
|
+
<div class="list-item-switch">
|
|
107
|
+
<label class="c8y-switch c8y-switch--inline">
|
|
108
|
+
<input
|
|
109
|
+
type="checkbox"
|
|
110
|
+
ng-model="vm.skipIfEmptyAll"
|
|
111
|
+
ng-change="vm.setAllResources()"
|
|
112
|
+
/>
|
|
113
|
+
<span></span>
|
|
114
|
+
<span class="sr-only">
|
|
115
|
+
{{ 'If selected it ignores empty values on all resources below.' | translate }}
|
|
116
|
+
</span>
|
|
117
|
+
</label>
|
|
118
|
+
</div>
|
|
119
|
+
{{ 'Ignore empty values' | translate }}
|
|
120
|
+
|
|
121
|
+
<div class="list-item-icon">
|
|
122
|
+
<button
|
|
123
|
+
class="btn-help btn-help--sm"
|
|
124
|
+
aria-label="{{ 'Help' | translate }}"
|
|
125
|
+
type="button"
|
|
126
|
+
uib-popover="{{ 'If selected it ignores empty values on all resources below.' | translate }}"
|
|
127
|
+
popover-placement="right"
|
|
128
|
+
popover-trigger="'focus'"
|
|
129
|
+
popover-append-to-body="true"
|
|
130
|
+
></button>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
<div class="col-2">
|
|
134
|
+
{{ 'Validation rules' | translate }}
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
<div class="c8y-list__item__actions">
|
|
139
|
+
<div class="c8y-list__item--empty-actions"></div>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
92
142
|
</div>
|
|
93
143
|
</div>
|
|
94
|
-
<div class="
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
></c8y-lwm2m-resource>
|
|
102
|
-
</div>
|
|
144
|
+
<div class="c8y-list__group">
|
|
145
|
+
<c8y-lwm2m-resource
|
|
146
|
+
ng-repeat="(resourceId, resource) in vm.getResources()"
|
|
147
|
+
resource="resource"
|
|
148
|
+
mapping="vm.getMappingForResource(resourceId)"
|
|
149
|
+
on-update="vm.updateMapping(mapping)"
|
|
150
|
+
></c8y-lwm2m-resource>
|
|
103
151
|
</div>
|
|
104
152
|
</div>
|
|
105
153
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function n(e){var
|
|
1
|
+
"use strict";!function(){function n(e){var i=this;function r(){i.isDetailOpen=!i.isDetailOpen}function t(){i.mapping=_.cloneDeep(i.serverMapping)||{}}function n(){var n=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e={},t=i.resource.id;return e[t]=_.assign({resourceID:t},i.mapping),n?i.onUpdate({mapping:e}).then(r):i.onUpdate({mapping:e})}_.assign(i,{$onChanges:function(n){n.serverMapping&&t()},toggleDetail:r,helpTexts:e.helpTexts,save:n,$onInit:function(){e.getCustomActions().then(function(n){i.customActions=n})},showValidation:function(){return function(){var n=_.get(i.resource,"operations");if(n)return"W"===n||"RW"===n;return!1}()&&function(){var n=_.get(i.resource,"dataType");if(n)return!_.isUndefined(e.Validation.ResourceDataType[n]);return!1}()},validationAvailable:function(){var n=_.get(i.mapping,"validation.arg");if(n)return 0<n.length;return!1},cancel:function(){r(),t()},updateSkipIfEmptyValues:function(){n(!1)}})}n.$inject=["c8yLwm2m"],angular.module("c8y.lwm2m").component("c8yLwm2mResource",{templateUrl:":::PLUGIN_PATH:::/lwm2mResource.html",controllerAs:"vm",controller:n,bindings:{resource:"<",serverMapping:"<mapping",onUpdate:"&"}})}();
|
|
@@ -9,49 +9,66 @@
|
|
|
9
9
|
<div class="c8y-list__item__body">
|
|
10
10
|
<div class="content-flex-70">
|
|
11
11
|
<div
|
|
12
|
-
class="col-
|
|
12
|
+
class="col-4"
|
|
13
13
|
ng-click="vm.toggleDetail()"
|
|
14
14
|
>
|
|
15
15
|
<small class="text-muted">{{ vm.resource.id }}</small>
|
|
16
16
|
{{ vm.resource.name }}
|
|
17
17
|
</div>
|
|
18
|
-
<div class="col-
|
|
19
|
-
<div class="list-functionalities">
|
|
20
|
-
<label
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
>
|
|
24
|
-
Functionalities
|
|
25
|
-
</label>
|
|
26
|
-
|
|
18
|
+
<div class="col-3">
|
|
19
|
+
<div class="list-functionalities d-flex a-i-center">
|
|
20
|
+
<span class="text-label-small visible-xs m-r-4">
|
|
21
|
+
{{ 'Functionalities' | translate }}:
|
|
22
|
+
</span>
|
|
27
23
|
<c8y-object-mapping-status-icons
|
|
28
24
|
mapping="vm.serverMapping"
|
|
29
25
|
></c8y-object-mapping-status-icons>
|
|
30
26
|
</div>
|
|
31
27
|
</div>
|
|
32
|
-
<div class="col-
|
|
28
|
+
<div class="col-3">
|
|
29
|
+
<div class="d-flex a-i-center">
|
|
30
|
+
<div class="list-item-switch m-r-4">
|
|
31
|
+
<label class="c8y-switch c8y-switch--inline">
|
|
32
|
+
<input
|
|
33
|
+
type="checkbox"
|
|
34
|
+
ng-model="vm.mapping.skipIfEmpty"
|
|
35
|
+
ng-change="vm.updateSkipIfEmptyValues()"
|
|
36
|
+
/>
|
|
37
|
+
<span></span>
|
|
38
|
+
<span class="visible-xs">{{ 'Ignore empty values' | translate }}</span>
|
|
39
|
+
<span class="sr-only">{{ 'Ignore empty values' | translate }}</span>
|
|
40
|
+
</label>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="col-2 m-t-xs-4 d-flex a-i-center">
|
|
45
|
+
<span
|
|
46
|
+
class="m-r-xs-4 text-label-small visible-xs"
|
|
47
|
+
ng-show="vm.showValidation()"
|
|
48
|
+
>
|
|
49
|
+
{{ 'Validation rules' | translate }}:
|
|
50
|
+
</span>
|
|
33
51
|
<div
|
|
34
52
|
class="dot small"
|
|
35
|
-
ng-show="vm.showValidation()"
|
|
36
53
|
ng-class="{
|
|
37
|
-
'
|
|
54
|
+
'dot-default': !vm.validationAvailable(),
|
|
38
55
|
'dot-success': vm.validationAvailable()
|
|
39
56
|
}"
|
|
57
|
+
ng-show="vm.showValidation()"
|
|
40
58
|
>
|
|
41
59
|
<i
|
|
42
|
-
c8y-icon="
|
|
43
|
-
|
|
44
|
-
uib-tooltip="{{ 'Validation rules set' | translate }}"
|
|
60
|
+
c8y-icon="list-ul"
|
|
61
|
+
uib-tooltip="{{ 'Validation rules set' | translate }}."
|
|
45
62
|
tooltip-popup-delay="500"
|
|
46
63
|
tooltip-append-to-body="true"
|
|
64
|
+
ng-show="vm.validationAvailable()"
|
|
47
65
|
></i>
|
|
48
66
|
<i
|
|
49
67
|
c8y-icon="list-ul"
|
|
50
|
-
|
|
51
|
-
class="text-12"
|
|
52
|
-
uib-tooltip="{{ 'No validation rules defined' | translate }}"
|
|
68
|
+
uib-tooltip="{{ 'No validation rules defined' | translate }}."
|
|
53
69
|
tooltip-popup-delay="500"
|
|
54
70
|
tooltip-append-to-body="true"
|
|
71
|
+
ng-show="!vm.validationAvailable()"
|
|
55
72
|
></i>
|
|
56
73
|
</div>
|
|
57
74
|
</div>
|
|
@@ -60,9 +77,9 @@
|
|
|
60
77
|
<div class="c8y-list__item__actions">
|
|
61
78
|
<button
|
|
62
79
|
class="collapse-btn"
|
|
63
|
-
type="button"
|
|
64
|
-
title="{{ 'Expand' | translate }}"
|
|
65
80
|
ng-class="{ active: vm.isDetailOpen }"
|
|
81
|
+
title="{{ 'Expand' | translate }}"
|
|
82
|
+
type="button"
|
|
66
83
|
ng-click="vm.toggleDetail()"
|
|
67
84
|
>
|
|
68
85
|
<i c8y-icon="chevron-down"></i>
|
|
@@ -184,16 +201,16 @@
|
|
|
184
201
|
<hr />
|
|
185
202
|
<button
|
|
186
203
|
class="btn btn-default"
|
|
187
|
-
type="button"
|
|
188
204
|
title="{{ 'Cancel' | translate }}"
|
|
205
|
+
type="button"
|
|
189
206
|
ng-click="vm.cancel(); mappingForm.$pristine = true"
|
|
190
207
|
>
|
|
191
208
|
{{ 'Cancel' | translate }}
|
|
192
209
|
</button>
|
|
193
210
|
<button
|
|
194
211
|
class="btn btn-primary"
|
|
195
|
-
type="submit"
|
|
196
212
|
title="{{ 'Save' | translate }}"
|
|
213
|
+
type="submit"
|
|
197
214
|
ng-click="vm.save()"
|
|
198
215
|
ng-disabled="mappingForm.$invalid || mappingForm.$pristine"
|
|
199
216
|
>
|