@c8y/ng1-modules 1021.22.0 → 1021.22.27

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,16 +1,13 @@
1
- <div title="{{ 'Display as' | translate }}" class="form-group">
2
- <label class="m-r-4" for="displayControl">{{ 'Display as' | translate }}</label>
3
- <div class="input-group">
4
- <div class="c8y-select-wrapper">
5
- <select
6
- id="displayControl"
7
- name="displayControl"
8
- class="form-control"
9
- ng-model="vm.selectedOption"
10
- ng-options="option as (option.label | translate) for option in vm.options | orderBy:vm.optionOrder"
11
- ng-change="vm.selectOption(vm.selectedOption)"
12
- ></select>
13
- <span></span>
14
- </div>
1
+ <div title="{{ 'Display as' | translate }}" class="form-group d-flex m-b-0">
2
+ <label class="m-r-8 text-nowrap" for="displayControl">{{ 'Display as' | translate }}</label>
3
+ <div class="c8y-select-wrapper">
4
+ <select
5
+ id="displayControl"
6
+ name="displayControl"
7
+ class="form-control"
8
+ ng-model="vm.selectedOption"
9
+ ng-options="option as (option.label | translate) for option in vm.options | orderBy:vm.optionOrder"
10
+ ng-change="vm.selectOption(vm.selectedOption)"
11
+ ></select>
15
12
  </div>
16
13
  </div>
@@ -8,7 +8,6 @@
8
8
  "lwm2m.provider.js",
9
9
  "lwm2mUploadStep.component.js",
10
10
  "lwm2mFinalStep.component.js",
11
- "lwm2mDetail.component.js",
12
11
  "lwm2mResource.component.js",
13
12
  "lwm2mValidationRules/lwm2mValidationRules.component.js",
14
13
  "lwm2mValidationRules/lwm2mValidationRule.component.js"
@@ -1 +1 @@
1
- (()=>{e.$inject=["gettext","c8yDeviceProtocolUiProvider","c8yViewsProvider"];var r="c8yLwm2m";function e(p,e,t){a.$inject=["c8yBase","c8yInventory","c8yTenant","c8yObjectMappings","c8yLwm2mPluginCheckerService","$http","$upload"],i.$inject=["$routeParams"];var n={service:r,id:"lwm2m",name:p("LWM2M")},g={path:"/deviceprotocols/".concat(n.id,"/:id"),template:'<c8y-lwm2m-detail id="vm.id"></c8y-lwm2m-detail>',controllerAs:"vm",controller:i};return{initUi:function(){e.register(n),t.when(g.path,g)},$get:a};function i(e){_.assign(this,e)}function a(n,i,e,a,r,o,t){var c,u=n.url("service/lwm2m-agent/"),s="".concat(u,"objectResourceMappings");return{flow:function(){return["c8yLwm2mUploadStep","c8yLwm2mFinalStep"]},list:function(){return o.get(s,{silentError:!0}).then(n.getResData)},detail:function(e){var t=n.getId(e);return r.isLwm2mPluginInstalled().then(function(e){return e?null:i.detail(t).then(n.getResData)})},detailPath:function(e){e=d(e);return g.path.replace(/:id$/,e)},upload:function(e){return t.upload({url:"".concat(s,"/ddf"),method:"POST",headers:{Accept:"application/json"},file:e,fileName:e.name.replace(/\s+/g,"_")})},remove:function(e){e=d(e);return i.remove(e)},getName:function(e){var t=a.getName(e),e=a.getObjectId(e);return"".concat(e," ").concat(t)},updateMapping:function(e,t){e="".concat(s,"/").concat(e,"/add");return o.put(e,t)},getPostRegistrationOptions:function(){var e={url:"".concat(u,"postRegistrationOptions"),method:"GET",silentError:!0};return o(e).then(n.getResData)},setPostRegistrationOptions:function(e){e={url:"".concat(u,"postRegistrationOptions"),method:"PUT",data:{commands:e}};return o(e)},helpTexts:{minPeriod:p("The minimum period attribute indicates the minimum time in seconds the LWM2M client MUST wait between two notifications."),maxPeriod:p("The maximum period attribute indicates the maximum time in seconds the LWM2M client MAY wait between two notifications."),greaterThan:p("This greater than attribute defines a threshold high value."),lessThan:p("This less than attribute defines a threshold low value."),step:p("This step attribute defines a minimum change value between two notifications.")},isServiceSubscribed:l,showIf:m,listRowInfoComponent:"c8yDeviceProtocolRowCountResources",getCustomActions:function(){c=c||o.get("".concat(u,"mappingActions/resourceactions")).then(n.getResData).then(h);return c},Validation:{RuleType:{LT:"lt",GT:"gt",EQ:"eq",NEQ:"neq",GTE:"gte",LTE:"lte",AND:"and",OR:"or"},ValueType:{NUMBER:"number",DATE:"date",STRING:"string",REGEX:"regex",OBJECTLINK:"objectLink"},ResourceDataType:{INTEGER:"INTEGER",FLOAT:"FLOAT",STRING:"STRING",BOOLEAN:"BOOLEAN",TIME:"TIME",OBJECTLINK:"OBJECTLINK"},RuleName:{GT:"Greater than",LT:"Lower than",GTE:"Greater or equals than",LTE:"Lower or equals than",EQ:"Equals",NEQ:"Equals not"}}};function l(){return e.isSubscribed({name:"lwm2m-agent",type:"MICROSERVICE"})}function m(){return m._cached=m._cached?m._cached:l()}function d(e){return _.get(e,"id")}function h(e){return _.reduce(e,function(e,t){var n=t.name,t=t.args,t=_.get(t,"length")?t.map(function(e){return"".concat(n,":").concat(e)}):[n];return e.concat(t)},[])}}}angular.module("c8y.lwm2m").provider(r,e)})();
1
+ (()=>{e.$inject=["gettext","c8yDeviceProtocolUiProvider","c8yViewsProvider"];var o="c8yLwm2m";function e(h,e,t){a.$inject=["c8yBase","c8yInventory","c8yTenant","c8yObjectMappings","$http","$upload"],i.$inject=["$routeParams"];var n={service:o,id:"lwm2m",name:h("LWM2M")},p={path:"/deviceprotocols/".concat(n.id,"/:id"),template:'<c8y-lwm2m-detail id="vm.id"></c8y-lwm2m-detail>',controllerAs:"vm",controller:i};return{initUi:function(){e.register(n),t.when(p.path,p)},$get:a};function i(e){_.assign(this,e)}function a(t,n,e,i,a,o){var r,c=t.url("service/lwm2m-agent/"),s="".concat(c,"objectResourceMappings");return{flow:function(){return["c8yLwm2mUploadStep","c8yLwm2mFinalStep"]},list:function(){return a.get(s,{silentError:!0}).then(t.getResData)},detailPath:function(e){e=l(e);return p.path.replace(/:id$/,e)},upload:function(e){return o.upload({url:"".concat(s,"/ddf"),method:"POST",headers:{Accept:"application/json"},file:e,fileName:e.name.replace(/\s+/g,"_")})},remove:function(e){e=l(e);return n.remove(e)},getName:function(e){var t=i.getName(e),e=i.getObjectId(e);return"".concat(e," ").concat(t)},updateMapping:function(e,t){e="".concat(s,"/").concat(e,"/add");return a.put(e,t)},getPostRegistrationOptions:function(){var e={url:"".concat(c,"postRegistrationOptions"),method:"GET",silentError:!0};return a(e).then(t.getResData)},setPostRegistrationOptions:function(e){e={url:"".concat(c,"postRegistrationOptions"),method:"PUT",data:{commands:e}};return a(e)},helpTexts:{minPeriod:h("The minimum period attribute indicates the minimum time in seconds the LWM2M client MUST wait between two notifications."),maxPeriod:h("The maximum period attribute indicates the maximum time in seconds the LWM2M client MAY wait between two notifications."),greaterThan:h("This greater than attribute defines a threshold high value."),lessThan:h("This less than attribute defines a threshold low value."),step:h("This step attribute defines a minimum change value between two notifications.")},isServiceSubscribed:u,showIf:m,listRowInfoComponent:"c8yDeviceProtocolRowCountResources",getCustomActions:function(){r=r||a.get("".concat(c,"mappingActions/resourceactions")).then(t.getResData).then(d);return r},Validation:{RuleType:{LT:"lt",GT:"gt",EQ:"eq",NEQ:"neq",GTE:"gte",LTE:"lte",AND:"and",OR:"or"},ValueType:{NUMBER:"number",DATE:"date",STRING:"string",REGEX:"regex",OBJECTLINK:"objectLink"},ResourceDataType:{INTEGER:"INTEGER",FLOAT:"FLOAT",STRING:"STRING",BOOLEAN:"BOOLEAN",TIME:"TIME",OBJECTLINK:"OBJECTLINK"},RuleName:{GT:"Greater than",LT:"Lower than",GTE:"Greater or equals than",LTE:"Lower or equals than",EQ:"Equals",NEQ:"Equals not"}}};function u(){return e.isSubscribed({name:"lwm2m-agent",type:"MICROSERVICE"})}function m(){return m._cached=m._cached?m._cached:u()}function l(e){return _.get(e,"id")}function d(e){return _.reduce(e,function(e,t){var n=t.name,t=t.args,t=_.get(t,"length")?t.map(function(e){return"".concat(n,":").concat(e)}):[n];return e.concat(t)},[])}}}angular.module("c8y.lwm2m").provider(o,e)})();
@@ -1 +1 @@
1
- function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},t=Object.prototype,s=t.hasOwnProperty,f=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(u){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof g?e:g,e=Object.create(e.prototype),n=new G(n||[]);return f(e,"_invoke",{value:(o=t,i=r,a=n,c=h,function(t,e){if(c===y)throw Error("Generator is already running");if(c===v){if("throw"===t)throw e;return{value:u,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(o===u)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=u,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;n=l(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,d;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u),r.delegate=null,d):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}(r,a);if(r){if(r===d)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===h)throw c=v,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=y;r=l(o,i,a);if("normal"===r.type){if(c=a.done?v:p,r.arg===d)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=v,a.method="throw",a.arg=r.arg)}})}),e}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",d={};function g(){}function m(){}function w(){}var e={},b=(i(e,n,function(){return this}),Object.getPrototypeOf),b=b&&b(b(O([]))),L=(b&&b!==t&&s.call(b,n)&&(e=b),w.prototype=g.prototype=Object.create(e));function _(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function x(a,c){var e;f(this,"_invoke",{value:function(r,n){function t(){return new c(function(t,e){!function e(t,r,n,o){var i,t=l(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==_typeof(r)&&s.call(r,"__await")?c.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):c.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(_typeof(e)+" is not iterable")}return f(L,"constructor",{value:m.prototype=w,configurable:!0}),f(w,"constructor",{value:m,configurable:!0}),m.displayName=i(w,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,i(t,o,"GeneratorFunction")),t.prototype=Object.create(L),t},a.awrap=function(t){return{__await:t}},_(x.prototype),i(x.prototype,r,function(){return this}),a.AsyncIterator=x,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new x(c(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},_(L),i(L,o,"Generator"),i(L,n,function(){return this}),i(L,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=O,G.prototype={constructor:G,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,S(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=u),d}},a}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}(()=>{function t(t,e,r,n,o,i,a,c,u){var s=r("Restart device"),f=this,l=c.get("additionalDeviceStatusButtons");function h(t){f.status=i.status(t)}function p(){return(p=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.delete(f.device);case 2:n.success(r("Device deleted.")),e.path("/device");case 4:case"end":return t.stop()}},t)}))).apply(this,arguments)}_.assign(f,{$onInit:function(){o.detailRealtime(f.config.device.id,t,h).then(function(e){f.device=e,f.displayRestartBtn=o.supportsOperation(e,"c8y_Restart"),f.additionalButtonsInfo=l.filter(function(t){return t.canShowButton(e)}).map(function(t){return t.getButtonInfo()})})},restart:function(){a.create({deviceId:f.device.id,description:s,c8y_Restart:{}}).then(function(){n.success(r("Device will be restarted."))})},deleteDevice:function(){return p.apply(this,arguments)}})}t.$inject=["$scope","$location","gettext","c8yAlert","c8yDevices","c8yDeviceStatus","c8yDeviceControl","c8yServiceRegistry","c8yDeviceGridService"],angular.module("c8y.deviceStatus").component("c8yDeviceStatus",{controller:t,controllerAs:"vm",templateUrl:":::PLUGIN_PATH:::/deviceStatus.html",bindings:{config:"<"}})})();
1
+ function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},t=Object.prototype,s=t.hasOwnProperty,l=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(u){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof g?e:g,e=Object.create(e.prototype),n=new G(n||[]);return l(e,"_invoke",{value:(o=t,i=r,a=n,c=h,function(t,e){if(c===y)throw Error("Generator is already running");if(c===d){if("throw"===t)throw e;return{value:u,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(o===u)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=u,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;n=f(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,v;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}(r,a);if(r){if(r===v)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===h)throw c=d,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=y;r=f(o,i,a);if("normal"===r.type){if(c=a.done?d:p,r.arg===v)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=d,a.method="throw",a.arg=r.arg)}})}),e}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function g(){}function m(){}function w(){}var e={},b=(i(e,n,function(){return this}),Object.getPrototypeOf),b=b&&b(b(O([]))),L=(b&&b!==t&&s.call(b,n)&&(e=b),w.prototype=g.prototype=Object.create(e));function _(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function x(a,c){var e;l(this,"_invoke",{value:function(r,n){function t(){return new c(function(t,e){!function e(t,r,n,o){var i,t=f(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==_typeof(r)&&s.call(r,"__await")?c.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):c.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(_typeof(e)+" is not iterable")}return l(L,"constructor",{value:m.prototype=w,configurable:!0}),l(w,"constructor",{value:m,configurable:!0}),m.displayName=i(w,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,i(t,o,"GeneratorFunction")),t.prototype=Object.create(L),t},a.awrap=function(t){return{__await:t}},_(x.prototype),i(x.prototype,r,function(){return this}),a.AsyncIterator=x,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new x(c(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},_(L),i(L,o,"Generator"),i(L,n,function(){return this}),i(L,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=O,G.prototype={constructor:G,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,S(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=u),v}},a}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}(()=>{function t(t,e,r,n,o,i,a,c,u){var s=r("Restart device"),l=this,f=c.get("additionalDeviceStatusButtons");function h(t){l.status=i.status(t)}function p(){return(p=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.delete(l.device);case 2:n.success(r("Device deleted.")),e.path("/device");case 4:case"end":return t.stop()}},t)}))).apply(this,arguments)}l.additionalButtonsHaveDelete=!1,_.assign(l,{$onInit:function(){o.detailRealtime(l.config.device.id,t,h).then(function(e){l.device=e,l.displayRestartBtn=o.supportsOperation(e,"c8y_Restart"),l.additionalButtonsInfo=f.filter(function(t){return t.canShowButton(e)}).map(function(t){return t.getButtonInfo()}),l.additionalButtonsHaveDelete=!!l.additionalButtonsInfo.filter(function(t){return"delete"===t.icon}).length})},restart:function(){a.create({deviceId:l.device.id,description:s,c8y_Restart:{}}).then(function(){n.success(r("Device will be restarted."))})},deleteDevice:function(){return p.apply(this,arguments)}})}t.$inject=["$scope","$location","gettext","c8yAlert","c8yDevices","c8yDeviceStatus","c8yDeviceControl","c8yServiceRegistry","c8yDeviceGridService"],angular.module("c8y.deviceStatus").component("c8yDeviceStatus",{controller:t,controllerAs:"vm",templateUrl:":::PLUGIN_PATH:::/deviceStatus.html",bindings:{config:"<"}})})();
@@ -28,7 +28,7 @@
28
28
  <span>{{ 'Restart' | translate }}</span>
29
29
  </button>
30
30
  <button
31
- class="btn btn-default"
31
+ class="btn btn-default {{ buttonInfo.class }}"
32
32
  title="{{ buttonInfo.title | translate }}"
33
33
  type="button"
34
34
  data-cy="c8y-device-status--additional-btn"
@@ -44,6 +44,7 @@
44
44
  type="button"
45
45
  data-cy="c8y-device-status--delete-btn"
46
46
  ng-click="vm.deleteDevice()"
47
+ ng-if="!vm.additionalButtonsHaveDelete"
47
48
  >
48
49
  <i c8y-icon="delete"></i>
49
50
  <span>{{ 'Delete' | translate }}</span>
@@ -33,7 +33,7 @@
33
33
  bindToController directive option).
34
34
  @TODO: Now this option should be available. Try to fix it when feasible.
35
35
  -->
36
- <div class="measurements-time-control" ng-show="showTime()">
36
+ <div class="measurements-time-control m-l-auto" ng-show="showTime()">
37
37
  <div
38
38
  class="measurements-date-from"
39
39
  uib-tooltip="{{ realtime ? (realtimeActiveInfo | translate) : undefined }}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1021.22.0",
3
+ "version": "1021.22.27",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -1 +1 @@
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 ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{function e(n,r,e,a,i,c,t,s,o,l,u,p){var d="service/remoteaccess",y="127.0.0.1",f=":::PLUGIN_PATH:::/clients/terminal/index.html",m="top=30,left=30,height=933,width=1350,location=no,menubar=no,toolbar=no,status=no,resizable=no",b=a.url("".concat(d,"/keypair/generate")),S={http:"ws:",https:"wss:"}[e.protocol()]||"ws:",e="wss:"===S,v="XSRF-TOKEN",P={category:"remoteaccess",key:"pass-through.enabled"},g=a.createEnum([{name:"NONE",value:"NONE",label:l("No password")},{name:"USER_PASS",value:"USER_PASS",label:l("Username and password")},{name:"PASS_ONLY",value:"PASS_ONLY",label:l("Password only")},{name:"KEY_PAIR",value:"KEY_PAIR",label:l("Public/private keys")},{name:"CERTIFICATE",value:"CERTIFICATE",label:l("Certificate")}]),h=[{name:"VNC",value:"VNC",label:l("VNC"),supportedCredentialsTypes:[g.NONE,g.PASS_ONLY],defaults:{host:y,port:5900},clientWindowPath:":::PLUGIN_PATH:::/clients/vnc/vncClient.html",clientWindowParams:"top=0,left=0,location=no,menubar=no,toolbar=no,status=no,resizable=yes",extraConnectionParams:{encrypt:e,true_color:!0,local_cursor:!1,viewport:!0,shared:!0,view_only:!1,disconnectTimeout:10,repeaterID:"",port:443,password:""}},{name:"TELNET",value:"TELNET",label:l("Telnet"),supportedCredentialsTypes:[g.NONE],defaults:{host:y,port:23},clientWindowPath:f,clientWindowParams:m},{name:"SSH",value:"SSH",label:l("SSH"),supportedCredentialsTypes:[g.USER_PASS,g.KEY_PAIR,g.CERTIFICATE],defaults:{host:y,port:22},clientWindowPath:f,clientWindowParams:m},{name:"PASSTHROUGH",value:"PASSTHROUGH",label:l("PASSTHROUGH"),supportedCredentialsTypes:[],defaults:{host:y,port:22},isConnectDissalowed:!0,tooltipConnectDissalowed:l("PASSTHROUGH protocol configuration should be used with native client only."),showIf:function(){return p.getSystemOptionValue(P)}}];return{DEFAULT_HOST:y,getProtocols:function(){return n.all(_.map(h,function(e){return s.configureVisibility(e,"visible")})).then(function(e){return _.filter(e,"visible")})},CREDENTIALS_TYPES:g,save:function(t,n){try{return((e,t)=>{var n=_.includes([g.USER_PASS.value,g.PASS_ONLY.value],t.credentialsType),o=_.includes([g.KEY_PAIR.value],t.credentialsType),n=(_.defaults(t,{password:n?_.get(t,"credentials.password"):void 0,privateKey:o?_.get(t,"credentials.privateKey"):void 0}),_.unset(t,"credentials"),_.unset(t,"attrs"),E(e,t));return r.put(n,t).then(a.getResData)})(t,n)}catch(e){return((e,t)=>(e=w(e),r.post(e,t).then(a.getResData)))(t,n)}},list:function(e){e=w(e);return r.get(e).then(a.getResData)},detail:function(e,t){e=E(e,t);return r.get(e).then(a.getResData)},remove:function(e,t){e=E(e,t);return r.delete(e)},getConnectionParams:function(e,t){return n.all({title:u.getString("Connected to: {{name}}",t),protocol:_.find(h,{value:t.protocol}),host:n.resolve(window.location.host),path:((n,o)=>c.current().then(function(e){var e={deviceId:a.getId(n),configurationId:o.id,token:i.encodeToken(e.userName,i.getPassword(),e.tenant)},e="service/remoteaccess/client/".concat(e.deviceId,"/configurations/").concat(e.configurationId,"?token=").concat(e.token),t=s.getCookieValue(v);return t&&(t=encodeURIComponent(t),e="".concat(e,"&").concat(v,"=").concat(t)),e}))(e,t),wsProtocol:S}).then(function(e){return _objectSpread(_objectSpread({},e),e.protocol.extraConnectionParams)})},isMicroServiceAvailable:function(t){return o.isAvailable({name:"cloud-remote-access",type:"MICROSERVICE"}).then(function(e){e=e?r.head(w(t),{silentError:!0}).then(_.constant(!0),_.constant(!1)):n.resolve(e);return e})},parseSshKeyFile:function(o){return n(function(t,e){var n=new FileReader;n.onload=function(e){e=e.target;return t(e.result)},n.onerror=function(){return e({feedback:{type:"error",summary:l("Could not read file.")}})},n.readAsText(o)})},generateKeys:function(e){return r.post(b,{hostname:e}).then(a.getResData)},exportSshKey:function(e){e=new Blob([e],{type:"text/plain"});window.saveAs(e,"key.pub")}};function w(e){e=[d,"devices",a.getId(e),"configurations"].join("/");return a.url(e)}function E(e,t){return[w(e),a.getId(t)].join("/")}}e.$inject=["$q","$http","$location","c8yBase","c8yAuth","c8yUser","c8yTenant","c8yUiUtil","c8yApplication","gettext","gettextCatalog","c8ySettings"],angular.module("c8y.remoteAccess").factory("c8yRemoteAccess",e)})();
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 ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{function e(n,r,e,a,i,c,l,o,s,u){var t="service/remoteaccess",p="127.0.0.1",d=":::PLUGIN_PATH:::/clients/terminal/index.html",f="top=30,left=30,height=933,width=1350,location=no,menubar=no,toolbar=no,status=no,resizable=no",y=a.url("".concat(t,"/keypair/generate")),b={http:"ws:",https:"wss:"}[e.protocol()]||"ws:",e="wss:"===b,m="XSRF-TOKEN",S=a.createEnum([{name:"NONE",value:"NONE",label:s("No password")},{name:"USER_PASS",value:"USER_PASS",label:s("Username and password")},{name:"PASS_ONLY",value:"PASS_ONLY",label:s("Password only")},{name:"KEY_PAIR",value:"KEY_PAIR",label:s("Public/private keys")},{name:"CERTIFICATE",value:"CERTIFICATE",label:s("Certificate")}]),v=[{name:"VNC",value:"VNC",label:s("VNC"),supportedCredentialsTypes:[S.NONE,S.PASS_ONLY],defaults:{host:p,port:5900},clientWindowPath:":::PLUGIN_PATH:::/clients/vnc/vncClient.html",clientWindowParams:"top=0,left=0,location=no,menubar=no,toolbar=no,status=no,resizable=yes",extraConnectionParams:{encrypt:e,true_color:!0,local_cursor:!1,viewport:!0,shared:!0,view_only:!1,disconnectTimeout:10,repeaterID:"",port:443,password:""}},{name:"TELNET",value:"TELNET",label:s("Telnet"),supportedCredentialsTypes:[S.NONE],defaults:{host:p,port:23},clientWindowPath:d,clientWindowParams:f},{name:"SSH",value:"SSH",label:s("SSH"),supportedCredentialsTypes:[S.USER_PASS,S.KEY_PAIR,S.CERTIFICATE],defaults:{host:p,port:22},clientWindowPath:d,clientWindowParams:f},{name:"PASSTHROUGH",value:"PASSTHROUGH",label:s("PASSTHROUGH"),supportedCredentialsTypes:[],defaults:{host:p,port:22},isConnectDissalowed:!0,tooltipConnectDissalowed:s("PASSTHROUGH protocol configuration should be used with native client only.")}];return{DEFAULT_HOST:p,getProtocols:function(){return n.all(_.map(v,function(e){return l.configureVisibility(e,"visible")})).then(function(e){return _.filter(e,"visible")})},CREDENTIALS_TYPES:S,save:function(t,n){try{return((e,t)=>{var n=_.includes([S.USER_PASS.value,S.PASS_ONLY.value],t.credentialsType),o=_.includes([S.KEY_PAIR.value],t.credentialsType),n=(_.defaults(t,{password:n?_.get(t,"credentials.password"):void 0,privateKey:o?_.get(t,"credentials.privateKey"):void 0}),_.unset(t,"credentials"),_.unset(t,"attrs"),g(e,t));return r.put(n,t).then(a.getResData)})(t,n)}catch(e){return((e,t)=>(e=P(e),r.post(e,t).then(a.getResData)))(t,n)}},list:function(e){e=P(e);return r.get(e).then(a.getResData)},detail:function(e,t){e=g(e,t);return r.get(e).then(a.getResData)},remove:function(e,t){e=g(e,t);return r.delete(e)},getConnectionParams:function(e,t){return n.all({title:u.getString("Connected to: {{name}}",t),protocol:_.find(v,{value:t.protocol}),host:n.resolve(window.location.host),path:((n,o)=>c.current().then(function(e){var e={deviceId:a.getId(n),configurationId:o.id,token:i.encodeToken(e.userName,i.getPassword(),e.tenant)},e="service/remoteaccess/client/".concat(e.deviceId,"/configurations/").concat(e.configurationId,"?token=").concat(e.token),t=l.getCookieValue(m);return t&&(t=encodeURIComponent(t),e="".concat(e,"&").concat(m,"=").concat(t)),e}))(e,t),wsProtocol:b}).then(function(e){return _objectSpread(_objectSpread({},e),e.protocol.extraConnectionParams)})},isMicroServiceAvailable:function(t){return o.isAvailable({name:"cloud-remote-access",type:"MICROSERVICE"}).then(function(e){e=e?r.head(P(t),{silentError:!0}).then(_.constant(!0),_.constant(!1)):n.resolve(e);return e})},parseSshKeyFile:function(o){return n(function(t,e){var n=new FileReader;n.onload=function(e){e=e.target;return t(e.result)},n.onerror=function(){return e({feedback:{type:"error",summary:s("Could not read file.")}})},n.readAsText(o)})},generateKeys:function(e){return r.post(y,{hostname:e}).then(a.getResData)},exportSshKey:function(e){e=new Blob([e],{type:"text/plain"});window.saveAs(e,"key.pub")}};function P(e){e=[t,"devices",a.getId(e),"configurations"].join("/");return a.url(e)}function g(e,t){return[P(e),a.getId(t)].join("/")}}e.$inject=["$q","$http","$location","c8yBase","c8yAuth","c8yUser","c8yUiUtil","c8yApplication","gettext","gettextCatalog"],angular.module("c8y.remoteAccess").factory("c8yRemoteAccess",e)})();
@@ -1 +1 @@
1
- (()=>{function e(t,e,n,i,l,c){var s,o=this,r={},d={},a=null,u={open:!1},f={text:""};function h(e){r={},d={},_.forEach(e,function(e){r[e.id]=!0,d[e.id]=!0})}function g(e){return d[e.id]}function p(e){d[e.id]=!0}function A(){return e("filter")(s,f.text)}function C(e){d[e.id]=!1}o.isSelected=g,o.selectAllVisible=function(){_.forEach(A(),p)},o.select=p,o.deselectAllVisible=function(){_.forEach(A(),C)},o.deselect=C,o.toggle=function(e){d[e.id]=!d[e.id]},o.areAllVisibleSelected=function(){var e=A();return!!e&&_.filter(e,g).length===e.length},o.getSelectedStatusText=function(){var e=_.filter(r,_.identity).length;return e===a?c.getString("All children active`assets`"):0===e?c.getString("No children active`assets`"):c.getPlural(e,"1 child active`asset`","{{$count}} children active`asset`",{})},o.apply=function(){t.onSelectionConfirmed&&t.onSelectionConfirmed({selection:_.filter(s,g)}),u.open=!1},o.filterCfg=f,o.dropdownStatus=u,t.$watch("parentMo()",function(e){o.parentMoId=e.id||e,l.detail(o.parentMoId).then(i.getResData).then(function(e){o.childAssets=_.map(e.childAssets.references,"managedObject").concat(_.map(e.childDevices.references,"managedObject")),s=o.childAssets,o.allChildAssetsCount=o.childAssets.length,a=o.allChildAssetsCount})}),t.$watch("selectedChildAssets()",h),t.$watch("ctrl.dropdownStatus.open",function(e){e&&h(t.selectedChildAssets()),n(function(){o.dropdownOpeningFinished=e})})}e.$inject=["$scope","$filter","$timeout","c8yBase","c8yInventory","gettextCatalog"],angular.module("c8y.smartRules").controller("c8yChildAssetsSelectorCtrl",e)})();
1
+ (()=>{function e(t,e,n,i,l,c){var s,o=this,a={},r={},d=null,f={open:!1},u={text:""};function h(e){a={},r={},_.forEach(e,function(e){a[e.id]=!0,r[e.id]=!0})}function g(e){return r[e.id]}function p(e){r[e.id]=!0}function C(){var e,t=S();t?(e=_.filter(t,g),o.allVisibleSelected=e.length===t.length):o.allVisibleSelected=!1}function S(){return e("filter")(s,u.text)}function A(e){r[e.id]=!1}o.allVisibleSelected=!1,o.isSelected=g,o.selectAllVisible=function(){_.forEach(S(),p),C()},o.select=p,o.deselectAllVisible=function(){_.forEach(S(),A),C()},o.deselect=A,o.toggle=function(e){r[e.id]=!r[e.id],C()},o.getSelectedStatusText=function(){var e=_.filter(a,_.identity).length;return e===d?c.getString("All children active`assets`"):0===e?c.getString("No children active`assets`"):c.getPlural(e,"1 child active`asset`","{{$count}} children active`asset`",{})},o.apply=function(){t.onSelectionConfirmed&&t.onSelectionConfirmed({selection:_.filter(s,g)}),f.open=!1},o.filterCfg=u,o.dropdownStatus=f,t.$watch("parentMo()",function(e){o.parentMoId=e.id||e,l.detail(o.parentMoId).then(i.getResData).then(function(e){o.childAssets=_.map(e.childAssets.references,"managedObject").concat(_.map(e.childDevices.references,"managedObject")),s=o.childAssets,o.allChildAssetsCount=o.childAssets.length,d=o.allChildAssetsCount,C()})}),t.$watch("selectedChildAssets()",h),t.$watch("ctrl.dropdownStatus.open",function(e){e&&h(t.selectedChildAssets()),n(function(){o.dropdownOpeningFinished=e})}),t.$watch("ctrl.filterCfg.text",C),t.$watchCollection(function(){return r},C)}e.$inject=["$scope","$filter","$timeout","c8yBase","c8yInventory","gettextCatalog"],angular.module("c8y.smartRules").controller("c8yChildAssetsSelectorCtrl",e)})();
@@ -39,7 +39,7 @@
39
39
  <li class="multiselect-item">
40
40
  <label
41
41
  title="{{ 'Activate all visible`children`' | translate }}"
42
- ng-if="!ctrl.areAllVisibleSelected()"
42
+ ng-if="!ctrl.allVisibleSelected"
43
43
  class="c8y-checkbox input-sm"
44
44
  ng-click="ctrl.selectAllVisible()"
45
45
  >
@@ -54,7 +54,7 @@
54
54
  </label>
55
55
  <label
56
56
  title="{{ 'Deactivate all visible`children`' | translate }}"
57
- ng-if="ctrl.areAllVisibleSelected()"
57
+ ng-if="ctrl.allVisibleSelected"
58
58
  class="c8y-checkbox input-sm"
59
59
  ng-click="ctrl.deselectAllVisible()"
60
60
  >
@@ -1 +1 @@
1
- (()=>{function e(a,F,c,e,f,d,l,E,n,r,t,g,h,s,m,o,p){var i,u,v,w=this,N=(_.assign(w,{cancel:g.gotoList,shouldDisableGlobalRolesCheckbox:D,isUserAndRolesFormPristine:U,isUserFormInvalid:y,isRolesFormInvalid:I,canSave:function(){return!(c.saving||U()||y()||I())},getRoleName:o.getName}),e.userId),R=["business"];function T(){N?d.detail(N).then(function(e){return e.data}).then(A).then(function(){return d.getUserTfaSettings(c.user).then(f.getResData).then(function(e){c.userTfaEnforced=!!e.tfaEnforced})}):(A({enabled:c.isNew=!0}),P(p("New user"),!0))}function A(e){u=e.email,e.devicePermissions=e.devicePermissions||{},c.user=e,c._groups=O(e),c.password.showPassword=c.isNew,c.hasExternalOrigin=d.hasExternalOrigin(e),c.isNew&&(_.forEach(c.groups,function(e){_.includes(R,e.name)&&(c._groups[e.id]=!0)}),v)&&E.warning(g.LOCAL_USER_TEXT),c.hasExternalOrigin&&s.isSsoClearingUserRolesOnEveryLogin().then(function(e){return c.userCanEditRoles=!e,c.userCanEditRoles}).then(function(e){e?E.warning(g.EXTERNAL_ORIGIN_DYNAMIC_ACCESS_MAPPING_EXCEPTION_TEXT):E.warning(g.EXTERNAL_ORIGIN_TEXT)})}function U(){return c.forms.userForm.$pristine&&c.forms.rolesForm.$pristine}function y(){return!!(M(c.currentUser,c.user)&&!c.hasExternalOrigin)&&c.forms.userForm.$invalid}function I(){return!D()&&c.forms.rolesForm.$invalid}function O(e){return _.reduce(_.get(e,"groups.references"),function(e,n){return e[n.group.id]=!0,e},{})}function C(e){c.groups=e}function L(e){c.currentUser=e}function G(r,e){function n(){return E.success(p("User saved."))}var t=1<arguments.length&&void 0!==e?e:"",e=(c.saving=!0,g.gotoList),s=!(r.id&&!r.groups),o=_(c._groups).map(function(e,n){return e&&parseInt(n,10)}).filter().value(),i=s?function(){return l.updateGroups(0<arguments.length&&void 0!==arguments[0]?arguments[0]:r,o)}:function(){return a.resolve()},s=c.forms.rolesForm.$dirty,u=c.password.showPassword;try{(c.hasExternalOrigin?g.warnAboutUserLogOutIfNeeded(r,{rolesChanged:s,passwordChanged:u}).then(function(){return i()}):g.warnAboutUserLogOutIfNeeded(r,{rolesChanged:s,passwordChanged:u}).then(function(){return r.password&&!c.isNew?d.changePassword(r,r.password,t):a.resolve()}).then(function(){return d.current()}).then(function(e){return _.isEqual(e.userName,r.userName)}).then(function(e){var n;return m.isActivatedFor("units-conversion")&&(e&&(n=r,n=_.get(r,"measurementUnit.value"),h.set("unit",n)),_.unset(r,"measurementUnit")),e}).then(function(e){return d.save(_.omit(r,c.isNew?["measurementUnit"]:["measurementUnit","password"]),e)}).then(f.getResData).then(function(e){return i(e)}).then(function(){return d.setUserTfaSettings(r,{tfaEnforced:!!c.userTfaEnforced})})).then(n).then(e).finally(function(){c.saving=!1})}catch(e){E.danger(e.message),c.saving=!1}}function P(){return n.changeTitle({title:0<arguments.length&&void 0!==arguments[0]?arguments[0]:""},{skipTitleTranslation:!(1<arguments.length&&void 0!==arguments[1]&&arguments[1])})}function S(e){return d.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||d.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE")}function M(e,n){return!(!e||!n)&&(!n.id||(e.id===n.id?d.hasRole(e,"ROLE_USER_MANAGEMENT_OWN_ADMIN"):d.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||d.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE")))}function $(e){return _.get(c.user,"owner")&&i&&!i[e.id]}function D(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,n=S(c.currentUser),e=!e||!$(e),r=!!c.userCanEditRoles||!c.hasExternalOrigin;return!(n&&e&&r)}c.checkPassword=function(n){var e=!c.isNew,r=c.password.showPassword||(e=>e.email!==u)(n);return e&&r?t.currentPassword().then(function(e){return G(n,e)}).catch(function(e){e&&E.danger(f.getResErrorMessage(e)),T()}):G(n)},c.$watch("user.userName",P),c.$watch("user.owner",function(e){e?d.detail(e).then(f.getResData).then(function(e){i=O(e),_.forEach(c._groups,function(e,n){c._groups[n]=e&&i[n]})}):i=null}),c.$watch("_groups",function(e){c.enforcedGroup&&(c.topLevelTfaEnforced=e[c.enforcedGroup.id])},!0),c.canEditUser=M,c.canEditUserGroups=S,c.canActivateUser=function(e,n){return!(!e||!n)&&e.id!==n.id},c.forms={},c.password={},c.saving=!1,c.showAcl=function(){var e=_.get(c.user,"devicePermissions"),e=_.keys(e);return f.getFlag("deprecated")||e.length},c.restrictedByOwner=$,c.$on("$destroy",function(){E.remove({text:g.EXTERNAL_ORIGIN_TEXT,type:"warning"}),E.remove({text:g.EXTERNAL_ORIGIN_DYNAMIC_ACCESS_MAPPING_EXCEPTION_TEXT,type:"warning"}),E.remove({text:g.LOCAL_USER_TEXT,type:"warning"})}),l.list(void 0).then(C).then(s.isSsoEnabled).then(function(e){v=e}).then(T).then(function(){return r.current().then(function(e){return d.getTenantTfaSettings(c.user,e.name)}).then(function(e){c.enforcedGroup=_.find(c.groups,{name:e.enforcedUsersGroup}),c.topLevelTfaEnforced=d.isEnforcedForUser(c.user,e)||c._groups[c.enforcedGroup.id]})}),d.current().then(L),g.userHierarchyActive().then(function(e){w.FEATURE_USER_HIERARCHY=e})}e.$inject=["$q","$injector","$scope","$routeParams","c8yBase","c8yUser","c8yUserGroup","c8yAlert","c8yTitle","c8yTenant","c8yUserUtil","c8yUsersUi","c8yUserPreferences","c8yLoginOptions","c8yBeta","c8yPropertyValueTransformService","gettext"],angular.module("c8y.users").component("c8yUserDetailView",{templateUrl:":::PLUGIN_PATH:::/userDetailView/userDetailView.html",controller:e,controllerAs:"vm"})})();
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 ownKeys(r,e){var n,t=Object.keys(r);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(r),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,n)),t}function _objectSpread(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(r,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))})}return r}function _defineProperty(e,r,n){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,r){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===r?String:Number)(e);n=n.call(e,r||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{function e(a,D,c,e,f,l,d,p,r,n,t,g,E,o,m,i,h){var s,u,y,v=this,w=(_.assign(v,{cancel:g.gotoList,shouldDisableGlobalRolesCheckbox:M,isUserAndRolesFormPristine:T,isUserFormInvalid:b,isRolesFormInvalid:U,canSave:function(){return!(c.saving||T()||b()||U())},getUserData:S,getRoleName:i.getName}),e.userId),N=["business"];function O(){w?l.detail(w).then(function(e){return e.data}).then(R).then(function(){return l.getUserTfaSettings(c.user).then(f.getResData).then(function(e){c.userTfaEnforced=!!e.tfaEnforced})}):(R({enabled:c.isNew=!0}),C(h("New user"),!0))}function R(e){u=e.email,e.devicePermissions=e.devicePermissions||{},c.user=e,c._groups=A(e),c.password.showPassword=c.isNew,c.hasExternalOrigin=l.hasExternalOrigin(e),c.isNew&&(_.forEach(c.groups,function(e){_.includes(N,e.name)&&(c._groups[e.id]=!0)}),y)&&p.warning(g.LOCAL_USER_TEXT),c.hasExternalOrigin&&o.isSsoClearingUserRolesOnEveryLogin().then(function(e){return c.userCanEditRoles=!e,c.userCanEditRoles}).then(function(e){e?p.warning(g.EXTERNAL_ORIGIN_DYNAMIC_ACCESS_MAPPING_EXCEPTION_TEXT):p.warning(g.EXTERNAL_ORIGIN_TEXT)})}function T(){return c.forms.userForm.$pristine&&c.forms.rolesForm.$pristine}function b(){return!!(G(c.currentUser,c.user)&&!c.hasExternalOrigin)&&c.forms.userForm.$invalid}function U(){return!M()&&c.forms.rolesForm.$invalid}function A(e){return _.reduce(_.get(e,"groups.references"),function(e,r){return e[r.group.id]=!0,e},{})}function P(e){c.groups=e}function $(e){c.currentUser=e}function S(e){return c.isNew?_.omitBy(_.omit(e,["measurementUnit"]),function(e,r){return"displayName"===r&&""===_.trim(e)}):_objectSpread(_objectSpread({},_.omit(e,["measurementUnit","password"])),{},{displayName:""===_.trim(e.displayName)?"":e.displayName})}function I(n,e){function r(){return p.success(h("User saved."))}var t=1<arguments.length&&void 0!==e?e:"",e=(c.saving=!0,g.gotoList),o=!(n.id&&!n.groups),i=_(c._groups).map(function(e,r){return e&&parseInt(r,10)}).filter().value(),s=o?function(){return d.updateGroups(0<arguments.length&&void 0!==arguments[0]?arguments[0]:n,i)}:function(){return a.resolve()},o=c.forms.rolesForm.$dirty,u=c.password.showPassword;try{(c.hasExternalOrigin?g.warnAboutUserLogOutIfNeeded(n,{rolesChanged:o,passwordChanged:u}).then(function(){return s()}):g.warnAboutUserLogOutIfNeeded(n,{rolesChanged:o,passwordChanged:u}).then(function(){return n.password&&!c.isNew?l.changePassword(n,n.password,t):a.resolve()}).then(function(){return l.current()}).then(function(e){return _.isEqual(e.userName,n.userName)}).then(function(e){var r;return m.isActivatedFor("units-conversion")&&(e&&(r=n,r=_.get(n,"measurementUnit.value"),E.set("unit",r)),_.unset(n,"measurementUnit")),e}).then(function(e){return l.save(S(n),e)}).then(f.getResData).then(function(e){return s(e)}).then(function(){return l.setUserTfaSettings(n,{tfaEnforced:!!c.userTfaEnforced})})).then(r).then(e).finally(function(){c.saving=!1})}catch(e){p.danger(e.message),c.saving=!1}}function C(){return r.changeTitle({title:0<arguments.length&&void 0!==arguments[0]?arguments[0]:""},{skipTitleTranslation:!(1<arguments.length&&void 0!==arguments[1]&&arguments[1])})}function L(e){return l.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||l.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE")}function G(e,r){return!(!e||!r)&&(!r.id||(e.id===r.id?l.hasRole(e,"ROLE_USER_MANAGEMENT_OWN_ADMIN"):l.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||l.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE")))}function j(e){return _.get(c.user,"owner")&&s&&!s[e.id]}function M(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,r=L(c.currentUser),e=!e||!j(e),n=!!c.userCanEditRoles||!c.hasExternalOrigin;return!(r&&e&&n)}c.checkPassword=function(r){var e=!c.isNew,n=c.password.showPassword||(e=>e.email!==u)(r);return e&&n?t.currentPassword().then(function(e){return I(r,e)}).catch(function(e){e&&p.danger(f.getResErrorMessage(e)),O()}):I(r)},c.$watch("user.userName",C),c.$watch("user.owner",function(e){e?l.detail(e).then(f.getResData).then(function(e){s=A(e),_.forEach(c._groups,function(e,r){c._groups[r]=e&&s[r]})}):s=null}),c.$watch("_groups",function(e){c.enforcedGroup&&(c.topLevelTfaEnforced=e[c.enforcedGroup.id])},!0),c.canEditUser=G,c.canEditUserGroups=L,c.canActivateUser=function(e,r){return!(!e||!r)&&e.id!==r.id},c.forms={},c.password={},c.saving=!1,c.showAcl=function(){var e=_.get(c.user,"devicePermissions"),e=_.keys(e);return f.getFlag("deprecated")||e.length},c.restrictedByOwner=j,c.$on("$destroy",function(){p.remove({text:g.EXTERNAL_ORIGIN_TEXT,type:"warning"}),p.remove({text:g.EXTERNAL_ORIGIN_DYNAMIC_ACCESS_MAPPING_EXCEPTION_TEXT,type:"warning"}),p.remove({text:g.LOCAL_USER_TEXT,type:"warning"})}),d.list(void 0).then(P).then(o.isSsoEnabled).then(function(e){y=e}).then(O).then(function(){return n.current().then(function(e){return l.getTenantTfaSettings(c.user,e.name)}).then(function(e){c.enforcedGroup=_.find(c.groups,{name:e.enforcedUsersGroup}),c.topLevelTfaEnforced=l.isEnforcedForUser(c.user,e)||c._groups[c.enforcedGroup.id]})}),l.current().then($),g.userHierarchyActive().then(function(e){v.FEATURE_USER_HIERARCHY=e})}e.$inject=["$q","$injector","$scope","$routeParams","c8yBase","c8yUser","c8yUserGroup","c8yAlert","c8yTitle","c8yTenant","c8yUserUtil","c8yUsersUi","c8yUserPreferences","c8yLoginOptions","c8yBeta","c8yPropertyValueTransformService","gettext"],angular.module("c8y.users").component("c8yUserDetailView",{templateUrl:":::PLUGIN_PATH:::/userDetailView/userDetailView.html",controller:e,controllerAs:"vm"})})();
@@ -1 +0,0 @@
1
- (()=>{function e(t,e,n,c){var i=this;function u(){t.detail(i.id).then(s),t.getCustomActions().then(r)}function o(){var e=i.getMappings(),t=Object.values(i.getResources());return!((e?Object.values(e):[]).length<t.length)&&e&&Object.values(e).every(function(e){return!0===e.skipIfEmpty})}function s(e){(i.object=e)&&(i.title=t.getName(e),i.skipIfEmptyAll=o())}function r(e){i.customActions=e}function a(){return e.getMappings(i.object)}_.assign(i,{$onChanges:function(e){e.id&&u()},updateMapping:function(e){return t.updateMapping(i.object.id,e).then(u)},getMappings:a,getResources:function(){return e.getResources(i.object)},getMainObject:function(){return e.getMainObject(i.object)},getMappingForResource:function(e){return _.get(a(),e)},setAllResources:function(){var e=i.getResources(),t=i.getMappings(),e=e?Object.values(e):[];t=t||{};e.forEach(function(e){null!=e.id&&(t[e.id]||(t[e.id]={resourceID:e.id}),t[e.id].skipIfEmpty=i.skipIfEmptyAll)}),t&&0<Object.entries(t).length&&i.updateMapping(t).then(function(){return n.success(c("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:"<"}})})();
@@ -1,155 +0,0 @@
1
- <c8y-ui-title-set ng-if="vm.object" title="vm.title"></c8y-ui-title-set>
2
- <c8y-device-protocol-breadcrumb ng-if="vm.object"></c8y-device-protocol-breadcrumb>
3
-
4
- <div class="row" ng-if="vm.object">
5
- <div class="col-lg-12 col-lg-max">
6
- <div class="card card--fullpage">
7
- <div class="card-block bg-level-1 flex-no-shrink p-t-24 p-b-24">
8
- <div class="content-flex-70">
9
- <div class="text-center">
10
- <i class="c8y-icon-duocolor icon-48 c8y-icon c8y-icon-device-protocols"></i>
11
- <p ng-if="!vm.isNew()">
12
- <small class="label label-info">LWM2M</small>
13
- </p>
14
- </div>
15
- <div class="flex-grow col-10">
16
- <div class="content-flex-80">
17
- <div class="col-9">
18
- <form class="form form-read-only">
19
- <div class="form-group">
20
- <label
21
- for="name"
22
- class="sr-only"
23
- translate
24
- >
25
- Name
26
- </label>
27
- <input
28
- class="form-control input-lg"
29
- id="name"
30
- ng-model="vm.getMainObject().name"
31
- />
32
- </div>
33
- <div class="form-group">
34
- <label
35
- for="description"
36
- class="sr-only"
37
- translate
38
- >
39
- Description
40
- </label>
41
- <textarea
42
- class="form-control"
43
- id="description"
44
- ng-model="vm.getMainObject().description"
45
- ></textarea>
46
- </div>
47
- </form>
48
- </div>
49
-
50
- <div class="flex-grow">
51
- <ul class="list-unstyled small">
52
- <li class="p-t-4 p-b-4 d-flex separator-bottom text-nowrap">
53
- <label
54
- class="small m-b-0 m-r-8"
55
- translate
56
- >
57
- ID
58
- </label>
59
- <span class="m-l-auto">{{ vm.getMainObject().id }}</span>
60
- </li>
61
- <li class="p-t-4 p-b-4 d-flex separator-bottom text-nowrap">
62
- <label
63
- class="small m-b-0 m-r-8"
64
- translate
65
- >
66
- Date created
67
- </label>
68
- <span class="m-l-auto">{{ vm.object.creationTime | absoluteDate }}</span>
69
- </li>
70
- <li class="p-t-4 p-b-4 d-flex separator-bottom text-nowrap">
71
- <label
72
- class="small m-b-0 m-r-8"
73
- translate
74
- >
75
- Last update
76
- </label>
77
- <span class="m-l-auto">{{ vm.object.lastUpdated | absoluteDate }}</span>
78
- </li>
79
- </ul>
80
- </div>
81
- </div>
82
- </div>
83
- </div>
84
- </div>
85
- <div class="card-header separator-top-bottom sticky-top">
86
- <div class="card-title">
87
- {{ 'Resources' | translate }}
88
- </div>
89
- </div>
90
- <div class="inner-scroll">
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>
142
- </div>
143
- </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>
151
- </div>
152
- </div>
153
- </div>
154
- </div>
155
- </div>