File

core/common/group.service.ts

Index

Properties
Methods

Constructor

constructor(assetTypesRealtimeService: AssetTypesRealtimeService)
Parameters :
Name Type Optional
assetTypesRealtimeService AssetTypesRealtimeService No

Methods

getAssetPath
getAssetPath(mo: IManagedObject)

Retrieves the path associated with a given managed object.

Parameters :
Name Type Optional Description
mo IManagedObject No

The managed object for which the asset path is to be retrieved.

Returns : AssetPath

The path associated with the managed object's type.

Async getIcon
getIcon(mo: IManagedObject, open, fallbackIcon?: string)

Finds an icon based on the contents of a managed object. It takes into account factors such as type, and specific fragments.

Parameters :
Name Type Optional Default value Description
mo IManagedObject No

Managed object to be checked.

open No false

Determines whether the method should return an alternative icon showing the open state.

fallbackIcon string Yes

If no icon is found, this icon is returned.

Returns : Promise<string>

Returns an icon.

isAnyGroup
isAnyGroup(mo: IManagedObject)

Checks whether the object belongs to any type of group. Types of groups: group, dynamic group, data broker, data broker active.

Parameters :
Name Type Optional Description
mo IManagedObject No

Managed object to be checked.

Returns : boolean

Returns true if the managed object belongs to the group category.

isAsset
isAsset(mo: IManagedObject)

Checks whether a given managed object is an asset.

Parameters :
Name Type Optional Description
mo IManagedObject No

Managed object to be checked.

Returns : boolean

Returns true if the managed object is an asset.

isDataBroker
isDataBroker(mo: IManagedObject)

Checks whether a given managed object is a data broker.

Parameters :
Name Type Optional Description
mo IManagedObject No

Managed object to be checked.

Returns : boolean

Returns true if the managed object is a data broker.

isDataBrokerActive
isDataBrokerActive(mo: IManagedObject)

Checks whether a given managed object is a data broker active.

Parameters :
Name Type Optional Description
mo IManagedObject No

Managed object to be checked.

Returns : boolean

Returns true if the managed object is a data broker active.

isDevice
isDevice(mo: IManagedObject)

Checks whether a given managed object is a device.

Parameters :
Name Type Optional Description
mo IManagedObject No

Managed object to be checked.

Returns : boolean

Returns true if the managed object is a device.

isDynamicGroup
isDynamicGroup(mo: IManagedObject)

Checks whether a given managed object is a dynamic group.

Parameters :
Name Type Optional Description
mo IManagedObject No

Managed object to be checked.

Returns : boolean

Returns true if the managed object is a dynamic group.

isGroup
isGroup(mo: IManagedObject)

Checks whether a given managed object is a group.

Parameters :
Name Type Optional Description
mo IManagedObject No

Managed object to be checked.

Returns : boolean

Returns true if the managed object is a group.

Properties

assetPaths
Type : Map<AssetTypes | AssetPath>
Default value : new Map([ ['group', ASSET_PATH.DEFAULT], ['dynamicGroup', ASSET_PATH.DEFAULT], ['asset', ASSET_PATH.DEFAULT], ['device', ASSET_PATH.DEVICE], ['other', ASSET_PATH.DEVICE] ])

A mapping of managed object types to their corresponding asset path.

dataBrokerSourceFragmentInactive
Default value : `_${GroupFragment.dataBrokerSourceFragment}`
Readonly icons
Type : GroupIcons
Default value : { brokerSourceInactive: { icon: 'c8y-group-remote-inactive', iconOpen: 'c8y-group-remote-inactive' }, brokerSource: { icon: 'c8y-group-remote', iconOpen: 'c8y-group-remote-open' }, group: { icon: 'c8y-group', iconOpen: 'c8y-group-open' }, dynamicGroup: { icon: 'c8y-group-smart', iconOpen: 'c8y-group-smart-open' }, other: { icon: 'exchange', iconClass: 'statusUnknown' } }

results matching ""

    No results matching ""