Browse Source

Merge branch 'master' of github.com:thingsboard/thingsboard into enhacements/carbon-monoxide-widgets

pull/9838/head
Dmitriymush 3 years ago
parent
commit
b786b3c127
  1. 3
      application/src/main/data/json/edge/install_instructions/docker/localhost_warning.md
  2. 24
      application/src/main/data/json/edge/instructions/install/centos/instructions.md
  3. 33
      application/src/main/data/json/edge/instructions/install/docker/instructions.md
  4. 4
      application/src/main/data/json/edge/instructions/install/ubuntu/instructions.md
  5. 15
      application/src/main/data/json/edge/instructions/upgrade/centos/instructions.md
  6. 10
      application/src/main/data/json/edge/instructions/upgrade/docker/instructions.md
  7. 23
      application/src/main/data/json/edge/instructions/upgrade/docker/start_service.md
  8. 61
      application/src/main/data/json/edge/instructions/upgrade/docker/upgrade_db.md
  9. 83
      application/src/main/data/json/edge/instructions/upgrade/docker/upgrade_preparing.md
  10. 6
      application/src/main/data/json/edge/instructions/upgrade/start_service.md
  11. 15
      application/src/main/data/json/edge/instructions/upgrade/ubuntu/instructions.md
  12. 8
      application/src/main/data/json/edge/instructions/upgrade/upgrade_db.md
  13. 36
      application/src/main/data/json/edge/instructions/upgrade/upgrade_preparing.md
  14. 3
      application/src/main/data/json/system/widget_bundles/indoor_environment.json
  15. 40
      application/src/main/data/json/system/widget_bundles/industial_widgets.json
  16. 3
      application/src/main/data/json/system/widget_bundles/outdoor_environment.json
  17. 29
      application/src/main/data/json/system/widget_types/efficiency_card.json
  18. 29
      application/src/main/data/json/system/widget_types/efficiency_card_with_background.json
  19. 32
      application/src/main/data/json/system/widget_types/efficiency_chart_card.json
  20. 32
      application/src/main/data/json/system/widget_types/efficiency_chart_card_with_background.json
  21. 29
      application/src/main/data/json/system/widget_types/efficiency_progress_bar.json
  22. 29
      application/src/main/data/json/system/widget_types/efficiency_progress_bar_with_background.json
  23. 32
      application/src/main/data/json/system/widget_types/efficiency_range_chart.json
  24. 32
      application/src/main/data/json/system/widget_types/efficiency_range_chart_with_background.json
  25. 2
      application/src/main/data/json/system/widget_types/flow_rate_card.json
  26. 2
      application/src/main/data/json/system/widget_types/flow_rate_card_with_background.json
  27. 2
      application/src/main/data/json/system/widget_types/flow_rate_chart_card.json
  28. 2
      application/src/main/data/json/system/widget_types/flow_rate_chart_card_with_background.json
  29. 2
      application/src/main/data/json/system/widget_types/flow_rate_gauge.json
  30. 2
      application/src/main/data/json/system/widget_types/flow_rate_progress_bar.json
  31. 2
      application/src/main/data/json/system/widget_types/flow_rate_progress_bar_with_background.json
  32. 2
      application/src/main/data/json/system/widget_types/fluid_pressure_card.json
  33. 2
      application/src/main/data/json/system/widget_types/fluid_pressure_chart_card.json
  34. 2
      application/src/main/data/json/system/widget_types/fluid_pressure_chart_card_with_background.json
  35. 2
      application/src/main/data/json/system/widget_types/fluid_pressure_gauge.json
  36. 2
      application/src/main/data/json/system/widget_types/fluid_pressure_progress_bar.json
  37. 2
      application/src/main/data/json/system/widget_types/fluid_pressure_progress_bar_with_background.json
  38. 32
      application/src/main/data/json/system/widget_types/fluid_temperature_card.json
  39. 32
      application/src/main/data/json/system/widget_types/fluid_temperature_card_with_background.json
  40. 35
      application/src/main/data/json/system/widget_types/fluid_temperature_chart_card.json
  41. 35
      application/src/main/data/json/system/widget_types/fluid_temperature_chart_card_with_background.json
  42. 33
      application/src/main/data/json/system/widget_types/fluid_temperature_gauge.json
  43. 32
      application/src/main/data/json/system/widget_types/fluid_temperature_progress_bar.json
  44. 32
      application/src/main/data/json/system/widget_types/fluid_temperature_progress_bar_with_background.json
  45. 35
      application/src/main/data/json/system/widget_types/fluid_temperature_range_chart.json
  46. 35
      application/src/main/data/json/system/widget_types/fluid_temperature_range_chart_with_background.json
  47. 29
      application/src/main/data/json/system/widget_types/horizontal_efficiency_card.json
  48. 29
      application/src/main/data/json/system/widget_types/horizontal_efficiency_card_with_background.json
  49. 2
      application/src/main/data/json/system/widget_types/horizontal_flow_rate_card.json
  50. 2
      application/src/main/data/json/system/widget_types/horizontal_flow_rate_card_with_background.json
  51. 2
      application/src/main/data/json/system/widget_types/horizontal_fluid_pressure_card.json
  52. 2
      application/src/main/data/json/system/widget_types/horizontal_fluid_pressure_card_with_background.json
  53. 32
      application/src/main/data/json/system/widget_types/horizontal_fluid_temperature_card.json
  54. 32
      application/src/main/data/json/system/widget_types/horizontal_fluid_temperature_card_with_background.json
  55. 2
      application/src/main/data/json/system/widget_types/horizontal_power_consumption_card.json
  56. 2
      application/src/main/data/json/system/widget_types/horizontal_power_consumption_card_with_background.json
  57. 2
      application/src/main/data/json/system/widget_types/horizontal_pump_vibration_card.json
  58. 2
      application/src/main/data/json/system/widget_types/horizontal_pump_vibration_card_with_background.json
  59. 30
      application/src/main/data/json/system/widget_types/horizontal_rotational_speed_card.json
  60. 30
      application/src/main/data/json/system/widget_types/horizontal_rotational_speed_card_with_background.json
  61. 29
      application/src/main/data/json/system/widget_types/indoor_temperature_gauge.json
  62. 31
      application/src/main/data/json/system/widget_types/indoor_temperature_range_chart.json
  63. 31
      application/src/main/data/json/system/widget_types/indoor_temperature_range_chart_with_background.json
  64. 2
      application/src/main/data/json/system/widget_types/power_consumption_card.json
  65. 2
      application/src/main/data/json/system/widget_types/power_consumption_card_with_background.json
  66. 2
      application/src/main/data/json/system/widget_types/power_consumption_chart_card.json
  67. 2
      application/src/main/data/json/system/widget_types/power_consumption_chart_card_with_background.json
  68. 2
      application/src/main/data/json/system/widget_types/pump_vibration_card.json
  69. 2
      application/src/main/data/json/system/widget_types/pump_vibration_card_with_background.json
  70. 2
      application/src/main/data/json/system/widget_types/pump_vibration_chart_card.json
  71. 2
      application/src/main/data/json/system/widget_types/pump_vibration_chart_card_with_background.json
  72. 30
      application/src/main/data/json/system/widget_types/rotational_speed_card.json
  73. 30
      application/src/main/data/json/system/widget_types/rotational_speed_card_with_background.json
  74. 33
      application/src/main/data/json/system/widget_types/rotational_speed_chart_card.json
  75. 33
      application/src/main/data/json/system/widget_types/rotational_speed_chart_card_with_background.json
  76. 31
      application/src/main/data/json/system/widget_types/rotational_speed_gauge.json
  77. 30
      application/src/main/data/json/system/widget_types/rotational_speed_progress_bar.json
  78. 30
      application/src/main/data/json/system/widget_types/rotational_speed_progress_bar_with_background.json
  79. 33
      application/src/main/data/json/system/widget_types/rotational_speed_range_chart.json
  80. 33
      application/src/main/data/json/system/widget_types/rotational_speed_range_chart_with_background.json
  81. 32
      application/src/main/data/json/system/widget_types/simple_efficiency_chart_card.json
  82. 32
      application/src/main/data/json/system/widget_types/simple_efficiency_chart_card_with_background.json
  83. 2
      application/src/main/data/json/system/widget_types/simple_flow_rate_chart_card.json
  84. 2
      application/src/main/data/json/system/widget_types/simple_flow_rate_chart_card_with_background.json
  85. 2
      application/src/main/data/json/system/widget_types/simple_fluid_pressure_chart_card.json
  86. 2
      application/src/main/data/json/system/widget_types/simple_fluid_pressure_chart_card_with_background.json
  87. 35
      application/src/main/data/json/system/widget_types/simple_fluid_temperature_chart_card.json
  88. 35
      application/src/main/data/json/system/widget_types/simple_fluid_temperature_chart_card_with_background.json
  89. 2
      application/src/main/data/json/system/widget_types/simple_power_consumption_chart_card.json
  90. 2
      application/src/main/data/json/system/widget_types/simple_power_consumption_chart_card_with_background.json
  91. 2
      application/src/main/data/json/system/widget_types/simple_pump_vibration_chart_card.json
  92. 2
      application/src/main/data/json/system/widget_types/simple_pump_vibration_chart_card_with_background.json
  93. 33
      application/src/main/data/json/system/widget_types/simple_rotational_speed_chart_card.json
  94. 33
      application/src/main/data/json/system/widget_types/simple_rotational_speed_chart_card_with_background.json
  95. 29
      application/src/main/data/json/system/widget_types/temperature_gauge.json
  96. 31
      application/src/main/data/json/system/widget_types/temperature_range_chart.json
  97. 31
      application/src/main/data/json/system/widget_types/temperature_range_chart_with_background.json
  98. 314
      application/src/main/data/json/tenant/dashboards/gateways.json
  99. 4
      application/src/main/java/org/thingsboard/server/controller/AssetController.java
  100. 20
      application/src/main/java/org/thingsboard/server/controller/AssetProfileController.java

3
application/src/main/data/json/edge/install_instructions/docker/localhost_warning.md

@ -1,3 +0,0 @@
###### WARNING NOTE: 'localhost' can not be used as CLOUD_RPC_HOST
Please note that your ThingsBoard base URL is **'localhost'** at the moment. **'localhost'** cannot be used for docker containers - please update **CLOUD_RPC_HOST** environment variable below to the IP address of your machine (*docker **host** machine*). IP address must be `192.168.1.XX` or similar format. In other case - ThingsBoard Edge service, that is running in docker container, will not be able to connect to the cloud.

24
application/src/main/data/json/edge/install_instructions/centos/instructions.md → application/src/main/data/json/edge/instructions/install/centos/instructions.md

@ -1,4 +1,4 @@
Here is the list of commands, that can be used to quickly install ThingsBoard Edge on RHEL/CentOS 7/8 and connect to the cloud.
Here is the list of commands, that can be used to quickly install ThingsBoard Edge on RHEL/CentOS 7/8 and connect to the server.
#### Prerequisites
Before continue to installation execute the following commands in order to install necessary tools:
@ -56,13 +56,13 @@ sudo yum update
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# Install packages
sudo yum -y install epel-release yum-utils
sudo yum-config-manager --enable pgdg12
sudo yum install postgresql12-server postgresql12
sudo yum-config-manager --enable pgdg15
sudo yum install postgresql15-server postgresql15
# Initialize your PostgreSQL DB
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
sudo systemctl start postgresql-12
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
sudo systemctl start postgresql-15
# Optional: Configure PostgreSQL to start on boot
sudo systemctl enable --now postgresql-12
sudo systemctl enable --now postgresql-15
{:copy-code}
```
@ -74,12 +74,12 @@ sudo systemctl enable --now postgresql-12
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# Install packages
sudo dnf -qy module disable postgresql
sudo dnf -y install postgresql12 postgresql12-server
sudo dnf -y install postgresql15 postgresql15-server
# Initialize your PostgreSQL DB
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
sudo systemctl start postgresql-12
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
sudo systemctl start postgresql-15
# Optional: Configure PostgreSQL to start on boot
sudo systemctl enable --now postgresql-12
sudo systemctl enable --now postgresql-15
{:copy-code}
```
@ -101,7 +101,7 @@ After configuring the password, edit the pg_hba.conf to use MD5 authentication w
Edit pg_hba.conf file:
```bash
sudo nano /var/lib/pgsql/12/data/pg_hba.conf
sudo nano /var/lib/pgsql/15/data/pg_hba.conf
{:copy-code}
```
@ -121,7 +121,7 @@ host all all 127.0.0.1/32 md5
Finally, you should restart the PostgreSQL service to initialize the new configuration:
```bash
sudo systemctl restart postgresql-12.service
sudo systemctl restart postgresql-15.service
{:copy-code}
```

33
application/src/main/data/json/edge/install_instructions/docker/instructions.md → application/src/main/data/json/edge/instructions/install/docker/instructions.md

@ -1,25 +1,11 @@
Here is the list of commands, that can be used to quickly install ThingsBoard Edge using docker compose and connect to the cloud.
Here is the list of commands, that can be used to quickly install ThingsBoard Edge using docker compose and connect to the server.
#### Prerequisites
Install <a href="https://docs.docker.com/engine/install/" target="_blank"> Docker CE</a> and <a href="https://docs.docker.com/compose/install/" target="_blank"> Docker Compose</a>.
#### Create data and logs folders
Run following commands, before starting docker container(s), to create folders for storing data and logs.
These commands additionally will change owner of newly created folders to docker container user.
To do this (to change user) **chown** command is used, and this command requires *sudo* permissions (command will request password for a *sudo* access):
```bash
mkdir -p ~/.mytb-edge-data && sudo chown -R 799:799 ~/.mytb-edge-data
mkdir -p ~/.mytb-edge-logs && sudo chown -R 799:799 ~/.mytb-edge-logs
{:copy-code}
```
#### Running ThingsBoard Edge as docker service
${LOCALHOST_WARNING}
Create docker compose file for ThingsBoard Edge service:
```bash
@ -30,7 +16,7 @@ nano docker-compose.yml
Add the following lines to the yml file:
```bash
version: '3.0'
version: '3.8'
services:
mytbedge:
restart: always
@ -47,8 +33,9 @@ services:
CLOUD_RPC_PORT: ${CLOUD_RPC_PORT}
CLOUD_RPC_SSL_ENABLED: ${CLOUD_RPC_SSL_ENABLED}
volumes:
- ~/.mytb-edge-data:/data
- ~/.mytb-edge-logs:/var/log/tb-edge
- tb-edge-data:/data
- tb-edge-logs:/var/log/tb-edge
${EXTRA_HOSTS}
postgres:
restart: always
image: "postgres:15"
@ -58,7 +45,15 @@ services:
POSTGRES_DB: tb-edge
POSTGRES_PASSWORD: postgres
volumes:
- ~/.mytb-edge-data/db:/var/lib/postgresql/data
- tb-edge-postgres-data:/var/lib/postgresql/data
volumes:
tb-edge-data:
name: tb-edge-data
tb-edge-logs:
name: tb-edge-logs
tb-edge-postgres-data:
name: tb-edge-postgres-data
{:copy-code}
```

4
application/src/main/data/json/edge/install_instructions/ubuntu/instructions.md → application/src/main/data/json/edge/instructions/install/ubuntu/instructions.md

@ -1,4 +1,4 @@
Here is the list of commands, that can be used to quickly install ThingsBoard Edge on Ubuntu Server and connect to the cloud.
Here is the list of commands, that can be used to quickly install ThingsBoard Edge on Ubuntu Server and connect to the server.
#### Install Java 11 (OpenJDK)
ThingsBoard service is running on Java 11. Follow these instructions to install OpenJDK 11:
@ -49,7 +49,7 @@ echo "deb http://apt.postgresql.org/pub/repos/apt/ ${RELEASE}"-pgdg main | sudo
# install and launch the postgresql service:
sudo apt update
sudo apt -y install postgresql-12
sudo apt -y install postgresql-15
sudo service postgresql start
{:copy-code}
```

15
application/src/main/data/json/edge/instructions/upgrade/centos/instructions.md

@ -0,0 +1,15 @@
#### Upgrading to ${TB_EDGE_VERSION}EDGE
**ThingsBoard Edge package download:**
```bash
wget https://github.com/thingsboard/thingsboard-edge/releases/download/v${TB_EDGE_TAG}/tb-edge-${TB_EDGE_TAG}.rpm
{:copy-code}
```
##### ThingsBoard Edge service upgrade
Install package:
```bash
sudo rpm -Uvh tb-edge-${TB_EDGE_TAG}.rpm
{:copy-code}
```
${UPGRADE_DB}

10
application/src/main/data/json/edge/instructions/upgrade/docker/instructions.md

@ -0,0 +1,10 @@
#### Upgrading to ${TB_EDGE_VERSION}
Execute the following command to pull **${TB_EDGE_VERSION}** image:
```bash
docker pull thingsboard/tb-edge:${TB_EDGE_VERSION}
{:copy-code}
```
${UPGRADE_DB}

23
application/src/main/data/json/edge/instructions/upgrade/docker/start_service.md

@ -0,0 +1,23 @@
Modify ‘main’ docker compose (`docker-compose.yml`) file for ThingsBoard Edge and update version of the image:
```bash
nano docker-compose.yml
{:copy-code}
```
```text
version: '3.8'
services:
mytbedge:
restart: always
image: "thingsboard/tb-edge:${TB_EDGE_VERSION}"
...
```
Make sure your image is the set to **tb-edge-${TB_EDGE_VERSION}**.
Execute the following commands to up this docker compose directly:
```bash
docker compose up -d
docker compose logs -f mytbedge
{:copy-code}
```

61
application/src/main/data/json/edge/instructions/upgrade/docker/upgrade_db.md

@ -0,0 +1,61 @@
Create docker compose file for ThingsBoard Edge upgrade process:
```bash
> docker-compose-upgrade.yml && nano docker-compose-upgrade.yml
{:copy-code}
```
Add the following lines to the yml file:
```bash
version: '3.8'
services:
mytbedge:
restart: on-failure
image: "thingsboard/tb-edge:${TB_EDGE_VERSION}"
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/tb-edge
volumes:
- tb-edge-data:/data
- tb-edge-logs:/var/log/tb-edge
entrypoint: upgrade-tb-edge.sh
postgres:
restart: always
image: "postgres:15"
ports:
- "5432"
environment:
POSTGRES_DB: tb-edge
POSTGRES_PASSWORD: postgres
volumes:
- tb-edge-postgres-data:/var/lib/postgresql/data
volumes:
tb-edge-data:
name: tb-edge-data
tb-edge-logs:
name: tb-edge-logs
tb-edge-postgres-data:
name: tb-edge-postgres-data
{:copy-code}
```
Execute the following command to start upgrade process:
```bash
docker compose -f docker-compose-upgrade.yml up
{:copy-code}
```
Once upgrade process successfully completed, exit from the docker-compose shell by this combination:
```text
Ctrl + C
```
Execute the following command to stop TB Edge upgrade container:
```bash
docker compose -f docker-compose-upgrade.yml stop
{:copy-code}
```

83
application/src/main/data/json/edge/instructions/upgrade/docker/upgrade_preparing.md

@ -0,0 +1,83 @@
Here is the list of commands, that can be used to quickly upgrade ThingsBoard Edge on Docker (Linux or MacOS).
#### Prepare for upgrading ThingsBoard Edge
Set the terminal in the directory which contains the `docker-compose.yml` file and execute the following command
to stop and remove currently running TB Edge container:
```bash
docker compose stop
docker compose rm mytbedge
{:copy-code}
```
**OPTIONAL:** If you still rely on Docker Compose as docker-compose (with a hyphen) here is the list of the above commands:
```text
docker-compose stop
docker-compose rm mytbedge
```
##### Migrating Data from Docker Bind Mount Folders to Docker Volumes
Starting with the **3.6.2** release, the ThingsBoard team has transitioned from using Docker bind mount folders to Docker volumes.
This change aims to enhance security and efficiency in storing data for Docker containers and to mitigate permission issues across various environments.
To migrate from Docker bind mounts to Docker volumes, please execute the following commands:
```bash
docker run --rm -v tb-edge-data:/volume -v ~/.mytb-edge-data:/backup busybox sh -c "cp -a /backup/. /volume"
docker run --rm -v tb-edge-logs:/volume -v ~/.mytb-edge-logs:/backup busybox sh -c "cp -a /backup/. /volume"
docker run --rm -v tb-edge-postgres-data:/volume -v ~/.mytb-edge-data/db:/backup busybox sh -c "cp -a /backup/. /volume"
{:copy-code}
```
After completing the data migration to the newly created Docker volumes, you'll need to update the volume mounts in your Docker Compose configuration.
Modify the `docker-compose.yml` file for ThingsBoard Edge to update the volume settings.
First, please update docker compose file version. Find next snippet:
```text
version: '3.0'
...
```
And replace it with:
```text
version: '3.8'
...
```
Then update volume mounts. Locate the following snippet:
```text
volumes:
- ~/.mytb-edge-data:/data
- ~/.mytb-edge-logs:/var/log/tb-edge
...
```
And replace it with:
```text
volumes:
- tb-edge-data:/data
- tb-edge-logs:/var/log/tb-edge
...
```
Apply a similar update for the PostgreSQL service. Find the section:
```text
volumes:
- ~/.mytb-edge-data/db:/var/lib/postgresql/data
...
```
And replace it with:
```text
volumes:
- tb-edge-postgres-data/:/var/lib/postgresql/data
...
```
##### Backup Database
Make a copy of the database volume before upgrading:
```bash
docker run --rm -v tb-edge-postgres-data:/source -v tb-edge-postgres-data-backup:/backup busybox sh -c "cp -a /source/. /backup"
{:copy-code}
```

6
application/src/main/data/json/edge/instructions/upgrade/start_service.md

@ -0,0 +1,6 @@
Start the service
```bash
sudo systemctl tb-edge start
{:copy-code}
```

15
application/src/main/data/json/edge/instructions/upgrade/ubuntu/instructions.md

@ -0,0 +1,15 @@
#### Upgrading to ${TB_EDGE_VERSION}EDGE
**ThingsBoard Edge package download:**
```bash
wget https://github.com/thingsboard/thingsboard-edge/releases/download/v${TB_EDGE_TAG}/tb-edge-${TB_EDGE_TAG}.deb
{:copy-code}
```
##### ThingsBoard Edge service upgrade
Install package:
```bash
sudo dpkg -i tb-edge-${TB_EDGE_TAG}.deb
{:copy-code}
```
${UPGRADE_DB}

8
application/src/main/data/json/edge/instructions/upgrade/upgrade_db.md

@ -0,0 +1,8 @@
**NOTE**: Package installer may ask you to merge your tb-edge configuration. It is preferred to use **merge option** to make sure that all your previous parameters will not be overwritten.
Execute regular upgrade script:
```bash
sudo /usr/share/tb-edge/bin/install/upgrade.sh --fromVersion=${FROM_TB_EDGE_VERSION}
{:copy-code}
```

36
application/src/main/data/json/edge/instructions/upgrade/upgrade_preparing.md

@ -0,0 +1,36 @@
Here is the list of commands, that can be used to quickly upgrade ThingsBoard Edge on ${OS}
#### Prepare for upgrading ThingsBoard Edge
Stop ThingsBoard Edge service:
```bash
sudo systemctl stop tb-edge
{:copy-code}
```
##### Backup Database
Make a backup of the database before upgrading. **Make sure you have enough space to place a backup of the database.**
Check database size:
```bash
sudo -u postgres psql -c "SELECT pg_size_pretty( pg_database_size('tb_edge') );"
{:copy-code}
```
Check free space:
```bash
df -h /
{:copy-code}
```
If there is enough free space - make a backup:
```bash
sudo -Hiu postgres pg_dump tb_edge > tb_edge.sql.bak
{:copy-code}
```
Check backup file created successfully.

3
application/src/main/data/json/system/widget_bundles/indoor_environment.json

@ -19,6 +19,9 @@
"indoor_simple_temperature_chart_card_with_background",
"indoor_temperature_progress_bar",
"indoor_temperature_progress_bar_with_background",
"indoor_temperature_range_chart",
"indoor_temperature_range_chart_with_background",
"indoor_temperature_gauge",
"indoor_humidity_card",
"indoor_humidity_card_with_background",
"indoor_horizontal_humidity_card",

40
application/src/main/data/json/system/widget_bundles/industial_widgets.json

@ -35,19 +35,6 @@
"fluid_pressure_range_chart",
"fluid_pressure_range_chart_with_background",
"fluid_pressure_gauge",
"fluid_temperature_card",
"fluid_temperature_card_with_background",
"horizontal_fluid_temperature_card",
"horizontal_fluid_temperature_card_with_background",
"fluid_temperature_chart_card",
"fluid_temperature_chart_card_with_background",
"simple_fluid_temperature_chart_card",
"simple_fluid_temperature_chart_card_with_background",
"fluid_temperature_progress_bar",
"fluid_temperature_progress_bar_with_background",
"fluid_temperature_range_chart",
"fluid_temperature_range_chart_with_background",
"fluid_temperature_gauge",
"pump_vibration_card",
"pump_vibration_card_with_background",
"horizontal_pump_vibration_card",
@ -67,6 +54,31 @@
"simple_power_consumption_chart_card",
"simple_power_consumption_chart_card_with_background",
"power_consumption_range_chart",
"power_consumption_range_chart_with_background"
"power_consumption_range_chart_with_background",
"rotational_speed_card",
"rotational_speed_card_with_background",
"horizontal_rotational_speed_card",
"horizontal_rotational_speed_card_with_background",
"rotational_speed_chart_card",
"rotational_speed_chart_card_with_background",
"simple_rotational_speed_chart_card",
"simple_rotational_speed_chart_card_with_background",
"rotational_speed_progress_bar",
"rotational_speed_progress_bar_with_background",
"rotational_speed_range_chart",
"rotational_speed_range_chart_with_background",
"rotational_speed_gauge",
"efficiency_card",
"efficiency_card_with_background",
"horizontal_efficiency_card",
"horizontal_efficiency_card_with_background",
"efficiency_chart_card",
"efficiency_chart_card_with_background",
"simple_efficiency_chart_card",
"simple_efficiency_chart_card_with_background",
"efficiency_progress_bar",
"efficiency_progress_bar_with_background",
"efficiency_range_chart",
"efficiency_range_chart_with_background"
]
}

3
application/src/main/data/json/system/widget_bundles/outdoor_environment.json

@ -17,6 +17,9 @@
"temperature_chart_card_with_background",
"simple_temperature_chart_card",
"simple_temperature_chart_card_with_background",
"temperature_range_chart",
"temperature_range_chart_with_background",
"temperature_gauge",
"humidity_card",
"humidity_card_with_background",
"horizontal_humidity_card",

29
application/src/main/data/json/system/widget_types/efficiency_card.json

File diff suppressed because one or more lines are too long

29
application/src/main/data/json/system/widget_types/efficiency_card_with_background.json

File diff suppressed because one or more lines are too long

32
application/src/main/data/json/system/widget_types/efficiency_chart_card.json

File diff suppressed because one or more lines are too long

32
application/src/main/data/json/system/widget_types/efficiency_chart_card_with_background.json

File diff suppressed because one or more lines are too long

29
application/src/main/data/json/system/widget_types/efficiency_progress_bar.json

File diff suppressed because one or more lines are too long

29
application/src/main/data/json/system/widget_types/efficiency_progress_bar_with_background.json

File diff suppressed because one or more lines are too long

32
application/src/main/data/json/system/widget_types/efficiency_range_chart.json

File diff suppressed because one or more lines are too long

32
application/src/main/data/json/system/widget_types/efficiency_range_chart_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/flow_rate_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/flow_rate_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/flow_rate_chart_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/flow_rate_chart_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/flow_rate_gauge.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/flow_rate_progress_bar.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/flow_rate_progress_bar_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/fluid_pressure_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/fluid_pressure_chart_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/fluid_pressure_chart_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/fluid_pressure_gauge.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/fluid_pressure_progress_bar.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/fluid_pressure_progress_bar_with_background.json

File diff suppressed because one or more lines are too long

32
application/src/main/data/json/system/widget_types/fluid_temperature_card.json

File diff suppressed because one or more lines are too long

32
application/src/main/data/json/system/widget_types/fluid_temperature_card_with_background.json

File diff suppressed because one or more lines are too long

35
application/src/main/data/json/system/widget_types/fluid_temperature_chart_card.json

File diff suppressed because one or more lines are too long

35
application/src/main/data/json/system/widget_types/fluid_temperature_chart_card_with_background.json

File diff suppressed because one or more lines are too long

33
application/src/main/data/json/system/widget_types/fluid_temperature_gauge.json

File diff suppressed because one or more lines are too long

32
application/src/main/data/json/system/widget_types/fluid_temperature_progress_bar.json

File diff suppressed because one or more lines are too long

32
application/src/main/data/json/system/widget_types/fluid_temperature_progress_bar_with_background.json

File diff suppressed because one or more lines are too long

35
application/src/main/data/json/system/widget_types/fluid_temperature_range_chart.json

File diff suppressed because one or more lines are too long

35
application/src/main/data/json/system/widget_types/fluid_temperature_range_chart_with_background.json

File diff suppressed because one or more lines are too long

29
application/src/main/data/json/system/widget_types/horizontal_efficiency_card.json

File diff suppressed because one or more lines are too long

29
application/src/main/data/json/system/widget_types/horizontal_efficiency_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/horizontal_flow_rate_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/horizontal_flow_rate_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/horizontal_fluid_pressure_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/horizontal_fluid_pressure_card_with_background.json

File diff suppressed because one or more lines are too long

32
application/src/main/data/json/system/widget_types/horizontal_fluid_temperature_card.json

File diff suppressed because one or more lines are too long

32
application/src/main/data/json/system/widget_types/horizontal_fluid_temperature_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/horizontal_power_consumption_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/horizontal_power_consumption_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/horizontal_pump_vibration_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/horizontal_pump_vibration_card_with_background.json

File diff suppressed because one or more lines are too long

30
application/src/main/data/json/system/widget_types/horizontal_rotational_speed_card.json

File diff suppressed because one or more lines are too long

30
application/src/main/data/json/system/widget_types/horizontal_rotational_speed_card_with_background.json

File diff suppressed because one or more lines are too long

29
application/src/main/data/json/system/widget_types/indoor_temperature_gauge.json

File diff suppressed because one or more lines are too long

31
application/src/main/data/json/system/widget_types/indoor_temperature_range_chart.json

File diff suppressed because one or more lines are too long

31
application/src/main/data/json/system/widget_types/indoor_temperature_range_chart_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/power_consumption_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/power_consumption_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/power_consumption_chart_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/power_consumption_chart_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/pump_vibration_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/pump_vibration_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/pump_vibration_chart_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/pump_vibration_chart_card_with_background.json

File diff suppressed because one or more lines are too long

30
application/src/main/data/json/system/widget_types/rotational_speed_card.json

File diff suppressed because one or more lines are too long

30
application/src/main/data/json/system/widget_types/rotational_speed_card_with_background.json

File diff suppressed because one or more lines are too long

33
application/src/main/data/json/system/widget_types/rotational_speed_chart_card.json

File diff suppressed because one or more lines are too long

33
application/src/main/data/json/system/widget_types/rotational_speed_chart_card_with_background.json

File diff suppressed because one or more lines are too long

31
application/src/main/data/json/system/widget_types/rotational_speed_gauge.json

File diff suppressed because one or more lines are too long

30
application/src/main/data/json/system/widget_types/rotational_speed_progress_bar.json

File diff suppressed because one or more lines are too long

30
application/src/main/data/json/system/widget_types/rotational_speed_progress_bar_with_background.json

File diff suppressed because one or more lines are too long

33
application/src/main/data/json/system/widget_types/rotational_speed_range_chart.json

File diff suppressed because one or more lines are too long

33
application/src/main/data/json/system/widget_types/rotational_speed_range_chart_with_background.json

File diff suppressed because one or more lines are too long

32
application/src/main/data/json/system/widget_types/simple_efficiency_chart_card.json

File diff suppressed because one or more lines are too long

32
application/src/main/data/json/system/widget_types/simple_efficiency_chart_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/simple_flow_rate_chart_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/simple_flow_rate_chart_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/simple_fluid_pressure_chart_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/simple_fluid_pressure_chart_card_with_background.json

File diff suppressed because one or more lines are too long

35
application/src/main/data/json/system/widget_types/simple_fluid_temperature_chart_card.json

File diff suppressed because one or more lines are too long

35
application/src/main/data/json/system/widget_types/simple_fluid_temperature_chart_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/simple_power_consumption_chart_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/simple_power_consumption_chart_card_with_background.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/simple_pump_vibration_chart_card.json

File diff suppressed because one or more lines are too long

2
application/src/main/data/json/system/widget_types/simple_pump_vibration_chart_card_with_background.json

File diff suppressed because one or more lines are too long

33
application/src/main/data/json/system/widget_types/simple_rotational_speed_chart_card.json

File diff suppressed because one or more lines are too long

33
application/src/main/data/json/system/widget_types/simple_rotational_speed_chart_card_with_background.json

File diff suppressed because one or more lines are too long

29
application/src/main/data/json/system/widget_types/temperature_gauge.json

File diff suppressed because one or more lines are too long

31
application/src/main/data/json/system/widget_types/temperature_range_chart.json

File diff suppressed because one or more lines are too long

31
application/src/main/data/json/system/widget_types/temperature_range_chart_with_background.json

File diff suppressed because one or more lines are too long

314
application/src/main/data/json/tenant/dashboards/gateways.json

@ -250,9 +250,9 @@
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "customPretty",
"customHtml": "<form #addEntityForm=\"ngForm\" [formGroup]=\"addEntityFormGroup\"\r\n (ngSubmit)=\"save()\" class=\"add-entity-form\">\r\n <mat-toolbar fxLayout=\"row\" color=\"primary\">\r\n <h2>Add gateway</h2>\r\n <span fxFlex></span>\r\n <button mat-icon-button (click)=\"cancel()\" type=\"button\">\r\n <mat-icon class=\"material-icons\">close</mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n <mat-progress-bar color=\"warn\" mode=\"indeterminate\" *ngIf=\"isLoading$ | async\">\r\n </mat-progress-bar>\r\n <div style=\"height: 4px;\" *ngIf=\"!(isLoading$ | async)\"></div>\r\n <div mat-dialog-content fxLayout=\"column\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"8px\" fxLayout.xs=\"column\" fxLayoutGap.xs=\"0\">\r\n <mat-form-field fxFlex class=\"mat-block\">\r\n <mat-label>Name</mat-label>\r\n <input matInput formControlName=\"entityName\" required>\r\n <mat-error *ngIf=\"addEntityFormGroup.get('entityName').hasError('required')\">\r\n Gateway name is required.\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n <div fxLayout=\"row\" fxLayoutGap=\"8px\" fxLayout.xs=\"column\" fxLayoutGap.xs=\"0\">\r\n <tb-entity-subtype-autocomplete\r\n fxFlex\r\n class=\"mat-block\"\r\n formControlName=\"type\"\r\n [required]=\"true\"\r\n [entityType]=\"'DEVICE'\"\r\n ></tb-entity-subtype-autocomplete>\r\n </div>\r\n </div>\r\n <div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"end center\">\r\n <button mat-button color=\"primary\"\r\n type=\"button\"\r\n [disabled]=\"(isLoading$ | async)\"\r\n (click)=\"cancel()\" cdkFocusInitial>\r\n Cancel\r\n </button>\r\n <button mat-button mat-raised-button color=\"primary\"\r\n type=\"submit\"\r\n [disabled]=\"(isLoading$ | async) || addEntityForm.invalid || !addEntityForm.dirty\">\r\n Create\r\n </button>\r\n </div>\r\n</form>\r\n",
"customHtml": "<form #addEntityForm=\"ngForm\" [formGroup]=\"addEntityFormGroup\"\r\n (ngSubmit)=\"save($event)\" class=\"add-entity-form\">\r\n <mat-toolbar fxLayout=\"row\" color=\"primary\">\r\n <h2>Add gateway</h2>\r\n <span fxFlex></span>\r\n <button mat-icon-button (click)=\"cancel()\" type=\"button\">\r\n <mat-icon class=\"material-icons\">close</mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n <mat-progress-bar color=\"warn\" mode=\"indeterminate\" *ngIf=\"isLoading$ | async\">\r\n </mat-progress-bar>\r\n <div style=\"height: 4px;\" *ngIf=\"!(isLoading$ | async)\"></div>\r\n <div mat-dialog-content fxLayout=\"column\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"8px\" fxLayout.xs=\"column\" fxLayoutGap.xs=\"0\">\r\n <mat-form-field fxFlex class=\"mat-block\">\r\n <mat-label>Name</mat-label>\r\n <input matInput formControlName=\"entityName\" required>\r\n <mat-error *ngIf=\"addEntityFormGroup.get('entityName').hasError('required')\">\r\n Gateway name is required.\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n <div fxLayout=\"row\" fxLayoutGap=\"8px\" fxLayout.xs=\"column\" fxLayoutGap.xs=\"0\">\r\n <tb-entity-subtype-autocomplete\r\n fxFlex\r\n class=\"mat-block\"\r\n formControlName=\"type\"\r\n [required]=\"true\"\r\n [entityType]=\"'DEVICE'\"\r\n ></tb-entity-subtype-autocomplete>\r\n </div>\r\n </div>\r\n <div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"end center\">\r\n <button mat-button color=\"primary\"\r\n type=\"button\"\r\n [disabled]=\"(isLoading$ | async)\"\r\n (click)=\"cancel()\" cdkFocusInitial>\r\n Cancel\r\n </button>\r\n <button mat-button mat-raised-button color=\"primary\"\r\n type=\"submit\"\r\n [disabled]=\"(isLoading$ | async) || addEntityForm.invalid || !addEntityForm.dirty\">\r\n Create\r\n </button>\r\n </div>\r\n</form>\r\n",
"customCss": ".add-entity-form {\r\n min-width: 400px !important;\r\n}\r\n\r\n.add-entity-form .boolean-value-input {\r\n padding-left: 5px;\r\n}\r\n\r\n.add-entity-form .boolean-value-input .checkbox-label {\r\n margin-bottom: 8px;\r\n color: rgba(0,0,0,0.54);\r\n font-size: 12px;\r\n}\r\n\r\n.relations-list .header {\r\n padding-right: 5px;\r\n padding-bottom: 5px;\r\n padding-left: 5px;\r\n}\r\n\r\n.relations-list .header .cell {\r\n padding-right: 5px;\r\n padding-left: 5px;\r\n font-size: 12px;\r\n font-weight: 700;\r\n color: rgba(0, 0, 0, .54);\r\n white-space: nowrap;\r\n}\r\n\r\n.relations-list .mat-form-field-infix {\r\n width: auto !important;\r\n}\r\n\r\n.relations-list .body {\r\n padding-right: 5px;\r\n padding-bottom: 15px;\r\n padding-left: 5px;\r\n}\r\n\r\n.relations-list .body .row {\r\n padding-top: 5px;\r\n}\r\n\r\n.relations-list .body .cell {\r\n padding-right: 5px;\r\n padding-left: 5px;\r\n}\r\n\r\n.relations-list .body .md-button {\r\n margin: 0;\r\n}\r\n\r\n",
"customFunction": "let $injector = widgetContext.$scope.$injector;\r\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\r\nlet assetService = $injector.get(widgetContext.servicesMap.get('assetService'));\r\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\r\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\r\nlet entityRelationService = $injector.get(widgetContext.servicesMap.get('entityRelationService'));\r\nlet userSettingsService = $injector.get(widgetContext.servicesMap.get('userSettingsService'));\r\n\r\nopenAddEntityDialog();\r\n\r\nfunction openAddEntityDialog() {\r\n customDialog.customDialog(htmlTemplate, AddEntityDialogController).subscribe();\r\n}\r\n\r\nfunction AddEntityDialogController(instance) {\r\n let vm = instance;\r\n let userSettings;\r\n userSettingsService.loadUserSettings().subscribe(settings=> {\r\n userSettings = settings;\r\n if (!userSettings.createdGatewaysCount) userSettings.createdGatewaysCount = 0;\r\n });\r\n \r\n\r\n vm.addEntityFormGroup = vm.fb.group({\r\n entityName: ['', [vm.validators.required]],\r\n entityType: ['DEVICE'],\r\n entityLabel: [''],\r\n type: ['', [vm.validators.required]],\r\n });\r\n\r\n vm.cancel = function() {\r\n vm.dialogRef.close(null);\r\n };\r\n\r\n\r\n vm.save = function() {\r\n vm.addEntityFormGroup.markAsPristine();\r\n saveEntityObservable().subscribe(\r\n function (device) {\r\n widgetContext.updateAliases();\r\n userSettingsService.putUserSettings({ createdGatewaysCount: ++userSettings.createdGatewaysCount }).subscribe(_=>{\r\n });\r\n vm.dialogRef.close(null);\r\n goToConfigState(device);\r\n }\r\n );\r\n };\r\n \r\n function goToConfigState(device) {\r\n const stateParams = {};\r\n stateParams.entityId = device.id;\r\n stateParams.entityName = device.name;\r\n const newStateParams = {\r\n targetEntityParamName: 'default',\r\n new_gateway: {\r\n entityId: device.id,\r\n entityName: device.name\r\n }\r\n }\r\n const params = {...stateParams, ...newStateParams};\r\n widgetContext.stateController.openState('gateway_details', params, false);\r\n }\r\n\r\n function saveEntityObservable() {\r\n const formValues = vm.addEntityFormGroup.value;\r\n let entity = {\r\n name: formValues.entityName,\r\n type: formValues.type,\r\n label: formValues.entityLabel,\r\n additionalInfo: {\r\n gateway: true\r\n }\r\n };\r\n return deviceService.saveDevice(entity);\r\n }\r\n}\r\n",
"customFunction": "let $injector = widgetContext.$scope.$injector;\r\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\r\nlet assetService = $injector.get(widgetContext.servicesMap.get('assetService'));\r\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\r\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\r\nlet entityRelationService = $injector.get(widgetContext.servicesMap.get('entityRelationService'));\r\nlet userSettingsService = $injector.get(widgetContext.servicesMap.get('userSettingsService'));\r\n\r\nopenAddEntityDialog();\r\n\r\nfunction openAddEntityDialog() {\r\n customDialog.customDialog(htmlTemplate, AddEntityDialogController).subscribe();\r\n}\r\n\r\nfunction AddEntityDialogController(instance) {\r\n let vm = instance;\r\n let userSettings;\r\n userSettingsService.loadUserSettings().subscribe(settings=> {\r\n userSettings = settings;\r\n if (!userSettings.createdGatewaysCount) userSettings.createdGatewaysCount = 0;\r\n });\r\n \r\n\r\n vm.addEntityFormGroup = vm.fb.group({\r\n entityName: ['', [vm.validators.required]],\r\n entityType: ['DEVICE'],\r\n entityLabel: [''],\r\n type: ['', [vm.validators.required]],\r\n });\r\n\r\n vm.cancel = function() {\r\n vm.dialogRef.close(null);\r\n };\r\n\r\n\r\n vm.save = function($event) {\r\n vm.addEntityFormGroup.markAsPristine();\r\n saveEntityObservable().subscribe(\r\n function (device) {\r\n widgetContext.updateAliases();\r\n userSettingsService.putUserSettings({ createdGatewaysCount: ++userSettings.createdGatewaysCount }).subscribe(_=>{\r\n });\r\n vm.dialogRef.close(null);\r\n openCommandDialog(device, $event);\r\n }\r\n );\r\n };\r\n \r\n function openCommandDialog(device, $event) {\r\n vm.device = device;\r\n let openCommandAction = widgetContext.actionsApi.getActionDescriptors(\"actionCellButton\").find(action => action.name == \"Docker commands\");\r\n widgetContext.actionsApi.handleWidgetAction($event, openCommandAction, device.id, device.name, {newDevice: true});\r\n setTimeout(function() {\r\n document.querySelector(\".dashboard-state-dialog .mat-mdc-button-touch-target\").addEventListener('click', goToConfigState);\r\n document.querySelector(\".dashboard-state-dialog .mat-mdc-button.mat-primary\").addEventListener('click', goToConfigState);\r\n }, 500);\r\n }\r\n\r\n \r\n function goToConfigState() {\r\n document.querySelector(\".dashboard-state-dialog .mat-mdc-button-touch-target\").removeEventListener('click', goToConfigState);\r\n document.querySelector(\".dashboard-state-dialog .mat-mdc-button.mat-primary\").removeEventListener('click', goToConfigState);\r\n const stateParams = {};\r\n stateParams.entityId = vm.device.id;\r\n stateParams.entityName = vm.device.name;\r\n const newStateParams = {\r\n targetEntityParamName: 'default',\r\n new_gateway: {\r\n entityId: vm.device.id,\r\n entityName: vm.device.name\r\n }\r\n }\r\n const params = {...stateParams, ...newStateParams};\r\n widgetContext.stateController.openState('gateway_details', params, false);\r\n }\r\n\r\n function saveEntityObservable() {\r\n const formValues = vm.addEntityFormGroup.value;\r\n let entity = {\r\n name: formValues.entityName,\r\n type: formValues.type,\r\n label: formValues.entityLabel,\r\n additionalInfo: {\r\n gateway: true\r\n }\r\n };\r\n return deviceService.saveDevice(entity);\r\n }\r\n}\r\n",
"customResources": [],
"openInSeparateDialog": false,
"openInPopover": false,
@ -2142,7 +2142,7 @@
"settings": {
"useMarkdownTextFunction": false,
"markdownTextPattern": "<div style=\"width: 100%; height: 100%; padding: 0;\" fxFlex fxLayout=\"column\">\r\n <mat-tab-group [(selectedIndex)]=\"selectedTabIndex\">\r\n <mat-tab label=\"All\" value=\"gateway_devices_0\"></mat-tab>\r\n <mat-tab label=\"MQTT\" value=\"gateway_devices_1\"></mat-tab>\r\n <mat-tab label=\"MODBUS\" value=\"gateway_devices_2\"></mat-tab>\r\n <mat-tab label=\"GRPC\" value=\"gateway_devices_3\"></mat-tab>\r\n <mat-tab label=\"OPCUA\" value=\"gateway_devices_4\"> </mat-tab>\r\n <mat-tab label=\"OPCUA ASYNCIO\" value=\"gateway_devices_5\"></mat-tab>\r\n <mat-tab label=\"BLE\" value=\"gateway_devices_6\"></mat-tab>\r\n <mat-tab label=\"REQUEST\" value=\"gateway_devices_7\"></mat-tab>\r\n <mat-tab label=\"CAN\" value=\"gateway_devices_8\"></mat-tab>\r\n <mat-tab label=\"BACNET\" value=\"gateway_devices_9\"></mat-tab>\r\n <mat-tab label=\"ODBC\" value=\"gateway_devices_10\"></mat-tab>\r\n <mat-tab label=\"REST\" value=\"gateway_devices_11\"></mat-tab>\r\n <mat-tab label=\"SNMP\" value=\"gateway_devices_12\"></mat-tab>\r\n <mat-tab label=\"FTP\" value=\"gateway_devices_13\"></mat-tab>\r\n <mat-tab label=\"SOCKET\" value=\"gateway_devices_14\"></mat-tab>\r\n <mat-tab label=\"XMPP\" value=\"gateway_devices_15\"></mat-tab>\r\n <mat-tab label=\"OCCP\" value=\"gateway_devices_16\"></mat-tab>\r\n <mat-tab label=\"CUSTOM\" value=\"gateway_devices_17\"></mat-tab>\r\n </mat-tab-group><tb-dashboard-state *ngIf=\"selectedTabIndex == 1\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_1\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 2\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_2\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 3\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_3\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 4\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_4\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 5\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_5\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 6\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_6\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 7\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_7\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 8\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_8\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 9\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_9\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 10\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_10\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 11\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_11\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 12\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_12\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 13\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_13\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 14\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_14\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 15\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_15\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 16\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_16\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"selectedTabIndex == 17\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_17\"></tb-dashboard-state>\r\n <tb-dashboard-state *ngIf=\"!selectedTabIndex\" [ctx]=\"ctx\" fxFlex syncParentStateParams=\"true\" stateId=\"gateway_devices_0\"></tb-dashboard-state>\r\n</div>\r\n",
"applyDefaultMarkdownStyle": true,
"applyDefaultMarkdownStyle": false,
"markdownCss": ".mat-mdc-form-field-subscript-wrapper {\n display: none !important;\n}"
},
"title": "Gateway devices",
@ -2316,7 +2316,22 @@
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false,
"borderRadius": ""
"borderRadius": "",
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "45e4507d-3adc-bb31-8b2b-1ba09bbd56ac"
}
]
}
},
"row": 0,
"col": 0,
@ -2468,7 +2483,22 @@
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false,
"borderRadius": "4px"
"borderRadius": "4px",
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "852eccce-98eb-24db-c783-bdd62566f906"
}
]
}
},
"row": 0,
"col": 0,
@ -2619,7 +2649,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "3c31ba62-e760-2bea-4c8d-d32784a86c24"
}
]
}
},
"row": 0,
"col": 0,
@ -2770,7 +2815,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "4b55ea81-93bf-4206-9166-3e0bdc1dd9f3"
}
]
}
},
"row": 0,
"col": 0,
@ -2921,7 +2981,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "babf88d0-a118-e2b5-f10e-3a5970c8a65b"
}
]
}
},
"row": 0,
"col": 0,
@ -3072,7 +3147,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "94de7690-f91d-b032-6771-85af99abd749"
}
]
}
},
"row": 0,
"col": 0,
@ -3223,7 +3313,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "18414f44-1c65-536a-14de-eaf21a7d56bd"
}
]
}
},
"row": 0,
"col": 0,
@ -3374,7 +3479,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "794974da-c9d2-a9f7-be47-c9eb642094e8"
}
]
}
},
"row": 0,
"col": 0,
@ -3525,7 +3645,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "2add705b-3e53-8559-8126-380cac686fb0"
}
]
}
},
"row": 0,
"col": 0,
@ -3676,7 +3811,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "7e1ba820-9992-d52a-579b-20485abb3926"
}
]
}
},
"row": 0,
"col": 0,
@ -3827,7 +3977,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "91af27c1-b37c-2276-6022-a332e41b2b33"
}
]
}
},
"row": 0,
"col": 0,
@ -3978,7 +4143,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "26cf8696-054b-13ec-7984-6fc5df20e6f1"
}
]
}
},
"row": 0,
"col": 0,
@ -4129,7 +4309,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "1dcfaf24-32be-cd19-62d6-86d12cc6a7ef"
}
]
}
},
"row": 0,
"col": 0,
@ -4280,7 +4475,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "ad2bc817-f3c4-150c-4672-8fe0c38aee8d"
}
]
}
},
"row": 0,
"col": 0,
@ -4431,7 +4641,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "d1ad84cd-bd9c-4dca-e4a0-f444ae8598bd"
}
]
}
},
"row": 0,
"col": 0,
@ -4582,7 +4807,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "bf80eef9-b879-9a08-40a4-488dbdefa125"
}
]
}
},
"row": 0,
"col": 0,
@ -4733,7 +4973,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "b5a406b3-cc0a-8a09-9aec-3f8befae5fb8"
}
]
}
},
"row": 0,
"col": 0,
@ -4884,7 +5139,22 @@
"widgetCss": ".status {\r\n border-radius: 20px;\r\n font-weight: 500;\r\n padding: 5px 15px;\r\n }\r\n\r\n .status-active {\r\n color: green;\r\n background: rgba(0, 128, 0, 0.1);\r\n }\r\n\r\n .status-inactive {\r\n color: red;\r\n background: rgba(255, 0, 0, 0.1);\r\n }\r\n",
"pageSize": 1024,
"noDataDisplayMessage": "",
"enableDataExport": false
"enableDataExport": false,
"actions": {
"actionCellButton": [
{
"name": "Show Device Info",
"icon": "info",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
"type": "custom",
"customFunction": "const url = `${window.location.origin}/entities/devices/${entityId.id}`;\nwindow.open(url, '_blank');",
"openInSeparateDialog": false,
"openInPopover": false,
"id": "ec1dfba3-4b43-2491-8948-f602337f8a3b"
}
]
}
},
"row": 0,
"col": 0,
@ -6596,4 +6866,4 @@
},
"externalId": null,
"name": "Gateway"
}
}

4
application/src/main/java/org/thingsboard/server/controller/AssetController.java

@ -397,10 +397,12 @@ public class AssetController extends BaseController {
}
@ApiOperation(value = "Get Asset Types (getAssetTypes)",
notes = "Returns a set of unique asset types based on assets that are either owned by the tenant or assigned to the customer which user is performing the request.", produces = MediaType.APPLICATION_JSON_VALUE)
notes = "Deprecated. See 'getAssetProfileNames' API from Asset Profile Controller instead." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
produces = MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
@RequestMapping(value = "/asset/types", method = RequestMethod.GET)
@ResponseBody
@Deprecated(since = "3.6.2")
public List<EntitySubtype> getAssetTypes() throws ThingsboardException, ExecutionException, InterruptedException {
SecurityUser user = getCurrentUser();
TenantId tenantId = user.getTenantId();

20
application/src/main/java/org/thingsboard/server/controller/AssetProfileController.java

@ -29,18 +29,23 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import org.thingsboard.server.common.data.EntityInfo;
import org.thingsboard.server.common.data.asset.AssetProfile;
import org.thingsboard.server.common.data.asset.AssetProfileInfo;
import org.thingsboard.server.common.data.exception.ThingsboardException;
import org.thingsboard.server.common.data.id.AssetProfileId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.page.PageData;
import org.thingsboard.server.common.data.page.PageLink;
import org.thingsboard.server.dao.resource.ImageService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.entitiy.asset.profile.TbAssetProfileService;
import org.thingsboard.server.service.security.model.SecurityUser;
import org.thingsboard.server.service.security.permission.Operation;
import org.thingsboard.server.service.security.permission.Resource;
import java.util.List;
import static org.thingsboard.server.controller.ControllerConstants.ASSET_PROFILE_ID;
import static org.thingsboard.server.controller.ControllerConstants.ASSET_PROFILE_ID_PARAM_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.ASSET_PROFILE_INFO_DESCRIPTION;
@ -212,4 +217,19 @@ public class AssetProfileController extends BaseController {
PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder);
return checkNotNull(assetProfileService.findAssetProfileInfos(getTenantId(), pageLink));
}
@ApiOperation(value = "Get Asset Profile names (getAssetProfileNames)",
notes = "Returns a set of unique asset profile names owned by the tenant."
+ TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
@RequestMapping(value = "/assetProfile/names", method = RequestMethod.GET)
@ResponseBody
public List<EntityInfo> getAssetProfileNames(
@ApiParam(value = "Flag indicating whether to retrieve exclusively the names of asset profiles that are referenced by tenant's assets.")
@RequestParam(value = "activeOnly", required = false, defaultValue = "false") boolean activeOnly) throws ThingsboardException {
SecurityUser user = getCurrentUser();
TenantId tenantId = user.getTenantId();
return checkNotNull(assetProfileService.findAssetProfileNamesByTenantId(tenantId, activeOnly));
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save