@c8y/ng1-modules 1021.22.156 → 1021.22.158
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/core/ui/directives/map.js +1 -1
- package/core/ui/views/map.html +1 -1
- package/map/controllers/geofenceEdit.js +1 -1
- package/package.json +1 -1
- package/scada/index.js +1 -1
- package/scada/widget.controller.js +1 -1
- package/smartRules/directives/smartRuleParamInputGeofence.js +1 -1
- package/smartRules/views/paramInputGeofence.html +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a,o,l=[],c=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=a.call(n)).done)&&(l.push(i.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw r}}return l}}function _arrayWithHoles(e){if(Array.isArray(e))return e}(()=>{function e(v,A,w,T,I,N,$){return{link:function(n){var o=[],i="c8y_Position",r=g,a=b,l=[];function e(){l.length=0,o.length=0,n.deviceId?c(n.deviceId):d()}function c(e){A.detail(e).then(I.getResData).then(t)}function t(e){l.push(e),n.multipleDevices?(e=n.deviceId,v.all([A.childDevices(e),A.childAssets(e)]).then(_.flattenDeep).then(s)):d(u(l))}function s(e){d(u(_.union(l,e)))}function u(e){return _.map(_.filter(e,function(e){return!N.isGroup(e)}),"id")}function d(e){var t={},e=e&&e.length?(t.ids=e.join(","),A.list(t)):A.list({fragmentType:i});e.then(f).then(g)}function f(e){return n.withPosition=_.filter(e,p),_.filter(_.map(n.withPosition,b),_.identity)}function m(){n.realtimeAnimation=!1}function h(e,t){w.addListener(n.$id,n.realtimeChannel,e,t)}function y(e,t){p(t)&&(a(t),r())}function p(e){return e[i]}function g(e){e&&e.length&&_.forEach(e,function(e){o.push(e)}),n.withPosition.length&&T.getMap("c8y-map-".concat(n.$id)).then(function(e){e.fitBounds(o,{padding:[50,50]})})}function b(e){var t,n=p(e),i=_.cloneDeep(n||{}),r=null,a=_.find(o,{id:e.id});return a?(n.lat=Number(n.lat),a.lat=n.lat,n.lng=Number(n.lng),a.lng=n.lng):(n.lat=Number(n.lat),i.lat=n.lat,n.lng=Number(n.lng),i.lng=n.lng,n&&_.isNumber(n.lat)&&_.isNumber(n.lng)&&!_.isNaN(_.toNumber(n.lat))&&!_.isNaN(_.toNumber(n.lng))&&(i.id=e.id,i.message='\n <a\n class="btn btn-link"\n style="width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"\n href="#/device/'.concat((a=e).id,'"\n title="').concat(a.name,'"\n >\n ').concat(a.name,"\n </a>\n "),i.icon={className:"".concat((t=e.c8y_ActiveAlarmsStatus||{},_.find(["critical","major","minor","warning"],function(e){return t[e]})||"normal"),"-marker-icon"),iconSize:[25,41],iconAnchor:[12,41],type:"div"},r=i)),r}n.$watch("deviceId",function(e,t){e&&e!==t&&(l=[],o.length=0,c(e))}),n.markers=o,n.mapDefault={scrollWheelZoom:!1},n.cssToHide=function(){return n.withPosition&&n.withPosition.length?{}:{visibility:"hidden"}},n.paging={refresh:!0},n.realtime||(n.refresh=e),v.all([$.listByUser(),T.getMap("c8y-map-".concat(n.$id))]).then(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];_.some(t,{contextPath:"openseamap"})&&(t=L.tileLayer("/apps/openseamap/{z}/{x}/{y}.png"),L.control.layers({},{openseamap:t}).addTo(e))}),n.realtimeChannel="/managedobjects/*",h("".concat(n.$id,"-subscribed"),m),h("UPDATE",y),n.realtime&&(n.$on("$destroy",function(){w.stop(n.$id,n.realtimeChannel)}),w.start(n.$id,n.realtimeChannel)),e()},restrict:"E",scope:{deviceId:"=?",multipleDevices:"=",cssClass:"@",width:"=?",height:"=?",config:"=",realtime:"="},templateUrl:":::PLUGIN_PATH:::/ui/views/map.html"}}e.$inject=["$q","c8yInventory","c8yRealtime","leafletData","c8yBase","c8yGroups","c8yApplication"],angular.module("c8y.ui").directive("c8yMap",e)})();
|
|
1
|
+
function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a,o,l=[],c=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=a.call(n)).done)&&(l.push(i.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw r}}return l}}function _arrayWithHoles(e){if(Array.isArray(e))return e}(()=>{function e(v,A,w,T,I,N,$){return{link:function(n){var o=[],i="c8y_Position",r=g,a=b,l=[];function e(){l.length=0,o.length=0,n.deviceId?c(n.deviceId):d()}function c(e){A.detail(e).then(I.getResData).then(t)}function t(e){l.push(e),n.multipleDevices?(e=n.deviceId,v.all([A.childDevices(e),A.childAssets(e)]).then(_.flattenDeep).then(s)):d(u(l))}function s(e){d(u(_.union(l,e)))}function u(e){return _.map(_.filter(e,function(e){return!N.isGroup(e)}),"id")}function d(e){var t={},e=e&&e.length?(t.ids=e.join(","),A.list(t)):A.list({fragmentType:i});e.then(f).then(g)}function f(e){return n.withPosition=_.filter(e,p),_.filter(_.map(n.withPosition,b),_.identity)}function m(){n.realtimeAnimation=!1}function h(e,t){w.addListener(n.$id,n.realtimeChannel,e,t)}function y(e,t){p(t)&&(a(t),r())}function p(e){return e[i]}function g(e){e&&e.length&&_.forEach(e,function(e){o.push(e)}),n.withPosition.length&&T.getMap("c8y-map-".concat(n.$id)).then(function(e){e.fitBounds(o,{padding:[50,50]})})}function b(e){var t,n=p(e),i=_.cloneDeep(n||{}),r=null,a=_.find(o,{id:e.id});return a?(n.lat=Number(n.lat),a.lat=n.lat,n.lng=Number(n.lng),a.lng=n.lng):(n.lat=Number(n.lat),i.lat=n.lat,n.lng=Number(n.lng),i.lng=n.lng,n&&_.isNumber(n.lat)&&_.isNumber(n.lng)&&!_.isNaN(_.toNumber(n.lat))&&!_.isNaN(_.toNumber(n.lng))&&(i.id=e.id,i.message='\n <a\n class="btn btn-link"\n style="width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"\n href="#/device/'.concat((a=e).id,'"\n title="').concat(a.name,'"\n >\n ').concat(a.name,"\n </a>\n "),i.icon={className:"".concat((t=e.c8y_ActiveAlarmsStatus||{},_.find(["critical","major","minor","warning"],function(e){return t[e]})||"normal"),"-marker-icon"),iconSize:[25,41],iconAnchor:[12,41],type:"div"},r=i)),r}n.$watch("deviceId",function(e,t){e&&e!==t&&(l=[],o.length=0,c(e))}),n.markers=o,n.mapDefault={scrollWheelZoom:!1,tileLayerOptions:{referrerPolicy:"strict-origin-when-cross-origin"}},n.cssToHide=function(){return n.withPosition&&n.withPosition.length?{}:{visibility:"hidden"}},n.paging={refresh:!0},n.realtime||(n.refresh=e),v.all([$.listByUser(),T.getMap("c8y-map-".concat(n.$id))]).then(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];_.some(t,{contextPath:"openseamap"})&&(t=L.tileLayer("/apps/openseamap/{z}/{x}/{y}.png"),L.control.layers({},{openseamap:t}).addTo(e))}),n.realtimeChannel="/managedobjects/*",h("".concat(n.$id,"-subscribed"),m),h("UPDATE",y),n.realtime&&(n.$on("$destroy",function(){w.stop(n.$id,n.realtimeChannel)}),w.start(n.$id,n.realtimeChannel)),e()},restrict:"E",scope:{deviceId:"=?",multipleDevices:"=",cssClass:"@",width:"=?",height:"=?",config:"=",realtime:"="},templateUrl:":::PLUGIN_PATH:::/ui/views/map.html"}}e.$inject=["$q","c8yInventory","c8yRealtime","leafletData","c8yBase","c8yGroups","c8yApplication"],angular.module("c8y.ui").directive("c8yMap",e)})();
|
package/core/ui/views/map.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{function e(e,n,l,
|
|
1
|
+
(()=>{function e(e,n,t,l,a,o,r){var c,g=new l.Bounds,i=[],s={type:"polygon",stroke:!0,weight:1,color:"#2e3974",fillColor:"#2e3974",latlngs:[]},d={center:{},events:{},defaults:{tileLayerOptions:{referrerPolicy:"strict-origin-when-cross-origin"},doubleClickZoom:!1},bounds:g.get(),markers:i,paths:{geofencePath:s}};function f(e){e&&(d.center=_.assign(d.center,{lat:Number(e.lat),lng:Number(e.lng),zoom:17}))}function u(){0<s.latlngs.length&&(g.reset(),_.forEach(s.latlngs,function(e){g.add(e)}),d.bounds=g.get())}function h(){s.latlngs.length=0,i.length=0}function m(e,n){switch(e.name){case"leafletDirectiveMarker.dragstart":c={lat:n.model.lat,lng:n.model.lng,draggable:!0};break;case"leafletDirectiveMarker.dragend":s.latlngs[_.findIndex(s.latlngs,c)]={lat:n.model.lat,lng:n.model.lng,draggable:!0}}}e.gotoAddress=function(e){l.geoCode(e).then(function(e){e=_.get(e,"data[0]");return e?(e.lng=e.lon,e):(o.warning(r("Address could not be found.")),null)}).then(f)},e.centerMap=u,e.clearGeofence=h,e.chooseGeofence=function(){var e;n.close((e=s.latlngs,_.map(e,function(e){return{lat:e.lat,lng:e.lng}})))},e.cancel=n.dismiss,e.map=d,e.$on("leafletDirectiveMap.click",function(e,n){n={lat:n.leafletEvent.latlng.lat,lng:n.leafletEvent.latlng.lng,draggable:!0,icon:{type:"div",className:"normal-marker-icon",iconSize:[25,41],iconAnchor:[12.5,41]}},d.markers.push(n),s.latlngs.push(n),1===s.latlngs.length&&(d.paths={geofencePath:s})}),e.$on("leafletDirectiveMarker.dragend",m),e.$on("leafletDirectiveMarker.dragstart",m),h(),_.forEach(a,function(e){e.draggable=!0,e.icon={type:"div",className:"normal-marker-icon",iconSize:[25,41],iconAnchor:[12.5,41]},i.push(e),s.latlngs.push(e)}),0<s.latlngs.length?d.paths={geofencePath:s}:d.paths={},t(u,0)}e.$inject=["$scope","$uibModalInstance","$timeout","c8yGeo","geofenceLatLngs","c8yAlert","gettext"],angular.module("c8y.cockpit.map").controller("GeofenceEditCtrl",e)})();
|
package/package.json
CHANGED
package/scada/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{function e(e,t){e.add({name:"SCADA",description:t("Display a configurable SVG."),templateUrl:":::PLUGIN_PATH:::/views/component.html",configTemplateUrl:":::PLUGIN_PATH:::/views/componentConfig.html",previewImage:":::PLUGIN_PATH:::/img/scada-widget-pr.png",transformConfigWithContext:["config","context","dashboard",function(e,t,
|
|
1
|
+
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}(()=>{function e(e,t){function c(n){n&&"object"===_typeof(n)&&(Array.isArray(n)?n.forEach(c):Object.keys(n).forEach(function(e){var t,o;"__target"===e&&n[e]&&"object"===_typeof(n[e])?(o=(t=n[e]).id,n[e]={id:o,name:t.name,c8y_IsDevice:t.c8y_IsDevice}):c(n[e])}))}e.add({name:"SCADA",description:t("Display a configurable SVG."),templateUrl:":::PLUGIN_PATH:::/views/component.html",configTemplateUrl:":::PLUGIN_PATH:::/views/componentConfig.html",previewImage:":::PLUGIN_PATH:::/img/scada-widget-pr.png",transformConfigWithContext:["config","context","dashboard",function(e,t,o){return o.deviceType&&e.deviceIds&&(e.deviceIds=_.mapValues(e.deviceIds,_.constant(t.id)),c(e)),e}],options:{groupsSelectable:!0}})}e.$inject=["c8yComponentsProvider","gettext"],angular.module("c8y.parts.scadaWidget",[]).config(e)})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{function i(e,n,t,c,d,a,o){var r=this;function l(n){return _.find(r.devices,function(i){return n===i.id})}this.init=function(){e.child.config.deviceIds||(e.child.config.deviceIds={},_.forOwn(e.child.config.mapping,function(i,n){e.child.config.deviceIds[n]=e.child.config.device.id}));var i=_(e.child.config.deviceIds).values().uniq().map(function(i){return d.detailRealtime(i,e,function(i){i.name=t("truncate")(i.name)})}).value();n.all(i).then(function(i){r.devices=i,r.updateComputedProperties(e.child.config.deviceIds,e.child.config.mapping)}),c.detail(e.child.config.binaryId).then(function(i){r.svgFile=i.data,c.downloadAsDataUri(r.svgFile).then(c.decodeDataUri).then(function(i){return new File([i],r.svgFile.name,{type:r.svgFile.type})}).then(function(i){return o.sanitizeFileByLevel(i,e.child.config.sanitization)}).then(function(i){return c.readDataUri(i)}).then(c.decodeDataUri).then(function(i){r.svgFile.data=i})})},this.updateComputedProperties=function(i,e){i&&e&&_.forOwn(i,function(i,n){n=[e[n]];n.length&&a.attach(l(i),n)})},e.$
|
|
1
|
+
(()=>{function i(e,n,t,c,d,a,o){var i=this,r=this;function l(n){return _.find(r.devices,function(i){return n===i.id})}this.init=function(){e.child.config.deviceIds||(e.child.config.deviceIds={},_.forOwn(e.child.config.mapping,function(i,n){e.child.config.deviceIds[n]=e.child.config.device.id}));var i=_(e.child.config.deviceIds).values().uniq().map(function(i){return d.detailRealtime(i,e,function(i){i.name=t("truncate")(i.name)})}).value();n.all(i).then(function(i){r.devices=i,r.updateComputedProperties(e.child.config.deviceIds,e.child.config.mapping)}),c.detail(e.child.config.binaryId).then(function(i){r.svgFile=i.data,c.downloadAsDataUri(r.svgFile).then(c.decodeDataUri).then(function(i){return new File([i],r.svgFile.name,{type:r.svgFile.type})}).then(function(i){return o.sanitizeFileByLevel(i,e.child.config.sanitization)}).then(function(i){return c.readDataUri(i)}).then(c.decodeDataUri).then(function(i){r.svgFile.data=i})})},this.updateComputedProperties=function(i,e){i&&e&&_.forOwn(i,function(i,n){n=[e[n]];n.length&&a.attach(l(i),n)})},e.$watchGroup(["child.config.binaryId","child.config.sanitization","child.config.deviceIds"],function(){return i.init()}),e.$on("$destroy",function(){var i=_.uniq(_.values(e.child.config.deviceIds));_.forEach(i,function(i){a.detach(l(i))})})}i.$inject=["$scope","$q","$filter","c8yBinary","c8yDevices","c8yComputedProperties","c8ySanitizeHtml"],angular.module("c8y.parts.scadaWidget").controller("ScadaWidgetCtrl",i)})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
angular.module("c8y.smartRules").directive("smartRuleParamInputGeofence",function(){return{require:"smartRuleParamInput",scope:{rule:"=",param:"="},restrict:"E",templateUrl:":::PLUGIN_PATH:::/views/paramInputGeofence.html",controller:["$scope","c8yGeo","geofenceSvc",function(t,e,
|
|
1
|
+
angular.module("c8y.smartRules").directive("smartRuleParamInputGeofence",function(){return{require:"smartRuleParamInput",scope:{rule:"=",param:"="},restrict:"E",templateUrl:":::PLUGIN_PATH:::/views/paramInputGeofence.html",controller:["$scope","c8yGeo","geofenceSvc",function(t,e,o){var n={type:"polygon",stroke:!0,weight:1,color:"#2e3974",fillColor:"#2e3974",latlngs:[]},r=new e.Bounds,l={center:{},bounds:r.get(),paths:{geofence:n},defaults:{zoomControl:!1,scrollWheelZoom:!1,tileLayerOptions:{referrerPolicy:"strict-origin-when-cross-origin"}}};function a(e){t.rule.config[t.param.property]=e,n.latlngs.length=0,_.forEach(e,function(e){n.latlngs.push(e),r.add(e)}),l.bounds=r.get(),0<n.latlngs.length?l.paths={geofence:n}:l.paths={}}t.map=l,t.editGeofence=function(){o.showEditUI(n.latlngs).then(function(e){a(e)})},a(t.rule.config[t.param.property])}]}});
|