@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,11 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { HeaderModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'tut-cascading-style-sheets-example',
|
|
6
|
+
template: `<c8y-title>CSS component styles</c8y-title>`,
|
|
7
|
+
styleUrls: ['./cascading-style-sheets-example.component.css'],
|
|
8
|
+
standalone: true,
|
|
9
|
+
imports: [HeaderModule]
|
|
10
|
+
})
|
|
11
|
+
export class CascadingStyleSheetsExampleComponent {}
|
package/src/component-styles/cascading-style-sheets-example/cascading-style-sheets-example.module.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
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: 'component-styles/css',
|
|
10
|
+
loadComponent: () =>
|
|
11
|
+
import('./cascading-style-sheets-example.component').then(
|
|
12
|
+
m => m.CascadingStyleSheetsExampleComponent
|
|
13
|
+
)
|
|
14
|
+
}),
|
|
15
|
+
hookNavigator(
|
|
16
|
+
new NavigatorNode({
|
|
17
|
+
path: '/component-styles/css',
|
|
18
|
+
label: 'CSS',
|
|
19
|
+
icon: 'c8y-css',
|
|
20
|
+
priority: 79,
|
|
21
|
+
parent: 'Component styles'
|
|
22
|
+
})
|
|
23
|
+
)
|
|
24
|
+
]
|
|
25
|
+
})
|
|
26
|
+
export class CascadingStyleSheetsExampleModule {}
|
package/src/component-styles/leaner-style-sheets-example/leaner-style-sheets-example.component.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { HeaderModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'tut-leaner-style-sheets-example',
|
|
6
|
+
template: `<c8y-title>LESS component styles</c8y-title>`,
|
|
7
|
+
styleUrls: ['./leaner-style-sheets-example.component.less'],
|
|
8
|
+
standalone: true,
|
|
9
|
+
imports: [HeaderModule]
|
|
10
|
+
})
|
|
11
|
+
export class LeanerStyleSheetsExampleComponent {}
|
package/src/component-styles/leaner-style-sheets-example/leaner-style-sheets-example.module.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
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: 'component-styles/less',
|
|
10
|
+
loadComponent: () =>
|
|
11
|
+
import('./leaner-style-sheets-example.component').then(
|
|
12
|
+
m => m.LeanerStyleSheetsExampleComponent
|
|
13
|
+
)
|
|
14
|
+
}),
|
|
15
|
+
hookNavigator(
|
|
16
|
+
new NavigatorNode({
|
|
17
|
+
path: '/component-styles/less',
|
|
18
|
+
label: 'LESS',
|
|
19
|
+
icon: 'c8y-css',
|
|
20
|
+
priority: 79,
|
|
21
|
+
parent: 'Component styles'
|
|
22
|
+
})
|
|
23
|
+
)
|
|
24
|
+
]
|
|
25
|
+
})
|
|
26
|
+
export class LeanerStyleSheetsExampleModule {}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { HeaderModule } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'tut-syntactically-awesome-style-sheets-example',
|
|
6
|
+
template: `<c8y-title>SCSS component styles</c8y-title>`,
|
|
7
|
+
styleUrls: ['./syntactically-awesome-style-sheets-example.component.scss'],
|
|
8
|
+
standalone: true,
|
|
9
|
+
imports: [HeaderModule]
|
|
10
|
+
})
|
|
11
|
+
export class SyntacticallyAwesomeStyleSheetsExampleComponent {}
|
|
@@ -0,0 +1,26 @@
|
|
|
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: 'component-styles/sass',
|
|
10
|
+
loadComponent: () =>
|
|
11
|
+
import('./syntactically-awesome-style-sheets-example.component').then(
|
|
12
|
+
m => m.SyntacticallyAwesomeStyleSheetsExampleComponent
|
|
13
|
+
)
|
|
14
|
+
}),
|
|
15
|
+
hookNavigator(
|
|
16
|
+
new NavigatorNode({
|
|
17
|
+
path: '/component-styles/sass',
|
|
18
|
+
label: 'SASS',
|
|
19
|
+
icon: 'c8y-css',
|
|
20
|
+
priority: 79,
|
|
21
|
+
parent: 'Component styles'
|
|
22
|
+
})
|
|
23
|
+
)
|
|
24
|
+
]
|
|
25
|
+
})
|
|
26
|
+
export class SyntacticallyAwesomeStyleSheetsExampleModule {}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CoreModule, Widget } from '@c8y/ngx-components';
|
|
3
|
+
import { ContextDashboardModule } from '@c8y/ngx-components/context-dashboard';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-context-dashboard',
|
|
8
|
+
template: `<c8y-title>Context dashboard</c8y-title>
|
|
9
|
+
<c8y-context-dashboard
|
|
10
|
+
name="example-widget"
|
|
11
|
+
[defaultWidgets]="defaultWidgets"
|
|
12
|
+
[canDelete]="false"
|
|
13
|
+
></c8y-context-dashboard> `,
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [ContextDashboardModule, CoreModule, CommonModule]
|
|
16
|
+
})
|
|
17
|
+
export class ContextDashboardComponent {
|
|
18
|
+
defaultWidgets: Widget[] = [
|
|
19
|
+
{
|
|
20
|
+
_x: 3,
|
|
21
|
+
_y: 0,
|
|
22
|
+
_width: 6,
|
|
23
|
+
_height: 6,
|
|
24
|
+
componentId: 'angular.widget.demo',
|
|
25
|
+
config: {
|
|
26
|
+
text: 'Welcome to a context dashboard'
|
|
27
|
+
},
|
|
28
|
+
title: 'Hello',
|
|
29
|
+
id: 'some_unique_id'
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
providers: [
|
|
6
|
+
hookRoute({
|
|
7
|
+
path: 'dashboards/context',
|
|
8
|
+
loadComponent: () =>
|
|
9
|
+
import('./context-dashboard.component').then(m => m.ContextDashboardComponent)
|
|
10
|
+
}),
|
|
11
|
+
hookNavigator(
|
|
12
|
+
new NavigatorNode({
|
|
13
|
+
label: 'Context dashboard',
|
|
14
|
+
path: '/dashboards/context',
|
|
15
|
+
icon: 'th-list',
|
|
16
|
+
priority: 0,
|
|
17
|
+
parent: 'Dashboards'
|
|
18
|
+
})
|
|
19
|
+
)
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
export class ContextDashboardModule {}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<c8y-title>Custom dashboard</c8y-title>
|
|
2
|
+
|
|
3
|
+
<!--TODO: align action bar-->
|
|
4
|
+
<c8y-action-bar-item [placement]="'right'">
|
|
5
|
+
<button
|
|
6
|
+
class="btn btn-link"
|
|
7
|
+
title="{{ 'Add random' | translate }}"
|
|
8
|
+
type="button"
|
|
9
|
+
(click)="addRandom()"
|
|
10
|
+
>
|
|
11
|
+
<i c8yIcon="plus-circle"></i>
|
|
12
|
+
{{ 'Add random' | translate }}
|
|
13
|
+
</button>
|
|
14
|
+
</c8y-action-bar-item>
|
|
15
|
+
<c8y-action-bar-item [placement]="'right'">
|
|
16
|
+
<button
|
|
17
|
+
class="btn btn-link"
|
|
18
|
+
title="{{ 'Toggle freeze' | translate }}"
|
|
19
|
+
(click)="isFrozen = !isFrozen"
|
|
20
|
+
>
|
|
21
|
+
<i [c8yIcon]="isFrozen ? 'lock' : 'unlock'"></i>
|
|
22
|
+
{{ 'Toggle freeze' | translate }}
|
|
23
|
+
</button>
|
|
24
|
+
</c8y-action-bar-item>
|
|
25
|
+
|
|
26
|
+
<c8y-help src="/docs/cockpit/working-with-dashboards/#working-with-dashboards"></c8y-help>
|
|
27
|
+
|
|
28
|
+
<c8y-dashboard (dashboardChange)="dashboardChange($event)">
|
|
29
|
+
<c8y-dashboard-child
|
|
30
|
+
[class]="{
|
|
31
|
+
'panel-title-hidden': true
|
|
32
|
+
}"
|
|
33
|
+
title="dynamic"
|
|
34
|
+
[isFrozen]="isFrozen"
|
|
35
|
+
*ngFor="let widget of widgets"
|
|
36
|
+
[data]="widget"
|
|
37
|
+
[width]="widget.width"
|
|
38
|
+
[height]="widget.height"
|
|
39
|
+
#current
|
|
40
|
+
>
|
|
41
|
+
<div class="card-block">
|
|
42
|
+
x: {{ current.x }}
|
|
43
|
+
<br />
|
|
44
|
+
y: {{ current.y }}
|
|
45
|
+
<br />
|
|
46
|
+
width: {{ current.width }}
|
|
47
|
+
<br />
|
|
48
|
+
height: {{ current.height }}
|
|
49
|
+
<br />
|
|
50
|
+
</div>
|
|
51
|
+
</c8y-dashboard-child>
|
|
52
|
+
<c8y-dashboard-child
|
|
53
|
+
[class]="{
|
|
54
|
+
'panel-content-branded': true,
|
|
55
|
+
'panel-title-overlay': true
|
|
56
|
+
}"
|
|
57
|
+
#cpWidget
|
|
58
|
+
[isFrozen]="isFrozen"
|
|
59
|
+
[x]="0"
|
|
60
|
+
[y]="1"
|
|
61
|
+
[width]="3"
|
|
62
|
+
[height]="2"
|
|
63
|
+
>
|
|
64
|
+
<c8y-dashboard-child-title>
|
|
65
|
+
<span>World!</span>
|
|
66
|
+
</c8y-dashboard-child-title>
|
|
67
|
+
<div class="card-block">
|
|
68
|
+
x: {{ cpWidget.x }}
|
|
69
|
+
<br />
|
|
70
|
+
y: {{ cpWidget.y }}
|
|
71
|
+
<br />
|
|
72
|
+
width: {{ cpWidget.width }}
|
|
73
|
+
<br />
|
|
74
|
+
height: {{ cpWidget.height }}
|
|
75
|
+
<br />
|
|
76
|
+
</div>
|
|
77
|
+
</c8y-dashboard-child>
|
|
78
|
+
<c8y-dashboard-child
|
|
79
|
+
[class]="{ 'panel-content-dark': true }"
|
|
80
|
+
#cpWidget2
|
|
81
|
+
[isFrozen]="isFrozen"
|
|
82
|
+
[x]="8"
|
|
83
|
+
[y]="1"
|
|
84
|
+
[width]="4"
|
|
85
|
+
[height]="4"
|
|
86
|
+
>
|
|
87
|
+
<c8y-dashboard-child-title>
|
|
88
|
+
<span>Hello!</span>
|
|
89
|
+
</c8y-dashboard-child-title>
|
|
90
|
+
<c8y-dashboard-child-action>
|
|
91
|
+
<a
|
|
92
|
+
href=""
|
|
93
|
+
(click)="cpWidget2.isFrozen = !cpWidget2.isFrozen; (false)"
|
|
94
|
+
>
|
|
95
|
+
<i [c8yIcon]="cpWidget2.isFrozen ? 'lock' : 'unlock'"></i>
|
|
96
|
+
Toggle freeze
|
|
97
|
+
</a>
|
|
98
|
+
</c8y-dashboard-child-action>
|
|
99
|
+
<div class="card-block">
|
|
100
|
+
x: {{ cpWidget2.x }}
|
|
101
|
+
<br />
|
|
102
|
+
y: {{ cpWidget2.y }}
|
|
103
|
+
<br />
|
|
104
|
+
width: {{ cpWidget2.width }}
|
|
105
|
+
<br />
|
|
106
|
+
height: {{ cpWidget2.height }}
|
|
107
|
+
<br />
|
|
108
|
+
</div>
|
|
109
|
+
</c8y-dashboard-child>
|
|
110
|
+
|
|
111
|
+
<c8y-dashboard-child
|
|
112
|
+
[class]="{ 'panel-content-transparent': true }"
|
|
113
|
+
#cpWidget3
|
|
114
|
+
[isFrozen]="isFrozen"
|
|
115
|
+
[x]="0"
|
|
116
|
+
[y]="3"
|
|
117
|
+
[width]="8"
|
|
118
|
+
[height]="2"
|
|
119
|
+
>
|
|
120
|
+
<c8y-dashboard-child-title *ngIf="showTitle">
|
|
121
|
+
<span>Another!</span>
|
|
122
|
+
</c8y-dashboard-child-title>
|
|
123
|
+
<c8y-dashboard-child-action>
|
|
124
|
+
<a
|
|
125
|
+
href=""
|
|
126
|
+
(click)="showTitle = !showTitle; (false)"
|
|
127
|
+
>
|
|
128
|
+
<i [c8yIcon]="'heading'"></i>
|
|
129
|
+
Hide/show title
|
|
130
|
+
</a>
|
|
131
|
+
</c8y-dashboard-child-action>
|
|
132
|
+
<c8y-dashboard-child-action>
|
|
133
|
+
<a
|
|
134
|
+
href=""
|
|
135
|
+
(click)="cpWidget3.isFrozen = !cpWidget3.isFrozen; (false)"
|
|
136
|
+
>
|
|
137
|
+
<i [c8yIcon]="cpWidget3.isFrozen ? 'lock' : 'unlock'"></i>
|
|
138
|
+
Toggle freeze
|
|
139
|
+
</a>
|
|
140
|
+
</c8y-dashboard-child-action>
|
|
141
|
+
<div class="card-block">
|
|
142
|
+
x: {{ cpWidget3.x }}
|
|
143
|
+
<br />
|
|
144
|
+
y: {{ cpWidget3.y }}
|
|
145
|
+
<br />
|
|
146
|
+
width: {{ cpWidget3.width }}
|
|
147
|
+
<br />
|
|
148
|
+
height: {{ cpWidget3.height }}
|
|
149
|
+
<br />
|
|
150
|
+
</div>
|
|
151
|
+
</c8y-dashboard-child>
|
|
152
|
+
|
|
153
|
+
<!-- A dashboard child with a dynamic component -->
|
|
154
|
+
<c8y-dashboard-child
|
|
155
|
+
[isFrozen]="isFrozen"
|
|
156
|
+
[width]="10"
|
|
157
|
+
[height]="4"
|
|
158
|
+
>
|
|
159
|
+
<c8y-dashboard-child-title>
|
|
160
|
+
<span>Dynamic component demo</span>
|
|
161
|
+
</c8y-dashboard-child-title>
|
|
162
|
+
<c8y-dashboard-child-action>
|
|
163
|
+
<button
|
|
164
|
+
title="{{ 'Configure this widget' | translate }}"
|
|
165
|
+
type="button"
|
|
166
|
+
(click)="editComponent = !editComponent; (false)"
|
|
167
|
+
>
|
|
168
|
+
<i [c8yIcon]="'cog'"></i>
|
|
169
|
+
{{ 'Configure this widget' | translate }}
|
|
170
|
+
</button>
|
|
171
|
+
</c8y-dashboard-child-action>
|
|
172
|
+
<div class="card-block">
|
|
173
|
+
<c8y-dynamic-component
|
|
174
|
+
componentId="angular.widget.demo"
|
|
175
|
+
[config]="{ text: 'Hello world' }"
|
|
176
|
+
[mode]="editComponent ? 'config' : 'component'"
|
|
177
|
+
></c8y-dynamic-component>
|
|
178
|
+
</div>
|
|
179
|
+
</c8y-dashboard-child>
|
|
180
|
+
</c8y-dashboard>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { DashboardChildDimension, CoreModule } from '@c8y/ngx-components';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { AssetSelectorModule } from '@c8y/ngx-components/assets-navigator';
|
|
5
|
+
import { DatapointSelectorModule } from '@c8y/ngx-components/datapoint-selector';
|
|
6
|
+
import { DashboardWidgetDemoModule } from '../../widget';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'custom-dashboard',
|
|
10
|
+
templateUrl: './custom-dashboard.component.html',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [
|
|
13
|
+
CommonModule,
|
|
14
|
+
CoreModule,
|
|
15
|
+
AssetSelectorModule,
|
|
16
|
+
DatapointSelectorModule,
|
|
17
|
+
// TODO: REMOVE ME
|
|
18
|
+
DashboardWidgetDemoModule
|
|
19
|
+
]
|
|
20
|
+
})
|
|
21
|
+
export class CustomDashboardComponent {
|
|
22
|
+
widgets = [
|
|
23
|
+
{ x: 0, y: 0, width: 12, height: 1 },
|
|
24
|
+
{ x: 3, y: 1, width: 5, height: 2 }
|
|
25
|
+
] as DashboardChildDimension[];
|
|
26
|
+
isFrozen = false;
|
|
27
|
+
showTitle = true;
|
|
28
|
+
editComponent = false;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Add a random child to the dashboard.
|
|
32
|
+
*/
|
|
33
|
+
addRandom() {
|
|
34
|
+
let width = Math.round(Math.random() * 10);
|
|
35
|
+
if (width < 2) {
|
|
36
|
+
width += 2;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let height = Math.round(Math.random() * 10);
|
|
40
|
+
if (height < 1) {
|
|
41
|
+
height += 1;
|
|
42
|
+
}
|
|
43
|
+
this.widgets.push({ width, height });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Called when the user change the dashboard
|
|
48
|
+
*/
|
|
49
|
+
dashboardChange(event) {
|
|
50
|
+
console.log(event);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
providers: [
|
|
6
|
+
hookRoute({
|
|
7
|
+
path: 'dashboards/custom',
|
|
8
|
+
loadComponent: () =>
|
|
9
|
+
import('./custom-dashboard.component').then(m => m.CustomDashboardComponent)
|
|
10
|
+
}),
|
|
11
|
+
hookNavigator(
|
|
12
|
+
new NavigatorNode({
|
|
13
|
+
label: 'Custom dashboard',
|
|
14
|
+
path: '/dashboards/custom',
|
|
15
|
+
icon: 'th-large',
|
|
16
|
+
priority: 3,
|
|
17
|
+
parent: 'Dashboards'
|
|
18
|
+
})
|
|
19
|
+
)
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
export class CustomDashboardModule {}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute } from '@angular/router';
|
|
3
|
+
import { IManagedObject } from '@c8y/client';
|
|
4
|
+
import { CoreModule, Widget } from '@c8y/ngx-components';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
import { ContextDashboardModule } from '@c8y/ngx-components/context-dashboard';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-named-context-dashboard',
|
|
10
|
+
template: `<c8y-title>Named context dashboard</c8y-title>
|
|
11
|
+
<!-- TODO: verify if device is found and everything is displaying properly -->
|
|
12
|
+
<c8y-context-dashboard
|
|
13
|
+
[name]="name"
|
|
14
|
+
[defaultWidgets]="defaultWidgets"
|
|
15
|
+
[context]="context"
|
|
16
|
+
[canDelete]="false"
|
|
17
|
+
></c8y-context-dashboard> `,
|
|
18
|
+
standalone: true,
|
|
19
|
+
imports: [CommonModule, CoreModule, ContextDashboardModule]
|
|
20
|
+
})
|
|
21
|
+
export class NamedContextDashboardComponent {
|
|
22
|
+
context: any;
|
|
23
|
+
name = 'myCustomDeviceDashboardName';
|
|
24
|
+
defaultWidgets: Widget[] = [];
|
|
25
|
+
|
|
26
|
+
constructor(private route: ActivatedRoute) {
|
|
27
|
+
this.context = this.route.parent.snapshot.data;
|
|
28
|
+
if (this.context && this.context.contextData) {
|
|
29
|
+
const device: IManagedObject = this.context.contextData;
|
|
30
|
+
this.name = this.name + '-' + device.id;
|
|
31
|
+
this.defaultWidgets = [
|
|
32
|
+
{
|
|
33
|
+
_x: 3,
|
|
34
|
+
_y: 0,
|
|
35
|
+
_width: 6,
|
|
36
|
+
_height: 6,
|
|
37
|
+
componentId: 'angular.widget.demo',
|
|
38
|
+
config: {
|
|
39
|
+
device: {
|
|
40
|
+
id: device.id,
|
|
41
|
+
name: device.name
|
|
42
|
+
},
|
|
43
|
+
text: 'Welcome to a context dashboard'
|
|
44
|
+
},
|
|
45
|
+
title: 'Hello',
|
|
46
|
+
id: 'some_unique_id'
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { NgModule, inject } from '@angular/core';
|
|
2
|
+
import { EmptyComponent, ViewContext, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
import { ViewContextRedirectService } from '../../redirect-to-last-route/view-context-redirect.service';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
providers: [
|
|
7
|
+
hookRoute([
|
|
8
|
+
{
|
|
9
|
+
label: 'Named context Dashboard',
|
|
10
|
+
icon: 'info',
|
|
11
|
+
path: 'named-context',
|
|
12
|
+
context: ViewContext.Device,
|
|
13
|
+
loadComponent: () =>
|
|
14
|
+
import('./named-context-dashboard.component').then(m => m.NamedContextDashboardComponent)
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
path: 'dashboards/named-context',
|
|
18
|
+
canActivate: [
|
|
19
|
+
() =>
|
|
20
|
+
inject(ViewContextRedirectService).redirectToFirstItemOf(
|
|
21
|
+
ViewContext.Device,
|
|
22
|
+
'named-context'
|
|
23
|
+
)
|
|
24
|
+
],
|
|
25
|
+
component: EmptyComponent
|
|
26
|
+
}
|
|
27
|
+
]),
|
|
28
|
+
hookNavigator({
|
|
29
|
+
label: 'Named-context dashboard',
|
|
30
|
+
icon: 'list',
|
|
31
|
+
priority: 1,
|
|
32
|
+
path: `/dashboards/named-context`,
|
|
33
|
+
parent: 'Dashboards'
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
})
|
|
37
|
+
export class NamedContextDashboardModule {}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute } from '@angular/router';
|
|
3
|
+
import { IManagedObject } from '@c8y/client';
|
|
4
|
+
import { CoreModule, Widget } from '@c8y/ngx-components';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
import { ContextDashboardModule } from '@c8y/ngx-components/context-dashboard';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-service-dashboard',
|
|
10
|
+
template: `<c8y-title>Service dashboard</c8y-title>
|
|
11
|
+
<!-- TODO: check what to do with this example -->
|
|
12
|
+
<c8y-context-dashboard
|
|
13
|
+
[name]="name"
|
|
14
|
+
[defaultWidgets]="defaultWidgets"
|
|
15
|
+
[context]="context"
|
|
16
|
+
[canDelete]="false"
|
|
17
|
+
></c8y-context-dashboard>`,
|
|
18
|
+
standalone: true,
|
|
19
|
+
imports: [CommonModule, CoreModule, ContextDashboardModule]
|
|
20
|
+
})
|
|
21
|
+
export class ServiceDashboardComponent {
|
|
22
|
+
context: any;
|
|
23
|
+
name = 'myCustomDeviceDashboardName';
|
|
24
|
+
defaultWidgets: Widget[] = [];
|
|
25
|
+
|
|
26
|
+
constructor(private route: ActivatedRoute) {
|
|
27
|
+
this.context = this.route.parent.snapshot.data;
|
|
28
|
+
if (this.context && this.context.contextData) {
|
|
29
|
+
const device: IManagedObject = this.context.contextData;
|
|
30
|
+
this.name = this.name + '-' + device.id;
|
|
31
|
+
this.defaultWidgets = [
|
|
32
|
+
{
|
|
33
|
+
_x: 3,
|
|
34
|
+
_y: 0,
|
|
35
|
+
_width: 6,
|
|
36
|
+
_height: 6,
|
|
37
|
+
componentId: 'angular.widget.demo',
|
|
38
|
+
config: {
|
|
39
|
+
device: {
|
|
40
|
+
id: device.id,
|
|
41
|
+
name: device.name
|
|
42
|
+
},
|
|
43
|
+
text: 'Welcome to a context dashboard'
|
|
44
|
+
},
|
|
45
|
+
title: 'Hello',
|
|
46
|
+
id: 'some_unique_id'
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { NgModule, inject } from '@angular/core';
|
|
2
|
+
import { EmptyComponent, ViewContext, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
import { ViewContextRedirectService } from '../../redirect-to-last-route/view-context-redirect.service';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
providers: [
|
|
7
|
+
hookRoute([
|
|
8
|
+
{
|
|
9
|
+
path: 'service-dashboard',
|
|
10
|
+
context: ViewContext.Service,
|
|
11
|
+
loadComponent: () =>
|
|
12
|
+
import('./service-dashboard.component').then(m => m.ServiceDashboardComponent)
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
path: 'dashboards/service-dashboard',
|
|
16
|
+
canActivate: [
|
|
17
|
+
() =>
|
|
18
|
+
inject(ViewContextRedirectService).redirectToFirstItemOf(
|
|
19
|
+
ViewContext.Service,
|
|
20
|
+
'service-dashboard'
|
|
21
|
+
)
|
|
22
|
+
],
|
|
23
|
+
component: EmptyComponent
|
|
24
|
+
}
|
|
25
|
+
]),
|
|
26
|
+
hookNavigator({
|
|
27
|
+
label: 'Service dashboard',
|
|
28
|
+
path: '/dashboards/service-dashboard',
|
|
29
|
+
icon: 'th-list',
|
|
30
|
+
priority: -2,
|
|
31
|
+
parent: 'Dashboards'
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
})
|
|
35
|
+
export class ServiceDashboardModule {}
|