@c8y/ng1-modules 1018.396.0 → 1018.398.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";angular.module("c8y.cockpit.dataPointExplorer").controller("DataPointWidgetConfigCtrl",["$scope","c8yDataPointSvc","gettext",function(a,n,t){a.noActions=!0,a.dontSave=!0,a.onRealtimeAlarmFn=function(t){a.onAlarm=t},a.onRealtimeEventFn=function(t){a.onEvent=t},a.dateSelectionHelpPopoverText=t('\n Choose how to select a date range, the available options are:\n <ul class="m-l-0 p-l-8 m-t-8 m-b-0">\n <li><b>Widget configuration:</b> restricts the date selection only to the widget configuration</li>\n <li><b>Widget and widget configuration:</b> restricts the date selection to the widget view and widget configuration only</li>\n <li><b>Dashboard time range:</b> restricts date selection to the global dashboard configuration only</li>\n </ul>\n ');function e(t,a){var a=_.pick(a,"dateFrom","dateTo","aggregation","displayDateSelection","interval","realtime","displayDateSelection","widgetInstanceGlobalTimeContext","canDecoupleGlobalTimeContext"),e=n.getDefaultFilters();_.assign(t,e,a)}a.onBoxChanged=function(t){a.chartBox=t},a.data={},a.data.datapoints=_.cloneDeep(a.config.datapoints),a.data.alarmsEventsConfigs=_.cloneDeep(a.config.alarmsEventsConfigs),e(a.data,a.config),a.dateSelection=function(){var t=a.data.widgetInstanceGlobalTimeContext?"dashboard_context":a.data.displayDateSelection?"view_and_config":"config";return t}(),a.$watch("dateSelection",function(){switch(a.dateSelection){case"dashboard_context":a.data.widgetInstanceGlobalTimeContext=!0;break;case"view_and_config":a.data.widgetInstanceGlobalTimeContext=!1,a.data.displayDateSelection=!0;break;default:a.data.widgetInstanceGlobalTimeContext=!1,a.data.displayDateSelection=!1}},!0),a.$watch("data",function(){a.data.widgetInstanceGlobalTimeContext&&(a.data.dateFrom=a.config.date?a.config.date[0]:a.data.dateFrom,a.data.dateTo=a.config.date?a.config.date[1]:a.data.dateTo,a.data.realtime
|
|
1
|
+
"use strict";angular.module("c8y.cockpit.dataPointExplorer").controller("DataPointWidgetConfigCtrl",["$scope","c8yDataPointSvc","gettext",function(a,n,t){a.noActions=!0,a.dontSave=!0,a.onRealtimeAlarmFn=function(t){a.onAlarm=t},a.onRealtimeEventFn=function(t){a.onEvent=t},a.dateSelectionHelpPopoverText=t('\n Choose how to select a date range, the available options are:\n <ul class="m-l-0 p-l-8 m-t-8 m-b-0">\n <li><b>Widget configuration:</b> restricts the date selection only to the widget configuration</li>\n <li><b>Widget and widget configuration:</b> restricts the date selection to the widget view and widget configuration only</li>\n <li><b>Dashboard time range:</b> restricts date selection to the global dashboard configuration only</li>\n </ul>\n ');function e(t,a){var a=_.pick(a,"dateFrom","dateTo","aggregation","displayDateSelection","interval","realtime","displayDateSelection","widgetInstanceGlobalTimeContext","canDecoupleGlobalTimeContext"),e=n.getDefaultFilters();_.assign(t,e,a)}a.onBoxChanged=function(t){a.chartBox=t},a.data={},a.data.datapoints=_.cloneDeep(a.config.datapoints),a.data.alarmsEventsConfigs=_.cloneDeep(a.config.alarmsEventsConfigs),e(a.data,a.config),a.dateSelection=function(){var t=a.data.widgetInstanceGlobalTimeContext?"dashboard_context":a.data.displayDateSelection?"view_and_config":"config";return t}(),a.$watch("dateSelection",function(){switch(a.dateSelection){case"dashboard_context":a.data.widgetInstanceGlobalTimeContext=!0;break;case"view_and_config":a.data.widgetInstanceGlobalTimeContext=!1,a.data.displayDateSelection=!0;break;default:a.data.widgetInstanceGlobalTimeContext=!1,a.data.displayDateSelection=!1}},!0),a.$watch("data",function(){a.data.widgetInstanceGlobalTimeContext&&(a.data.dateFrom=a.config.date?a.config.date[0]:a.data.dateFrom,a.data.dateTo=a.config.date?a.config.date[1]:a.data.dateTo,a.data.realtime=a.config.realtime,a.data.displayDateSelection=!1,a.data.canDecoupleGlobalTimeContext=!1,a.data.interval=null),e(a.config,a.data),a.config.datapoints=a.data.graphDataPoints,a.config.alarmsEventsConfigs=a.data.graphAlarmsEventsConfigs},!0)}]);
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function e(
|
|
1
|
+
"use strict";!function(){function e(s,n,o,r,t,e,i,u,a,l,c){var f,g=this;function d(e){return f=e?[]:g.users,g.users=[],o.list((e=_.get(g.filters,"text"),n=(n=_.map(_.get(g.filters,"globalRoles"),"id")).length?n.join(","):void 0,{withSubusersCount:!0,username:e,groups:n,withApps:!1,withGroups:!1,withRoles:!1,onlyRoots:_.isEmpty(e)})).then(h);var n}function h(e){p(e),g.users.paging=e.paging}function p(e){var n=g.users,t=n.paging,r=o.getTfaStrategy();_.forEach(e,function(t){var e=_.find(f,{id:t.id});t.twoFactorAuthenticationEnabled||s.all({enforced:o.isTfaActive(t),strategy:r}).then(function(e){var n=e.enforced,e=e.strategy;"SMS"!==e&&e||n&&(t.twoFactorAuthenticationEnabled=n)}),e&&(t._expanded=e._expanded),_.some(n,{id:t.id})||(n=n.concat([t]))}),n.paging=t,g.users=n}function E(e){g.globalRoles=e}function R(e){return e._globalRoles=_.map(_.get(e,"groups.references"),function(e){return _.find(g.globalRoles,{id:e.group.id})}),e}function A(){o.current().then(function(e){g.canAddUser=o.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")||g.FEATURE_USER_HIERARCHY&&o.hasRole(e,"ROLE_USER_MANAGEMENT_CREATE"),g.canRevokeTokens=o.hasRole(e,"ROLE_USER_MANAGEMENT_ADMIN")})}function U(e){return f=g.users,o.listAll({owner:e.id,withSubusersCount:!0}).then(p)}_.assign(g,{ROUTE_NEW_USER:t.ROUTE_NEW_USER,$onInit:function(){s.all([d(),e.global.list({pageSize:1e4}).then(E)]).then(function(){return _.forEach(g.users,R)}),t.userHierarchyActive().then(function(e){g.FEATURE_USER_HIERARCHY=e}).then(A)},loadMore:function(){g.users.paging.loading=!0,g.users.paging.next().then(h).finally(function(){g.users.paging.loading=!1})},loadUsers:d,loadSubusers:U,changeUser:function(s,e){var n="changeGlobalRoles"===e.name;return t.warnAboutUserLogOutIfNeeded(s,{rolesChanged:n}).then(function(){return t.changeUser(s,e)}).then(function(e){var n,t,r=s;return(e=e||{}).removeUser&&(g.users=_.reject(g.users,{id:r.id}),t=_.get(r,"_owner.id"),g.users=_.map(g.users,function(e){return t&&t===e.id?(e.subusersCount--,angular.copy(e)):e})),e.refresh||e.removeUser||(n=o.list({username:r.id,withSubusersCount:!0}).then(_.first).then(function(t){var r=t.id,e=_.map(g.users,function(e){var n=r===e.id;return n&&(t._expanded=e._expanded),n?R(t):e});_.assign(e,_.pick(g.users,["statistics","paging"])),g.users=e})),n=e.refresh?d():n})},showExpandCollapse:function(){return g.FEATURE_USER_HIERARCHY&&_.some(g.users,function(e){return 0<e.subusersCount||_.get(e,"_owns.length")})},collapseAll:function(){t.collapseAll(g.users)},expandAll:function(){t.expandAll(g.users),s.all(_.map(g.users,function(e){return e.subusersCount>e._owns.length?U(e).then(function(){return!0}):s.resolve(!1)})).then(function(e){_.some(e)&&n(g.expandAll)})},filters:{},applyFilters:function(){d(!0)},clearFilters:function(){g.filters={},d(!0)},isAnyFilterSelected:function(){return _.some(g.filters,_.identity)},refresh:function(){return d(!0).then(function(){return _.forEach(g.users,R)})},revokeTokens:function(){function e(){return o.current().then(function(e){return t(e)}).then(function(e){return e?r.logoutAndReloadPage():s.resolve()})}var n=c.get("c8yAuthBridgeService").getPreferredLoginOption(),t=function(e){return!(!o.hasExternalOrigin(e)&&"BASIC"===n.type)};i({title:l("Confirm log out all users?"),body:l('You are about to log out all users currently logged with "OAI-Secure" or "Single sign-on redirect". The JWT tokens retrieved by all devices in the current tenant will also be invalidated. Do you want to proceed?'),status:"warning",size:"sm",labels:{ok:l("Log out all users and invalidate tokens")}}).then(function(){return o.revokeTokens()}).then(e).then(function(){return u.success(l("User tokens revoked."))}).catch(function(e){e&&u.danger(a.getResErrorMessage(e))})}})}e.$inject=["$q","$timeout","c8yUser","c8yUserUtil","c8yUsersUi","c8yRoles","c8yModal","c8yAlert","c8yBase","gettext","$injector"],angular.module("c8y.users").component("c8yUserListView",{templateUrl:":::PLUGIN_PATH:::/userListView/userListView.html",controller:e,controllerAs:"vm"})}();
|