|
|
|
@ -47,6 +47,7 @@ import { WidgetConfigCallbacks } from '@home/components/widget/config/widget-con |
|
|
|
import { TbFunction } from '@shared/models/js-function.models'; |
|
|
|
import { FormProperty, jsonFormSchemaToFormProperties } from '@shared/models/dynamic-form.models'; |
|
|
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; |
|
|
|
import { Device } from '@shared/models/device.models'; |
|
|
|
|
|
|
|
export enum widgetType { |
|
|
|
timeseries = 'timeseries', |
|
|
|
@ -589,7 +590,8 @@ export enum WidgetMobileActionType { |
|
|
|
scanQrCode = 'scanQrCode', |
|
|
|
makePhoneCall = 'makePhoneCall', |
|
|
|
getLocation = 'getLocation', |
|
|
|
takeScreenshot = 'takeScreenshot' |
|
|
|
takeScreenshot = 'takeScreenshot', |
|
|
|
deviceProvision = 'deviceProvision', |
|
|
|
} |
|
|
|
|
|
|
|
export enum MapItemType { |
|
|
|
@ -625,7 +627,8 @@ export const widgetMobileActionTypeTranslationMap = new Map<WidgetMobileActionTy |
|
|
|
[ WidgetMobileActionType.scanQrCode, 'widget-action.mobile.scan-qr-code' ], |
|
|
|
[ WidgetMobileActionType.makePhoneCall, 'widget-action.mobile.make-phone-call' ], |
|
|
|
[ WidgetMobileActionType.getLocation, 'widget-action.mobile.get-location' ], |
|
|
|
[ WidgetMobileActionType.takeScreenshot, 'widget-action.mobile.take-screenshot' ] |
|
|
|
[ WidgetMobileActionType.takeScreenshot, 'widget-action.mobile.take-screenshot' ], |
|
|
|
[ WidgetMobileActionType.deviceProvision, 'widget-action.mobile.device-provision' ] |
|
|
|
] |
|
|
|
); |
|
|
|
|
|
|
|
@ -656,10 +659,15 @@ export interface MobileLocationResult { |
|
|
|
longitude: number; |
|
|
|
} |
|
|
|
|
|
|
|
export interface MobileDeviceProvisionResult { |
|
|
|
deviceName: string; |
|
|
|
} |
|
|
|
|
|
|
|
export type MobileActionResult = MobileLaunchResult & |
|
|
|
MobileImageResult & |
|
|
|
MobileQrCodeResult & |
|
|
|
MobileLocationResult; |
|
|
|
MobileLocationResult & |
|
|
|
MobileDeviceProvisionResult; |
|
|
|
|
|
|
|
export interface WidgetMobileActionResult<T extends MobileActionResult> { |
|
|
|
result?: T; |
|
|
|
@ -668,6 +676,10 @@ export interface WidgetMobileActionResult<T extends MobileActionResult> { |
|
|
|
hasError: boolean; |
|
|
|
} |
|
|
|
|
|
|
|
export interface ProvisionSuccessDescriptor { |
|
|
|
handleProvisionSuccessFunction: TbFunction; |
|
|
|
} |
|
|
|
|
|
|
|
export interface ProcessImageDescriptor { |
|
|
|
processImageFunction: TbFunction; |
|
|
|
} |
|
|
|
@ -696,7 +708,8 @@ export type WidgetMobileActionDescriptors = ProcessImageDescriptor & |
|
|
|
LaunchMapDescriptor & |
|
|
|
ScanQrCodeDescriptor & |
|
|
|
MakePhoneCallDescriptor & |
|
|
|
GetLocationDescriptor; |
|
|
|
GetLocationDescriptor & |
|
|
|
ProvisionSuccessDescriptor; |
|
|
|
|
|
|
|
export interface WidgetMobileActionDescriptor extends WidgetMobileActionDescriptors { |
|
|
|
type: WidgetMobileActionType; |
|
|
|
|