@c8y/tutorial 1019.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +16 -0
- package/NOTICES +41743 -0
- package/cumulocity.config.ts +643 -0
- package/package.json +22 -0
- package/src/__mocks/README.md +73 -0
- package/src/__mocks/global-mocks/inventory.interceptor.ts +145 -0
- package/src/__mocks/global-mocks/measurements.interceptor.ts +58 -0
- package/src/__mocks/index.ts +5 -0
- package/src/__mocks/mock.model.ts +76 -0
- package/src/__mocks/mock.module.ts +121 -0
- package/src/__mocks/mock.realtime-subject.ts +68 -0
- package/src/__mocks/mock.realtime.ts +31 -0
- package/src/__mocks/mock.service.ts +113 -0
- package/src/__mocks/scoped-mocks/boilerplate.ts +54 -0
- package/src/__mocks/scoped-mocks/context-dashboard.ts +47 -0
- package/src/__mocks/scoped-mocks/device-data-grid.ts +44 -0
- package/src/__mocks/scoped-mocks/named-context-dashboard.ts +42 -0
- package/src/__mocks/scoped-mocks/server-side-data-grid.ts +47 -0
- package/src/__mocks/scoped-mocks/service-dashboard.ts +42 -0
- package/src/__mocks/utils/clean.realtime.ts +23 -0
- package/src/__mocks/utils/common.ts +114 -0
- package/src/__mocks/utils/generators/alarms.ts +30 -0
- package/src/__mocks/utils/generators/events.ts +14 -0
- package/src/__mocks/utils/generators/managedObjects.ts +208 -0
- package/src/__mocks/utils/generators/measurement.ts +22 -0
- package/src/__mocks/utils/generators/operations.ts +67 -0
- package/src/__mocks/utils/grid.ts +87 -0
- package/src/__mocks/utils/realtime.ts +59 -0
- package/src/alert/alert-example.components.html +110 -0
- package/src/alert/alert-example.components.ts +77 -0
- package/src/alert/alert-example.module.ts +21 -0
- package/src/app/app.module.ts +72 -0
- package/src/bootstrap.ts +19 -0
- package/src/branding/branding.less +78 -0
- package/src/client-interceptor/client-interceptor.module.ts +12 -0
- package/src/client-interceptor/client-interceptor.service.ts +61 -0
- package/src/client-interceptor/index.ts +1 -0
- package/src/component-styles/cascading-style-sheets-example/cascading-style-sheets-example.component.css +17 -0
- package/src/component-styles/cascading-style-sheets-example/cascading-style-sheets-example.component.ts +11 -0
- package/src/component-styles/cascading-style-sheets-example/cascading-style-sheets-example.module.ts +26 -0
- package/src/component-styles/leaner-style-sheets-example/leaner-style-sheets-example.component.less +14 -0
- package/src/component-styles/leaner-style-sheets-example/leaner-style-sheets-example.component.ts +11 -0
- package/src/component-styles/leaner-style-sheets-example/leaner-style-sheets-example.module.ts +26 -0
- package/src/component-styles/syntactically-awesome-style-sheets-example/syntactically-awesome-style-sheets-example.component.scss +13 -0
- package/src/component-styles/syntactically-awesome-style-sheets-example/syntactically-awesome-style-sheets-example.component.ts +11 -0
- package/src/component-styles/syntactically-awesome-style-sheets-example/syntactically-awesome-style-sheets-example.module.ts +26 -0
- package/src/dashboard/context-dashboard/context-dashboard.component.ts +32 -0
- package/src/dashboard/context-dashboard/context-dashboard.module.ts +22 -0
- package/src/dashboard/custom-dashboard/custom-dashboard.component.html +180 -0
- package/src/dashboard/custom-dashboard/custom-dashboard.component.ts +52 -0
- package/src/dashboard/custom-dashboard/custom-dashboard.module.ts +22 -0
- package/src/dashboard/index.ts +4 -0
- package/src/dashboard/named-context-dashboard/named-context-dashboard.component.ts +51 -0
- package/src/dashboard/named-context-dashboard/named-context-dashboard.module.ts +37 -0
- package/src/dashboard/service-dashboard/service-dashboard.component.ts +51 -0
- package/src/dashboard/service-dashboard/service-dashboard.module.ts +35 -0
- package/src/dashboard/widget-dashboard/widget-dashboard.component.ts +65 -0
- package/src/dashboard/widget-dashboard/widget-dashboard.module.ts +22 -0
- package/src/date-time-range/date-time-range-example.component.ts +109 -0
- package/src/date-time-range/date-time-range-example.module.ts +21 -0
- package/src/dynamic-forms/custom-element-example/custom-element-example.component.ts +70 -0
- package/src/dynamic-forms/custom-element-example/custom-element-example.module.ts +38 -0
- package/src/dynamic-forms/custom-element-example/types/checkbox/checkbox.type.component.html +26 -0
- package/src/dynamic-forms/custom-element-example/types/checkbox/checkbox.type.component.ts +21 -0
- package/src/dynamic-forms/dynamic-forms.module.ts +16 -0
- package/src/dynamic-forms/index.ts +2 -0
- package/src/dynamic-forms/introduction-example/introduction-example.component.ts +116 -0
- package/src/dynamic-forms/introduction-example/introduction-example.module.ts +24 -0
- package/src/dynamic-forms/json-schema-example/json-schema-example.component.html +33 -0
- package/src/dynamic-forms/json-schema-example/json-schema-example.component.ts +102 -0
- package/src/dynamic-forms/json-schema-example/json-schema-example.module.ts +24 -0
- package/src/for-of-directive/for-of-example.component.html +19 -0
- package/src/for-of-directive/for-of-example.component.ts +39 -0
- package/src/for-of-directive/for-of.module.ts +18 -0
- package/src/forms/form-validation/forms-validation.component.html +105 -0
- package/src/forms/form-validation/forms-validation.component.ts +52 -0
- package/src/forms/form-validation/forms.module.ts +22 -0
- package/src/forms/index.ts +1 -0
- package/src/grids/client-grid-example/client-grid-example.component.html +16 -0
- package/src/grids/client-grid-example/client-grid-example.component.ts +166 -0
- package/src/grids/client-grid-example/client-grid-example.module.ts +24 -0
- package/src/grids/client-grid-example/data.ts +427 -0
- package/src/grids/device-grid-example/device-grid-example.component.html +58 -0
- package/src/grids/device-grid-example/device-grid-example.component.ts +134 -0
- package/src/grids/device-grid-example/device-grid-example.module.ts +24 -0
- package/src/grids/grids-tabs.ts +37 -0
- package/src/grids/grids.module.ts +17 -0
- package/src/grids/index.ts +1 -0
- package/src/grids/server-grid-example/server-grid-example.component.html +26 -0
- package/src/grids/server-grid-example/server-grid-example.component.ts +121 -0
- package/src/grids/server-grid-example/server-grid-example.module.ts +24 -0
- package/src/grids/server-grid-example/server-grid-example.service.ts +266 -0
- package/src/grids/server-grid-example/type-data-grid-column/type.cell-renderer.component.ts +31 -0
- package/src/grids/server-grid-example/type-data-grid-column/type.data-grid-column.ts +47 -0
- package/src/grids/server-grid-example/type-data-grid-column/type.filtering-form-renderer.component.ts +107 -0
- package/src/grids/server-grid-example/type-data-grid-column/type.header-cell-renderer.component.ts +20 -0
- package/src/hello/hello.component.ts +55 -0
- package/src/hello/hello.module.ts +20 -0
- package/src/hello/index.ts +1 -0
- package/src/help/help-example.component.ts +23 -0
- package/src/help/help-example.module.ts +20 -0
- package/src/hooks/action/action.module.ts +34 -0
- package/src/hooks/action/action.ts +41 -0
- package/src/hooks/action/basic-view/basic-view.component.html +8 -0
- package/src/hooks/action/basic-view/basic-view.component.ts +18 -0
- package/src/hooks/action/index.ts +1 -0
- package/src/hooks/action/logout-action/logout-action.component.ts +18 -0
- package/src/hooks/action-bar/action-bar.module.ts +34 -0
- package/src/hooks/action-bar/action-bar.ts +28 -0
- package/src/hooks/action-bar/basic-view/basic-view.component.html +8 -0
- package/src/hooks/action-bar/basic-view/basic-view.component.ts +18 -0
- package/src/hooks/action-bar/index.ts +1 -0
- package/src/hooks/action-bar/refresh-element/refresh-element.component.html +15 -0
- package/src/hooks/action-bar/refresh-element/refresh-element.component.ts +21 -0
- package/src/hooks/breadcrumbs/basic-view/basic-view.component.html +7 -0
- package/src/hooks/breadcrumbs/basic-view/basic-view.component.ts +18 -0
- package/src/hooks/breadcrumbs/breadcrumbs.module.ts +34 -0
- package/src/hooks/breadcrumbs/breadcrumbs.ts +93 -0
- package/src/hooks/breadcrumbs/index.ts +1 -0
- package/src/hooks/component/basic-view/basic-view.component.html +11 -0
- package/src/hooks/component/basic-view/basic-view.component.ts +16 -0
- package/src/hooks/component/basic-view/simple.component.ts +8 -0
- package/src/hooks/component/component.module.ts +38 -0
- package/src/hooks/component/index.ts +1 -0
- package/src/hooks/drawer/index.ts +2 -0
- package/src/hooks/drawer/left-drawer-tutorial/left-drawer-tutorial.component.ts +8 -0
- package/src/hooks/drawer/left-drawer-tutorial/left-drawer.module.ts +10 -0
- package/src/hooks/drawer/right-drawer-tutorial/right-drawer-tutorial.component.ts +8 -0
- package/src/hooks/drawer/right-drawer-tutorial/right-drawer.module.ts +10 -0
- package/src/hooks/generic-wizard/index.ts +1 -0
- package/src/hooks/generic-wizard/minimal-setup/minimal-setup.component.ts +12 -0
- package/src/hooks/generic-wizard/minimal-setup/multiple-entries-one.component.ts +25 -0
- package/src/hooks/generic-wizard/minimal-setup/multiple-entries-two.component.ts +25 -0
- package/src/hooks/generic-wizard/minimal-setup/stepper-example.component.html +38 -0
- package/src/hooks/generic-wizard/minimal-setup/stepper-example.component.ts +33 -0
- package/src/hooks/generic-wizard/wizard-tabs.ts +22 -0
- package/src/hooks/generic-wizard/wizard.component.html +51 -0
- package/src/hooks/generic-wizard/wizard.component.ts +86 -0
- package/src/hooks/generic-wizard/wizard.module.ts +79 -0
- package/src/hooks/hooks.module.ts +19 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/navigator/index.ts +1 -0
- package/src/hooks/navigator/navigator.module.ts +21 -0
- package/src/hooks/navigator/navigator.ts +35 -0
- package/src/hooks/navigator/time-navigator-node/time-navigator-node.component.ts +19 -0
- package/src/hooks/navigator-route/basic-view/basic-view.component.html +7 -0
- package/src/hooks/navigator-route/basic-view/basic-view.component.ts +18 -0
- package/src/hooks/navigator-route/index.ts +1 -0
- package/src/hooks/navigator-route/navigator-route.module.ts +27 -0
- package/src/hooks/route/device/device-info.component.html +2 -0
- package/src/hooks/route/device/device-info.component.ts +13 -0
- package/src/hooks/route/device/device-tab-context.component.html +15 -0
- package/src/hooks/route/device/device-tab-context.component.ts +13 -0
- package/src/hooks/route/index.ts +1 -0
- package/src/hooks/route/random.guard.ts +12 -0
- package/src/hooks/route/route.module.ts +51 -0
- package/src/hooks/state/hook-state.module.ts +25 -0
- package/src/hooks/state/hook-with-service-example.component.html +29 -0
- package/src/hooks/state/hook-with-service-example.component.ts +36 -0
- package/src/hooks/stepper/basic-view/basic-view.component.html +17 -0
- package/src/hooks/stepper/basic-view/basic-view.component.ts +31 -0
- package/src/hooks/stepper/index.ts +4 -0
- package/src/hooks/stepper/stepper-hook.module.ts +53 -0
- package/src/hooks/stepper/steps/step1.component.html +24 -0
- package/src/hooks/stepper/steps/step1.component.ts +18 -0
- package/src/hooks/stepper/steps/step2.component.html +7 -0
- package/src/hooks/stepper/steps/step2.component.ts +11 -0
- package/src/hooks/tabs/awesome/awesome.component.html +7 -0
- package/src/hooks/tabs/awesome/awesome.component.ts +21 -0
- package/src/hooks/tabs/index.ts +1 -0
- package/src/hooks/tabs/outstanding/outstanding.component.html +22 -0
- package/src/hooks/tabs/outstanding/outstanding.component.ts +27 -0
- package/src/hooks/tabs/tab.ts +44 -0
- package/src/hooks/tabs/tabs.module.ts +37 -0
- package/src/hooks/version/custom-version-factory.service.ts +49 -0
- package/src/hooks/version/index.ts +1 -0
- package/src/hooks/version/version.module.ts +11 -0
- package/src/i18n.ts +18 -0
- package/src/input/range-input-example.component.ts +29 -0
- package/src/input/range-input-example.module.ts +19 -0
- package/src/lazy/component-one.component.ts +28 -0
- package/src/lazy/component-two.component.ts +17 -0
- package/src/lazy/index.ts +1 -0
- package/src/lazy/lazy-loaded.module.ts +21 -0
- package/src/lazy/lazy-routing.module.ts +21 -0
- package/src/lazy/lazy.hooks.ts +24 -0
- package/src/lazy-widget/index.ts +1 -0
- package/src/lazy-widget/lazy-widget-config/index.ts +1 -0
- package/src/lazy-widget/lazy-widget-config/lazy-widget-config.component.ts +10 -0
- package/src/lazy-widget/lazy-widget-view/index.ts +1 -0
- package/src/lazy-widget/lazy-widget-view/lazy-widget-view.component.ts +10 -0
- package/src/lazy-widget/lazy-widget.module.ts +27 -0
- package/src/list/index.ts +1 -0
- package/src/list/list/list-check/list-check.component.html +35 -0
- package/src/list/list/list-check/list-check.component.ts +47 -0
- package/src/list/list/list-check/list-check.module.ts +21 -0
- package/src/list/list/list-timeline/list-timeline.component.html +30 -0
- package/src/list/list/list-timeline/list-timeline.component.ts +46 -0
- package/src/list/list/list-timeline/list-timeline.module.ts +21 -0
- package/src/list/list-virtual-scroll/list-virtual-scroll-check/list-virtual-scroll-check.component.html +105 -0
- package/src/list/list-virtual-scroll/list-virtual-scroll-check/list-virtual-scroll-check.component.ts +70 -0
- package/src/list/list-virtual-scroll/list-virtual-scroll-check/list-virtual-scroll-check.module.ts +22 -0
- package/src/list/list-virtual-scroll/list-virtual-scroll-timeline/list-virtual-scroll-timeline.component.html +37 -0
- package/src/list/list-virtual-scroll/list-virtual-scroll-timeline/list-virtual-scroll-timeline.component.ts +69 -0
- package/src/list/list-virtual-scroll/list-virtual-scroll-timeline/list-virtual-scroll-timeline.module.ts +24 -0
- package/src/list/lists.module.ts +17 -0
- package/src/main.ts +23 -0
- package/src/maps/cluster-map/cluster-map-example.component.html +60 -0
- package/src/maps/cluster-map/cluster-map-example.component.ts +39 -0
- package/src/maps/cluster-map/cluster-map-example.module.ts +24 -0
- package/src/maps/cluster-map-root-node/cluster-map-root-node-example.component.html +54 -0
- package/src/maps/cluster-map-root-node/cluster-map-root-node-example.component.ts +54 -0
- package/src/maps/cluster-map-root-node/cluster-map-root-node-example.module.ts +26 -0
- package/src/maps/map-examples.module.ts +18 -0
- package/src/maps/map-popup/map-popup-example.component.html +34 -0
- package/src/maps/map-popup/map-popup-example.component.ts +43 -0
- package/src/maps/map-popup/map-popup-example.module.ts +24 -0
- package/src/maps/simple-map/simple-map-example.component.html +59 -0
- package/src/maps/simple-map/simple-map-example.component.ts +70 -0
- package/src/maps/simple-map/simple-map-example.module.ts +24 -0
- package/src/modal/confirm-modal/confirm-modal-example.component.ts +69 -0
- package/src/modal/confirm-modal/confirm-modal-example.module.ts +22 -0
- package/src/modal/ngx-modal/ngx-modal-example.component.ts +34 -0
- package/src/modal/ngx-modal/ngx-modal-example.module.ts +22 -0
- package/src/modal/simple-modal/modal-example.component.ts +34 -0
- package/src/modal/simple-modal/modal.example.module.ts +21 -0
- package/src/polyfills.ts +33 -0
- package/src/popconfirm/pop-confirm-example.component.ts +61 -0
- package/src/popconfirm/pop-confirm-example.module.ts +23 -0
- package/src/properties-list/properties-list-example.component.ts +49 -0
- package/src/properties-list/properties-list-example.module.ts +21 -0
- package/src/provider-configuration/index.ts +3 -0
- package/src/provider-configuration/introduction-example/introduction.component.ts +69 -0
- package/src/provider-configuration/introduction-example/introduction.module.ts +21 -0
- package/src/provider-configuration/provider-configuration-example/demo-provider.guard.ts +9 -0
- package/src/provider-configuration/provider-configuration-example/provider-configuration.module.ts +48 -0
- package/src/quick-link/quick-link-example.component.ts +39 -0
- package/src/quick-link/quick-link-example.module.ts +23 -0
- package/src/realtime/index.ts +1 -0
- package/src/realtime/realtime-tutorial.component.html +52 -0
- package/src/realtime/realtime-tutorial.component.ts +91 -0
- package/src/realtime/realtime-tutorial.module.ts +21 -0
- package/src/redirect-to-last-route/index.ts +1 -0
- package/src/redirect-to-last-route/redirect-to-last-route-guard.service.ts +16 -0
- package/src/redirect-to-last-route/redirect-to-last-route.module.ts +20 -0
- package/src/redirect-to-last-route/view-context-redirect.service.ts +53 -0
- package/src/selector/asset-selector-example/child-devices/asset-selector-child-devices.component.ts +49 -0
- package/src/selector/asset-selector-example/child-devices/asset-selector-child-devices.module.ts +24 -0
- package/src/selector/asset-selector-example/column-header/asset-selector-column-header.component.ts +46 -0
- package/src/selector/asset-selector-example/column-header/asset-selector-column-header.module.ts +24 -0
- package/src/selector/asset-selector-example/different-root/asset-selector-different-root.component.ts +87 -0
- package/src/selector/asset-selector-example/different-root/asset-selector-different-root.module.ts +24 -0
- package/src/selector/asset-selector-example/general-example/asset-selector-example.component.html +342 -0
- package/src/selector/asset-selector-example/general-example/asset-selector-example.component.ts +34 -0
- package/src/selector/asset-selector-example/general-example/asset-selector-example.module.ts +22 -0
- package/src/selector/asset-selector-example/global-search/asset-selector-global-search.component.ts +50 -0
- package/src/selector/asset-selector-example/global-search/asset-selector-global-search.module.ts +24 -0
- package/src/selector/asset-selector-example/miller-columns-options/asset-selector-miller-example.component.ts +85 -0
- package/src/selector/asset-selector-example/miller-columns-options/asset-selector-miller-example.module.ts +26 -0
- package/src/selector/asset-selector-example/multi-select/asset-selector-multi-select.component.ts +50 -0
- package/src/selector/asset-selector-example/multi-select/asset-selector-multi-select.module.ts +24 -0
- package/src/selector/asset-selector-example/only-devices/asset-selector-only-devices.component.ts +44 -0
- package/src/selector/asset-selector-example/only-devices/asset-selector-only-devices.module.ts +24 -0
- package/src/selector/asset-selector-example/single-search/asset-selector-single-search.component.ts +71 -0
- package/src/selector/asset-selector-example/single-search/asset-selector-single-search.module.ts +24 -0
- package/src/selector/asset-selector-example/single-select/asset-selector-single-select.component.ts +47 -0
- package/src/selector/asset-selector-example/single-select/asset-single-select.module.ts +24 -0
- package/src/selector/asset-selector-example/tree-devices/asset-selector-tree-devices.component.ts +62 -0
- package/src/selector/asset-selector-example/tree-devices/asset-selector-tree-devices.module.ts +24 -0
- package/src/selector/asset-selector-example/tree-options/asset-selector-tree-example.component.ts +83 -0
- package/src/selector/asset-selector-example/tree-options/asset-selector-tree-example.module.ts +26 -0
- package/src/selector/asset-selector-example/tree-search/asset-selector-tree-search.component.ts +75 -0
- package/src/selector/asset-selector-example/tree-search/asset-selector-tree-search.module.ts +24 -0
- package/src/selector/asset-selector-example/tree-single/asset-selector-tree-single.component.ts +66 -0
- package/src/selector/asset-selector-example/tree-single/asset-selector-tree-single.module.ts +24 -0
- package/src/selector/datapoint-selection-example/context-example/datapoint-selection-context-example.component.ts +54 -0
- package/src/selector/datapoint-selection-example/context-example/datapoint-selection-context-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/dragdrop-example/datapoint-selection-dragdrop-example.component.ts +43 -0
- package/src/selector/datapoint-selection-example/dragdrop-example/datapoint-selection-dragdrop-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/general-example/datapoint-selection-example.component.html +202 -0
- package/src/selector/datapoint-selection-example/general-example/datapoint-selection-example.component.ts +51 -0
- package/src/selector/datapoint-selection-example/general-example/datapoint-selection-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/list-example/datapoint-selection-list-example.component.ts +42 -0
- package/src/selector/datapoint-selection-example/list-example/datapoint-selection-list-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/modal-example/datapoint-selection-modal-example.component.ts +51 -0
- package/src/selector/datapoint-selection-example/modal-example/datapoint-selection-modal-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/no-templates-example/datapoint-selection-notemplates-example.component.ts +43 -0
- package/src/selector/datapoint-selection-example/no-templates-example/datapoint-selection-notemplates-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/selector/datapoint-selection-selector-example.component.ts +43 -0
- package/src/selector/datapoint-selection-example/selector/datapoint-selection-selector-example.module.ts +24 -0
- package/src/selector/datapoint-selection-example/validation-example/datapoint-selection-validation-example.component.ts +46 -0
- package/src/selector/datapoint-selection-example/validation-example/datapoint-selection-validation-example.module.ts +24 -0
- package/src/standalone-demo/index.ts +1 -0
- package/src/standalone-demo/standalone-component/standalone-component.component.html +4 -0
- package/src/standalone-demo/standalone-component/standalone-component.component.ts +11 -0
- package/src/standalone-demo/standalone-demo.module.ts +23 -0
- package/src/stepper/device-stepper.component.html +70 -0
- package/src/stepper/device-stepper.component.ts +98 -0
- package/src/stepper/device.model.ts +5 -0
- package/src/stepper/index.ts +1 -0
- package/src/stepper/stepper.component.ts +19 -0
- package/src/stepper/stepper.module.ts +24 -0
- package/src/stepper/stepper.service.ts +32 -0
- package/src/time/time-picker-example.component.ts +19 -0
- package/src/time/time-picker-example.module.ts +21 -0
- package/src/translations/date-translation/c8y-translation/c8y-date-translation.component.ts +23 -0
- package/src/translations/date-translation/c8y-translation/c8y-date-translation.module.ts +22 -0
- package/src/translations/date-translation/ng-translation/date-translation.component.ts +17 -0
- package/src/translations/date-translation/ng-translation/date-translation.module.ts +22 -0
- package/src/translations/dynamic-form-translation/dynamic-form-translation.component.ts +58 -0
- package/src/translations/dynamic-form-translation/dynamic-form-translation.module.ts +22 -0
- package/src/translations/index.ts +1 -0
- package/src/translations/locales/it.po +18 -0
- package/src/translations/locales/pt_BR.po +33 -0
- package/src/translations/new-language/new-language.component.html +45 -0
- package/src/translations/new-language/new-language.component.ts +19 -0
- package/src/translations/new-language/new-language.module.ts +21 -0
- package/src/translations/new-translate/new-translation.component.html +92 -0
- package/src/translations/new-translate/new-translation.component.ts +9 -0
- package/src/translations/new-translate/new-translation.module.ts +22 -0
- package/src/translations/text-translation/gettext-translation/text-translation-gettext.component.ts +18 -0
- package/src/translations/text-translation/gettext-translation/text-translation-gettext.module.ts +22 -0
- package/src/translations/text-translation/ngNonBindable-translation/text-translation-ngnonbindable.component.ts +22 -0
- package/src/translations/text-translation/ngNonBindable-translation/text-translation-ngnonbindable.module.ts +24 -0
- package/src/translations/text-translation/service-translation/text-translation-by-service.component.ts +38 -0
- package/src/translations/text-translation/service-translation/text-translation-by-service.module.ts +24 -0
- package/src/translations/translation-tabs.ts +50 -0
- package/src/translations/translations.module.ts +18 -0
- package/src/user-menu/index.ts +1 -0
- package/src/user-menu/user-menu.module.ts +13 -0
- package/src/user-menu/user-menu.ts +26 -0
- package/src/widget/demo-widget-config.component.ts +81 -0
- package/src/widget/demo-widget.component.ts +35 -0
- package/src/widget/demo-widget.module.ts +47 -0
- package/src/widget/index.ts +1 -0
- package/src/widget-resolvers/alternative-event.resolver.ts +21 -0
- package/src/widget-resolvers/event-property.resolver.ts +52 -0
- package/src/widget-resolvers/event.resolver.ts +100 -0
- package/src/widget-resolvers/index.ts +1 -0
- package/src/widget-resolvers/widget-resolvers-config/widget-resolvers-config.component.html +31 -0
- package/src/widget-resolvers/widget-resolvers-config/widget-resolvers-config.component.ts +67 -0
- package/src/widget-resolvers/widget-resolvers.component.html +13 -0
- package/src/widget-resolvers/widget-resolvers.component.ts +37 -0
- package/src/widget-resolvers/widget-resolvers.module.ts +50 -0
- package/tsconfig.app.json +18 -0
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
/** Just a sample set of data. */
|
|
2
|
+
export function getData() {
|
|
3
|
+
return [
|
|
4
|
+
{
|
|
5
|
+
id: '10215',
|
|
6
|
+
name: 'Simulated gateway',
|
|
7
|
+
type: 'c8y_Linux',
|
|
8
|
+
lastUpdated: '2017-09-15T15:38:33.192+02:00'
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: '128138',
|
|
12
|
+
name: 'ternary simulator #1',
|
|
13
|
+
type: 'c8y_MQTTDevice',
|
|
14
|
+
creationTime: '2017-04-21T21:30:02.288+02:00',
|
|
15
|
+
lastUpdated: '2019-07-07T16:12:31.919Z',
|
|
16
|
+
c8y_ActiveAlarmsStatus: { minor: 1 },
|
|
17
|
+
owner: 'service_device-simulator'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: '145075',
|
|
21
|
+
name: 'temperature simulator #1',
|
|
22
|
+
type: 'c8y_MQTTDevice',
|
|
23
|
+
creationTime: '2017-04-23T18:24:27.330+02:00',
|
|
24
|
+
lastUpdated: '2019-08-01T13:34:57.757Z',
|
|
25
|
+
c8y_ActiveAlarmsStatus: { minor: 1, critical: 0, major: 1 },
|
|
26
|
+
owner: 'service_device-simulator'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: '145891',
|
|
30
|
+
name: 'parent',
|
|
31
|
+
creationTime: '2017-04-26T22:06:42.899+02:00',
|
|
32
|
+
lastUpdated: '2017-10-14T12:48:18.650+02:00',
|
|
33
|
+
c8y_ActiveAlarmsStatus: { critical: 0, minor: 1 },
|
|
34
|
+
owner: 'admin'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: '147224',
|
|
38
|
+
name: 'gd_11',
|
|
39
|
+
type: 'ControllerModel_11',
|
|
40
|
+
creationTime: '2017-05-12T11:47:53.913Z',
|
|
41
|
+
lastUpdated: '2018-04-17T16:12:16.574Z',
|
|
42
|
+
owner: 'admin'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: '147225',
|
|
46
|
+
name: 'gd_12',
|
|
47
|
+
type: 'ControllerModel_12',
|
|
48
|
+
creationTime: '2017-05-12T11:48:00.807Z',
|
|
49
|
+
lastUpdated: '2017-05-12T11:48:00.807Z',
|
|
50
|
+
owner: 'admin'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: '147226',
|
|
54
|
+
name: 'gd_13',
|
|
55
|
+
type: 'ControllerModel_13',
|
|
56
|
+
creationTime: '2017-05-12T11:48:06.452Z',
|
|
57
|
+
lastUpdated: '2017-05-12T11:48:06.452Z',
|
|
58
|
+
owner: 'admin'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: '147227',
|
|
62
|
+
name: 'gd_4',
|
|
63
|
+
type: 'ControllerModel_4',
|
|
64
|
+
creationTime: '2017-05-12T11:48:14.590Z',
|
|
65
|
+
lastUpdated: '2017-05-12T21:18:12.192Z',
|
|
66
|
+
owner: 'admin'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: '147228',
|
|
70
|
+
name: 'gd_5',
|
|
71
|
+
type: 'ControllerModel_5',
|
|
72
|
+
creationTime: '2017-05-12T11:48:21.023Z',
|
|
73
|
+
lastUpdated: '2017-05-12T21:18:26.017Z',
|
|
74
|
+
owner: 'admin'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: '147290',
|
|
78
|
+
name: 'gd_0',
|
|
79
|
+
type: 'ControllerModel_0',
|
|
80
|
+
creationTime: '2017-05-15T08:59:26.767Z',
|
|
81
|
+
lastUpdated: '2017-05-15T08:59:26.767Z',
|
|
82
|
+
owner: 'admin'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: '147428',
|
|
86
|
+
name: 'i_want_to_ride_my_bicycle',
|
|
87
|
+
creationTime: '2017-05-22T13:11:58.011Z',
|
|
88
|
+
lastUpdated: '2017-06-01T11:11:35.951+02:00',
|
|
89
|
+
c8y_ActiveAlarmsStatus: { minor: 0, major: 0 },
|
|
90
|
+
owner: 'admin'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: '148802',
|
|
94
|
+
name: 'testMeasurementDevice',
|
|
95
|
+
type: 'ControllerModel_Universal',
|
|
96
|
+
creationTime: '2017-06-14T12:00:06.874+02:00',
|
|
97
|
+
lastUpdated: '2019-01-02T13:32:03.621Z',
|
|
98
|
+
owner: 'service_device-simulator'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: '1561670',
|
|
102
|
+
name: 'AtCo machine 1 #1',
|
|
103
|
+
type: 'c8y_MQTTDevice',
|
|
104
|
+
creationTime: '2017-11-13T18:08:23.793+01:00',
|
|
105
|
+
lastUpdated: '2018-03-26T15:17:05.265Z',
|
|
106
|
+
c8y_ActiveAlarmsStatus: { major: 0 },
|
|
107
|
+
owner: 'service_device-simulator'
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: '1561671',
|
|
111
|
+
name: 'AtCo machine 2 #1',
|
|
112
|
+
type: 'c8y_MQTTDevice',
|
|
113
|
+
creationTime: '2017-11-13T18:08:24.602+01:00',
|
|
114
|
+
lastUpdated: '2018-03-26T15:24:37.613Z',
|
|
115
|
+
c8y_ActiveAlarmsStatus: { major: 0 },
|
|
116
|
+
owner: 'service_device-simulator'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: '158361',
|
|
120
|
+
name: 'c8y_EnergyDevice device',
|
|
121
|
+
type: 'c8y_EnergyDevice',
|
|
122
|
+
creationTime: '2017-10-10T19:10:17.146+02:00',
|
|
123
|
+
lastUpdated: '2017-10-10T22:37:06.856+02:00',
|
|
124
|
+
owner: 'admin'
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: '18790138',
|
|
128
|
+
name: 'temperature simulator mirror #1',
|
|
129
|
+
type: 'c8y_MQTTDevice',
|
|
130
|
+
creationTime: '2018-06-26T10:24:08.534Z',
|
|
131
|
+
lastUpdated: '2019-08-01T13:35:00.703Z',
|
|
132
|
+
owner: 'service_device-simulator'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: '2248747',
|
|
136
|
+
name: 'trackingDevice',
|
|
137
|
+
creationTime: '2017-12-12T22:09:06.881+01:00',
|
|
138
|
+
lastUpdated: '2018-07-19T12:01:50.731Z',
|
|
139
|
+
c8y_Availability: { lastMessage: '2019-03-08T11:16:10.630Z', status: 'UNAVAILABLE' },
|
|
140
|
+
c8y_RequiredAvailability: { responseInterval: 42 },
|
|
141
|
+
c8y_Connection: { status: 'DISCONNECTED' },
|
|
142
|
+
c8y_ActiveAlarmsStatus: { major: 1 },
|
|
143
|
+
owner: 'admin'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: '2300564',
|
|
147
|
+
name: 'the simulator #1',
|
|
148
|
+
type: 'c8y_MQTTDevice',
|
|
149
|
+
creationTime: '2018-01-22T18:25:37.046+01:00',
|
|
150
|
+
lastUpdated: '2019-08-01T13:35:20.641Z',
|
|
151
|
+
owner: 'service_device-simulator'
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: '2300743',
|
|
155
|
+
name: 'steam simulator #1',
|
|
156
|
+
type: 'c8y_MQTTDevice',
|
|
157
|
+
creationTime: '2018-01-22T18:34:32.144+01:00',
|
|
158
|
+
lastUpdated: '2018-04-27T16:02:16.109Z',
|
|
159
|
+
owner: 'service_device-simulator'
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
id: '2441189',
|
|
163
|
+
name: 'Steam generator',
|
|
164
|
+
type: 'c8y_ModbusDevice',
|
|
165
|
+
creationTime: '2018-01-24T17:14:12.080+01:00',
|
|
166
|
+
lastUpdated: '2019-08-01T13:35:33.007Z',
|
|
167
|
+
c8y_ActiveAlarmsStatus: { minor: 0 },
|
|
168
|
+
owner: 'service_device-simulator'
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: '25834000',
|
|
172
|
+
name: 'IO-Key X',
|
|
173
|
+
creationTime: '2018-08-08T10:44:48.023Z',
|
|
174
|
+
lastUpdated: '2018-08-08T10:44:48.023Z',
|
|
175
|
+
owner: 'admin'
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: '25834001',
|
|
179
|
+
name: 'IO-Key Y',
|
|
180
|
+
creationTime: '2018-08-08T10:45:56.704Z',
|
|
181
|
+
lastUpdated: '2018-08-08T10:45:56.704Z',
|
|
182
|
+
owner: 'admin'
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
id: '28366',
|
|
186
|
+
name: 'testMobileDevice',
|
|
187
|
+
type: '',
|
|
188
|
+
creationTime: '2016-12-11T23:52:58.557+01:00',
|
|
189
|
+
lastUpdated: '2018-07-20T19:09:15.394Z',
|
|
190
|
+
owner: 'admin'
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: '4445536',
|
|
194
|
+
name: 'testtest',
|
|
195
|
+
creationTime: '2018-02-21T01:31:01.317+01:00',
|
|
196
|
+
lastUpdated: '2018-02-21T01:31:01.317+01:00',
|
|
197
|
+
owner: 'admin'
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: '49118163',
|
|
201
|
+
name: '525722',
|
|
202
|
+
type: 'bkh_Machine',
|
|
203
|
+
creationTime: '2019-01-15T22:44:06.614Z',
|
|
204
|
+
lastUpdated: '2019-01-15T22:44:06.614Z',
|
|
205
|
+
owner: 'admin'
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: '49118164',
|
|
209
|
+
name: '522727',
|
|
210
|
+
type: 'bkh_Machine',
|
|
211
|
+
creationTime: '2019-01-15T22:44:06.664Z',
|
|
212
|
+
lastUpdated: '2019-01-15T22:44:06.664Z',
|
|
213
|
+
owner: 'admin'
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: '4930446',
|
|
217
|
+
name: 'A SMARTBOX',
|
|
218
|
+
type: 'SmartBoxDeviceType',
|
|
219
|
+
creationTime: '2018-02-27T18:02:03.430+01:00',
|
|
220
|
+
lastUpdated: '2018-02-28T15:46:19.329+01:00',
|
|
221
|
+
owner: 'admin'
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: '4932771',
|
|
225
|
+
name: 'A Modbus agent',
|
|
226
|
+
type: 'POSIX Agent',
|
|
227
|
+
creationTime: '2018-02-26T00:34:17.489+01:00',
|
|
228
|
+
lastUpdated: '2018-03-22T09:10:29.585Z',
|
|
229
|
+
owner: 'admin'
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: '50805783',
|
|
233
|
+
name: '522661',
|
|
234
|
+
type: 'bkh_Machine',
|
|
235
|
+
creationTime: '2019-01-15T22:44:06.533Z',
|
|
236
|
+
lastUpdated: '2019-01-15T22:44:06.533Z',
|
|
237
|
+
owner: 'admin'
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
id: '50805784',
|
|
241
|
+
name: '523535',
|
|
242
|
+
type: 'bkh_Machine',
|
|
243
|
+
creationTime: '2019-01-15T22:44:06.571Z',
|
|
244
|
+
lastUpdated: '2019-01-15T22:44:06.571Z',
|
|
245
|
+
owner: 'admin'
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
id: '50805785',
|
|
249
|
+
name: '522203',
|
|
250
|
+
type: 'bkh_Machine',
|
|
251
|
+
creationTime: '2019-01-15T22:44:07.171Z',
|
|
252
|
+
lastUpdated: '2019-04-02T11:12:33.791Z',
|
|
253
|
+
c8y_ActiveAlarmsStatus: { critical: 1 },
|
|
254
|
+
owner: 'admin'
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
id: '50939310',
|
|
258
|
+
name: '524502',
|
|
259
|
+
type: 'bkh_Machine',
|
|
260
|
+
creationTime: '2019-01-15T22:44:06.574Z',
|
|
261
|
+
lastUpdated: '2019-01-15T22:44:06.574Z',
|
|
262
|
+
owner: 'admin'
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: '50939311',
|
|
266
|
+
name: '524505',
|
|
267
|
+
type: 'bkh_Machine',
|
|
268
|
+
creationTime: '2019-01-15T22:44:06.582Z',
|
|
269
|
+
lastUpdated: '2019-01-15T22:44:06.582Z',
|
|
270
|
+
owner: 'admin'
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
id: '50939312',
|
|
274
|
+
name: '523804',
|
|
275
|
+
type: 'bkh_Machine',
|
|
276
|
+
creationTime: '2019-01-15T22:44:06.630Z',
|
|
277
|
+
lastUpdated: '2019-01-15T22:44:06.630Z',
|
|
278
|
+
owner: 'admin'
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
id: '50939313',
|
|
282
|
+
name: '522419',
|
|
283
|
+
type: 'bkh_Machine',
|
|
284
|
+
creationTime: '2019-01-15T22:44:06.742Z',
|
|
285
|
+
lastUpdated: '2019-01-15T22:44:06.742Z',
|
|
286
|
+
owner: 'admin'
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
id: '50939314',
|
|
290
|
+
name: '522623',
|
|
291
|
+
type: 'bkh_Machine',
|
|
292
|
+
creationTime: '2019-01-15T22:44:06.927Z',
|
|
293
|
+
lastUpdated: '2019-01-15T22:44:06.927Z',
|
|
294
|
+
owner: 'admin'
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
id: '53924',
|
|
298
|
+
name: 'binary simulator #1',
|
|
299
|
+
type: 'c8y_MQTTDevice',
|
|
300
|
+
creationTime: '2017-03-15T15:19:34.316+01:00',
|
|
301
|
+
lastUpdated: '2017-12-06T13:19:05.415+01:00',
|
|
302
|
+
owner: 'service_device-simulator'
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
id: '620780',
|
|
306
|
+
name: 'lamp 1',
|
|
307
|
+
type: 'c8y_LampDevice',
|
|
308
|
+
creationTime: '2017-10-30T14:41:27.587+01:00',
|
|
309
|
+
lastUpdated: '2017-10-30T14:41:27.587+01:00',
|
|
310
|
+
owner: 'admin'
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
id: '6377056',
|
|
314
|
+
name: 'marker_5',
|
|
315
|
+
creationTime: '2018-03-20T14:26:35.552Z',
|
|
316
|
+
lastUpdated: '2018-03-20T14:26:35.552Z',
|
|
317
|
+
c8y_ActiveAlarmsStatus: { warning: 0 },
|
|
318
|
+
owner: 'admin'
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
id: '6377057',
|
|
322
|
+
name: 'marker_6',
|
|
323
|
+
creationTime: '2018-03-20T14:26:38.718Z',
|
|
324
|
+
lastUpdated: '2018-03-20T14:26:38.718Z',
|
|
325
|
+
c8y_ActiveAlarmsStatus: { minor: 0 },
|
|
326
|
+
owner: 'admin'
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
id: '6669506',
|
|
330
|
+
name: 'marker_1',
|
|
331
|
+
creationTime: '2018-03-20T14:23:32.051Z',
|
|
332
|
+
lastUpdated: '2018-03-20T14:23:32.051Z',
|
|
333
|
+
owner: 'admin'
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
id: '6669507',
|
|
337
|
+
name: 'marker_3',
|
|
338
|
+
creationTime: '2018-03-20T14:23:55.399Z',
|
|
339
|
+
lastUpdated: '2018-03-20T14:23:55.399Z',
|
|
340
|
+
c8y_ActiveAlarmsStatus: { minor: 0 },
|
|
341
|
+
owner: 'admin'
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: '6669508',
|
|
345
|
+
name: 'marker_4',
|
|
346
|
+
creationTime: '2018-03-20T14:23:58.586Z',
|
|
347
|
+
lastUpdated: '2018-03-20T14:23:58.586Z',
|
|
348
|
+
c8y_ActiveAlarmsStatus: { major: 0 },
|
|
349
|
+
owner: 'admin'
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
id: '6669995',
|
|
353
|
+
name: 'marker_2',
|
|
354
|
+
creationTime: '2018-03-20T14:23:51.937Z',
|
|
355
|
+
lastUpdated: '2018-03-20T14:23:51.937Z',
|
|
356
|
+
owner: 'admin'
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
id: '738765',
|
|
360
|
+
name: 'lamp 2',
|
|
361
|
+
type: 'c8y_LampDevice',
|
|
362
|
+
creationTime: '2017-10-30T14:41:32.477+01:00',
|
|
363
|
+
lastUpdated: '2017-10-30T14:41:32.477+01:00',
|
|
364
|
+
owner: 'admin'
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
id: '738768',
|
|
368
|
+
name: 'lamp 3',
|
|
369
|
+
type: 'c8y_LampDevice',
|
|
370
|
+
creationTime: '2017-10-30T14:41:37.476+01:00',
|
|
371
|
+
lastUpdated: '2017-10-30T14:41:37.476+01:00',
|
|
372
|
+
owner: 'admin'
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
id: '739007',
|
|
376
|
+
name: 'lamp 4',
|
|
377
|
+
type: 'c8y_LampDevice',
|
|
378
|
+
creationTime: '2017-10-30T14:49:43.832+01:00',
|
|
379
|
+
lastUpdated: '2017-10-30T14:59:35.412+01:00',
|
|
380
|
+
owner: 'admin'
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
id: '739309',
|
|
384
|
+
name: 'lamp 5',
|
|
385
|
+
type: 'c8y_LampDevice',
|
|
386
|
+
creationTime: '2017-10-30T15:00:03.899+01:00',
|
|
387
|
+
lastUpdated: '2017-10-30T15:00:03.899+01:00',
|
|
388
|
+
owner: 'admin'
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
id: '79265648',
|
|
392
|
+
name: 'Latitude (CFPPNV2)',
|
|
393
|
+
type: 'c8y_cumulocity_agent',
|
|
394
|
+
creationTime: '2019-07-10T14:30:51.616Z',
|
|
395
|
+
lastUpdated: '2019-07-26T08:22:46.591Z',
|
|
396
|
+
c8y_Availability: { lastMessage: '2019-07-26T08:22:56.253Z', status: 'UNAVAILABLE' },
|
|
397
|
+
c8y_RequiredAvailability: { responseInterval: 20 },
|
|
398
|
+
c8y_Connection: { status: 'DISCONNECTED' },
|
|
399
|
+
c8y_ActiveAlarmsStatus: { major: 1 },
|
|
400
|
+
owner: 'device_CFPPNV2'
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
id: '79387749',
|
|
404
|
+
name: 'Latitude (eaa3aa91f1bf41f79f72838721fcef6e)',
|
|
405
|
+
type: 'c8y_cumulocity_agent',
|
|
406
|
+
creationTime: '2019-07-11T13:05:52.005Z',
|
|
407
|
+
lastUpdated: '2019-08-08T08:36:23.207Z',
|
|
408
|
+
c8y_Availability: { lastMessage: '2019-08-08T08:36:32.896Z', status: 'UNAVAILABLE' },
|
|
409
|
+
c8y_RequiredAvailability: { responseInterval: 20 },
|
|
410
|
+
c8y_Connection: { status: 'DISCONNECTED' },
|
|
411
|
+
c8y_ActiveAlarmsStatus: { major: 1 },
|
|
412
|
+
owner: 'device_CFPPNV2'
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
id: '82495860',
|
|
416
|
+
name: 'NTC-221 (S/N 191611192800580)',
|
|
417
|
+
type: 'POSIX Agent',
|
|
418
|
+
creationTime: '2019-07-31T12:56:31.161Z',
|
|
419
|
+
lastUpdated: '2019-08-02T11:53:34.110Z',
|
|
420
|
+
c8y_Availability: { lastMessage: '2019-07-31T12:56:31.162Z', status: 'UNAVAILABLE' },
|
|
421
|
+
c8y_RequiredAvailability: { responseInterval: 20 },
|
|
422
|
+
c8y_Connection: { status: 'DISCONNECTED' },
|
|
423
|
+
c8y_ActiveAlarmsStatus: { major: 1 },
|
|
424
|
+
owner: 'device_191611192800580'
|
|
425
|
+
}
|
|
426
|
+
];
|
|
427
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<c8y-title>Data grid examples</c8y-title>
|
|
2
|
+
|
|
3
|
+
<div class="card">
|
|
4
|
+
<div class="card-header separator">
|
|
5
|
+
<h4 class="card-title">Device grid</h4>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="card-block">
|
|
8
|
+
<p>
|
|
9
|
+
The following example features
|
|
10
|
+
<code>DeviceGridComponent</code>
|
|
11
|
+
and:
|
|
12
|
+
</p>
|
|
13
|
+
<ul>
|
|
14
|
+
<li>displaying a filterable and sortable list of devices</li>
|
|
15
|
+
<li>loading grid configuration from presets (columns, stored filtering and sorting)</li>
|
|
16
|
+
<li>event handlers for: columns config changes, device query string changes</li>
|
|
17
|
+
<li>
|
|
18
|
+
custom validators for filters (based on
|
|
19
|
+
<a
|
|
20
|
+
href="https://formly.dev/docs/guide/validation/#3-declaring-validation-function-and-message-within-field-definition"
|
|
21
|
+
target="_blank"
|
|
22
|
+
rel="noopener noreferrer"
|
|
23
|
+
>
|
|
24
|
+
Formly documentation
|
|
25
|
+
</a>
|
|
26
|
+
)
|
|
27
|
+
</li>
|
|
28
|
+
</ul>
|
|
29
|
+
|
|
30
|
+
<div class="form-group">
|
|
31
|
+
<label for="exampleSelect">Select a preset example</label>
|
|
32
|
+
<div class="c8y-select-wrapper">
|
|
33
|
+
<select
|
|
34
|
+
class="form-control"
|
|
35
|
+
id="exampleSelect"
|
|
36
|
+
[ngModel]="selectedExample"
|
|
37
|
+
(ngModelChange)="selectExample($event)"
|
|
38
|
+
>
|
|
39
|
+
<option
|
|
40
|
+
*ngFor="let example of examples"
|
|
41
|
+
[ngValue]="example"
|
|
42
|
+
>
|
|
43
|
+
{{ example.label }}
|
|
44
|
+
</option>
|
|
45
|
+
</select>
|
|
46
|
+
<span></span>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<c8y-device-grid
|
|
51
|
+
[title]="'Devices'"
|
|
52
|
+
[columns]="columnsInput"
|
|
53
|
+
[actionControls]="[]"
|
|
54
|
+
(onColumnsChange)="onColumnsChange($event)"
|
|
55
|
+
(onDeviceQueryStringChange)="onDeviceQueryStringChange($event)"
|
|
56
|
+
></c8y-device-grid>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { AbstractControl } from '@angular/forms';
|
|
3
|
+
import { RouterModule } from '@angular/router';
|
|
4
|
+
import { Column, CoreModule, CustomColumn, gettext } from '@c8y/ngx-components';
|
|
5
|
+
import { DeviceGridModule, DeviceGridService } from '@c8y/ngx-components/device-grid';
|
|
6
|
+
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
7
|
+
import { find } from 'lodash-es';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'c8y-device-grid-example',
|
|
11
|
+
templateUrl: './device-grid-example.component.html',
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [CoreModule, DeviceGridModule, RouterModule],
|
|
14
|
+
providers: [DeviceGridService]
|
|
15
|
+
})
|
|
16
|
+
export class DeviceGridExampleComponent {
|
|
17
|
+
examples: Array<{ label: string; columns: Column[] }>;
|
|
18
|
+
selectedExample;
|
|
19
|
+
columnsInput: Column[];
|
|
20
|
+
|
|
21
|
+
constructor(protected deviceGridService: DeviceGridService) {
|
|
22
|
+
this.examples = [
|
|
23
|
+
this.getExampleWithStandardColumns(),
|
|
24
|
+
this.getExampleWithStandardColumnsAndSavedFilteringSorting(),
|
|
25
|
+
this.getExampleWithCustomColumnAndPredefinedFiltering(),
|
|
26
|
+
this.getExampleWithCustomColumnAndCustomValidator()
|
|
27
|
+
];
|
|
28
|
+
this.selectExample(this.examples[0]);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
getExampleWithStandardColumns() {
|
|
32
|
+
const columns = this.deviceGridService.getDefaultColumns();
|
|
33
|
+
return {
|
|
34
|
+
label: 'Standard columns',
|
|
35
|
+
columns
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
getExampleWithStandardColumnsAndSavedFilteringSorting() {
|
|
40
|
+
const columns = this.deviceGridService.getDefaultColumns();
|
|
41
|
+
const nameColumn = find(columns, { name: 'name' });
|
|
42
|
+
nameColumn.externalFilterQuery = {
|
|
43
|
+
names: ['*Temp*']
|
|
44
|
+
};
|
|
45
|
+
nameColumn.sortOrder = 'desc';
|
|
46
|
+
return {
|
|
47
|
+
label: 'Standard columns with saved filtering/sorting',
|
|
48
|
+
columns
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
getExampleWithCustomColumnAndPredefinedFiltering() {
|
|
53
|
+
const columns = this.deviceGridService.getDefaultColumns();
|
|
54
|
+
const typeColumn = new CustomColumn();
|
|
55
|
+
typeColumn.name = 'type';
|
|
56
|
+
typeColumn.path = 'type';
|
|
57
|
+
typeColumn.header = gettext('Type');
|
|
58
|
+
typeColumn.externalFilterQuery = {
|
|
59
|
+
equals: ['c8y_MQTTDevice']
|
|
60
|
+
};
|
|
61
|
+
columns.splice(2, 0, typeColumn);
|
|
62
|
+
return {
|
|
63
|
+
label: 'Standard columns with custom one with predefined filtering',
|
|
64
|
+
columns
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
getExampleWithCustomColumnAndCustomValidator() {
|
|
69
|
+
const columns = this.deviceGridService.getDefaultColumns();
|
|
70
|
+
const nameColumn = columns.find(column => column.name === 'name');
|
|
71
|
+
|
|
72
|
+
nameColumn.filteringConfig.fields = [
|
|
73
|
+
{
|
|
74
|
+
key: 'name',
|
|
75
|
+
type: 'array',
|
|
76
|
+
defaultValue: [''],
|
|
77
|
+
templateOptions: {
|
|
78
|
+
required: true,
|
|
79
|
+
addText: 'Add next`name`'
|
|
80
|
+
},
|
|
81
|
+
fieldArray: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
templateOptions: {
|
|
84
|
+
required: true,
|
|
85
|
+
label: 'Show items with name',
|
|
86
|
+
tooltip: 'Use * as a wildcard character',
|
|
87
|
+
placeholder: 'My device`DEVICE_NAME`'
|
|
88
|
+
},
|
|
89
|
+
validators: {
|
|
90
|
+
minLength: {
|
|
91
|
+
expression: (c: AbstractControl) => c.value.length >= 3,
|
|
92
|
+
message: (error: any, field: FormlyFieldConfig) =>
|
|
93
|
+
`value "${field.formControl.value}" is too short. min length is 3 characters`
|
|
94
|
+
},
|
|
95
|
+
maxLength: {
|
|
96
|
+
expression: (c: AbstractControl) => c.value.length <= 6,
|
|
97
|
+
message: (error: any, field: FormlyFieldConfig) =>
|
|
98
|
+
`value "${field.formControl.value}" is too long. max length is 6 characters `
|
|
99
|
+
},
|
|
100
|
+
regexExampleValidator: {
|
|
101
|
+
expression: (c: AbstractControl) => /foo/.test(c.value),
|
|
102
|
+
message: (error: any, field: FormlyFieldConfig) =>
|
|
103
|
+
`value "${field.formControl.value}" must contain "foo"`
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
label: 'Standard columns with custom validators for "Name" column\'s filter',
|
|
112
|
+
columns
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
selectExample(example) {
|
|
117
|
+
this.selectedExample = example;
|
|
118
|
+
this.columnsInput = example.columns;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
onColumnsChange(columns: Column[]): void {
|
|
122
|
+
// the columns list contains the current setup of the columns in the grid:
|
|
123
|
+
|
|
124
|
+
// eslint-disable-next-line no-console
|
|
125
|
+
console.log({ columns });
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
onDeviceQueryStringChange(deviceQueryString: string): void {
|
|
129
|
+
// the query string is based on currently selected filters and sorting in columns:
|
|
130
|
+
|
|
131
|
+
// eslint-disable-next-line no-console
|
|
132
|
+
console.log({ deviceQueryString });
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
imports: [CommonModule],
|
|
7
|
+
providers: [
|
|
8
|
+
hookRoute({
|
|
9
|
+
path: 'grids/device-grid-example',
|
|
10
|
+
loadComponent: () =>
|
|
11
|
+
import('./device-grid-example.component').then(m => m.DeviceGridExampleComponent)
|
|
12
|
+
}),
|
|
13
|
+
hookNavigator(
|
|
14
|
+
new NavigatorNode({
|
|
15
|
+
priority: 10,
|
|
16
|
+
path: 'grids/device-grid-example',
|
|
17
|
+
icon: 'table',
|
|
18
|
+
label: 'Device grid',
|
|
19
|
+
parent: 'Data grid examples'
|
|
20
|
+
})
|
|
21
|
+
)
|
|
22
|
+
]
|
|
23
|
+
})
|
|
24
|
+
export class DeviceGridExampleModule {}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { TabFactory, Tab } from '@c8y/ngx-components';
|
|
3
|
+
import { Router } from '@angular/router';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class GridsTabs implements TabFactory {
|
|
7
|
+
constructor(public router: Router) {}
|
|
8
|
+
|
|
9
|
+
get() {
|
|
10
|
+
const tabs: Tab[] = [];
|
|
11
|
+
|
|
12
|
+
if (this.router.url.match(/data-grid/g)) {
|
|
13
|
+
tabs.push({
|
|
14
|
+
icon: 'resume-website',
|
|
15
|
+
priority: 1000,
|
|
16
|
+
label: 'Client-side data grid',
|
|
17
|
+
path: 'data-grid/client-grid-example'
|
|
18
|
+
} as Tab);
|
|
19
|
+
|
|
20
|
+
tabs.push({
|
|
21
|
+
icon: 'server',
|
|
22
|
+
priority: 900,
|
|
23
|
+
label: 'Server-side data grid',
|
|
24
|
+
path: 'data-grid/server-grid-example'
|
|
25
|
+
} as Tab);
|
|
26
|
+
|
|
27
|
+
tabs.push({
|
|
28
|
+
icon: 'c8y-device-management',
|
|
29
|
+
priority: 800,
|
|
30
|
+
label: 'Device grid',
|
|
31
|
+
path: 'data-grid/device-grid-example'
|
|
32
|
+
} as Tab);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return tabs;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { hookNavigator, NavigatorNode } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
imports: [],
|
|
6
|
+
declarations: [],
|
|
7
|
+
providers: [
|
|
8
|
+
hookNavigator(
|
|
9
|
+
new NavigatorNode({
|
|
10
|
+
label: 'Data grid examples',
|
|
11
|
+
icon: 'table',
|
|
12
|
+
priority: 30
|
|
13
|
+
})
|
|
14
|
+
)
|
|
15
|
+
]
|
|
16
|
+
})
|
|
17
|
+
export class GridsModule {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './grids.module';
|