Browse Source

Merge branch 'fix/helpUrls' of github.com:kalutkaz/thingsboard into fix/helpUrls

pull/10816/head
Vladyslav_Prykhodko 2 years ago
parent
commit
225acfa072
  1. 5
      ui-ngx/src/app/core/services/help.service.ts
  2. 7
      ui-ngx/src/app/shared/models/constants.ts
  3. 4
      ui-ngx/src/assets/help/en_US/rulenode/clear_alarm_node_script_fn.md
  4. 2
      ui-ngx/src/assets/help/en_US/rulenode/common_node_fields_templatization.md
  5. 2
      ui-ngx/src/assets/help/en_US/rulenode/common_node_script_args.md
  6. 4
      ui-ngx/src/assets/help/en_US/rulenode/create_alarm_node_script_fn.md
  7. 4
      ui-ngx/src/assets/help/en_US/rulenode/filter_node_script_fn.md
  8. 2
      ui-ngx/src/assets/help/en_US/rulenode/log_node_script_fn.md
  9. 4
      ui-ngx/src/assets/help/en_US/rulenode/switch_node_script_fn.md
  10. 6
      ui-ngx/src/assets/help/en_US/rulenode/tbel/clear_alarm_node_script_fn.md
  11. 2
      ui-ngx/src/assets/help/en_US/rulenode/tbel/common_node_script_args.md
  12. 6
      ui-ngx/src/assets/help/en_US/rulenode/tbel/create_alarm_node_script_fn.md
  13. 6
      ui-ngx/src/assets/help/en_US/rulenode/tbel/filter_node_script_fn.md
  14. 2
      ui-ngx/src/assets/help/en_US/rulenode/tbel/generator_node_script_fn.md
  15. 4
      ui-ngx/src/assets/help/en_US/rulenode/tbel/log_node_script_fn.md
  16. 6
      ui-ngx/src/assets/help/en_US/rulenode/tbel/switch_node_script_fn.md
  17. 6
      ui-ngx/src/assets/help/en_US/rulenode/tbel/transformation_node_script_fn.md
  18. 4
      ui-ngx/src/assets/help/en_US/rulenode/transformation_node_script_fn.md
  19. 2
      ui-ngx/src/assets/help/en_US/widget/action/mobile_process_qr_code_fn.md
  20. 2
      ui-ngx/src/assets/help/en_US/widget/editor/examples/rpc_widget.md
  21. 4
      ui-ngx/src/assets/help/en_US/widget/editor/widget_js_fn.md
  22. 8
      ui-ngx/src/assets/help/en_US/widget/editor/widget_js_subscription_object.md
  23. 2
      ui-ngx/src/assets/help/en_US/widget/lib/markdown/markdown_text_fn.md
  24. 2
      ui-ngx/src/assets/help/en_US/widget/lib/qrcode/qrcode_text_fn.md

5
ui-ngx/src/app/core/services/help.service.ts

@ -19,7 +19,7 @@ import { HttpClient } from '@angular/common/http';
import { TranslateService } from '@ngx-translate/core';
import { Observable, of } from 'rxjs';
import { catchError, map, mergeMap, tap } from 'rxjs/operators';
import { helpBaseUrl as siteBaseUrl } from '@shared/models/constants';
import { docPlatformPrefix, helpBaseUrl as siteBaseUrl } from '@shared/models/constants';
import { UiSettingsService } from '@core/http/ui-settings.service';
const localHelpBaseUrl = '/assets';
@ -35,6 +35,7 @@ const NOT_FOUND_CONTENT: HelpData = {
export class HelpService {
private siteBaseUrl = siteBaseUrl;
private docPlatformPrefix = docPlatformPrefix;
private helpCache: {[lang: string]: {[key: string]: string}} = {};
constructor(
@ -106,6 +107,8 @@ export class HelpService {
private processVariables(helpData: HelpData): string {
const baseUrlReg = /\${siteBaseUrl}/g;
helpData.content = helpData.content.replace(baseUrlReg, this.siteBaseUrl);
const docPlatformPrefixUrlReg = /\${docPlatformPrefix}/g;
helpData.content = helpData.content.replace(docPlatformPrefixUrlReg, this.docPlatformPrefix);
const helpBaseUrlReg = /\${helpBaseUrl}/g;
return helpData.content.replace(helpBaseUrlReg, helpData.helpBaseUrl);
}

7
ui-ngx/src/app/shared/models/constants.ts

@ -81,6 +81,13 @@ export const resolveBreakpoint = (breakpoint: string): string => {
export const helpBaseUrl = 'https://thingsboard.io';
enum DocPlatformPrefix {
CE = '',
PE = '/pe',
CLOUD = '/paas'
}
export const docPlatformPrefix = DocPlatformPrefix.CE;
export const HelpLinks = {
linksMap: {
outgoingMailSettings: helpBaseUrl + '/docs/user-guide/ui/mail-settings',

4
ui-ngx/src/assets/help/en_US/rulenode/clear_alarm_node_script_fn.md

@ -59,11 +59,11 @@ return details;
<br>
More details about Alarms can be found in [this tutorial{:target="_blank"}](${siteBaseUrl}/docs/user-guide/alarms/).
More details about Alarms can be found in [this tutorial{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/alarms/).
You can see the real life example, where this node is used, in the next tutorial:
- [Create and Clear Alarms{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/create-clear-alarms/)
- [Create and Clear Alarms{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/create-clear-alarms/)
<br>
<br>

2
ui-ngx/src/assets/help/en_US/rulenode/common_node_fields_templatization.md

@ -1,4 +1,4 @@
Fields templatization feature allows you to process the incoming messages with dynamic configuration
by substitution of templates specified in the configuration fields with values from message or message metadata.
For more detailed information, please refer to the ThingsBoard [documentation](${siteBaseUrl}/docs/user-guide/templatization/)
For more detailed information, please refer to the ThingsBoard [documentation](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/templatization/)

2
ui-ngx/src/assets/help/en_US/rulenode/common_node_script_args.md

@ -8,4 +8,4 @@
</ul>
Enable 'debug mode' for your rule node to see the messages that arrive in near real-time.
See <a href="${siteBaseUrl}/docs/user-guide/rule-engine-2-0/overview/#debugging" target="_blank">Debugging</a> for more information.
See <a href="${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/overview/#debugging" target="_blank">Debugging</a> for more information.

4
ui-ngx/src/assets/help/en_US/rulenode/create_alarm_node_script_fn.md

@ -60,11 +60,11 @@ return details;
<br>
More details about Alarms can be found in [this tutorial{:target="_blank"}](${siteBaseUrl}/docs/user-guide/alarms/).
More details about Alarms can be found in [this tutorial{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/alarms/).
You can see the real life example, where this node is used, in the next tutorial:
- [Create and Clear Alarms{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/create-clear-alarms/)
- [Create and Clear Alarms{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/create-clear-alarms/)
<br>
<br>

4
ui-ngx/src/assets/help/en_US/rulenode/filter_node_script_fn.md

@ -76,8 +76,8 @@ return false;
You can see real life example, how to use this node in those tutorials:
- [Create and Clear Alarms{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/create-clear-alarms/#node-a-filter-script)
- [Reply to RPC Calls{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/rpc-reply-tutorial#add-filter-script-node)
- [Create and Clear Alarms{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/create-clear-alarms/#node-a-filter-script)
- [Reply to RPC Calls{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/rpc-reply-tutorial#add-filter-script-node)
<br>
<br>

2
ui-ngx/src/assets/help/en_US/rulenode/log_node_script_fn.md

@ -31,7 +31,7 @@ return 'Incoming message:\n' + JSON.stringify(msg) +
You can see real life example, how to use this node in this tutorial:
- [Reply to RPC Calls{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/rpc-reply-tutorial#log-unknown-request)
- [Reply to RPC Calls{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/rpc-reply-tutorial#log-unknown-request)
<br>
<br>

4
ui-ngx/src/assets/help/en_US/rulenode/switch_node_script_fn.md

@ -15,7 +15,7 @@ JavaScript function computing **an array of Link names** to forward the incoming
Should return an array of `string` values presenting **link names** that the Rule Engine should use to further route the incoming Message.<br>
If the result is an empty array - message will not be routed to any Node and will be immediately
<a href="${siteBaseUrl}/docs/user-guide/rule-engine-2-0/overview/#message-processing-result" target="_blank">acknowledged</a>.
<a href="${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/overview/#message-processing-result" target="_blank">acknowledged</a>.
<div class="divider"></div>
@ -95,7 +95,7 @@ return [];
You can see real life example, how to use this node in this tutorial:
- [Data function based on telemetry from 2 devices{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/function-based-on-telemetry-from-two-devices#delta-temperature-rule-chain)
- [Data function based on telemetry from 2 devices{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/function-based-on-telemetry-from-two-devices#delta-temperature-rule-chain)
<br>
<br>

6
ui-ngx/src/assets/help/en_US/rulenode/tbel/clear_alarm_node_script_fn.md

@ -5,7 +5,7 @@
*function Details(msg, metadata, msgType): any*
[TBEL{:target="_blank"}](${siteBaseUrl}/docs/user-guide/tbel/) function generating **Alarm Details** object to update existing one. Used for storing additional parameters inside Alarm.<br>
[TBEL{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/tbel/) function generating **Alarm Details** object to update existing one. Used for storing additional parameters inside Alarm.<br>
For example you can save attribute name/value pair from Original Message payload or Metadata.
**Parameters:**
@ -59,11 +59,11 @@ return details;
<br>
More details about Alarms can be found in [this tutorial{:target="_blank"}](${siteBaseUrl}/docs/user-guide/alarms/).
More details about Alarms can be found in [this tutorial{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/alarms/).
You can see the real life example, where this node is used, in the next tutorial:
- [Create and Clear Alarms{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/create-clear-alarms/)
- [Create and Clear Alarms{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/create-clear-alarms/)
<br>
<br>

2
ui-ngx/src/assets/help/en_US/rulenode/tbel/common_node_script_args.md

@ -8,4 +8,4 @@
</ul>
Enable 'debug mode' for your rule node to see the messages that arrive in near real-time.
See <a href="${siteBaseUrl}/docs/user-guide/rule-engine-2-0/overview/#debugging" target="_blank">Debugging</a> for more information.
See <a href="${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/overview/#debugging" target="_blank">Debugging</a> for more information.

6
ui-ngx/src/assets/help/en_US/rulenode/tbel/create_alarm_node_script_fn.md

@ -5,7 +5,7 @@
*function Details(msg, metadata, msgType): any*
[TBEL{:target="_blank"}](${siteBaseUrl}/docs/user-guide/tbel/) function generating **Alarm Details** object. Used for storing additional parameters inside Alarm.<br>
[TBEL{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/tbel/) function generating **Alarm Details** object. Used for storing additional parameters inside Alarm.<br>
For example you can save attribute name/value pair from Original Message payload or Metadata.
**Parameters:**
@ -59,11 +59,11 @@ return details;
<br>
More details about Alarms can be found in [this tutorial{:target="_blank"}](${siteBaseUrl}/docs/user-guide/alarms/).
More details about Alarms can be found in [this tutorial{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/alarms/).
You can see the real life example, where this node is used, in the next tutorial:
- [Create and Clear Alarms{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/create-clear-alarms/)
- [Create and Clear Alarms{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/create-clear-alarms/)
<br>
<br>

6
ui-ngx/src/assets/help/en_US/rulenode/tbel/filter_node_script_fn.md

@ -5,7 +5,7 @@
*function Filter(msg, metadata, msgType): boolean*
[TBEL{:target="_blank"}](${siteBaseUrl}/docs/user-guide/tbel/) function defines a boolean expression based on the incoming Message and Metadata.
[TBEL{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/tbel/) function defines a boolean expression based on the incoming Message and Metadata.
**Parameters:**
@ -76,8 +76,8 @@ return false;
You can see real life example, how to use this node in those tutorials:
- [Create and Clear Alarms{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/create-clear-alarms/#node-a-filter-script)
- [Reply to RPC Calls{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/rpc-reply-tutorial#add-filter-script-node)
- [Create and Clear Alarms{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/create-clear-alarms/#node-a-filter-script)
- [Reply to RPC Calls{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/rpc-reply-tutorial#add-filter-script-node)
<br>
<br>

2
ui-ngx/src/assets/help/en_US/rulenode/tbel/generator_node_script_fn.md

@ -5,7 +5,7 @@
*function Generate(prevMsg, prevMetadata, prevMsgType): {msg: object, metadata: object, msgType: string}*
[TBEL{:target="_blank"}](${siteBaseUrl}/docs/user-guide/tbel/) function generating new Message using previous Message payload, Metadata and Message type as input arguments.
[TBEL{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/tbel/) function generating new Message using previous Message payload, Metadata and Message type as input arguments.
**Parameters:**

4
ui-ngx/src/assets/help/en_US/rulenode/tbel/log_node_script_fn.md

@ -5,7 +5,7 @@
*function toString(msg, metadata, msgType): string*
[TBEL{:target="_blank"}](${siteBaseUrl}/docs/user-guide/tbel/) function transforming incoming Message to String for further logging to the server log file.
[TBEL{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/tbel/) function transforming incoming Message to String for further logging to the server log file.
**Parameters:**
@ -31,7 +31,7 @@ return 'Incoming message:\n' + JSON.stringify(msg) +
You can see real life example, how to use this node in this tutorial:
- [Reply to RPC Calls{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/rpc-reply-tutorial#log-unknown-request)
- [Reply to RPC Calls{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/rpc-reply-tutorial#log-unknown-request)
<br>
<br>

6
ui-ngx/src/assets/help/en_US/rulenode/tbel/switch_node_script_fn.md

@ -5,7 +5,7 @@
*function Switch(msg, metadata, msgType): string[]*
[TBEL{:target="_blank"}](${siteBaseUrl}/docs/user-guide/tbel/) function computing **an array of Link names** to forward the incoming Message.
[TBEL{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/tbel/) function computing **an array of Link names** to forward the incoming Message.
**Parameters:**
@ -15,7 +15,7 @@
Should return an array of `string` values presenting **link names** that the Rule Engine should use to further route the incoming Message.<br>
If the result is an empty array - message will not be routed to any Node and will be immediately
<a href="${siteBaseUrl}/docs/user-guide/rule-engine-2-0/overview/#message-processing-result" target="_blank">acknowledged</a>.
<a href="${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/overview/#message-processing-result" target="_blank">acknowledged</a>.
<div class="divider"></div>
@ -95,7 +95,7 @@ return [];
You can see real life example, how to use this node in this tutorial:
- [Data function based on telemetry from 2 devices{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/function-based-on-telemetry-from-two-devices#delta-temperature-rule-chain)
- [Data function based on telemetry from 2 devices{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/function-based-on-telemetry-from-two-devices#delta-temperature-rule-chain)
<br>
<br>

6
ui-ngx/src/assets/help/en_US/rulenode/tbel/transformation_node_script_fn.md

@ -5,7 +5,7 @@
*function Transform(msg, metadata, msgType): {msg: object, metadata: object, msgType: string}*
The [TBEL{:target="_blank"}](${siteBaseUrl}/docs/user-guide/tbel/) function to transform input Message payload, Metadata and/or Message type to the output message.
The [TBEL{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/tbel/) function to transform input Message payload, Metadata and/or Message type to the output message.
**Parameters:**
@ -82,8 +82,8 @@ return [
You can see real life example, how to use this node in those tutorials:
- [Transform incoming telemetry{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/transform-incoming-telemetry/)
- [Reply to RPC Calls{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/rpc-reply-tutorial#add-transform-script-node)
- [Transform incoming telemetry{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/transform-incoming-telemetry/)
- [Reply to RPC Calls{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/rpc-reply-tutorial#add-transform-script-node)
<br>
<br>

4
ui-ngx/src/assets/help/en_US/rulenode/transformation_node_script_fn.md

@ -82,8 +82,8 @@ return [
You can see real life example, how to use this node in those tutorials:
- [Transform incoming telemetry{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/transform-incoming-telemetry/)
- [Reply to RPC Calls{:target="_blank"}](${siteBaseUrl}/docs/user-guide/rule-engine-2-0/tutorials/rpc-reply-tutorial#add-transform-script-node)
- [Transform incoming telemetry{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/transform-incoming-telemetry/)
- [Reply to RPC Calls{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/tutorials/rpc-reply-tutorial#add-transform-script-node)
<br>
<br>

2
ui-ngx/src/assets/help/en_US/widget/action/mobile_process_qr_code_fn.md

@ -34,7 +34,7 @@ function showQrCodeDialog(title, code, format) {
{:copy-code}
```
* Parse code as a device claiming info (in this case ```{deviceName: string, secretKey: string}```)<br>and then claim device (see [Claiming devices{:target="_blank"}](${siteBaseUrl}/docs/user-guide/claiming-devices/) for details):
* Parse code as a device claiming info (in this case ```{deviceName: string, secretKey: string}```)<br>and then claim device (see [Claiming devices{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/claiming-devices/) for details):
```javascript
var $scope = widgetContext.$scope;

2
ui-ngx/src/assets/help/en_US/widget/editor/examples/rpc_widget.md

@ -123,7 +123,7 @@ To test how this widget performs RPC commands, we will need to place it in a das
- Login as Tenant administrator.
- Navigate to **Devices** and create new device with some name, for ex. "My RPC Device".
- Open device details and click "Copy Access Token" button to copy device access token to clipboard.
- Download [mqtt-js-rpc-from-server.sh{:target="_blank"}](${siteBaseUrl}/docs/reference/resources/mqtt-js-rpc-from-server.sh) and [mqtt-js-rpc-from-server.js{:target="_blank"}](${siteBaseUrl}/docs/reference/resources/mqtt-js-rpc-from-server.js). Place these files in a folder.
- Download [mqtt-js-rpc-from-server.sh{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/reference/resources/mqtt-js-rpc-from-server.sh) and [mqtt-js-rpc-from-server.js{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/reference/resources/mqtt-js-rpc-from-server.js). Place these files in a folder.
Edit **mqtt-js-rpc-from-server.sh** - replace **$ACCESS_TOKEN** with your device access token from the clipboard. And install mqtt client library.
- Run **mqtt-js-rpc-from-server.sh** script. You should see a "connected" message in the console.
- Navigate to **Dashboards** and create a new dashboard with some name, for ex. "My first control dashboard". Open this dashboard.

4
ui-ngx/src/assets/help/en_US/widget/editor/widget_js_fn.md

@ -3,7 +3,7 @@
<div class="divider"></div>
<br/>
All widget related JavaScript code according to the [Widget API{:target="_blank"}](${siteBaseUrl}/docs/user-guide/contribution/widgets-development/#basic-widget-api).
All widget related JavaScript code according to the [Widget API{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/contribution/widgets-development/#basic-widget-api).
The built-in variable **self** is a reference to the widget instance.<br>
Each widget function should be defined as a property of the **self** variable.
**self** variable has property **ctx** of type [WidgetContext{:target="_blank"}](https://github.com/thingsboard/thingsboard/blob/5bb6403407aa4898084832d6698aa9ea6d484889/ui-ngx/src/app/modules/home/models/widget-component.models.ts#L107) - a reference to widget context that has all necessary API and data used by widget instance.
@ -129,7 +129,7 @@ Browser debugger (if enabled) will automatically pause code execution at the deb
##### Further reading
For more information read [Widgets Development Guide{:target="_blank"}](${siteBaseUrl}/docs/user-guide/contribution/widgets-development).
For more information read [Widgets Development Guide{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/contribution/widgets-development).
<br>
<br>

8
ui-ngx/src/assets/help/en_US/widget/editor/widget_js_subscription_object.md

@ -3,10 +3,10 @@
<div class="divider"></div>
<br/>
The widget subscription object is instance of [IWidgetSubscription{:target="_blank"}](https://github.com/thingsboard/thingsboard/blob/2627fe51d491055d4140f16617ed543f7f5bd8f6/ui-ngx/src/app/core/api/widget-api.models.ts#L264") and contains all subscription information, including current data, according to the [widget type{:target="_blank"}](${siteBaseUrl}/docs/user-guide/ui/widget-library/#widget-types).
The widget subscription object is instance of [IWidgetSubscription{:target="_blank"}](https://github.com/thingsboard/thingsboard/blob/2627fe51d491055d4140f16617ed543f7f5bd8f6/ui-ngx/src/app/core/api/widget-api.models.ts#L264") and contains all subscription information, including current data, according to the [widget type{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/widget-library/#widget-types).
Depending on widget type, subscription object provides different data structures.
For [Latest values{:target="_blank"}](${siteBaseUrl}/docs/user-guide/ui/widget-library/#latest-values) and [Time-series{:target="_blank"}](${siteBaseUrl}/docs/user-guide/ui/widget-library/#time-series) widget types, it provides the following properties:
For [Latest values{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/widget-library/#latest-values) and [Time-series{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/widget-library/#time-series) widget types, it provides the following properties:
- **datasources** - array of datasources (Array<[Datasource{:target="_blank"}](https://github.com/thingsboard/thingsboard/blob/2627fe51d491055d4140f16617ed543f7f5bd8f6/ui-ngx/src/app/shared/models/widget.models.ts#L279)>) used by this subscription, using the following structure:
@ -54,7 +54,7 @@ For [Latest values{:target="_blank"}](${siteBaseUrl}/docs/user-guide/ui/widget-l
]
```
For [Alarm widget{:target="_blank"}](${siteBaseUrl}/docs/user-guide/ui/widget-library/#alarm-widget) type it provides the following properties:
For [Alarm widget{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/widget-library/#alarm-widget) type it provides the following properties:
- **alarmSource** - ([Datasource{:target="_blank"}](https://github.com/thingsboard/thingsboard/blob/2627fe51d491055d4140f16617ed543f7f5bd8f6/ui-ngx/src/app/shared/models/widget.models.ts#L279)) information about entity for which alarms are fetched, using the following structure:
@ -110,4 +110,4 @@ For [Alarm widget{:target="_blank"}](${siteBaseUrl}/docs/user-guide/ui/widget-li
]
```
For [RPC{:target="_blank"}](${siteBaseUrl}/docs/user-guide/ui/widget-library/#rpc-control-widget) or [Static{:target="_blank"}](${siteBaseUrl}/docs/user-guide/ui/widget-library/#static) widget types, subscription object is optional and does not contain necessary information.
For [RPC{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/widget-library/#rpc-control-widget) or [Static{:target="_blank"}](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/widget-library/#static) widget types, subscription object is optional and does not contain necessary information.

2
ui-ngx/src/assets/help/en_US/widget/lib/markdown/markdown_text_fn.md

@ -36,7 +36,7 @@ return '# Some title\n - Entity name: ' + data[0]['entityName'];
<ul>
<li>
Display greetings for currently logged-in user.<br>
Let's assume widget has first datasource configured using <code>Current User</code> <a target="_blank" href="${siteBaseUrl}/docs/user-guide/ui/aliases/#single-entity">Single entity</a> alias<br>
Let's assume widget has first datasource configured using <code>Current User</code> <a target="_blank" href="${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/aliases/#single-entity">Single entity</a> alias<br>
and has data keys for <code>firstName</code>, <code>lastName</code> and <code>name</code> entity fields:
</li>
</ul>

2
ui-ngx/src/assets/help/en_US/widget/lib/qrcode/qrcode_text_fn.md

@ -34,7 +34,7 @@ return data[0] ? data[0]['entityName'] : '';
<li>
Prepare QR code text to use as device claiming info (in this case <code>{deviceName: string, secretKey: string}</code>).<br>
Let's assume device has <code>claimingData</code> attribute with string JSON value containing <code>secretKey</code> field<br>
(see <a target="_blank" href="${siteBaseUrl}/docs/user-guide/claiming-devices/">Claiming devices</a>):
(see <a target="_blank" href="${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/claiming-devices/">Claiming devices</a>):
</li>
</ul>

Loading…
Cancel
Save