@c8y/ng1-modules 1018.336.0 → 1018.339.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 +0 -26
- package/package.json +1 -1
- package/scada/config.controller.js +1 -1
package/NOTICES
CHANGED
|
@@ -21019,32 +21019,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
21019
21019
|
|
|
21020
21020
|
-----
|
|
21021
21021
|
|
|
21022
|
-
The following software may be included in this product: mkdir-p. A copy of the source code may be downloaded from https://github.com/pillys/mkdir-p. This software contains the following license and notice below:
|
|
21023
|
-
|
|
21024
|
-
The MIT License (MIT)
|
|
21025
|
-
|
|
21026
|
-
Copyright (c) 2015 Pillys
|
|
21027
|
-
|
|
21028
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
21029
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
21030
|
-
in the Software without restriction, including without limitation the rights
|
|
21031
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21032
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
21033
|
-
furnished to do so, subject to the following conditions:
|
|
21034
|
-
|
|
21035
|
-
The above copyright notice and this permission notice shall be included in all
|
|
21036
|
-
copies or substantial portions of the Software.
|
|
21037
|
-
|
|
21038
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21039
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21040
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21041
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21042
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21043
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21044
|
-
SOFTWARE.
|
|
21045
|
-
|
|
21046
|
-
-----
|
|
21047
|
-
|
|
21048
21022
|
The following software may be included in this product: mkdirp. A copy of the source code may be downloaded from https://github.com/isaacs/node-mkdirp.git. This software contains the following license and notice below:
|
|
21049
21023
|
|
|
21050
21024
|
Copyright James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me)
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function e(c,t,o,a,i,n,r,
|
|
1
|
+
"use strict";!function(){function e(c,t,o,a,i,n,d,r,f,s){var u=this,g="",e={c8y_Global:{}};function p(n){return u.svgFile={name:n.name,size:n.length},n instanceof Blob?i.readDataUri(n).then(i.decodeDataUri).then(l):i.downloadAsDataUri(n).then(i.decodeDataUri).then(function(e){return new File([e],n.name,{type:n.type})}).then(function(e){return s.sanitizeFileByLevel(e,c.config.sanitization)}).then(function(e){return i.readDataUri(e)}).then(i.decodeDataUri).then(l)}function l(e){return u.svgFile.data=e,function(){if(!u.svgFile)return;var n=c.config.mapping||{},i=c.config.deviceIds||{},t=c.config.device&&c.config.device.id;c.config.mapping={},c.config.deviceIds={},_.forEach(function(e){var n=[],i=/{{\s*([$\w]+?)\s*}}/g,t=i.exec(e);for(;null!==t;)n.push(t[1]),t=i.exec(e);return n}(u.svgFile.data),function(e){c.config.mapping[e]=n[e]?n[e]:null,c.config.deviceIds[e]=i[e]?i[e]:t||null}),function(e,c){if(!e||!c)return;_.forOwn(e,function(e,i){var n=v(e),t=r.generatePaths(n);f.list().then(function(e){var n=_.sortBy(e,function(e){return e.keyPath.length}).reverse();null===c[i]&&(_.forEach(n,function(e){_.last(e.keyPath).toUpperCase()===i.toUpperCase()&&(c[i]=e)}),_.forEach(t,function(e){_.last(e).toUpperCase()===i.toUpperCase()&&(c[i]=r.createProperty(e))}))})})}(c.config.deviceIds,c.config.mapping)}(),e}function v(n){return _.find(u.devices,function(e){return n===e.id})}function h(e,n){u.device&&u.device.id!==n.id||_.assign(u.device,n)}function m(){var e=function(e){return _(e).values().uniq().value().sort(function(e,n){return e-n}).join(",")}(c.config.deviceIds);e!==g&&(g.length&&n.stop(c.$id,"/managedobjects/".concat(g)),e.length&&(n.addListener(c.$id,"/managedobjects/".concat(e),"UPDATE",h),n.start(c.$id,"/managedobjects/".concat(e)),c.$on("$destroy",_.partial(n.stop,c.$id,"/managedobjects/".concat(e)))),g=e)}this.deviceDetail=function(e,n){var i;e&&(i=!n||!(e.name===n.name&&e.id===n.id),a.detail(e.id).then(function(e){u.device=e.data;var n=_.union([u.device.id],_.map(_.union(u.device.childAssets.references,u.device.childDevices.references),function(e){return e.managedObject.id}));_.remove(n,_.isUndefined),t.all(_.map(n,function(e){return a.detail(e)})).then(function(e){u.devices=_.map(e,function(e){var n=e.data;return _.assign({},n,{name:o("truncate")(n.name)})}),function(i){_.forOwn(c.config.mapping,function(e,n){(1===u.devices.length||i)&&(c.config.deviceIds[n]=c.config.device.id),c.config.deviceIds[n]=c.config.deviceIds[n]||c.config.device.id})}(i),u.updateComputedProperties(c.config.deviceIds,c.config.mapping)})}))},this.onSelectFile=function(n){u.loading=!0,i.upload(n,e).then(function(e){u.binaryFile=e.data,c.config.binaryId=e.data.id,p(n),c.forms.componentForm.$setDirty()}).finally(function(){u.loading=!1})},this.updateComputedProperties=function(e,c){_.isEmpty(e)||_.isEmpty(c)||_.forOwn(e,function(e,n){var i=[c[n]];if(c[n]){var t=v(e);d.attach(t,_.filter(i,function(e){return _.isObjectLike(e)}))}})},this.onMappingChange=function(){u.updateComputedProperties(c.config.deviceIds,c.config.mapping)},this.onDeviceIdsChange=function(){u.updateComputedProperties(c.config.deviceIds,c.config.mapping),m()},u.binaryFile={},c.config.mapping=c.config.mapping||{},c.config.deviceIds=c.config.deviceIds||{},c.config.devices&&delete c.config.devices,c.config.binaryId?(u.loading=!0,c.config.sanitization||(c.config.sanitization="none"),i.detail(c.config.binaryId).then(function(e){u.binaryFile=e.data,p(u.binaryFile),u.loading=!1}).then(function(){var e=[];e.push({file:u.svgFile}),u.files=e})):t.when(),m(),c.$watch("config.device",this.deviceDetail,!0),c.$watch("config.mapping",this.onMappingChange,!0),c.$on("$destroy",function(){_.forEach(c.config.deviceIds,function(e){d.detach(v(e))})})}e.$inject=["$scope","$q","$filter","c8yDevices","c8yBinary","c8yRealtime","c8yComputedProperties","fieldbusPropertyGenerator","c8yPropertiesLibrary","c8ySanitizeHtml"],angular.module("c8y.parts.scadaWidget").controller("ScadaWidgetConfigCtrl",e)}();
|