Skip to content

Commit

Permalink
Changes added for DTM-Assets Support
Browse files Browse the repository at this point in the history
  • Loading branch information
SheethalJR committed Jan 17, 2023
1 parent 987b86e commit 49c13b5
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 46 deletions.
60 changes: 22 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cumulocity KPI Trend Widget Plugin [<img width="35" src="https://user-images.githubusercontent.com/67993842/97668428-f360cc80-1aa7-11eb-8801-da578bda4334.png"/>](https://github.com/SoftwareAG/cumulocity-kpi-trend-widget-plugin/releases/download/1.0.1-beta/cumulocity-kpi-trend-widget-plugin-1.0.1-beta.zip)
# Cumulocity KPI Trend Widget Plugin [<img width="35" src="https://user-images.githubusercontent.com/32765455/211497905-561e9197-18b9-43d5-a023-071d3635f4eb.png"/>](https://github.com/SoftwareAG/cumulocity-kpi-trend-widget-plugin/releases/download/1.0.2-beta/cumulocity-kpi-trend-widget-plugin-1.0.2-beta.zip)

This KPI Trend Widget is the Cumulocity module federation plugin created using c8ycli. This plugin can be used in Application Builder or Cockpit. It shows current measurement value in realtime and a chart based on measurement values as datapoints in widget.

Expand Down Expand Up @@ -46,46 +46,30 @@ This KPI Trend Widget is the Cumulocity module federation plugin created using c
17. Click `Save` to add the widget on the dashboard.
18. In case you see unexpected results on the widget, refer to browser console to see if there are error logs.

### Runtime Deployment?

* This widget support runtime deployment. Download [Runtime Binary](https://github.com/SoftwareAG/cumulocity-kpi-trend-widget-plugin/releases/download/1.0.0-beta/cumulocity-kpi-trend-widget-plugin-1.0.0-beta.zip) and install via Administrations(Beta mode) --> Ecosystems --> Applications --> Packages

### Local Development?

**Requirements:**
* Git
* NodeJS (release builds are currently built with `v14.18.0`)
* NPM (Included with NodeJS)

**Instructions**
1. Clone the repository:
```
git clone https://github.com/SoftwareAG/cumulocity-kpi-trend-widget-plugin.git
```
2. Change directory:
```
cd cumulocity-kpi-trend-widget-plugin
```
3. Install the dependencies:
```
npm install
```
4. (Optional) Local development server:
```
npm start -- --shell cockpit
```
5. Build the app:
```
npm run build
```
6. Deploy the app:
```
npm run deploy
```
### Runtime Widget Deployment?

* This widget support runtime deployment. Download [Runtime Binary](https://github.com/SoftwareAG/cumulocity-kpi-trend-widget-plugin/releases/download/1.0.2-beta/cumulocity-kpi-trend-widget-plugin-1.0.2-beta.zip) and install via Administrations(Beta mode) --> Ecosystems --> Applications --> Packages

## QuickStart

This guide will teach you how to add widget in your existing or new dashboard.

1. Open your application from App Switcher

2. Add new dashboard or navigate to existing dashboard

3. Click `Add Widget`

4. Search for `KPI Trend`

5. Select `Target Assets or Devices`

7. Click `Save`

Congratulations! KPI Trend is configured.

------------------------------

These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.
This widget is provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.
_____________________
For more information you can Ask a Question in the [TECH Community Forums](https://tech.forums.softwareag.com/tag/Cumulocity-IoT).
17 changes: 17 additions & 0 deletions app.module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Copyright (c) 2020 Software AG, Darmstadt, Germany and/or its licensors
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule as ngRouterModule } from '@angular/router';
Expand Down
8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "cumulocity-kpi-trend-widget-plugin",
"version": "1.0.1-beta",
"version": "1.0.2-beta",
"description": "This widget shows current measurement value in realtime and a chart based on measurement values as datapoints.",
"scripts": {
"start": "c8ycli server --env.beta=true",
"start": "c8ycli server",
"build": "c8ycli build",
"deploy": "c8ycli deploy",
"postinstall": "ngcc",
"prebuild": " gulp clean",
"postbuild": " gulp bundle"
},
"keywords": [],
"author": "Sheethal J R- Software AG, Global Presales",
"author": "Software AG, Global Presales",
"license": "Apache-2.0",
"dependencies": {
"@angular/animations": "14.0.6",
Expand Down Expand Up @@ -49,18 +49,23 @@
"gulp": "^4.0.2",
"gulp-zip": "^5.0.1",
"del": "^6.1.1",
"html-loader": "4.1.0"
"html-loader": "4.1.0",
"style-loader": "3.3.1"
},
"c8y": {
"application": {
"name": "KPI Trend",
"description": "This widget shows current measurement value in realtime and a chart based on measurement values as datapoints.",
"contextPath": "kpitrend-widget",
"key": "kpitrend-widget-application-key",
"globalTitle": "Cumulocity KPI Trend Widget with Module Federation",
"globalTitle": "This widget shows current measurement value in realtime and a chart based on measurement values as datapoints.",
"tabsHorizontal": true,
"isPackage": true,
"noAppSwitcher": true,
"package": "plugin",
"icon": {
"class": "fa fa-puzzle-piece"
},
"requiredPlatformVersion": ">=1016.0.0",
"exports": [
{
Expand Down
31 changes: 29 additions & 2 deletions widget/kpitrend-widget.module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Copyright (c) 2020 Software AG, Darmstadt, Germany and/or its licensors
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { NgModule } from '@angular/core';
import { CoreModule, HOOK_COMPONENTS } from '@c8y/ngx-components';
import { KPITrendWidget } from './kpitrend-widget.component';
Expand All @@ -7,7 +24,7 @@ import { HttpClientModule } from '@angular/common/http';
import { ColorPickerComponent } from './color-picker/color-picker-component';
import { ColorSliderComponent } from './color-picker/color-slider/color-slider-component';
import { ColorPaletteComponent } from './color-picker/color-palette/color-palette-component';
import { CommonModule, DatePipe } from '@angular/common';
import { CommonModule } from '@angular/common';

@NgModule({
imports: [
Expand All @@ -28,7 +45,17 @@ import { CommonModule, DatePipe } from '@angular/common';
description: 'This widget shows the latest measurement value and unit received from a device as a KPI. It compares this measurement value with the average of measurements received in the selected interval and calculated the percentage growth or fall. It allows to configure threshold values to change the KPI color when threshold values are reached. It also shows a trend chart by plotting all the measurement values received for the selected interval or measurements count.',
component: KPITrendWidget,
configComponent: KPITrendWidgetConfig,
previewImage: require("./assets/img-preview.png")
previewImage: require("./assets/img-preview.png"),
data: {
ng1: {
options: {
noDeviceTarget: false,
noNewWidgets: false,
deviceTargetNotRequired: false,
groupsSelectable: true
}
}
}
}
}],
})
Expand Down

0 comments on commit 49c13b5

Please sign in to comment.