@c8y/ng1-modules 1017.0.255 → 1017.0.257

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 _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_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(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _iterableToArrayLimit(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i=[],o=!0,l=!1;try{for(r=r.call(t);!(o=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);o=!0);}catch(t){l=!0,a=t}finally{try{o||null==r.return||r.return()}finally{if(l)throw a}}return i}}function _arrayWithHoles(t){if(Array.isArray(t))return t}!function(){function t(l,c,u,s,a,r,f){var i=u.createEnum([{name:"ALARM",value:"ALARM",label:f("Alarm")},{name:"EVENT",value:"EVENT",label:f("Event")}]);return{TIMELINE_TYPES:i,getSampleAlarmsAndEventsConfigsForDevice:function(t){return l.all([function(t){var e={source:t.id||t,pageSize:10};return s.list(e).then(function(t){return _.map(t,function(t){return{__active:!1,__target:_.pick(t.source,"id","name"),label:t.type,color:r.generateColor(),timelineType:i.ALARM.value,filters:{type:t.type}}})})}(t),function(t){var e={source:t.id||t,pageSize:10};return a.list(e).then(function(t){return _.map(t,function(t){return{__active:!1,__target:_.pick(t.source,"id","name"),label:t.type,color:r.generateColor(),timelineType:i.EVENT.value,filters:{type:t.type}}})})}(t)]).then(_.flatten).then(e)},getEmptyAlarmEventConfigForDevice:function(t){return{__active:!1,__target:_.pick(t,"id","name"),label:"",color:r.generateColor(),timelineType:i.ALARM.value,filters:{type:""}}},fetchTimelinesForAlarmsEvents:function(t,r){var e=_.filter(t,{__active:!0}),n=_.map(e,function(e){return function(t,e){var r=l.when([]),n=_.assign({},e,t.filters,{source:t.__target.id});t.timelineType===i.EVENT.value?r=function(t,e){return a.list(e).then(function(t){return l.all(_.map(t,m))})}(0,n):t.timelineType===i.ALARM.value&&(r=function(t,e){var r=_.assign({},e,{dateFrom:moment(0).format(u.dateFullFormat),dateTo:e.dateFrom,revert:!0,pageSize:1}),n=e,a=_.assign({},e,{dateFrom:e.dateTo,dateTo:moment().format(u.dateFullFormat),pageSize:1}),i=[s.list(r),s.list(n),s.list(a)];return l.all(i).then(_.flatten).then(function(t){return l.all(_.map(t,o))})}(0,n));return r}(e,r).then(function(t){return function(t,e){return{label:t.label,color:t.color,events:e,alarmsEventsConfig:t}}(e,t)})});return l.all(n)},alarmMatchesConfig:function(t,e){return _.isMatch(e,{timelineType:"ALARM",__target:{id:t.source.id},filters:{type:t.type}})},eventMatchesConfig:function(t,e){return _.isMatch(e,{timelineType:"EVENT",__target:{id:t.source.id},filters:{type:t.type}})},transformAlarmToTimelineEvent:o,transformEventToTimelineEvent:m};function e(t){return _.uniqBy(t,function(t){return[t.__target.id,t.timelineType,t.filters.type].join(":")})}function o(o){return l.all([s.alarmDurationDiff(o),function(r){var n=c("absoluteDate"),a=c("translate"),i=c("humanize2");return s.statusText(r).then(function(t){var e=r.firstOccurrenceTime||r.time;return _.flatten(['<i class="dlt-c8y-icon-bell"></i> <b>'.concat(n(e),"</b>"),"".concat(a(f("Status")),": ").concat(t),_.map(s.getStandardKeys(r),function(t,e){return"".concat(_.escape(a(t)),": <b>").concat(_.escape(r[e]),"</b>")}),_.map(s.getNonStandardKeys(r),function(t){return"".concat(_.escape(i(t)),": <b>").concat(_.escape(JSON.stringify(r[t])),"</b>")})]).join("<br />")})}(o)]).then(function(t){var e=_slicedToArray(t,2),r=e[0],n=e[1],a=o.firstOccurrenceTime||o.time||o.creationTime,i=o.status!==s.status.ACTIVE&&r?moment(a).subtract(r).format(u.dateFullFormat):void 0;return{id:o.id,dateFrom:a,dateTo:i,tooltip:n}})}function m(e){return function(r){var t=c("absoluteDate"),n=c("translate"),e=c("humanize2");return l.when(_.flatten(['<i class="dlt-c8y-icon-rss"></i> <b>'.concat(t(r.time),"</b>"),_.map(a.getStandardKeys(r),function(t,e){return"".concat(_.escape(n(t)),": <b>").concat(_.escape(r[e]),"</b>")}),_.map(a.getNonStandardKeys(r),function(t){return"".concat(_.escape(e(t)),": <b>").concat(_.escape(JSON.stringify(r[t])),"</b>")})]).join("<br />"))}(e).then(function(t){return{id:e.id,date:e.time,tooltip:t}})}}t.$inject=["$q","$filter","c8yBase","c8yAlarms","c8yEvents","c8yUiUtil","gettext"],angular.module("c8y.alarmsEventsExplorer").factory("c8yAlarmsEventsTimelinesChartService",t)}();
1
+ "use strict";function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_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(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _iterableToArrayLimit(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i=[],o=!0,l=!1;try{for(r=r.call(t);!(o=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);o=!0);}catch(t){l=!0,a=t}finally{try{o||null==r.return||r.return()}finally{if(l)throw a}}return i}}function _arrayWithHoles(t){if(Array.isArray(t))return t}!function(){function t(l,c,u,s,a,r,f){var i=u.createEnum([{name:"ALARM",value:"ALARM",label:f("Alarm")},{name:"EVENT",value:"EVENT",label:f("Event")}]);return{TIMELINE_TYPES:i,getSampleAlarmsAndEventsConfigsForDevice:function(t){return l.all([function(t){var e={source:t.id||t,pageSize:10};return s.list(e).then(function(t){return _.map(t,function(t){return{__active:!1,__target:_.pick(t.source,"id","name"),label:t.type,color:r.generateColor(),timelineType:i.ALARM.value,filters:{type:t.type}}})})}(t),function(t){var e={source:t.id||t,pageSize:10};return a.list(e).then(function(t){return _.map(t,function(t){return{__active:!1,__target:_.pick(t.source,"id","name"),label:t.type,color:r.generateColor(),timelineType:i.EVENT.value,filters:{type:t.type}}})})}(t)]).then(_.flatten).then(e)},getEmptyAlarmEventConfigForDevice:function(t){return{__active:!1,__target:_.pick(t,"id","name"),label:"",color:r.generateColor(),timelineType:i.ALARM.value,filters:{type:""}}},fetchTimelinesForAlarmsEvents:function(t,r){var e=_.filter(t,{__active:!0}),n=_.map(e,function(e){return function(t,e){var r=l.when([]),n=_.assign({},e,t.filters,{source:t.__target.id});t.timelineType===i.EVENT.value?r=function(t,e){return a.list(e).then(function(t){return l.all(_.map(t,m))})}(0,n):t.timelineType===i.ALARM.value&&(r=function(t,e){var r=_.assign({},e,{dateFrom:moment(0).format(u.dateFullFormat),dateTo:e.dateFrom,revert:!0,pageSize:1}),n=e,a=_.assign({},e,{dateFrom:e.dateTo,dateTo:moment().format(u.dateFullFormat),pageSize:1}),i=[s.list(r),s.list(n),s.list(a)];return l.all(i).then(_.flatten).then(function(t){return l.all(_.map(t,o))})}(0,n));return r}(e,r).then(function(t){return function(t,e){return{label:t.label,color:t.color,events:e,alarmsEventsConfig:t}}(e,t)})});return l.all(n)},alarmMatchesConfig:function(t,e){return _.isMatch(e,{timelineType:"ALARM",__target:{id:t.source.id},filters:{type:t.type}})},eventMatchesConfig:function(t,e){return _.isMatch(e,{timelineType:"EVENT",__target:{id:t.source.id},filters:{type:t.type}})},transformAlarmToTimelineEvent:o,transformEventToTimelineEvent:m};function e(t){return _.uniqBy(t,function(t){return[t.__target.id,t.timelineType,t.filters.type].join(":")})}function o(o){return l.all([s.alarmDurationDiff(o),function(r){var n=c("absoluteDate"),a=c("translate"),i=c("humanize2");return s.statusText(r).then(function(t){var e=r.firstOccurrenceTime||r.time;return _.flatten(['<i class="dlt-c8y-icon-bell"></i> <b>'.concat(n(e),"</b>"),"".concat(a(f("Status")),": ").concat(t),_.map(s.getStandardKeys(r,["lastUpdated"]),function(t,e){return"".concat(_.escape(a(t)),": <b>").concat(_.escape(r[e]),"</b>")}),"".concat(a(f("Last updated")),": <b>").concat(n(r.lastUpdated),"</b>"),_.map(s.getNonStandardKeys(r),function(t){return"".concat(_.escape(i(t)),": <b>").concat(_.escape(JSON.stringify(r[t])),"</b>")})]).join("<br />")})}(o)]).then(function(t){var e=_slicedToArray(t,2),r=e[0],n=e[1],a=o.firstOccurrenceTime||o.time||o.creationTime,i=o.status!==s.status.ACTIVE&&r?moment(a).subtract(r).format(u.dateFullFormat):void 0;return{id:o.id,dateFrom:a,dateTo:i,tooltip:n}})}function m(e){return function(r){var t=c("absoluteDate"),n=c("translate"),e=c("humanize2");return l.when(_.flatten(['<i class="dlt-c8y-icon-rss"></i> <b>'.concat(t(r.time),"</b>"),_.map(a.getStandardKeys(r),function(t,e){return"".concat(_.escape(n(t)),": <b>").concat(_.escape(r[e]),"</b>")}),_.map(a.getNonStandardKeys(r),function(t){return"".concat(_.escape(e(t)),": <b>").concat(_.escape(JSON.stringify(r[t])),"</b>")})]).join("<br />"))}(e).then(function(t){return{id:e.id,date:e.time,tooltip:t}})}}t.$inject=["$q","$filter","c8yBase","c8yAlarms","c8yEvents","c8yUiUtil","gettext"],angular.module("c8y.alarmsEventsExplorer").factory("c8yAlarmsEventsTimelinesChartService",t)}();
@@ -1 +1 @@
1
- "use strict";function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),n.forEach(function(t){_defineProperty(e,t,r[t])})}return e}function _defineProperty(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(){function t(a,u,o,i,n,t,e,c){var s=u.cleanFields,f="alarm/alarms",l="".concat(f,"/reports"),m={headers:u.contentHeaders("alarm")},r={WARNING:e("WARNING"),MINOR:e("MINOR"),MAJOR:e("MAJOR"),CRITICAL:e("CRITICAL")},p=[r.CRITICAL,r.MAJOR,r.MINOR,r.WARNING],g=_.keys(r),y={ACTIVE:e("ACTIVE"),ACKNOWLEDGED:e("ACKNOWLEDGED"),CLEARED:e("CLEARED")},h=_.keys(y),d=["id"],v=["id","self","creationTime","type","time","count","history","firstOccurence","firstOccurrenceTime"],E={},C="status",A={type:e("Type"),text:e("Text")};function D(t){var e=t.id||t;return u.url("".concat(f,"/").concat(e))}function O(t){var e=u.url(f),r=u.timeOrderFilter(u.pageSizeNoTotalFilter(t)),n={params:r},i=u.cleanListCallback("alarms",O,r);return a.get(e,n).then(i)}function w(t){var e=u.url(f),r=s(t,d);return a.post(e,r,m)}function N(t){var e=D(t),r=s(t,v);return a.put(e,r,m)}function T(e,t){return t?r(t):n.list({source:e.id,pageSize:1e3}).then(r);function r(t){var n="--";return e.status!==y.ACKNOWLEDGED||_.isEmpty(t)||(n=_.last(t).user),t.forEach(function(t){var e=t.changes||[],r=!1;if(e.forEach(function(t){if(t.attribute===C&&t.newValue===y.ACKNOWLEDGED)return!(r=!0)}),r)return n=t.user||n,!1}),n}}function b(t,e){function r(t){var e=t||[],n=e.length?e[e.length-1].creationTime:void 0;return e.forEach(function(e){var t=e.changes||[],r=!1;if(t.forEach(function(t){if(t.attribute===C&&t.newValue===y.ACKNOWLEDGED)return n=e.creationTime,!(r=!0)}),r)return!1}),n}return e?r(e):n.list({source:t.id,pageSize:1e3}).then(r)}function L(t,e){var r=R(t,e);return r.humanize?r.humanize():r.then(function(t){return t.humanize?t.humanize():""})}function R(o,t){function e(t){var e=t||[],r=o.creationTime,n=e.length?e[e.length-1].creationTime:void 0,i="";if(_.forEach(e,function(e){var t=e.changes||[],r=!1;if(t.forEach(function(t){if(t.attribute===C&&t.newValue===y.CLEARED)return n=e.creationTime,!(r=!0)}),r)return!1}),r&&n){var a=moment(r),u=moment(n);i=moment.duration(a.diff(u))}return i}return t?e(t):n.list({source:o.id,pageSize:1e3}).then(e)}function I(t,e){var r=[l,t];return e.id&&r.push(e.id),u.url(r.join("/"))}function S(t){var r=_.memoize(t,function(t,e){return[t.id,t.status,t.count,e&&e.length].join(":")});return function(t,e){return r(t,e)}}function k(t,e){var r=i.when(T(t,e)),n=i.when(b(t,e));return i.all([r,n]).then(function(t){return c.getString("ACKNOWLEDGED`alarm` by: {{ackBy}} {{ackTimeFromNow}}",{ackBy:t[0],ackTimeFromNow:moment(t[1]).fromNow()})})}function W(t,e){return i.when(L(t,e)).then(function(t){return c.getString("CLEARED`alarm`: was active for {{alarmDuration}}",{alarmDuration:t})})}function j(t){return i.when(c.getString("ACTIVE`alarm`: triggered {{alarmTimeFromNow}}",{alarmTimeFromNow:moment(t.time).fromNow()}))}E[r.WARNING]="circle",E[r.MINOR]="high-priority",E[r.MAJOR]="warning",E[r.CRITICAL]="exclamation-circle",E[y.CLEARED]="c8y-alert-idle",E[y.ACKNOWLEDGED]="bell-slash",E[y.ACTIVE]="bell";var G={list:O,listByStatus:function(t,e){var r=_.compact(_.map(t,function(t,e){return t?e:void 0})),n=_.map(r,function(t){return O(_objectSpread({},e,{status:t}))});return i.all(n).then(u.combineLists)},listByDevices:function(t,e){return i.all(_.map(t,function(t){return e.source=t,O(e)})).then(u.combineLists)},getSeverityCount:function(t,e){return _.filter(t,{severity:e}).length},detail:function(t){var e=D(t);return a.get(e)},update:N,updateBulk:function(t,e){var r=u.url(f);return a.put(r,e,{params:t})},create:w,save:function(t){return t.id?N(t):w(t)},acknowledgedBy:S(T),ackTime:S(b),alarmDuration:S(L),alarmDurationDiff:S(R),severity:r,severityList:g,getHighestSeverityFromAlarmsStatus:function(e){var t=_.map(p,function(t){return{severity:t,count:_.get(e,_.toLower(t),0)}}),r=_.find(t,function(t){return 0<t.count});return _.get(r,"severity",null)},status:y,statusList:h,statusText:S(function(t,e){var r;switch((t.status||"").toUpperCase()){case y.ACKNOWLEDGED:r=k;break;case y.CLEARED:r=W;break;case y.ACTIVE:r=j}return r&&r(t,e)}),icon:function(t){var e=(_.isObjectLike(t)?t.severity:t).toUpperCase();return E[e]},reports:{downtimeDuration:function(t){var e=u.timeOrderFilter(t),r=I("downtimeDuration",e),n={params:e};return a.get(r,n)},downtimeDurationAggregation:function(t){var e=u.timeOrderFilter(t),r=I("downtimeDuration/aggregation",e),n={params:e};return a.get(r,n)}},getDisplayCount:function(t){var e=u.url("".concat(f,"/count")),r={params:t};return a.get(e,r).then(u.getResData).then(function(t){return 99<t?"99+":t})},createCounter:function(t){var e=_.get(t,"source"),r="/alarms/".concat(e||"*"),n=new o.Counter(O,r);if(t){var i=[o.defaultPropertyMaps.date,o.defaultPropertyMaps.source];if(t.type){var a=t.type;i.push([function(t){return a===t.type}])}delete t.type,n.filter(t,i)}return n}};return t.enhanceWithKeysUtil({target:G,reservedKeys:["history","id","severity","self","source","creationTime","time","text","firstOccurrence","count","firstOccurrenceTime","status"],standardKeys:A})}t.$inject=["$http","c8yBase","c8yCounter","$q","c8yAudits","c8yUtil","gettext","gettextCatalog"],angular.module("c8y.core").factory("c8yAlarms",t)}();
1
+ "use strict";function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),n.forEach(function(t){_defineProperty(e,t,r[t])})}return e}function _defineProperty(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(){function t(a,u,o,i,n,t,e,c){var s=u.cleanFields,f="alarm/alarms",l="".concat(f,"/reports"),m={headers:u.contentHeaders("alarm")},r={WARNING:e("WARNING"),MINOR:e("MINOR"),MAJOR:e("MAJOR"),CRITICAL:e("CRITICAL")},p=[r.CRITICAL,r.MAJOR,r.MINOR,r.WARNING],g=_.keys(r),y={ACTIVE:e("ACTIVE"),ACKNOWLEDGED:e("ACKNOWLEDGED"),CLEARED:e("CLEARED")},d=_.keys(y),h=["id"],v=["id","self","creationTime","type","time","count","history","firstOccurence","firstOccurrenceTime"],E={},C="status",A={type:e("Type"),text:e("Text"),lastUpdated:e("Last updated")};function D(t){var e=t.id||t;return u.url("".concat(f,"/").concat(e))}function O(t){var e=u.url(f),r=u.timeOrderFilter(u.pageSizeNoTotalFilter(t)),n={params:r},i=u.cleanListCallback("alarms",O,r);return a.get(e,n).then(i)}function T(t){var e=u.url(f),r=s(t,h);return a.post(e,r,m)}function w(t){var e=D(t),r=s(t,v);return a.put(e,r,m)}function N(e,t){return t?r(t):n.list({source:e.id,pageSize:1e3}).then(r);function r(t){var n="--";return e.status!==y.ACKNOWLEDGED||_.isEmpty(t)||(n=_.last(t).user),t.forEach(function(t){var e=t.changes||[],r=!1;if(e.forEach(function(t){if(t.attribute===C&&t.newValue===y.ACKNOWLEDGED)return!(r=!0)}),r)return n=t.user||n,!1}),n}}function b(t,e){function r(t){var e=t||[],n=e.length?e[e.length-1].creationTime:void 0;return e.forEach(function(e){var t=e.changes||[],r=!1;if(t.forEach(function(t){if(t.attribute===C&&t.newValue===y.ACKNOWLEDGED)return n=e.creationTime,!(r=!0)}),r)return!1}),n}return e?r(e):n.list({source:t.id,pageSize:1e3}).then(r)}function L(t,e){var r=R(t,e);return r.humanize?r.humanize():r.then(function(t){return t.humanize?t.humanize():""})}function R(o,t){function e(t){var e=t||[],r=o.firstOccurrenceTime||o.time||o.creationTime,n=e.length?e[e.length-1].creationTime:void 0,i="";if(_.forEach(e,function(e){var t=e.changes||[],r=!1;if(t.forEach(function(t){if(t.attribute===C&&t.newValue===y.CLEARED)return n=e.creationTime,!(r=!0)}),r)return!1}),r&&n){var a=moment(r),u=moment(n);i=moment.duration(a.diff(u))}return i}return t?e(t):n.list({source:o.id,pageSize:1e3}).then(e)}function I(t,e){var r=[l,t];return e.id&&r.push(e.id),u.url(r.join("/"))}function S(t){var r=_.memoize(t,function(t,e){return[t.id,t.status,t.count,e&&e.length].join(":")});return function(t,e){return r(t,e)}}function k(t,e){var r=i.when(N(t,e)),n=i.when(b(t,e));return i.all([r,n]).then(function(t){return c.getString("ACKNOWLEDGED`alarm` by: {{ackBy}} {{ackTimeFromNow}}",{ackBy:t[0],ackTimeFromNow:moment(t[1]).fromNow()})})}function W(t,e){return i.when(L(t,e)).then(function(t){return c.getString("CLEARED`alarm`: was active for {{alarmDuration}}",{alarmDuration:t})})}function j(t){return i.when(c.getString("ACTIVE`alarm`: triggered {{alarmTimeFromNow}}",{alarmTimeFromNow:moment(t.time).fromNow()}))}E[r.WARNING]="circle",E[r.MINOR]="high-priority",E[r.MAJOR]="warning",E[r.CRITICAL]="exclamation-circle",E[y.CLEARED]="c8y-alert-idle",E[y.ACKNOWLEDGED]="bell-slash",E[y.ACTIVE]="bell";var G={list:O,listByStatus:function(t,e){var r=_.compact(_.map(t,function(t,e){return t?e:void 0})),n=_.map(r,function(t){return O(_objectSpread({},e,{status:t}))});return i.all(n).then(u.combineLists)},listByDevices:function(t,e){return i.all(_.map(t,function(t){return e.source=t,O(e)})).then(u.combineLists)},getSeverityCount:function(t,e){return _.filter(t,{severity:e}).length},detail:function(t){var e=D(t);return a.get(e)},update:w,updateBulk:function(t,e){var r=u.url(f);return a.put(r,e,{params:t})},create:T,save:function(t){return t.id?w(t):T(t)},acknowledgedBy:S(N),ackTime:S(b),alarmDuration:S(L),alarmDurationDiff:S(R),severity:r,severityList:g,getHighestSeverityFromAlarmsStatus:function(e){var t=_.map(p,function(t){return{severity:t,count:_.get(e,_.toLower(t),0)}}),r=_.find(t,function(t){return 0<t.count});return _.get(r,"severity",null)},status:y,statusList:d,statusText:S(function(t,e){var r;switch((t.status||"").toUpperCase()){case y.ACKNOWLEDGED:r=k;break;case y.CLEARED:r=W;break;case y.ACTIVE:r=j}return r&&r(t,e)}),icon:function(t){var e=(_.isObjectLike(t)?t.severity:t).toUpperCase();return E[e]},reports:{downtimeDuration:function(t){var e=u.timeOrderFilter(t),r=I("downtimeDuration",e),n={params:e};return a.get(r,n)},downtimeDurationAggregation:function(t){var e=u.timeOrderFilter(t),r=I("downtimeDuration/aggregation",e),n={params:e};return a.get(r,n)}},getDisplayCount:function(t){var e=u.url("".concat(f,"/count")),r={params:t};return a.get(e,r).then(u.getResData).then(function(t){return 99<t?"99+":t})},createCounter:function(t){var e=_.get(t,"source"),r="/alarms/".concat(e||"*"),n=new o.Counter(O,r);if(t){var i=[o.defaultPropertyMaps.date,o.defaultPropertyMaps.source];if(t.type){var a=t.type;i.push([function(t){return a===t.type}])}delete t.type,n.filter(t,i)}return n}};return t.enhanceWithKeysUtil({target:G,reservedKeys:["history","id","severity","self","source","creationTime","time","text","firstOccurrence","count","firstOccurrenceTime","status"],standardKeys:A})}t.$inject=["$http","c8yBase","c8yCounter","$q","c8yAudits","c8yUtil","gettext","gettextCatalog"],angular.module("c8y.core").factory("c8yAlarms",t)}();
@@ -1 +1 @@
1
- "use strict";!function(){function t(t,e,n){var i,r,a,o,c,l,d,s,u,m,h,p=this,f={},g={top:20,right:0,bottom:10,left:0},v=30,y="10px",x=10,D=100,b=!1,A=!1,F=function(){h||(h=setTimeout(function(){h=null,function(){if(!b)return;c=c||e.find("svg")[0],l=l||d3.select("body").append("div").classed("c8y-timelines-chart-tooltip",!0).style("opacity",0),function(){var t=0<o.length?$(c).width()-g.left-g.right:0,e=0<o.length?o.length*v:0,n=0<o.length?t+g.left+g.right:0,a=0<o.length?e+g.top+g.bottom:0;n===f.totalWidth&&a===f.totalHeight||p.onSizeChanged({$size:{width:n,height:a}});f={chartWidth:0<t?t:0,chartHeight:0<e?e:0,totalWidth:0<n?n:0,totalHeight:0<a?a:0}}(),d3.select(c).attr({width:f.totalWidth,height:f.totalHeight}),function(){d||(d=d3.select(c).append("defs").append("svg:clipPath").attr("id","chart-clip-".concat(i)).append("svg:rect").attr("id","clip-rect".concat(i)).attr("x",0).attr("y",-15).attr("width",f.chartWidth).attr("height",f.chartHeight));d3.select("#clip-rect".concat(i)).attr("width",f.chartWidth).attr("height",f.chartHeight)}(),function(){s||(s=d3.select(c).append("g").classed("chart",!0));s.attr("transform",C(g.left,g.top))}(),u=d3.time.scale().domain([moment(r).toDate(),moment(a).toDate()]).range([0,f.chartWidth]),m=d3.svg.axis().scale(u).orient("bottom").ticks(0),function(){var t=s.selectAll("g.timeline").data(o),e=t.enter().append("g").classed("timeline",!0);e.append("g").classed("axis",!0),e.append("text").classed("axis-label",!0).attr("text-anchor","start").attr("x",0).attr("y",0).attr("transform",C(0,-10)).style("font-size",y),t.exit().remove(),s.selectAll("text.axis-label").data(o).text(function(t){return t.label}),s.selectAll("g.timeline").attr("transform",function(t,e){return C(0,e*v)}),s.selectAll("g.axis").call(m),s.selectAll("g.timeline").data(o).each(function(t){!function(t,e){A&&d3.select(t).selectAll("g.event").remove();var n=d3.select(t).selectAll("g.event").data(function(){return e.events}),a=d3.select(t).selectAll(".diamond").data(function(){return e.events});a.attr("d",d3.svg.symbol().type("diamond").size(function(){return D})).attr("transform",function(t){return C(u(moment(t.date).toDate()),0)}).attr("fill",function(){return e.color}),a.exit().remove();var o=d3.select(t).selectAll(".rect").data(function(){return e.events});o.attr("x",function(t){return u(moment(t.dateFrom).toDate())}).attr("width",function(t){return u(moment(r).add(moment(t.dateTo).diff(t.dateFrom)).toDate())}).style("fill",function(){return e.color}),o.exit().remove(),n.enter().append("g").classed("event",!0).attr("clip-path","url(#chart-clip-".concat(i,")")).each(function(t){t.date?d3.select(this).append("g").append("path").attr("class","diamond").attr("d",d3.svg.symbol().type("diamond").size(function(){return D})).attr("transform",C(u(moment(t.date).toDate()),0)).attr("fill",function(){return e.color}):d3.select(this).append("rect").attr("class","rect").attr("x",function(t){return u(moment(t.dateFrom).toDate())}).attr("y",0).attr("width",function(t){return u(moment(r).add(moment(t.dateTo).diff(t.dateFrom)).toDate())}).attr("height",x).attr("transform",C(0,-5)).style("fill",function(){return e.color})}).on("mouseover",function(t){l.transition().duration(200).style("opacity",.9);var e=l.html(_.isFunction(t.tooltip)?t.tooltip():t.tooltip).node().getBoundingClientRect().width,n=s.select("g.timeline").node().getBoundingClientRect().width;l.html(_.isFunction(t.tooltip)?t.tooltip():t.tooltip).style("left","".concat(n-e<d3.event.offsetX?d3.event.pageX-e:d3.event.pageX,"px")).style("top","".concat(d3.event.pageY-28,"px"))}).on("mouseout",function(){l.transition().duration(500).style("opacity",0)})}(this,t)}),A=!1}()}()},300))};if(n.has("ngZone")){var T=n.get("ngZone"),w=F;F=function(){return T.runOutsideAngular(w)}}function C(t,e){return"translate(".concat(t,", ").concat(e,")")}_.assign(p,{$onInit:function(){i=String(Math.random()).substr(2),r=_.cloneDeep(p.dateFrom),a=_.cloneDeep(p.dateTo),o=_.cloneDeep(p.data),t.$on("c8yTimelinesChart::render",F),t.$on("dashboardResize",F),window.addEventListener("resize",F),b=!0,F()},$onChanges:function(t){t.dateFrom&&(r=_.cloneDeep(t.dateFrom.currentValue));t.dateTo&&(a=_.cloneDeep(t.dateTo.currentValue));t.data&&(o=_.cloneDeep(t.data.currentValue));if(t.chartBox){var e=t.chartBox.currentValue;_.assign(g,{left:e&&e.leftSpace||0,right:e&&e.rightSpace||0})}F()},$doCheck:function(){var t=!1;_.isEqual(o,p.data)||(o=_.cloneDeep(p.data),t=A=!0);moment(r).isSame(p.dateFrom)||(r=_.cloneDeep(p.dateFrom),t=!0);moment(a).isSame(p.dateTo)||(a=_.cloneDeep(p.dateTo),t=!0);t&&F()},$onDestroy:function(){l&&l.remove()}})}t.$inject=["$scope","$element","$injector"],angular.module("c8y.ui").component("c8yTimelinesChart",{bindings:{dateFrom:"<",dateTo:"<",data:"<timelines",chartBox:"<",onSizeChanged:"&"},templateUrl:":::PLUGIN_PATH:::/ui/components/timelinesChart.html",controller:t,controllerAs:"vm"})}();
1
+ "use strict";!function(){function t(t,e,n){var i,r,a,o,c,l,d,s,u,m,h,p=this,f={},g={top:20,right:0,bottom:10,left:0},v=30,x="10px",y=10,D=100,b=!1,A=!1,F=function(){h||(h=setTimeout(function(){h=null,function(){if(!b)return;c=c||e.find("svg")[0],l=l||d3.select("body").append("div").classed("c8y-timelines-chart-tooltip",!0).style("opacity",0),function(){var t=0<o.length?$(c).width()-g.left-g.right:0,e=0<o.length?o.length*v:0,n=0<o.length?t+g.left+g.right:0,a=0<o.length?e+g.top+g.bottom:0;n===f.totalWidth&&a===f.totalHeight||p.onSizeChanged({$size:{width:n,height:a}});f={chartWidth:0<t?t:0,chartHeight:0<e?e:0,totalWidth:0<n?n:0,totalHeight:0<a?a:0}}(),d3.select(c).attr({width:f.totalWidth,height:f.totalHeight}),function(){d||(d=d3.select(c).append("defs").append("svg:clipPath").attr("id","chart-clip-".concat(i)).append("svg:rect").attr("id","clip-rect".concat(i)).attr("x",0).attr("y",-15).attr("width",f.chartWidth).attr("height",f.chartHeight));d3.select("#clip-rect".concat(i)).attr("width",f.chartWidth).attr("height",f.chartHeight)}(),function(){s||(s=d3.select(c).append("g").classed("chart",!0));s.attr("transform",C(g.left,g.top))}(),u=d3.time.scale().domain([moment(r).toDate(),moment(a).toDate()]).range([0,f.chartWidth]),m=d3.svg.axis().scale(u).orient("bottom").ticks(0),function(){var t=s.selectAll("g.timeline").data(o),e=t.enter().append("g").classed("timeline",!0);e.append("g").classed("axis",!0),e.append("text").classed("axis-label",!0).attr("text-anchor","start").attr("x",0).attr("y",0).attr("transform",C(0,-10)).style("font-size",x),t.exit().remove(),s.selectAll("text.axis-label").data(o).text(function(t){return t.label}),s.selectAll("g.timeline").attr("transform",function(t,e){return C(0,e*v)}),s.selectAll("g.axis").call(m),s.selectAll("g.timeline").data(o).each(function(t){!function(t,e){A&&d3.select(t).selectAll("g.event").remove();var n=d3.select(t).selectAll("g.event").data(function(){return e.events}),a=d3.select(t).selectAll(".diamond").data(function(){return e.events});a.attr("d",d3.svg.symbol().type("diamond").size(function(){return D})).attr("transform",function(t){return C(u(moment(t.date).toDate()),0)}).attr("fill",function(){return e.color}),a.exit().remove();var o=d3.select(t).selectAll(".rect").data(function(){return e.events});o.attr("x",function(t){return u(moment(t.dateFrom).toDate())}).attr("width",function(t){return _.max([1,u(moment(r).add(moment(t.dateTo).diff(t.dateFrom)).toDate())])}).style("fill",function(){return e.color}),o.exit().remove(),n.enter().append("g").classed("event",!0).attr("clip-path","url(#chart-clip-".concat(i,")")).each(function(t){t.date?d3.select(this).append("g").append("path").attr("class","diamond").attr("d",d3.svg.symbol().type("diamond").size(function(){return D})).attr("transform",C(u(moment(t.date).toDate()),0)).attr("fill",function(){return e.color}):d3.select(this).append("rect").attr("class","rect").attr("x",function(t){return u(moment(t.dateFrom).toDate())}).attr("y",0).attr("width",function(t){return _.max([1,u(moment(r).add(moment(t.dateTo).diff(t.dateFrom)).toDate())])}).attr("height",y).attr("transform",C(0,-5)).style("fill",function(){return e.color})}).on("mouseover",function(t){l.transition().duration(200).style("opacity",.9);var e=l.html(_.isFunction(t.tooltip)?t.tooltip():t.tooltip).node().getBoundingClientRect().width,n=s.select("g.timeline").node().getBoundingClientRect().width;l.html(_.isFunction(t.tooltip)?t.tooltip():t.tooltip).style("left","".concat(n-e<d3.event.offsetX?d3.event.pageX-e:d3.event.pageX,"px")).style("top","".concat(d3.event.pageY-28,"px"))}).on("mouseout",function(){l.transition().duration(500).style("opacity",0)})}(this,t)}),A=!1}()}()},300))};if(n.has("ngZone")){var T=n.get("ngZone"),w=F;F=function(){return T.runOutsideAngular(w)}}function C(t,e){return"translate(".concat(t,", ").concat(e,")")}_.assign(p,{$onInit:function(){i=String(Math.random()).substr(2),r=_.cloneDeep(p.dateFrom),a=_.cloneDeep(p.dateTo),o=_.cloneDeep(p.data),t.$on("c8yTimelinesChart::render",F),t.$on("dashboardResize",F),window.addEventListener("resize",F),b=!0,F()},$onChanges:function(t){t.dateFrom&&(r=_.cloneDeep(t.dateFrom.currentValue));t.dateTo&&(a=_.cloneDeep(t.dateTo.currentValue));t.data&&(o=_.cloneDeep(t.data.currentValue));if(t.chartBox){var e=t.chartBox.currentValue;_.assign(g,{left:e&&e.leftSpace||0,right:e&&e.rightSpace||0})}F()},$doCheck:function(){var t=!1;_.isEqual(o,p.data)||(o=_.cloneDeep(p.data),t=A=!0);moment(r).isSame(p.dateFrom)||(r=_.cloneDeep(p.dateFrom),t=!0);moment(a).isSame(p.dateTo)||(a=_.cloneDeep(p.dateTo),t=!0);t&&F()},$onDestroy:function(){l&&l.remove()}})}t.$inject=["$scope","$element","$injector"],angular.module("c8y.ui").component("c8yTimelinesChart",{bindings:{dateFrom:"<",dateTo:"<",data:"<timelines",chartBox:"<",onSizeChanged:"&"},templateUrl:":::PLUGIN_PATH:::/ui/components/timelinesChart.html",controller:t,controllerAs:"vm"})}();
@@ -1 +1 @@
1
- "use strict";!function(){function e(t){e.$inject=["$scope","$element"];var i=[250,500,1e3];function n(e){if(e.paging&&(e.paging.next||e.paging.blind))return t("More data may be available.")}return{restrict:"EA",replace:!0,templateUrl:":::PLUGIN_PATH:::/ui/views/loadmore.html",link:function(a,e,t){Object.hasOwn(t,"cheapnextcheck")&&(a.cheapNextCheck=!0),a.hidePageSize=!0,a.getLoadMoreTooltip=_.partial(n,a);var o=!_.isUndefined(t.changePageSize);!a.hidePageSize&&o&&(a._pageSizes=_.cloneDeep(i),a.$on("paging.statistics.pageSize",function(e){var t=parseInt(e,10),o=_.cloneDeep(i);t&&(a._pageSizes=_.without(o,t))}))},controller:e};function e(o,a){var i;function n(){var e=jQuery(a),t=_.head(e);if(!i){var o=t.querySelector(".classForObserver");(i=new IntersectionObserver(r,{root:null,rootMargin:"0px 0px 0px 0px",threshold:1})).observe(o)}}function r(e){o.paging&&o.paging.next&&e.forEach(function(e){e.isIntersecting&&o.loadNext()})}o.$watch("paging",function(e){if(e&&e.next){var t=e.next;t===_.noop?o.shouldShowLoadMore=!0:e.noPreFetch?(o.shouldShowLoadMore=!0,n()):o.cheapNextCheck&&e.statistics&&e.statistics.currentPage&&e.statistics.totalPages?(o.shouldShowLoadMore=e.statistics.currentPage<e.statistics.totalPages,o.shouldShowLoadMore&&n()):t().then(function(e){o.shouldShowLoadMore=!_.isEmpty(e),o.shouldShowLoadMore&&n()})}else o.shouldShowLoadMore=!1})}}e.$inject=["gettext"],angular.module("c8y.ui").directive("c8yLoadMore",e)}();
1
+ "use strict";!function(){function e(t){e.$inject=["$scope","$element"];var i=[250,500,1e3];function n(e){if(e.paging&&(e.paging.next||e.paging.blind))return t("More data may be available.")}return{restrict:"EA",replace:!0,templateUrl:":::PLUGIN_PATH:::/ui/views/loadmore.html",link:function(a,e,t){_.has(t,"cheapnextcheck")&&(a.cheapNextCheck=!0),a.hidePageSize=!0,a.getLoadMoreTooltip=_.partial(n,a);var o=!_.isUndefined(t.changePageSize);!a.hidePageSize&&o&&(a._pageSizes=_.cloneDeep(i),a.$on("paging.statistics.pageSize",function(e){var t=parseInt(e,10),o=_.cloneDeep(i);t&&(a._pageSizes=_.without(o,t))}))},controller:e};function e(o,a){var i;function n(){var e=jQuery(a),t=_.head(e);if(!i){var o=t.querySelector(".classForObserver");(i=new IntersectionObserver(r,{root:null,rootMargin:"0px 0px 0px 0px",threshold:1})).observe(o)}}function r(e){o.paging&&o.paging.next&&e.forEach(function(e){e.isIntersecting&&o.loadNext()})}o.$watch("paging",function(e){if(e&&e.next){var t=e.next;t===_.noop?o.shouldShowLoadMore=!0:e.noPreFetch?(o.shouldShowLoadMore=!0,n()):o.cheapNextCheck&&e.statistics&&e.statistics.currentPage&&e.statistics.totalPages?(o.shouldShowLoadMore=e.statistics.currentPage<e.statistics.totalPages,o.shouldShowLoadMore&&n()):t().then(function(e){o.shouldShowLoadMore=!_.isEmpty(e),o.shouldShowLoadMore&&n()})}else o.shouldShowLoadMore=!1})}}e.$inject=["gettext"],angular.module("c8y.ui").directive("c8yLoadMore",e)}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1017.0.255",
3
+ "version": "1017.0.257",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",