-
diff --git a/ui-ngx/src/app/shared/components/image/image-dialog.component.ts b/ui-ngx/src/app/shared/components/image/image-dialog.component.ts
index 434d76d74d..1a777d1bf7 100644
--- a/ui-ngx/src/app/shared/components/image/image-dialog.component.ts
+++ b/ui-ngx/src/app/shared/components/image/image-dialog.component.ts
@@ -154,7 +154,7 @@ export class ImageDialogComponent extends
this.imageChanged = true;
this.image = result;
this.imagePreviewData = {
- url: this.image.public ? this.image.publicLink : this.image.link
+ url: this.image.public ? `${this.image.publicLink}?ts=${new Date().getTime()}` : this.image.link
};
}
});
diff --git a/ui-ngx/src/app/shared/models/action-widget-settings.models.ts b/ui-ngx/src/app/shared/models/action-widget-settings.models.ts
new file mode 100644
index 0000000000..d1442c09c5
--- /dev/null
+++ b/ui-ngx/src/app/shared/models/action-widget-settings.models.ts
@@ -0,0 +1,128 @@
+///
+/// Copyright © 2016-2024 The Thingsboard Authors
+///
+/// Licensed under the Apache License, Version 2.0 (the "License");
+/// you may not use this file except in compliance with the License.
+/// You may obtain a copy of the License at
+///
+/// http://www.apache.org/licenses/LICENSE-2.0
+///
+/// Unless required by applicable law or agreed to in writing, software
+/// distributed under the License is distributed on an "AS IS" BASIS,
+/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+/// See the License for the specific language governing permissions and
+/// limitations under the License.
+///
+
+import { AttributeScope } from '@shared/models/telemetry/telemetry.models';
+
+export enum GetValueAction {
+ DO_NOTHING = 'DO_NOTHING',
+ EXECUTE_RPC = 'EXECUTE_RPC',
+ GET_ATTRIBUTE = 'GET_ATTRIBUTE',
+ GET_TIME_SERIES = 'GET_TIME_SERIES'
+}
+
+export const getValueActions = Object.keys(GetValueAction) as GetValueAction[];
+
+export const getValueActionTranslations = new Map(
+ [
+ [GetValueAction.DO_NOTHING, 'widgets.value-action.do-nothing'],
+ [GetValueAction.EXECUTE_RPC, 'widgets.value-action.execute-rpc'],
+ [GetValueAction.GET_ATTRIBUTE, 'widgets.value-action.get-attribute'],
+ [GetValueAction.GET_TIME_SERIES, 'widgets.value-action.get-time-series']
+ ]
+);
+
+export interface RpcSettings {
+ method: string;
+ requestTimeout: number;
+ requestPersistent: boolean;
+ persistentPollingInterval: number;
+}
+
+export interface TelemetryValueSettings {
+ key: string;
+}
+
+export interface GetTelemetryValueSettings extends TelemetryValueSettings {
+ subscribeForUpdates: boolean;
+}
+
+export interface GetAttributeValueSettings extends GetTelemetryValueSettings {
+ scope: AttributeScope | null;
+}
+
+export interface SetAttributeValueSettings extends TelemetryValueSettings {
+ scope: AttributeScope.SERVER_SCOPE | AttributeScope.SHARED_SCOPE;
+}
+
+export enum DataToValueType {
+ NONE = 'NONE',
+ FUNCTION = 'FUNCTION'
+}
+
+export interface DataToValueSettings {
+ type: DataToValueType;
+ dataToValueFunction: string;
+ compareToValue?: any;
+}
+
+export interface ValueActionSettings {
+ actionLabel?: string;
+}
+
+export interface GetValueSettings extends ValueActionSettings {
+ action: GetValueAction;
+ defaultValue: V;
+ executeRpc: RpcSettings;
+ getAttribute: GetAttributeValueSettings;
+ getTimeSeries: GetTelemetryValueSettings;
+ dataToValue: DataToValueSettings;
+}
+
+export enum SetValueAction {
+ EXECUTE_RPC = 'EXECUTE_RPC',
+ SET_ATTRIBUTE = 'SET_ATTRIBUTE',
+ ADD_TIME_SERIES = 'ADD_TIME_SERIES'
+}
+
+export const setValueActions = Object.keys(SetValueAction) as SetValueAction[];
+
+export const setValueActionTranslations = new Map(
+ [
+ [SetValueAction.EXECUTE_RPC, 'widgets.value-action.execute-rpc'],
+ [SetValueAction.SET_ATTRIBUTE, 'widgets.value-action.set-attribute'],
+ [SetValueAction.ADD_TIME_SERIES, 'widgets.value-action.add-time-series']
+ ]
+);
+
+export enum ValueToDataType {
+ CONSTANT = 'CONSTANT',
+ FUNCTION = 'FUNCTION',
+ NONE = 'NONE'
+}
+
+export interface ValueToDataSettings {
+ type: ValueToDataType;
+ constantValue: any;
+ valueToDataFunction: string;
+}
+
+export interface SetValueSettings extends ValueActionSettings {
+ action: SetValueAction;
+ executeRpc: RpcSettings;
+ setAttribute: SetAttributeValueSettings;
+ putTimeSeries: TelemetryValueSettings;
+ valueToData: ValueToDataSettings;
+}
+
+/*export interface RpcStateBehaviourSettings {
+ initialState: RpcInitialStateSettings;
+ updateStateByValue: (value: V) => RpcUpdateStateSettings;
+}
+
+export interface RpcStateWidgetSettings {
+ initialState: RpcInitialStateSettings;
+ background: BackgroundSettings;
+}*/
diff --git a/ui-ngx/src/app/shared/models/rpc-widget-settings.models.ts b/ui-ngx/src/app/shared/models/rpc-widget-settings.models.ts
deleted file mode 100644
index b912361805..0000000000
--- a/ui-ngx/src/app/shared/models/rpc-widget-settings.models.ts
+++ /dev/null
@@ -1,125 +0,0 @@
-///
-/// Copyright © 2016-2024 The Thingsboard Authors
-///
-/// Licensed under the Apache License, Version 2.0 (the "License");
-/// you may not use this file except in compliance with the License.
-/// You may obtain a copy of the License at
-///
-/// http://www.apache.org/licenses/LICENSE-2.0
-///
-/// Unless required by applicable law or agreed to in writing, software
-/// distributed under the License is distributed on an "AS IS" BASIS,
-/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-/// See the License for the specific language governing permissions and
-/// limitations under the License.
-///
-
-import { AttributeScope } from '@shared/models/telemetry/telemetry.models';
-import { BackgroundSettings } from '@shared/models/widget-settings.models';
-
-export enum RpcInitialStateAction {
- DO_NOTHING = 'DO_NOTHING',
- EXECUTE_RPC = 'EXECUTE_RPC',
- GET_ATTRIBUTE = 'GET_ATTRIBUTE',
- GET_TIME_SERIES = 'GET_TIME_SERIES'
-}
-
-export const rpcInitialStateActions = Object.keys(RpcInitialStateAction) as RpcInitialStateAction[];
-
-export const rpcInitialStateTranslations = new Map(
- [
- [RpcInitialStateAction.DO_NOTHING, 'widgets.rpc-state.do-nothing'],
- [RpcInitialStateAction.EXECUTE_RPC, 'widgets.rpc-state.execute-rpc'],
- [RpcInitialStateAction.GET_ATTRIBUTE, 'widgets.rpc-state.get-attribute'],
- [RpcInitialStateAction.GET_TIME_SERIES, 'widgets.rpc-state.get-time-series']
- ]
-);
-
-export interface RpcSettings {
- method: string;
- requestTimeout: number;
- requestPersistent: boolean;
- persistentPollingInterval: number;
-}
-
-export interface RpcTelemetrySettings {
- key: string;
-}
-
-export interface RpcGetAttributeSettings extends RpcTelemetrySettings {
- scope: AttributeScope | null;
-}
-
-export interface RpcSetAttributeSettings extends RpcTelemetrySettings {
- scope: AttributeScope.SERVER_SCOPE | AttributeScope.SHARED_SCOPE;
-}
-
-export enum RpcDataToStateType {
- NONE = 'NONE',
- FUNCTION = 'FUNCTION'
-}
-
-export interface RpcDataToStateSettings {
- type: RpcDataToStateType;
- dataToStateFunction: string;
- compareToValue?: any;
-}
-
-export interface RpcActionSettings {
- actionLabel?: string;
-}
-
-export interface RpcInitialStateSettings extends RpcActionSettings {
- action: RpcInitialStateAction;
- defaultValue: V;
- executeRpc: RpcSettings;
- getAttribute: RpcGetAttributeSettings;
- getTimeSeries: RpcTelemetrySettings;
- dataToState: RpcDataToStateSettings;
-}
-
-export enum RpcUpdateStateAction {
- EXECUTE_RPC = 'EXECUTE_RPC',
- SET_ATTRIBUTE = 'SET_ATTRIBUTE',
- ADD_TIME_SERIES = 'ADD_TIME_SERIES'
-}
-
-export const rpcUpdateStateActions = Object.keys(RpcUpdateStateAction) as RpcUpdateStateAction[];
-
-export const rpcUpdateStateTranslations = new Map(
- [
- [RpcUpdateStateAction.EXECUTE_RPC, 'widgets.rpc-state.execute-rpc'],
- [RpcUpdateStateAction.SET_ATTRIBUTE, 'widgets.rpc-state.set-attribute'],
- [RpcUpdateStateAction.ADD_TIME_SERIES, 'widgets.rpc-state.add-time-series']
- ]
-);
-
-export enum RpcStateToParamsType {
- CONSTANT = 'CONSTANT',
- FUNCTION = 'FUNCTION',
- NONE = 'NONE'
-}
-
-export interface RpcStateToParamsSettings {
- type: RpcStateToParamsType;
- constantValue: any;
- stateToParamsFunction: string;
-}
-
-export interface RpcUpdateStateSettings extends RpcActionSettings {
- action: RpcUpdateStateAction;
- executeRpc: RpcSettings;
- setAttribute: RpcSetAttributeSettings;
- putTimeSeries: RpcTelemetrySettings;
- stateToParams: RpcStateToParamsSettings;
-}
-
-export interface RpcStateBehaviourSettings {
- initialState: RpcInitialStateSettings;
- updateStateByValue: (value: V) => RpcUpdateStateSettings;
-}
-
-export interface RpcStateWidgetSettings {
- initialState: RpcInitialStateSettings;
- background: BackgroundSettings;
-}
diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json
index d4f57953e4..1e55d903bc 100644
--- a/ui-ngx/src/assets/locale/locale.constant-en_US.json
+++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json
@@ -6102,60 +6102,6 @@
"min-value": "Minimum value",
"max-value": "Maximum value"
},
- "rpc-state": {
- "initial-state": "Initial state",
- "initial-state-hint": "Action to get the initial value of the component.",
- "turn-on": "Turn 'On'",
- "turn-on-hint": "Action performed to turn ON the component.",
- "turn-off": "Turn 'Off'",
- "turn-off-hint": "Action performed to turn OFF the component.",
- "on": "On",
- "off": "Off",
- "do-nothing": "Do nothing",
- "execute-rpc": "Execute RPC",
- "get-attribute": "Get attribute",
- "set-attribute": "Set attribute",
- "get-time-series": "Get time-series",
- "add-time-series": "Add time-series",
- "execute-rpc-text": "Execute RPC method '{{methodName}}'",
- "get-attribute-text": "Use attribute '{{key}}'",
- "get-time-series-text": "Use time-series '{{key}}'",
- "set-attribute-to-value-text": "Set '{{key}}' attribute to: {{value}}",
- "add-time-series-value-text": "Add '{{key}}' time-series value: {{value}}",
- "set-attribute-text": "Set '{{key}}' attribute",
- "add-time-series-text": "Add '{{key}}' time-series",
- "action": "Action",
- "value": "Value",
- "init-value-hint": "Value that will be set until device sends data.",
- "method": "Method",
- "method-name-required": "Method name is required.",
- "request-timeout-ms": "RPC request timeout (ms)",
- "request-timeout-required": "Request timeout is required.",
- "min-request-timeout-error": "Request timeout value should be greater or equal 5000 ms (5 seconds).",
- "request-persistent": "RPC request persistent",
- "persistent-polling-interval": "Persistent polling interval (ms)",
- "persistent-polling-interval-hint": "Polling interval (ms) to get persistent RPC command response",
- "persistent-polling-interval-required": "Persistent polling interval is required.",
- "min-persistent-polling-interval-error": "Persistent polling interval value should be greater or equal 1000 ms (1 second).",
- "attribute-scope": "Attribute scope",
- "attribute-key": "Attribute key",
- "attribute-key-required": "Attribute key is required.",
- "time-series-key": "Time-series key",
- "time-series-key-required": "Time-series key is required.",
- "action-result-converter": "Action result converter",
- "converter-none": "None",
- "converter-function": "Function",
- "converter-constant": "Constant",
- "parse-value-function": "Parse value function",
- "on-when-result-is": "'On' when result is",
- "parameters": "Parameters",
- "convert-value-function": "Convert value function",
- "error": {
- "target-entity-is-not-set": "Target entity is not set!",
- "failed-to-perform-action": "Failed to perform the {{ actionLabel }} action.",
- "invalid-attribute-scope": "{{scope}} attribute scope is not supported by {{entityType}} entity."
- }
- },
"maps": {
"select-entity": "Select entity",
"select-entity-hint": "Hint: after selection click at the map to set position",
@@ -6628,6 +6574,62 @@
"source-entity-alias": "Source entity alias",
"source-entity-attribute": "Source entity attribute"
},
+ "value-action": {
+ "initial-state": "Initial state",
+ "initial-state-hint": "Action to get the initial value of the component.",
+ "turn-on": "Turn 'On'",
+ "turn-on-hint": "Action performed to turn ON the component.",
+ "turn-off": "Turn 'Off'",
+ "turn-off-hint": "Action performed to turn OFF the component.",
+ "on": "On",
+ "off": "Off",
+ "do-nothing": "Do nothing",
+ "execute-rpc": "Execute RPC",
+ "get-attribute": "Get attribute",
+ "set-attribute": "Set attribute",
+ "get-time-series": "Get time-series",
+ "add-time-series": "Add time-series",
+ "execute-rpc-text": "Execute RPC method '{{methodName}}'",
+ "get-attribute-text": "Use attribute '{{key}}'",
+ "get-time-series-text": "Use time-series '{{key}}'",
+ "set-attribute-to-value-text": "Set '{{key}}' attribute to: {{value}}",
+ "add-time-series-value-text": "Add '{{key}}' time-series value: {{value}}",
+ "set-attribute-text": "Set '{{key}}' attribute",
+ "add-time-series-text": "Add '{{key}}' time-series",
+ "action": "Action",
+ "value": "Value",
+ "init-value-hint": "Value that will be set until device sends data.",
+ "method": "Method",
+ "method-name-required": "Method name is required.",
+ "request-timeout-ms": "RPC request timeout (ms)",
+ "request-timeout-required": "Request timeout is required.",
+ "min-request-timeout-error": "Request timeout value should be greater or equal 5000 ms (5 seconds).",
+ "request-persistent": "RPC request persistent",
+ "persistent-polling-interval": "Persistent polling interval (ms)",
+ "persistent-polling-interval-hint": "Polling interval (ms) to get persistent RPC command response",
+ "persistent-polling-interval-required": "Persistent polling interval is required.",
+ "min-persistent-polling-interval-error": "Persistent polling interval value should be greater or equal 1000 ms (1 second).",
+ "attribute-scope": "Attribute scope",
+ "attribute-key": "Attribute key",
+ "attribute-key-required": "Attribute key is required.",
+ "time-series-key": "Time-series key",
+ "time-series-key-required": "Time-series key is required.",
+ "subscribe-for-updates": "Subscribe for updates",
+ "subscribe-for-updates-hint": "Subscribe for updates",
+ "action-result-converter": "Action result converter",
+ "converter-none": "None",
+ "converter-function": "Function",
+ "converter-constant": "Constant",
+ "parse-value-function": "Parse value function",
+ "on-when-result-is": "'On' when result is",
+ "parameters": "Parameters",
+ "convert-value-function": "Convert value function",
+ "error": {
+ "target-entity-is-not-set": "Target entity is not set!",
+ "failed-to-perform-action": "Failed to perform the {{ actionLabel }} action.",
+ "invalid-attribute-scope": "{{scope}} attribute scope is not supported by {{entityType}} entity."
+ }
+ },
"widget-font": {
"font-settings": "Font settings",
"font-family": "Font family",