@iobroker/dm-gui-components 10.0.2 → 10.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceCard.js","sourceRoot":"./src/","sources":["DeviceCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AACnD,OAAO,EACH,KAAK,IAAI,SAAS,EAClB,cAAc,IAAI,WAAW,EAC7B,QAAQ,IAAI,YAAY,EACxB,UAAU,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,GAAG,EACH,MAAM,EACN,MAAM,EACN,aAAa,EACb,aAAa,EACb,WAAW,EACX,GAAG,EACH,UAAU,EACV,KAAK,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,cAAc,EACd,IAAI,EACJ,KAAK,EAKL,IAAI,GACP,MAAM,0BAA0B,CAAC;AAClC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,sBAAsB,MAAM,iBAAiB,CAAC;AACrD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,qBAAqB,MAAM,gBAAgB,CAAC;AACnD,OAAO,UAAU,MAAM,cAAc,CAAC;AAetC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAkC,MAAM,wBAAwB,CAAC;AAE9F,mKAAmK;AACnK,MAAM,OAAO,GAAG;IACZ,6EAA6E;IAC7E,MAAM,EAAE,QAAQ;IAChB,kMAAkM;IAClM,cAAc,EAAE,gBAAgB;IAChC,2JAA2J;IAC3J,MAAM,EAAE,QAAQ;IAChB,kKAAkK;IAClK,OAAO,EAAE,SAAS;CACrB,CAAC;AAEF,MAAM,MAAM,GAAwB;IAChC,SAAS,E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jB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACZ,CACA;gBACN,oBAAC,GAAG,IACA,KAAK,EAAE,MAAM,CAAC,UAAU,EACxB,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;wBACV,KAAK,EAAE,WAAW,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY;wBAChE,QAAQ,EAAE,KAAK;qBAClB,CAAC;oBAEF,oBAAC,QAAQ,OAAG,CACV,CACJ;YACN,6BAAK,KAAK,EAAE,MAAM,CAAC,WAAW,GAAQ;YACtC,6BAAK,KAAK,EAAE,MAAM,CAAC,SAAS;gBACxB,oBAAC,UAAU,IACP,OAAO,EAAC,OAAO,EACf,KAAK,EAAE,MAAM,CAAC,eAAe;oBAE7B;wBACI,oBAAC,QAAQ,OAAG,CACV;oBACN;wBACI,oBAAC,QAAQ,OAAG,CACV;oBACN;wBACI,oBAAC,QAAQ,OAAG,CACV,CACG,CACX,CACF,CACX,CAAC;IACN,CAAC;IAED,kDAAkD;IAClD,kBAAkB,CAAC,KAAe,EAAE,QAAiB;QACjD,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QACrD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC;QAEnD,OAAO;YACH,eAAe;YACf,KAAK;YACL,QAAQ;SACX,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React, { Component, type JSX } from 'react';\nimport {\n Close as CloseIcon,\n VideogameAsset as ControlIcon,\n MoreVert as MoreVertIcon,\n ExpandMore,\n} from '@mui/icons-material';\nimport {\n Box,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Fab,\n IconButton,\n Paper,\n Skeleton,\n Tooltip,\n Typography,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n} from '@mui/material';\n\nimport {\n DeviceTypeIcon,\n I18n,\n Utils,\n type Connection,\n type IobTheme,\n type ThemeName,\n type ThemeType,\n Icon,\n} from '@iobroker/gui-components';\nimport DeviceActionButton from './DeviceActionButton';\nimport DeviceControlComponent from './DeviceControl';\nimport DeviceImageUpload from './DeviceImageUpload';\nimport DeviceStatusComponent from './DeviceStatus';\nimport JsonConfig from './JsonConfig';\nimport type {\n ActionBase,\n ControlBase,\n ControlState,\n DeviceDetails,\n DeviceControl,\n DeviceInfo,\n DeviceId,\n ConfigConnectionType,\n DeviceStatus,\n} from './protocol/api';\n\n/** Device fields that can be used for the text filter */\nexport type DeviceFilterField = 'name' | 'identifier' | 'manufacturer' | 'model';\nimport { getTranslation } from './Utils';\nimport { StateOrObjectHandler, type StateOrObjectSubscription } from './StateOrObjectHandler';\n\n/** Reserved action names (this is copied from https://github.com/ioBroker/dm-utils/blob/main/src/types/base.ts as we can only have type references to dm-utils) */\nconst ACTIONS = {\n /** This action will be called when the user clicks on the connection icon */\n STATUS: 'status',\n /** This action will be called when the user clicks on the enabled / disabled icon. The enabled/disabled icon will be shown only if the node status has the \"enabled\" flag set to false or true */\n ENABLE_DISABLE: 'enable/disable',\n /** This action will be called when the user clicks on the update indicator. The update indicator is shown only if `DeviceInfo.update.available` is true */\n UPDATE: 'update',\n /** This action will be called when the user clicks on the battery indicator. The battery indicator is shown only if the node status has the \"battery\" property */\n BATTERY: 'battery',\n};\n\nconst styles: Record<string, any> = {\n cardStyle: (theme: IobTheme): React.CSSProperties => ({\n width: 300,\n minHeight: 280,\n margin: '10px',\n overflow: 'hidden',\n display: 'flex',\n flexDirection: 'column',\n backgroundColor: theme.palette.mode === 'dark' ? '#0b0b0b' : '#d5d5d5',\n }),\n headerStyle: {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n paddingLeft: 8,\n paddingRight: 8,\n position: 'relative',\n minHeight: 60,\n color: '#000',\n },\n imgAreaStyle: {\n height: 45,\n width: 45,\n justifyContent: 'center',\n display: 'flex',\n alignItems: 'center',\n },\n imgStyle: {\n zIndex: 2,\n maxWidth: '100%',\n maxHeight: '100%',\n color: '#FFF',\n },\n titleStyle: {\n fontSize: 16,\n fontWeight: 'bold',\n // whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n detailsButtonStyle: {\n right: 20,\n bottom: -20,\n position: 'absolute',\n },\n bodyStyle: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n },\n deviceInfoStyle: {\n padding: '20px 16px 0 16px',\n },\n statusStyle: {\n padding: '15px 25px 0 15px',\n height: 41,\n },\n};\n\nfunction NoImageIcon(props: { style?: React.CSSProperties; className?: string }): JSX.Element {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n style={props.style}\n className={props.className}\n >\n <path\n fill=\"currentColor\"\n d=\"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z\"\n />\n </svg>\n );\n}\n\ninterface DeviceCardProps {\n filter?: string;\n /* Device ID */\n id: DeviceId;\n identifierLabel: ioBroker.StringOrTranslated;\n device: DeviceInfo;\n instanceId: string;\n socket: Connection;\n /* Instance, where the images should be uploaded to */\n uploadImagesToInstance?: string;\n deviceHandler: (deviceId: DeviceId, action: ActionBase) => () => void;\n controlHandler: (\n deviceId: DeviceId,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n controlStateHandler: (deviceId: DeviceId, control: ControlBase) => () => Promise<ioBroker.State | null>;\n smallCards?: boolean;\n alive: boolean;\n themeName: ThemeName;\n themeType: ThemeType;\n theme: IobTheme;\n isFloatComma: boolean;\n dateFormat: string;\n /** If true, only devices that have an available update are shown */\n onlyUpdatable?: boolean;\n /** If true, only devices that have a battery problem (empty/low battery) are shown */\n onlyBatteryProblem?: boolean;\n /** Device field the text filter applies to. Default `name` */\n filterField?: DeviceFilterField;\n /** Reports the resolved model value of this device up to the list (used to build the model filter dropdown) */\n onModel?: (deviceId: DeviceId, model: string | undefined) => void;\n}\n\nfunction getText(text: ioBroker.StringOrTranslated | undefined): string | undefined {\n if (typeof text === 'object') {\n return text[I18n.getLanguage()] || text.en;\n }\n\n return text;\n}\n\ninterface DeviceCardState {\n open: boolean;\n details: DeviceDetails | null;\n data: Record<string, any>;\n showControlDialog: boolean;\n\n // values possibly loaded from states/objects\n name?: string;\n identifier?: string;\n hasDetails?: boolean;\n icon?: string;\n backgroundColor?: string;\n color?: string;\n manufacturer?: string;\n model?: string;\n connectionType?: ConfigConnectionType;\n enabled?: boolean;\n updateAvailable?: boolean;\n batteryProblem?: boolean;\n}\n\n/**\n * Device Card Component\n */\nexport default class DeviceCard extends Component<DeviceCardProps, DeviceCardState> {\n private readonly stateOrObjectHandler: StateOrObjectHandler;\n private readonly subscriptions: Map<\n keyof DeviceInfo & keyof DeviceCardState,\n { subscription: StateOrObjectSubscription; transform?: (value: any) => any }\n > = new Map();\n\n /** Separate subscription for the nested `device.update.available` field (used for the update indicator and the \"only updatable\" filter) */\n private updateAvailableSubscription?: StateOrObjectSubscription;\n\n /** Separate subscription for the nested battery status (used for the \"battery problem\" filter) */\n private batteryProblemSubscription?: StateOrObjectSubscription;\n\n constructor(props: DeviceCardProps) {\n super(props);\n\n this.state = {\n open: false,\n details: null,\n data: {},\n showControlDialog: false,\n };\n\n this.stateOrObjectHandler = new StateOrObjectHandler(this.props.socket);\n }\n\n async fetchIcon(): Promise<void> {\n if (!this.props.device.icon) {\n const manufacturer = this.state.manufacturer;\n const model = this.state.model;\n\n // try to load the icon from file storage\n const fileName = `${manufacturer ? `${manufacturer}_` : ''}${model || JSON.stringify(this.props.device.id)}`;\n\n try {\n const file = await this.props.socket.readFile(\n this.props.instanceId.replace('system.adapter.', ''),\n `${fileName}.webp`,\n true,\n );\n if (file) {\n this.setState({ icon: `data:${file.mimeType};base64,${file.file}` });\n } else {\n this.setState({ icon: '' });\n }\n // const response = await fetch(url);\n // if (response.ok) {\n // const blob = await response.blob();\n // const reader = new FileReader();\n // reader.onloadend = () => {\n // setIcon(reader.result);\n // };\n // reader.readAsDataURL(blob);\n // } else {\n // throw new Error('Response not ok');\n // }\n } catch {\n if (this.state.icon) {\n this.setState({ icon: '' });\n }\n }\n }\n }\n\n async componentDidMount(): Promise<void> {\n await this.addStateOrObjectListener('name', getText);\n await this.addStateOrObjectListener('identifier');\n await this.addStateOrObjectListener('hasDetails');\n await this.addStateOrObjectListener('icon');\n await this.addStateOrObjectListener('backgroundColor');\n await this.addStateOrObjectListener('color');\n await this.addStateOrObjectListener('manufacturer', getText);\n await this.addStateOrObjectListener('model', getText);\n await this.addStateOrObjectListener('connectionType');\n await this.addStateOrObjectListener('enabled');\n await this.subscribeUpdateAvailable();\n await this.subscribeBatteryProblem();\n\n await this.fetchIcon().catch(e => console.error(e));\n }\n\n private async subscribeUpdateAvailable(): Promise<void> {\n this.updateAvailableSubscription = await this.stateOrObjectHandler.addListener(\n this.props.device.update?.available,\n value => this.setState({ updateAvailable: !!value }),\n );\n }\n\n /** Extract the battery value (literal or state/object reference) from the device status */\n private getBatteryItem(): Extract<DeviceStatus, object>['battery'] {\n const status = this.props.device.status;\n if (!status || typeof status === 'string') {\n return undefined;\n }\n const list = Array.isArray(status) ? status : [status];\n for (const entry of list) {\n if (typeof entry !== 'string' && entry.battery !== undefined) {\n return entry.battery;\n }\n }\n return undefined;\n }\n\n /** A battery problem is an explicit battery warning (`false`) or a charge level below 30 % */\n private static isBatteryProblem(value: number | boolean | string | undefined): boolean {\n if (value === false) {\n return true;\n }\n return typeof value === 'number' && value < 30;\n }\n\n private async subscribeBatteryProblem(): Promise<void> {\n this.batteryProblemSubscription = await this.stateOrObjectHandler.addListener(this.getBatteryItem(), value =>\n this.setState({ batteryProblem: DeviceCard.isBatteryProblem(value) }),\n );\n }\n\n private async addStateOrObjectListener(\n key: keyof DeviceInfo & keyof DeviceCardState,\n transform?: (value: any) => any,\n ): Promise<void> {\n const sub = await this.stateOrObjectHandler.addListener(this.props.device[key], value =>\n this.setState<typeof key>({ [key]: transform ? transform(value) : value }),\n );\n this.subscriptions.set(key, { subscription: sub, transform });\n }\n\n async componentDidUpdate(prevProps: DeviceCardProps, prevState: DeviceCardState): Promise<void> {\n if (prevState.model !== this.state.model) {\n this.props.onModel?.(this.props.device.id, this.state.model);\n }\n\n for (const [key, { subscription, transform }] of [...this.subscriptions]) {\n const newItem = this.props.device[key];\n const prevItem = prevProps.device[key];\n\n if (newItem !== prevItem) {\n console.log(`${key} of device ${JSON.stringify(this.props.device.id)} updated`, prevItem, newItem);\n this.subscriptions.delete(key);\n await this.addStateOrObjectListener(key, transform);\n await subscription.unsubscribe();\n }\n }\n\n if (this.props.device.update?.available !== prevProps.device.update?.available) {\n await this.updateAvailableSubscription?.unsubscribe();\n await this.subscribeUpdateAvailable();\n }\n\n if (this.props.device.status !== prevProps.device.status) {\n await this.batteryProblemSubscription?.unsubscribe();\n await this.subscribeBatteryProblem();\n }\n }\n\n async componentWillUnmount(): Promise<void> {\n for (const [, { subscription }] of this.subscriptions) {\n await subscription.unsubscribe();\n }\n this.subscriptions.clear();\n await this.updateAvailableSubscription?.unsubscribe();\n await this.batteryProblemSubscription?.unsubscribe();\n this.props.onModel?.(this.props.device.id, undefined);\n }\n\n /**\n * Load the device details\n */\n async loadDetails(): Promise<void> {\n console.log(`Loading device details for`, this.props.device.id, `... from ${this.props.instanceId}`);\n const details: DeviceDetails | null = await this.props.socket.sendTo(\n this.props.instanceId,\n 'dm:deviceDetails',\n this.props.device.id,\n );\n console.log(`Got device details for`, this.props.device.id, details);\n this.setState({ details, data: details?.data || {} });\n }\n\n /**\n * Copy the device ID to the clipboard\n */\n copyToClipboard = (): void => {\n const textToCopy = this.state.identifier;\n if (!textToCopy) {\n return;\n }\n Utils.copyToClipboard(textToCopy);\n alert(`${getTranslation('copied')} ${textToCopy} ${getTranslation('toClipboard')}!`);\n };\n\n renderDialog(): JSX.Element | null {\n if (!this.state.open || !this.state.details) {\n return null;\n }\n\n return (\n <Dialog\n open={!0}\n maxWidth=\"md\"\n onClose={() => this.setState({ open: false })}\n >\n <DialogContent>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.state.details.schema}\n data={this.state.data}\n onChange={(data: Record<string, any> | null) => data && this.setState({ data })}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </DialogContent>\n <DialogActions>\n <Button\n disabled={!this.props.alive}\n variant=\"contained\"\n color=\"primary\"\n onClick={() => this.setState({ open: false })}\n autoFocus\n >\n {getTranslation('closeButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderControlItems(\n controls: DeviceControl[],\n allControls: DeviceControl[],\n colors: { primary: string; secondary: string },\n parentGroupId?: string,\n ): JSX.Element[] {\n return controls\n .filter(control => (parentGroupId ? control.group === parentGroupId : !control.group))\n .map(control => {\n if (control.type === 'group') {\n const children = allControls.filter(ctrl => ctrl.group === control.id);\n return (\n <Accordion key={control.id}>\n <AccordionSummary expandIcon={<ExpandMore />}>\n <Typography\n component=\"span\"\n style={{ display: 'flex', gap: 8, color: control.color }}\n >\n {control.icon ? <Icon src={control.icon} /> : null}\n {getTranslation(control.label!)}\n </Typography>\n </AccordionSummary>\n <AccordionDetails style={{ display: 'flex', flexDirection: 'column' }}>\n {this.renderControlItems(children, allControls, colors, control.id)}\n </AccordionDetails>\n </Accordion>\n );\n }\n return (\n <DeviceControlComponent\n disabled={false}\n key={control.id}\n control={control}\n socket={this.props.socket}\n colors={colors}\n deviceId={this.props.device.id}\n controlHandler={this.props.controlHandler}\n controlStateHandler={this.props.controlStateHandler}\n />\n );\n });\n }\n\n renderControlDialog(): JSX.Element | null {\n if (!this.state.showControlDialog || !this.props.alive) {\n return null;\n }\n const colors = { primary: '#111', secondary: '#888' };\n const allControls = this.props.device.controls || [];\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showControlDialog: false })}\n >\n <DialogTitle style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>\n {this.state.name}\n <IconButton onClick={() => this.setState({ showControlDialog: false })}>\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent style={{ display: 'flex', flexDirection: 'column' }}>\n {this.renderControlItems(allControls, allControls, colors)}\n </DialogContent>\n </Dialog>\n );\n }\n\n renderControls(): JSX.Element | null {\n const colors = { primary: '#111', secondary: '#888' };\n const firstControl = this.props.device.controls?.[0];\n if (\n this.props.device.controls?.length === 1 &&\n firstControl &&\n (firstControl.type === 'icon' || firstControl.type === 'switch') &&\n !firstControl.label\n ) {\n // control can be placed in the button icon\n return (\n <DeviceControlComponent\n disabled={!this.props.alive}\n control={firstControl}\n colors={colors}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n controlHandler={this.props.controlHandler}\n controlStateHandler={this.props.controlStateHandler}\n />\n );\n }\n\n if (this.props.device.controls?.length) {\n // place a button and show a control dialog\n return (\n <Fab\n size=\"small\"\n style={{ width: 32, height: 32, minHeight: 32 }}\n disabled={!this.props.alive}\n onClick={() => this.setState({ showControlDialog: true })}\n >\n <ControlIcon />\n </Fab>\n );\n }\n return null;\n }\n\n renderActions(): JSX.Element[] | null {\n const actions = this.props.device.actions?.filter(\n a =>\n a.id !== ACTIONS.STATUS &&\n a.id !== ACTIONS.ENABLE_DISABLE &&\n a.id !== ACTIONS.UPDATE &&\n a.id !== ACTIONS.BATTERY,\n );\n\n return actions?.length\n ? actions.map(a => (\n <DeviceActionButton\n disabled={!this.props.alive}\n key={a.id}\n deviceId={this.props.device.id}\n action={a}\n deviceHandler={this.props.deviceHandler}\n />\n ))\n : null;\n }\n\n renderSmall(): JSX.Element {\n const status = !this.props.device.status\n ? []\n : Array.isArray(this.props.device.status)\n ? this.props.device.status\n : [this.props.device.status];\n\n const icon = this.state.icon ? (\n <DeviceTypeIcon\n src={this.state.icon}\n style={styles.imgStyle}\n />\n ) : (\n <NoImageIcon style={styles.imgStyle} />\n );\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n const title: string = this.state.details?.data?.name || this.props.device.name || '';\n\n return (\n <Paper\n style={{ width: 200, minHeight: 200, margin: 5 }}\n sx={styles.cardStyle}\n key={JSON.stringify(this.props.id)}\n >\n {/* Header */}\n <Box\n sx={headerStyle}\n style={{ ...styles.headerStyle, minHeight: 48 }}\n >\n <div style={{ ...styles.imgAreaStyle, height: 32, width: 32 }}>\n {this.props.uploadImagesToInstance ? (\n <DeviceImageUpload\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceId={this.props.device.id}\n manufacturer={this.state.manufacturer}\n model={this.state.model}\n onImageSelect={(imageData: string): void => {\n if (imageData) {\n this.setState({ icon: imageData });\n }\n }}\n socket={this.props.socket}\n />\n ) : null}\n {icon}\n </div>\n <Box\n style={{ ...styles.titleStyle, fontSize: 14 }}\n title={title.length > 15 ? title : undefined}\n sx={theme => ({ color: headerStyle.color || theme.palette.secondary.contrastText })}\n >\n {this.state.details?.data?.name || this.state.name}\n </Box>\n {this.state.hasDetails ? (\n <Fab\n disabled={!this.props.alive}\n size=\"small\"\n style={styles.detailsButtonStyle}\n onClick={() => {\n if (!this.state.open) {\n this.loadDetails().catch(console.error);\n this.setState({ open: true });\n }\n }}\n color=\"primary\"\n >\n <MoreVertIcon />\n </Fab>\n ) : null}\n </Box>\n {/* Status */}\n <div style={{ ...styles.statusStyle, height: 'auto', padding: '8px 15px 0 15px' }}>\n {status.map((s, i) => (\n <DeviceStatusComponent\n key={i}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n connectionType={this.state.connectionType}\n status={s}\n enabled={this.state.enabled}\n statusAction={this.props.device.actions?.find(a => a.id === ACTIONS.STATUS)}\n disableEnableAction={this.props.device.actions?.find(a => a.id === ACTIONS.ENABLE_DISABLE)}\n update={i === 0 ? this.props.device.update : undefined}\n updateAction={\n i === 0 ? this.props.device.actions?.find(a => a.id === ACTIONS.UPDATE) : undefined\n }\n batteryAction={this.props.device.actions?.find(a => a.id === ACTIONS.BATTERY)}\n deviceHandler={this.props.deviceHandler}\n theme={this.props.theme}\n stateOrObjectHandler={this.stateOrObjectHandler}\n />\n ))}\n </div>\n {/* Body */}\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body2\"\n style={{ ...styles.deviceInfoStyle, padding: '10px 10px 0 10px' }}\n >\n {this.state.identifier ? (\n <div\n onClick={this.copyToClipboard}\n style={{ textOverflow: 'ellipsis', overflow: 'hidden' }}\n >\n <b>{getText(this.props.identifierLabel)}:</b>\n <span style={{ marginLeft: 4 }}>{this.state.identifier}</span>\n </div>\n ) : null}\n {this.state.manufacturer ? (\n <Tooltip\n title={getTranslation('manufacturer')}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <div>{this.state.manufacturer}</div>\n </Tooltip>\n ) : null}\n {this.state.model ? (\n <Tooltip\n title={getTranslation('model')}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <div>{this.state.model}</div>\n </Tooltip>\n ) : null}\n </Typography>\n {this.props.device.customInfo ? (\n <div style={{ padding: '0 10px' }}>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.props.device.customInfo.schema}\n data={this.props.device.customInfo.data || {}}\n onChange={(_data: Record<string, any> | null) => {\n /* ignore */\n }}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </div>\n ) : null}\n {/* Footer */}\n {!!(this.props.device.actions?.length || this.props.device.controls?.length) && (\n <div\n style={{\n marginTop: 'auto',\n display: 'flex',\n gap: 4,\n paddingBottom: 5,\n minHeight: 34,\n paddingLeft: 8,\n paddingRight: 8,\n }}\n >\n {this.renderActions()}\n <div style={{ flexGrow: 1 }} />\n {this.renderControls()}\n </div>\n )}\n </div>\n {this.renderDialog()}\n {this.renderControlDialog()}\n </Paper>\n );\n }\n\n getCardHeaderStyle(theme: IobTheme, maxWidth?: number): React.CSSProperties {\n const backgroundColor =\n this.state.backgroundColor === 'primary'\n ? theme.palette.primary.main\n : this.state.backgroundColor === 'secondary'\n ? theme.palette.secondary.main\n : this.state.backgroundColor || theme.palette.secondary.main;\n\n let color;\n if (this.state.color && this.state.color !== 'primary' && this.state.color !== 'secondary') {\n // Color was directly defined\n color = this.state.color;\n } else if (this.state.color === 'primary') {\n color = theme.palette.primary.main;\n } else if (this.state.color === 'secondary') {\n color = theme.palette.secondary.main;\n } else {\n // Color was not defined\n if (this.state.backgroundColor === 'primary') {\n color = theme.palette.primary.contrastText;\n } else if (this.state.backgroundColor === 'secondary' || !this.state.backgroundColor) {\n color = theme.palette.secondary.contrastText;\n } else {\n color = Utils.invertColor(backgroundColor, true);\n }\n }\n\n return {\n backgroundColor,\n color,\n maxWidth,\n };\n }\n\n renderBig(): JSX.Element {\n const status = !this.props.device.status\n ? []\n : Array.isArray(this.props.device.status)\n ? this.props.device.status\n : [this.props.device.status];\n\n const icon = this.state.icon ? (\n <DeviceTypeIcon\n src={this.state.icon}\n style={styles.imgStyle}\n />\n ) : (\n <NoImageIcon style={styles.imgStyle} />\n );\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n const title: string = this.state.details?.data?.name || this.props.device.name || '';\n\n return (\n <Paper\n sx={styles.cardStyle}\n key={JSON.stringify(this.props.id)}\n >\n {/* Header */}\n <Box\n sx={headerStyle}\n style={styles.headerStyle}\n >\n <div style={styles.imgAreaStyle}>\n {this.props.uploadImagesToInstance ? (\n <DeviceImageUpload\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceId={this.props.device.id}\n manufacturer={this.state.manufacturer}\n model={this.state.model}\n onImageSelect={(imageData: string): void => {\n if (imageData) {\n this.setState({ icon: imageData });\n }\n }}\n socket={this.props.socket}\n />\n ) : null}\n {icon}\n </div>\n <Box\n style={styles.titleStyle}\n title={title.length > 20 ? title : undefined}\n sx={theme => ({ color: headerStyle.color || theme.palette.secondary.contrastText })}\n >\n {this.state.details?.data?.name || this.state.name}\n </Box>\n {this.state.hasDetails ? (\n <Fab\n disabled={!this.props.alive}\n size=\"small\"\n style={styles.detailsButtonStyle}\n onClick={() => {\n if (!this.state.open) {\n this.loadDetails().catch(console.error);\n this.setState({ open: true });\n }\n }}\n color=\"primary\"\n >\n <MoreVertIcon />\n </Fab>\n ) : null}\n </Box>\n {/* Body */}\n <div style={styles.statusStyle}>\n {status.map((s, i) => (\n <DeviceStatusComponent\n key={i}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n connectionType={this.state.connectionType}\n status={s}\n enabled={this.state.enabled}\n statusAction={this.props.device.actions?.find(a => a.id === ACTIONS.STATUS)}\n disableEnableAction={this.props.device.actions?.find(a => a.id === ACTIONS.ENABLE_DISABLE)}\n update={i === 0 ? this.props.device.update : undefined}\n updateAction={\n i === 0 ? this.props.device.actions?.find(a => a.id === ACTIONS.UPDATE) : undefined\n }\n batteryAction={this.props.device.actions?.find(a => a.id === ACTIONS.BATTERY)}\n deviceHandler={this.props.deviceHandler}\n theme={this.props.theme}\n stateOrObjectHandler={this.stateOrObjectHandler}\n />\n ))}\n </div>\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body1\"\n style={styles.deviceInfoStyle}\n >\n {this.state.identifier ? (\n <div onClick={this.copyToClipboard}>\n <b style={{ marginRight: 4 }}>{getText(this.props.identifierLabel)}:</b>\n {this.state.identifier}\n </div>\n ) : null}\n {this.state.manufacturer ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('manufacturer')}:</b>\n {this.state.manufacturer}\n </div>\n ) : null}\n {this.state.model ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('model')}:</b>\n {this.state.model}\n </div>\n ) : null}\n </Typography>\n {this.props.device.customInfo ? (\n <div style={{ padding: '0 16px' }}>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.props.device.customInfo.schema}\n data={this.props.device.customInfo.data || {}}\n onChange={(_data: Record<string, any> | null) => {\n /* ignore */\n }}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </div>\n ) : null}\n {/* Footer */}\n {!!(this.props.device.actions?.length || this.props.device.controls?.length) && (\n <div\n style={{\n marginTop: 'auto',\n display: 'flex',\n gap: 8,\n paddingBottom: 5,\n minHeight: 34,\n paddingLeft: 10,\n paddingRight: 10,\n }}\n >\n {this.renderActions()}\n <div style={{ flexGrow: 1 }} />\n {this.renderControls()}\n </div>\n )}\n </div>\n {this.renderDialog()}\n {this.renderControlDialog()}\n </Paper>\n );\n }\n\n render(): JSX.Element {\n if (this.props.filter) {\n const field = this.props.filterField ?? 'name';\n const value = String(this.state[field] ?? '').toLowerCase();\n if (!value.includes(this.props.filter.toLowerCase())) {\n return <></>;\n }\n }\n\n if (this.props.onlyUpdatable && !this.state.updateAvailable) {\n return <></>;\n }\n\n if (this.props.onlyBatteryProblem && !this.state.batteryProblem) {\n return <></>;\n }\n\n if (this.props.smallCards) {\n return this.renderSmall();\n }\n\n return this.renderBig();\n }\n}\n\ntype DeviceCardSkeletonProps = Pick<DeviceCardProps, 'smallCards' | 'theme'>;\n\nexport class DeviceCardSkeleton extends Component<DeviceCardSkeletonProps> {\n render(): JSX.Element {\n if (this.props.smallCards) {\n return this.renderSmall();\n }\n\n return this.renderBig();\n }\n\n renderSmall(): JSX.Element {\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n return (\n <Paper\n sx={styles.cardStyle}\n style={{ width: 200, minHeight: 200, margin: 5 }}\n >\n <Box\n sx={headerStyle}\n style={{ ...styles.headerStyle, minHeight: 48 }}\n >\n <div style={{ ...styles.imgAreaStyle, height: 32, width: 32 }}>\n <Skeleton\n variant=\"rounded\"\n width={24}\n height={24}\n />\n </div>\n <Box\n style={{ ...styles.titleStyle, fontSize: 14, minWidth: '50%' }}\n sx={theme => ({\n color: headerStyle.color || theme.palette.secondary.contrastText,\n })}\n >\n <Skeleton />\n </Box>\n </Box>\n <div style={{ ...styles.statusStyle, height: 'auto', padding: '8px 15px 0 15px' }} />\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body2\"\n style={{ ...styles.deviceInfoStyle, padding: '10px 10px 0 10px' }}\n >\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n </Typography>\n </div>\n </Paper>\n );\n }\n\n renderBig(): JSX.Element {\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n return (\n <Paper sx={styles.cardStyle}>\n <Box\n sx={headerStyle}\n style={styles.headerStyle}\n >\n <div style={styles.imgAreaStyle}>\n <Skeleton\n variant=\"rounded\"\n width={24}\n height={24}\n />\n </div>\n <Box\n style={styles.titleStyle}\n sx={theme => ({\n color: headerStyle.color || theme.palette.secondary.contrastText,\n minWidth: '50%',\n })}\n >\n <Skeleton />\n </Box>\n </Box>\n <div style={styles.statusStyle}></div>\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body1\"\n style={styles.deviceInfoStyle}\n >\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n </Typography>\n </div>\n </Paper>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n getCardHeaderStyle(theme: IobTheme, maxWidth?: number): React.CSSProperties {\n const backgroundColor = theme.palette.secondary.main;\n const color = theme.palette.secondary.contrastText;\n\n return {\n backgroundColor,\n color,\n maxWidth,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"DeviceCard.js","sourceRoot":"./src/","sources":["DeviceCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AACnD,OAAO,EACH,KAAK,IAAI,SAAS,EAClB,cAAc,IAAI,WAAW,EAC7B,QAAQ,IA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jD,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QACrD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC;QAEnD,OAAO;YACH,eAAe;YACf,KAAK;YACL,QAAQ;SACX,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React, { Component, type JSX } from 'react';\nimport {\n Close as CloseIcon,\n VideogameAsset as ControlIcon,\n MoreVert as MoreVertIcon,\n ExpandMore,\n} from '@mui/icons-material';\nimport {\n Box,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Fab,\n IconButton,\n Paper,\n Skeleton,\n Tooltip,\n Typography,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n} from '@mui/material';\n\nimport {\n DeviceTypeIcon,\n I18n,\n Utils,\n type Connection,\n type IobTheme,\n type ThemeName,\n type ThemeType,\n Icon,\n} from '@iobroker/gui-components';\nimport DeviceActionButton from './DeviceActionButton';\nimport DeviceControlComponent from './DeviceControl';\nimport DeviceImageUpload from './DeviceImageUpload';\nimport DeviceStatusComponent from './DeviceStatus';\nimport JsonConfig from './JsonConfig';\nimport { StatusIndicators } from './StatusIndicator';\nimport type {\n ActionBase,\n ControlBase,\n ControlState,\n DeviceDetails,\n DeviceAction,\n DeviceControl,\n DeviceInfo,\n DeviceId,\n ConfigConnectionType,\n DeviceStatus,\n} from './protocol/api';\n\n/** Device fields that can be used for the text filter */\nexport type DeviceFilterField = 'name' | 'identifier' | 'manufacturer' | 'model';\nimport { getTranslation } from './Utils';\nimport { StateOrObjectHandler, type StateOrObjectSubscription } from './StateOrObjectHandler';\n\n/** Reserved action names (this is copied from https://github.com/ioBroker/dm-utils/blob/main/src/types/base.ts as we can only have type references to dm-utils) */\nconst ACTIONS = {\n /** This action will be called when the user clicks on the connection icon */\n STATUS: 'status',\n /** This action will be called when the user clicks on the enabled / disabled icon. The enabled/disabled icon will be shown only if the node status has the \"enabled\" flag set to false or true */\n ENABLE_DISABLE: 'enable/disable',\n /** This action will be called when the user clicks on the update indicator. The update indicator is shown only if `DeviceInfo.update.available` is true */\n UPDATE: 'update',\n /** This action will be called when the user clicks on the battery indicator. The battery indicator is shown only if the node status has the \"battery\" property */\n BATTERY: 'battery',\n};\n\nconst styles: Record<string, any> = {\n cardStyle: (theme: IobTheme): React.CSSProperties => ({\n width: 300,\n minHeight: 280,\n margin: '10px',\n overflow: 'hidden',\n display: 'flex',\n flexDirection: 'column',\n backgroundColor: theme.palette.mode === 'dark' ? '#0b0b0b' : '#d5d5d5',\n }),\n headerStyle: {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n paddingLeft: 8,\n paddingRight: 8,\n position: 'relative',\n minHeight: 60,\n color: '#000',\n },\n imgAreaStyle: {\n height: 45,\n width: 45,\n justifyContent: 'center',\n display: 'flex',\n alignItems: 'center',\n },\n imgStyle: {\n zIndex: 2,\n maxWidth: '100%',\n maxHeight: '100%',\n color: '#FFF',\n },\n titleStyle: {\n fontSize: 16,\n fontWeight: 'bold',\n // whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n detailsButtonStyle: {\n right: 20,\n bottom: -20,\n position: 'absolute',\n },\n bodyStyle: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n },\n deviceInfoStyle: {\n padding: '20px 16px 0 16px',\n },\n statusStyle: {\n padding: '15px 25px 0 15px',\n // The line may grow if the device provides custom indicators, so only the minimum is fixed\n minHeight: 41,\n },\n};\n\nfunction NoImageIcon(props: { style?: React.CSSProperties; className?: string }): JSX.Element {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n style={props.style}\n className={props.className}\n >\n <path\n fill=\"currentColor\"\n d=\"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z\"\n />\n </svg>\n );\n}\n\ninterface DeviceCardProps {\n filter?: string;\n /* Device ID */\n id: DeviceId;\n identifierLabel: ioBroker.StringOrTranslated;\n device: DeviceInfo;\n instanceId: string;\n socket: Connection;\n /* Instance, where the images should be uploaded to */\n uploadImagesToInstance?: string;\n deviceHandler: (deviceId: DeviceId, action: ActionBase) => () => void;\n controlHandler: (\n deviceId: DeviceId,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n controlStateHandler: (deviceId: DeviceId, control: ControlBase) => () => Promise<ioBroker.State | null>;\n smallCards?: boolean;\n alive: boolean;\n themeName: ThemeName;\n themeType: ThemeType;\n theme: IobTheme;\n isFloatComma: boolean;\n dateFormat: string;\n /** If true, only devices that have an available update are shown */\n onlyUpdatable?: boolean;\n /** If true, only devices that have a battery problem (empty/low battery) are shown */\n onlyBatteryProblem?: boolean;\n /** Device field the text filter applies to. Default `name` */\n filterField?: DeviceFilterField;\n /** IDs of configurable indicators the user has switched off */\n hiddenIndicators?: string[];\n /** Reports the resolved model value of this device up to the list (used to build the model filter dropdown) */\n onModel?: (deviceId: DeviceId, model: string | undefined) => void;\n}\n\nfunction getText(text: ioBroker.StringOrTranslated | undefined): string | undefined {\n if (typeof text === 'object') {\n return text[I18n.getLanguage()] || text.en;\n }\n\n return text;\n}\n\ninterface DeviceCardState {\n open: boolean;\n details: DeviceDetails | null;\n data: Record<string, any>;\n showControlDialog: boolean;\n\n // values possibly loaded from states/objects\n name?: string;\n identifier?: string;\n hasDetails?: boolean;\n icon?: string;\n backgroundColor?: string;\n color?: string;\n manufacturer?: string;\n model?: string;\n connectionType?: ConfigConnectionType;\n enabled?: boolean;\n updateAvailable?: boolean;\n batteryProblem?: boolean;\n}\n\n/**\n * Device Card Component\n */\nexport default class DeviceCard extends Component<DeviceCardProps, DeviceCardState> {\n private readonly stateOrObjectHandler: StateOrObjectHandler;\n private readonly subscriptions: Map<\n keyof DeviceInfo & keyof DeviceCardState,\n { subscription: StateOrObjectSubscription; transform?: (value: any) => any }\n > = new Map();\n\n /** Separate subscription for the nested `device.update.available` field (used for the update indicator and the \"only updatable\" filter) */\n private updateAvailableSubscription?: StateOrObjectSubscription;\n\n /** Separate subscription for the nested battery status (used for the \"battery problem\" filter) */\n private batteryProblemSubscription?: StateOrObjectSubscription;\n\n constructor(props: DeviceCardProps) {\n super(props);\n\n this.state = {\n open: false,\n details: null,\n data: {},\n showControlDialog: false,\n };\n\n this.stateOrObjectHandler = new StateOrObjectHandler(this.props.socket);\n }\n\n async fetchIcon(): Promise<void> {\n if (!this.props.device.icon) {\n const manufacturer = this.state.manufacturer;\n const model = this.state.model;\n\n // try to load the icon from file storage\n const fileName = `${manufacturer ? `${manufacturer}_` : ''}${model || JSON.stringify(this.props.device.id)}`;\n\n try {\n const file = await this.props.socket.readFile(\n this.props.instanceId.replace('system.adapter.', ''),\n `${fileName}.webp`,\n true,\n );\n if (file) {\n this.setState({ icon: `data:${file.mimeType};base64,${file.file}` });\n } else {\n this.setState({ icon: '' });\n }\n // const response = await fetch(url);\n // if (response.ok) {\n // const blob = await response.blob();\n // const reader = new FileReader();\n // reader.onloadend = () => {\n // setIcon(reader.result);\n // };\n // reader.readAsDataURL(blob);\n // } else {\n // throw new Error('Response not ok');\n // }\n } catch {\n if (this.state.icon) {\n this.setState({ icon: '' });\n }\n }\n }\n }\n\n async componentDidMount(): Promise<void> {\n await this.addStateOrObjectListener('name', getText);\n await this.addStateOrObjectListener('identifier');\n await this.addStateOrObjectListener('hasDetails');\n await this.addStateOrObjectListener('icon');\n await this.addStateOrObjectListener('backgroundColor');\n await this.addStateOrObjectListener('color');\n await this.addStateOrObjectListener('manufacturer', getText);\n await this.addStateOrObjectListener('model', getText);\n await this.addStateOrObjectListener('connectionType');\n await this.addStateOrObjectListener('enabled');\n await this.subscribeUpdateAvailable();\n await this.subscribeBatteryProblem();\n\n await this.fetchIcon().catch(e => console.error(e));\n }\n\n private async subscribeUpdateAvailable(): Promise<void> {\n this.updateAvailableSubscription = await this.stateOrObjectHandler.addListener(\n this.props.device.update?.available,\n value => this.setState({ updateAvailable: !!value }),\n );\n }\n\n /** Extract the battery value (literal or state/object reference) from the device status */\n private getBatteryItem(): Extract<DeviceStatus, object>['battery'] {\n const status = this.props.device.status;\n if (!status || typeof status === 'string') {\n return undefined;\n }\n const list = Array.isArray(status) ? status : [status];\n for (const entry of list) {\n if (typeof entry !== 'string' && entry.battery !== undefined) {\n return entry.battery;\n }\n }\n return undefined;\n }\n\n /** A battery problem is an explicit battery warning (`false`) or a charge level below 30 % */\n private static isBatteryProblem(value: number | boolean | string | undefined): boolean {\n if (value === false) {\n return true;\n }\n return typeof value === 'number' && value < 30;\n }\n\n private async subscribeBatteryProblem(): Promise<void> {\n this.batteryProblemSubscription = await this.stateOrObjectHandler.addListener(this.getBatteryItem(), value =>\n this.setState({ batteryProblem: DeviceCard.isBatteryProblem(value) }),\n );\n }\n\n private async addStateOrObjectListener(\n key: keyof DeviceInfo & keyof DeviceCardState,\n transform?: (value: any) => any,\n ): Promise<void> {\n const sub = await this.stateOrObjectHandler.addListener(this.props.device[key], value =>\n this.setState<typeof key>({ [key]: transform ? transform(value) : value }),\n );\n this.subscriptions.set(key, { subscription: sub, transform });\n }\n\n async componentDidUpdate(prevProps: DeviceCardProps, prevState: DeviceCardState): Promise<void> {\n if (prevState.model !== this.state.model) {\n this.props.onModel?.(this.props.device.id, this.state.model);\n }\n\n for (const [key, { subscription, transform }] of [...this.subscriptions]) {\n const newItem = this.props.device[key];\n const prevItem = prevProps.device[key];\n\n if (newItem !== prevItem) {\n console.log(`${key} of device ${JSON.stringify(this.props.device.id)} updated`, prevItem, newItem);\n this.subscriptions.delete(key);\n await this.addStateOrObjectListener(key, transform);\n await subscription.unsubscribe();\n }\n }\n\n if (this.props.device.update?.available !== prevProps.device.update?.available) {\n await this.updateAvailableSubscription?.unsubscribe();\n await this.subscribeUpdateAvailable();\n }\n\n if (this.props.device.status !== prevProps.device.status) {\n await this.batteryProblemSubscription?.unsubscribe();\n await this.subscribeBatteryProblem();\n }\n }\n\n async componentWillUnmount(): Promise<void> {\n for (const [, { subscription }] of this.subscriptions) {\n await subscription.unsubscribe();\n }\n this.subscriptions.clear();\n await this.updateAvailableSubscription?.unsubscribe();\n await this.batteryProblemSubscription?.unsubscribe();\n this.props.onModel?.(this.props.device.id, undefined);\n }\n\n /**\n * Load the device details\n */\n async loadDetails(): Promise<void> {\n console.log(`Loading device details for`, this.props.device.id, `... from ${this.props.instanceId}`);\n const details: DeviceDetails | null = await this.props.socket.sendTo(\n this.props.instanceId,\n 'dm:deviceDetails',\n this.props.device.id,\n );\n console.log(`Got device details for`, this.props.device.id, details);\n this.setState({ details, data: details?.data || {} });\n }\n\n /**\n * Copy the device ID to the clipboard\n */\n copyToClipboard = (): void => {\n const textToCopy = this.state.identifier;\n if (!textToCopy) {\n return;\n }\n Utils.copyToClipboard(textToCopy);\n alert(`${getTranslation('copied')} ${textToCopy} ${getTranslation('toClipboard')}!`);\n };\n\n renderDialog(): JSX.Element | null {\n if (!this.state.open || !this.state.details) {\n return null;\n }\n\n return (\n <Dialog\n open={!0}\n maxWidth=\"md\"\n onClose={() => this.setState({ open: false })}\n >\n <DialogContent>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.state.details.schema}\n data={this.state.data}\n onChange={(data: Record<string, any> | null) => data && this.setState({ data })}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </DialogContent>\n <DialogActions>\n <Button\n disabled={!this.props.alive}\n variant=\"contained\"\n color=\"primary\"\n onClick={() => this.setState({ open: false })}\n autoFocus\n >\n {getTranslation('closeButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderControlItems(\n controls: DeviceControl[],\n allControls: DeviceControl[],\n colors: { primary: string; secondary: string },\n parentGroupId?: string,\n ): JSX.Element[] {\n return controls\n .filter(control => (parentGroupId ? control.group === parentGroupId : !control.group))\n .map(control => {\n if (control.type === 'group') {\n const children = allControls.filter(ctrl => ctrl.group === control.id);\n return (\n <Accordion key={control.id}>\n <AccordionSummary expandIcon={<ExpandMore />}>\n <Typography\n component=\"span\"\n style={{ display: 'flex', gap: 8, color: control.color }}\n >\n {control.icon ? <Icon src={control.icon} /> : null}\n {getTranslation(control.label!)}\n </Typography>\n </AccordionSummary>\n <AccordionDetails style={{ display: 'flex', flexDirection: 'column' }}>\n {this.renderControlItems(children, allControls, colors, control.id)}\n </AccordionDetails>\n </Accordion>\n );\n }\n return (\n <DeviceControlComponent\n disabled={false}\n key={control.id}\n control={control}\n socket={this.props.socket}\n colors={colors}\n deviceId={this.props.device.id}\n controlHandler={this.props.controlHandler}\n controlStateHandler={this.props.controlStateHandler}\n />\n );\n });\n }\n\n renderControlDialog(): JSX.Element | null {\n if (!this.state.showControlDialog || !this.props.alive) {\n return null;\n }\n const colors = { primary: '#111', secondary: '#888' };\n const allControls = this.props.device.controls || [];\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showControlDialog: false })}\n >\n <DialogTitle style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>\n {this.state.name}\n <IconButton onClick={() => this.setState({ showControlDialog: false })}>\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent style={{ display: 'flex', flexDirection: 'column' }}>\n {this.renderControlItems(allControls, allControls, colors)}\n </DialogContent>\n </Dialog>\n );\n }\n\n renderControls(): JSX.Element | null {\n const colors = { primary: '#111', secondary: '#888' };\n const firstControl = this.props.device.controls?.[0];\n if (\n this.props.device.controls?.length === 1 &&\n firstControl &&\n (firstControl.type === 'icon' || firstControl.type === 'switch') &&\n !firstControl.label\n ) {\n // control can be placed in the button icon\n return (\n <DeviceControlComponent\n disabled={!this.props.alive}\n control={firstControl}\n colors={colors}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n controlHandler={this.props.controlHandler}\n controlStateHandler={this.props.controlStateHandler}\n />\n );\n }\n\n if (this.props.device.controls?.length) {\n // place a button and show a control dialog\n return (\n <Fab\n size=\"small\"\n style={{ width: 32, height: 32, minHeight: 32 }}\n disabled={!this.props.alive}\n onClick={() => this.setState({ showControlDialog: true })}\n >\n <ControlIcon />\n </Fab>\n );\n }\n return null;\n }\n\n /**\n * IDs of all actions that are not rendered as a normal button in the footer, because they\n * already have their place in the status line: the reserved actions, the actions with\n * `placement: 'status'` and the actions referenced by a custom indicator.\n */\n private getStatusActionIds(): Set<string> {\n const ids = new Set<string>([ACTIONS.STATUS, ACTIONS.ENABLE_DISABLE, ACTIONS.UPDATE, ACTIONS.BATTERY]);\n\n for (const indicator of this.props.device.indicators || []) {\n if (indicator.actionId) {\n ids.add(indicator.actionId);\n }\n }\n for (const action of this.props.device.actions || []) {\n if (action.placement === 'status') {\n ids.add(action.id);\n }\n }\n\n return ids;\n }\n\n /** True if at least one action is left for the button row at the bottom of the card */\n private hasFooterActions(): boolean {\n const statusActionIds = this.getStatusActionIds();\n return !!this.props.device.actions?.some(action => !statusActionIds.has(action.id));\n }\n\n /** Resolve how a custom indicator behaves on click by looking up the referenced action */\n private resolveIndicatorAction = (\n actionId: string,\n ): { onClick?: () => void; url?: string; disabled?: boolean } | undefined => {\n const action = this.props.device.actions?.find(a => a.id === actionId);\n if (!action) {\n console.warn(\n `Indicator of device ${JSON.stringify(this.props.device.id)} references the unknown action \"${actionId}\"`,\n );\n return undefined;\n }\n\n if ('url' in action && action.url) {\n return { url: getTranslation(action.url), disabled: action.disabled };\n }\n\n return {\n onClick: this.props.deviceHandler(this.props.device.id, action),\n disabled: action.disabled,\n };\n };\n\n /** Custom indicators and the actions that requested to be shown in the status line */\n renderIndicators(small?: boolean): JSX.Element | null {\n const reserved: string[] = [ACTIONS.STATUS, ACTIONS.ENABLE_DISABLE, ACTIONS.UPDATE, ACTIONS.BATTERY];\n const statusActions: DeviceAction[] =\n this.props.device.actions?.filter(a => a.placement === 'status' && !reserved.includes(a.id)) || [];\n\n // An indicator switched off by the user is not shown at all. An action referenced by it stays\n // out of the footer too, as hiding the indicator was an explicit decision of the user.\n const indicators = this.props.hiddenIndicators?.length\n ? this.props.device.indicators?.filter(indicator => !this.props.hiddenIndicators!.includes(indicator.id))\n : this.props.device.indicators;\n\n if (!indicators?.length && !statusActions.length) {\n return null;\n }\n\n return (\n <StatusIndicators\n indicators={indicators}\n theme={this.props.theme}\n stateOrObjectHandler={this.stateOrObjectHandler}\n disabled={!this.props.alive}\n resolveAction={this.resolveIndicatorAction}\n style={{ marginTop: small ? 2 : 4 }}\n >\n {statusActions.map(action => (\n <DeviceActionButton\n disabled={!this.props.alive}\n key={action.id}\n deviceId={this.props.device.id}\n action={action}\n deviceHandler={this.props.deviceHandler}\n />\n ))}\n </StatusIndicators>\n );\n }\n\n renderActions(): JSX.Element[] | null {\n const statusActionIds = this.getStatusActionIds();\n const actions = this.props.device.actions?.filter(a => !statusActionIds.has(a.id));\n\n return actions?.length\n ? actions.map(a => (\n <DeviceActionButton\n disabled={!this.props.alive}\n key={a.id}\n deviceId={this.props.device.id}\n action={a}\n deviceHandler={this.props.deviceHandler}\n />\n ))\n : null;\n }\n\n renderSmall(): JSX.Element {\n const status = !this.props.device.status\n ? []\n : Array.isArray(this.props.device.status)\n ? this.props.device.status\n : [this.props.device.status];\n\n const icon = this.state.icon ? (\n <DeviceTypeIcon\n src={this.state.icon}\n style={styles.imgStyle}\n />\n ) : (\n <NoImageIcon style={styles.imgStyle} />\n );\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n const title: string = this.state.details?.data?.name || this.props.device.name || '';\n\n return (\n <Paper\n style={{ width: 200, minHeight: 200, margin: 5 }}\n sx={styles.cardStyle}\n key={JSON.stringify(this.props.id)}\n >\n {/* Header */}\n <Box\n sx={headerStyle}\n style={{ ...styles.headerStyle, minHeight: 48 }}\n >\n <div style={{ ...styles.imgAreaStyle, height: 32, width: 32 }}>\n {this.props.uploadImagesToInstance ? (\n <DeviceImageUpload\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceId={this.props.device.id}\n manufacturer={this.state.manufacturer}\n model={this.state.model}\n onImageSelect={(imageData: string): void => {\n if (imageData) {\n this.setState({ icon: imageData });\n }\n }}\n socket={this.props.socket}\n />\n ) : null}\n {icon}\n </div>\n <Box\n style={{ ...styles.titleStyle, fontSize: 14 }}\n title={title.length > 15 ? title : undefined}\n sx={theme => ({ color: headerStyle.color || theme.palette.secondary.contrastText })}\n >\n {this.state.details?.data?.name || this.state.name}\n </Box>\n {this.state.hasDetails ? (\n <Fab\n disabled={!this.props.alive}\n size=\"small\"\n style={styles.detailsButtonStyle}\n onClick={() => {\n if (!this.state.open) {\n this.loadDetails().catch(console.error);\n this.setState({ open: true });\n }\n }}\n color=\"primary\"\n >\n <MoreVertIcon />\n </Fab>\n ) : null}\n </Box>\n {/* Status */}\n <div style={{ ...styles.statusStyle, height: 'auto', padding: '8px 15px 0 15px' }}>\n {status.map((s, i) => (\n <DeviceStatusComponent\n key={i}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n connectionType={this.state.connectionType}\n status={s}\n enabled={this.state.enabled}\n statusAction={this.props.device.actions?.find(a => a.id === ACTIONS.STATUS)}\n disableEnableAction={this.props.device.actions?.find(a => a.id === ACTIONS.ENABLE_DISABLE)}\n update={i === 0 ? this.props.device.update : undefined}\n updateAction={\n i === 0 ? this.props.device.actions?.find(a => a.id === ACTIONS.UPDATE) : undefined\n }\n batteryAction={this.props.device.actions?.find(a => a.id === ACTIONS.BATTERY)}\n deviceHandler={this.props.deviceHandler}\n theme={this.props.theme}\n stateOrObjectHandler={this.stateOrObjectHandler}\n />\n ))}\n {this.renderIndicators(true)}\n </div>\n {/* Body */}\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body2\"\n style={{ ...styles.deviceInfoStyle, padding: '10px 10px 0 10px' }}\n >\n {this.state.identifier ? (\n <div\n onClick={this.copyToClipboard}\n style={{ textOverflow: 'ellipsis', overflow: 'hidden' }}\n >\n <b>{getText(this.props.identifierLabel)}:</b>\n <span style={{ marginLeft: 4 }}>{this.state.identifier}</span>\n </div>\n ) : null}\n {this.state.manufacturer ? (\n <Tooltip\n title={getTranslation('manufacturer')}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <div>{this.state.manufacturer}</div>\n </Tooltip>\n ) : null}\n {this.state.model ? (\n <Tooltip\n title={getTranslation('model')}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <div>{this.state.model}</div>\n </Tooltip>\n ) : null}\n </Typography>\n {this.props.device.customInfo ? (\n <div style={{ padding: '0 10px' }}>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.props.device.customInfo.schema}\n data={this.props.device.customInfo.data || {}}\n onChange={(_data: Record<string, any> | null) => {\n /* ignore */\n }}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </div>\n ) : null}\n {/* Footer */}\n {!!(this.hasFooterActions() || this.props.device.controls?.length) && (\n <div\n style={{\n marginTop: 'auto',\n display: 'flex',\n gap: 4,\n paddingBottom: 5,\n minHeight: 34,\n paddingLeft: 8,\n paddingRight: 8,\n }}\n >\n {this.renderActions()}\n <div style={{ flexGrow: 1 }} />\n {this.renderControls()}\n </div>\n )}\n </div>\n {this.renderDialog()}\n {this.renderControlDialog()}\n </Paper>\n );\n }\n\n getCardHeaderStyle(theme: IobTheme, maxWidth?: number): React.CSSProperties {\n const backgroundColor =\n this.state.backgroundColor === 'primary'\n ? theme.palette.primary.main\n : this.state.backgroundColor === 'secondary'\n ? theme.palette.secondary.main\n : this.state.backgroundColor || theme.palette.secondary.main;\n\n let color;\n if (this.state.color && this.state.color !== 'primary' && this.state.color !== 'secondary') {\n // Color was directly defined\n color = this.state.color;\n } else if (this.state.color === 'primary') {\n color = theme.palette.primary.main;\n } else if (this.state.color === 'secondary') {\n color = theme.palette.secondary.main;\n } else {\n // Color was not defined\n if (this.state.backgroundColor === 'primary') {\n color = theme.palette.primary.contrastText;\n } else if (this.state.backgroundColor === 'secondary' || !this.state.backgroundColor) {\n color = theme.palette.secondary.contrastText;\n } else {\n color = Utils.invertColor(backgroundColor, true);\n }\n }\n\n return {\n backgroundColor,\n color,\n maxWidth,\n };\n }\n\n renderBig(): JSX.Element {\n const status = !this.props.device.status\n ? []\n : Array.isArray(this.props.device.status)\n ? this.props.device.status\n : [this.props.device.status];\n\n const icon = this.state.icon ? (\n <DeviceTypeIcon\n src={this.state.icon}\n style={styles.imgStyle}\n />\n ) : (\n <NoImageIcon style={styles.imgStyle} />\n );\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n const title: string = this.state.details?.data?.name || this.props.device.name || '';\n\n return (\n <Paper\n sx={styles.cardStyle}\n key={JSON.stringify(this.props.id)}\n >\n {/* Header */}\n <Box\n sx={headerStyle}\n style={styles.headerStyle}\n >\n <div style={styles.imgAreaStyle}>\n {this.props.uploadImagesToInstance ? (\n <DeviceImageUpload\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceId={this.props.device.id}\n manufacturer={this.state.manufacturer}\n model={this.state.model}\n onImageSelect={(imageData: string): void => {\n if (imageData) {\n this.setState({ icon: imageData });\n }\n }}\n socket={this.props.socket}\n />\n ) : null}\n {icon}\n </div>\n <Box\n style={styles.titleStyle}\n title={title.length > 20 ? title : undefined}\n sx={theme => ({ color: headerStyle.color || theme.palette.secondary.contrastText })}\n >\n {this.state.details?.data?.name || this.state.name}\n </Box>\n {this.state.hasDetails ? (\n <Fab\n disabled={!this.props.alive}\n size=\"small\"\n style={styles.detailsButtonStyle}\n onClick={() => {\n if (!this.state.open) {\n this.loadDetails().catch(console.error);\n this.setState({ open: true });\n }\n }}\n color=\"primary\"\n >\n <MoreVertIcon />\n </Fab>\n ) : null}\n </Box>\n {/* Body */}\n <div style={styles.statusStyle}>\n {status.map((s, i) => (\n <DeviceStatusComponent\n key={i}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n connectionType={this.state.connectionType}\n status={s}\n enabled={this.state.enabled}\n statusAction={this.props.device.actions?.find(a => a.id === ACTIONS.STATUS)}\n disableEnableAction={this.props.device.actions?.find(a => a.id === ACTIONS.ENABLE_DISABLE)}\n update={i === 0 ? this.props.device.update : undefined}\n updateAction={\n i === 0 ? this.props.device.actions?.find(a => a.id === ACTIONS.UPDATE) : undefined\n }\n batteryAction={this.props.device.actions?.find(a => a.id === ACTIONS.BATTERY)}\n deviceHandler={this.props.deviceHandler}\n theme={this.props.theme}\n stateOrObjectHandler={this.stateOrObjectHandler}\n />\n ))}\n {this.renderIndicators()}\n </div>\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body1\"\n style={styles.deviceInfoStyle}\n >\n {this.state.identifier ? (\n <div onClick={this.copyToClipboard}>\n <b style={{ marginRight: 4 }}>{getText(this.props.identifierLabel)}:</b>\n {this.state.identifier}\n </div>\n ) : null}\n {this.state.manufacturer ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('manufacturer')}:</b>\n {this.state.manufacturer}\n </div>\n ) : null}\n {this.state.model ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('model')}:</b>\n {this.state.model}\n </div>\n ) : null}\n </Typography>\n {this.props.device.customInfo ? (\n <div style={{ padding: '0 16px' }}>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.props.device.customInfo.schema}\n data={this.props.device.customInfo.data || {}}\n onChange={(_data: Record<string, any> | null) => {\n /* ignore */\n }}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </div>\n ) : null}\n {/* Footer */}\n {!!(this.hasFooterActions() || this.props.device.controls?.length) && (\n <div\n style={{\n marginTop: 'auto',\n display: 'flex',\n gap: 8,\n paddingBottom: 5,\n minHeight: 34,\n paddingLeft: 10,\n paddingRight: 10,\n }}\n >\n {this.renderActions()}\n <div style={{ flexGrow: 1 }} />\n {this.renderControls()}\n </div>\n )}\n </div>\n {this.renderDialog()}\n {this.renderControlDialog()}\n </Paper>\n );\n }\n\n render(): JSX.Element {\n if (this.props.filter) {\n const field = this.props.filterField ?? 'name';\n const value = String(this.state[field] ?? '').toLowerCase();\n if (!value.includes(this.props.filter.toLowerCase())) {\n return <></>;\n }\n }\n\n if (this.props.onlyUpdatable && !this.state.updateAvailable) {\n return <></>;\n }\n\n if (this.props.onlyBatteryProblem && !this.state.batteryProblem) {\n return <></>;\n }\n\n if (this.props.smallCards) {\n return this.renderSmall();\n }\n\n return this.renderBig();\n }\n}\n\ntype DeviceCardSkeletonProps = Pick<DeviceCardProps, 'smallCards' | 'theme'>;\n\nexport class DeviceCardSkeleton extends Component<DeviceCardSkeletonProps> {\n render(): JSX.Element {\n if (this.props.smallCards) {\n return this.renderSmall();\n }\n\n return this.renderBig();\n }\n\n renderSmall(): JSX.Element {\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n return (\n <Paper\n sx={styles.cardStyle}\n style={{ width: 200, minHeight: 200, margin: 5 }}\n >\n <Box\n sx={headerStyle}\n style={{ ...styles.headerStyle, minHeight: 48 }}\n >\n <div style={{ ...styles.imgAreaStyle, height: 32, width: 32 }}>\n <Skeleton\n variant=\"rounded\"\n width={24}\n height={24}\n />\n </div>\n <Box\n style={{ ...styles.titleStyle, fontSize: 14, minWidth: '50%' }}\n sx={theme => ({\n color: headerStyle.color || theme.palette.secondary.contrastText,\n })}\n >\n <Skeleton />\n </Box>\n </Box>\n <div style={{ ...styles.statusStyle, height: 'auto', padding: '8px 15px 0 15px' }} />\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body2\"\n style={{ ...styles.deviceInfoStyle, padding: '10px 10px 0 10px' }}\n >\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n </Typography>\n </div>\n </Paper>\n );\n }\n\n renderBig(): JSX.Element {\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n return (\n <Paper sx={styles.cardStyle}>\n <Box\n sx={headerStyle}\n style={styles.headerStyle}\n >\n <div style={styles.imgAreaStyle}>\n <Skeleton\n variant=\"rounded\"\n width={24}\n height={24}\n />\n </div>\n <Box\n style={styles.titleStyle}\n sx={theme => ({\n color: headerStyle.color || theme.palette.secondary.contrastText,\n minWidth: '50%',\n })}\n >\n <Skeleton />\n </Box>\n </Box>\n <div style={styles.statusStyle}></div>\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body1\"\n style={styles.deviceInfoStyle}\n >\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n </Typography>\n </div>\n </Paper>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n getCardHeaderStyle(theme: IobTheme, maxWidth?: number): React.CSSProperties {\n const backgroundColor = theme.palette.secondary.main;\n const color = theme.palette.secondary.contrastText;\n\n return {\n backgroundColor,\n color,\n maxWidth,\n };\n }\n}\n"]}
@@ -44,6 +44,10 @@ interface DeviceListState extends CommunicationState {
44
44
  filterField: DeviceFilterField;
45
45
  /** Distinct resolved model values across the loaded devices (for the model filter dropdown) */
46
46
  modelOptions: string[];
47
+ /** Visibility of the configurable indicators, as explicitly chosen by the user for this instance */
48
+ indicatorVisibility: Record<string, boolean>;
49
+ /** Anchor of the indicator visibility menu */
50
+ indicatorsAnchor: HTMLElement | null;
47
51
  }
48
52
  /**
49
53
  * Device List Component
@@ -64,6 +68,8 @@ export default class DeviceList extends Communication<DeviceListProps, DeviceLis
64
68
  /** Resolved model value per device (stringified id -> model), reported by the cards to build the model dropdown */
65
69
  private readonly modelValues;
66
70
  private readonly language;
71
+ /** Subscriptions for the instance-wide indicators in the toolbar */
72
+ private readonly stateOrObjectHandler;
67
73
  constructor(props: DeviceListProps);
68
74
  setStateAsync(state: Partial<DeviceListState>): Promise<void>;
69
75
  private loadAdapters;
@@ -98,6 +104,26 @@ export default class DeviceList extends Communication<DeviceListProps, DeviceLis
98
104
  /** The filter value input: a model dropdown for the `model` field, a free-text field otherwise */
99
105
  renderFilterValue(): React.JSX.Element;
100
106
  renderRootInfo(): React.JSX.Element;
107
+ /** Key of the stored indicator visibility of one instance */
108
+ private static indicatorStorageKey;
109
+ /** Read the visibility the user has explicitly chosen for the configurable indicators of an instance */
110
+ private static loadIndicatorVisibility;
111
+ /**
112
+ * All configurable indicators of the instance and of the loaded devices, unique by ID.
113
+ * Indicators with the same ID on different devices are configured together.
114
+ */
115
+ private getConfigurableIndicators;
116
+ /** True if the given configurable indicator is currently shown */
117
+ private isIndicatorVisible;
118
+ /** IDs of the configurable indicators the user has switched off */
119
+ private getHiddenIndicators;
120
+ private toggleIndicator;
121
+ /** The toolbar button that lets the user show or hide the configurable indicators */
122
+ renderIndicatorSettings(): JSX.Element | null;
123
+ /** Resolve how an instance indicator behaves on click by looking up the referenced instance action */
124
+ private resolveInstanceIndicatorAction;
125
+ /** Instance actions in the toolbar. An action referenced by an indicator is not rendered twice */
126
+ renderInstanceActions(): JSX.Element | null;
101
127
  renderContent(): JSX.Element | JSX.Element[] | null;
102
128
  }
103
129
  export {};
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
- import { IconButton, InputAdornment, TextField, Toolbar, Tooltip, LinearProgress, Select, MenuItem, Box, Card, CardActionArea, CardContent, Typography, } from '@mui/material';
3
- import { ArrowBack, Clear, QuestionMark, Refresh, FilterAlt, FilterAltOff, SystemUpdateAlt, BatteryAlert, } from '@mui/icons-material';
2
+ import { IconButton, InputAdornment, TextField, Toolbar, Tooltip, LinearProgress, Select, MenuItem, Box, Card, CardActionArea, CardContent, Typography, Menu, Checkbox, ListSubheader, } from '@mui/material';
3
+ import { ArrowBack, Clear, QuestionMark, Refresh, FilterAlt, FilterAltOff, SystemUpdateAlt, BatteryAlert, Tune, } from '@mui/icons-material';
4
4
  import { I18n, DeviceTypeIcon, Icon, InfoBox } from '@iobroker/gui-components';
5
5
  import DeviceCard, { DeviceCardSkeleton } from './DeviceCard';
6
- import { getTranslation } from './Utils';
6
+ import { getTranslation, renderIcon } from './Utils';
7
7
  import Communication from './Communication';
8
8
  import InstanceActionButton from './InstanceActionButton';
9
+ import { StatusIndicators } from './StatusIndicator';
10
+ import { StateOrObjectHandler } from './StateOrObjectHandler';
9
11
  import de from './i18n/de.json';
10
12
  import en from './i18n/en.json';
11
13
  import ru from './i18n/ru.json';
@@ -44,8 +46,11 @@ export default class DeviceList extends Communication {
44
46
  /** Resolved model value per device (stringified id -> model), reported by the cards to build the model dropdown */
45
47
  modelValues = new Map();
46
48
  language = I18n.getLanguage();
49
+ /** Subscriptions for the instance-wide indicators in the toolbar */
50
+ stateOrObjectHandler;
47
51
  constructor(props) {
48
52
  super(props);
53
+ this.stateOrObjectHandler = new StateOrObjectHandler(this.props.socket);
49
54
  if (!DeviceList.i18nInitialized) {
50
55
  DeviceList.i18nInitialized = true;
51
56
  I18n.extendTranslations({
@@ -77,11 +82,17 @@ export default class DeviceList extends Communication {
77
82
  onlyBatteryProblem: window.localStorage.getItem('dm_onlyBatteryProblem') === 'true',
78
83
  filterField: window.localStorage.getItem('dm_filterField') || 'name',
79
84
  modelOptions: [],
85
+ indicatorVisibility: {},
86
+ indicatorsAnchor: null,
80
87
  };
81
88
  if (this.props.selectedInstance === undefined) {
82
89
  // Start with the root page that shows all instances as cards
83
90
  this.state = { ...this.state, selectedInstance: this.props.instance ?? '' };
84
91
  }
92
+ this.state = {
93
+ ...this.state,
94
+ indicatorVisibility: DeviceList.loadIndicatorVisibility(this.state.selectedInstance),
95
+ };
85
96
  this.lastInstance = this.state.selectedInstance;
86
97
  this.lastTriggerLoad = this.props.triggerLoad || 0;
87
98
  }
@@ -470,6 +481,106 @@ export default class DeviceList extends Communication {
470
481
  color: this.props.theme.palette.text.primary,
471
482
  } }, I18n.t('rootInfoText')));
472
483
  }
484
+ /** Key of the stored indicator visibility of one instance */
485
+ static indicatorStorageKey(instanceId) {
486
+ return `dm_indicators_${instanceId}`;
487
+ }
488
+ /** Read the visibility the user has explicitly chosen for the configurable indicators of an instance */
489
+ static loadIndicatorVisibility(instanceId) {
490
+ if (!instanceId) {
491
+ return {};
492
+ }
493
+ try {
494
+ const stored = window.localStorage.getItem(DeviceList.indicatorStorageKey(instanceId));
495
+ return stored ? JSON.parse(stored) : {};
496
+ }
497
+ catch (error) {
498
+ console.error(error);
499
+ return {};
500
+ }
501
+ }
502
+ /**
503
+ * All configurable indicators of the instance and of the loaded devices, unique by ID.
504
+ * Indicators with the same ID on different devices are configured together.
505
+ */
506
+ getConfigurableIndicators() {
507
+ const result = [];
508
+ const seen = new Set();
509
+ const collect = (indicators) => {
510
+ for (const indicator of indicators || []) {
511
+ if (indicator.configurable && !seen.has(indicator.id)) {
512
+ seen.add(indicator.id);
513
+ result.push(indicator);
514
+ }
515
+ }
516
+ };
517
+ collect(this.state.instanceInfo?.indicators);
518
+ for (const device of this.state.devices) {
519
+ collect(device.indicators);
520
+ }
521
+ return result;
522
+ }
523
+ /** True if the given configurable indicator is currently shown */
524
+ isIndicatorVisible(indicator) {
525
+ if (!indicator.configurable) {
526
+ return true;
527
+ }
528
+ return this.state.indicatorVisibility[indicator.id] ?? indicator.defaultVisible !== false;
529
+ }
530
+ /** IDs of the configurable indicators the user has switched off */
531
+ getHiddenIndicators() {
532
+ return this.getConfigurableIndicators()
533
+ .filter(indicator => !this.isIndicatorVisible(indicator))
534
+ .map(indicator => indicator.id);
535
+ }
536
+ toggleIndicator(indicator) {
537
+ const indicatorVisibility = {
538
+ ...this.state.indicatorVisibility,
539
+ [indicator.id]: !this.isIndicatorVisible(indicator),
540
+ };
541
+ this.setState({ indicatorVisibility });
542
+ window.localStorage.setItem(DeviceList.indicatorStorageKey(this.state.selectedInstance), JSON.stringify(indicatorVisibility));
543
+ }
544
+ /** The toolbar button that lets the user show or hide the configurable indicators */
545
+ renderIndicatorSettings() {
546
+ const configurable = this.getConfigurableIndicators();
547
+ if (!configurable.length) {
548
+ return null;
549
+ }
550
+ return (React.createElement(React.Fragment, null,
551
+ React.createElement(Tooltip, { title: getTranslation('indicatorsTooltip'), slotProps: { popper: { sx: { pointerEvents: 'none' } } } },
552
+ React.createElement(IconButton, { size: "small", onClick: e => this.setState({ indicatorsAnchor: e.currentTarget }) },
553
+ React.createElement(Tune, null))),
554
+ React.createElement(Menu, { open: !!this.state.indicatorsAnchor, anchorEl: this.state.indicatorsAnchor, onClose: () => this.setState({ indicatorsAnchor: null }) },
555
+ React.createElement(ListSubheader, { style: { lineHeight: '32px' } }, getTranslation('indicatorsTitle')),
556
+ configurable.map(indicator => (React.createElement(MenuItem, { key: indicator.id, onClick: () => this.toggleIndicator(indicator) },
557
+ React.createElement(Checkbox, { edge: "start", size: "small", checked: this.isIndicatorVisible(indicator) }),
558
+ typeof indicator.icon === 'string' ? (React.createElement("span", { style: { display: 'inline-flex', marginRight: 8 } }, renderIcon(indicator.icon, undefined, true))) : null,
559
+ this.getText(indicator.label || indicator.tooltip || indicator.id)))))));
560
+ }
561
+ /** Resolve how an instance indicator behaves on click by looking up the referenced instance action */
562
+ resolveInstanceIndicatorAction = (actionId) => {
563
+ const action = this.state.instanceInfo?.actions?.find(a => a.id === actionId);
564
+ if (!action) {
565
+ console.warn(`Indicator of instance ${this.state.selectedInstance} references unknown action "${actionId}"`);
566
+ return undefined;
567
+ }
568
+ if ('url' in action && action.url) {
569
+ return { url: getTranslation(action.url), disabled: action.disabled };
570
+ }
571
+ return { onClick: this.instanceHandler(action), disabled: action.disabled };
572
+ };
573
+ /** Instance actions in the toolbar. An action referenced by an indicator is not rendered twice */
574
+ renderInstanceActions() {
575
+ const referenced = new Set((this.state.instanceInfo?.indicators || [])
576
+ .map(indicator => indicator.actionId)
577
+ .filter((actionId) => !!actionId));
578
+ const actions = this.state.instanceInfo?.actions?.filter(action => !referenced.has(action.id));
579
+ if (!actions?.length) {
580
+ return null;
581
+ }
582
+ return (React.createElement("div", { style: { marginLeft: 20 } }, actions.map(action => (React.createElement(InstanceActionButton, { key: action.id, action: action, instanceHandler: this.instanceHandler })))));
583
+ }
473
584
  renderContent() {
474
585
  const emptyStyle = {
475
586
  padding: 25,
@@ -482,6 +593,11 @@ export default class DeviceList extends Communication {
482
593
  if (this.lastInstance !== this.state.selectedInstance) {
483
594
  this.lastInstance = this.state.selectedInstance;
484
595
  setTimeout(async () => {
596
+ // The indicator visibility is stored per instance
597
+ this.setState({
598
+ indicatorVisibility: DeviceList.loadIndicatorVisibility(this.state.selectedInstance),
599
+ indicatorsAnchor: null,
600
+ });
485
601
  if (this.state.selectedInstance) {
486
602
  try {
487
603
  await this.loadAllData();
@@ -564,7 +680,8 @@ export default class DeviceList extends Communication {
564
680
  }
565
681
  }
566
682
  if (this.state.selectedInstance) {
567
- list = filteredDevices.map(device => (React.createElement(DeviceCard, { key: JSON.stringify(device.id), smallCards: this.props.smallCards ?? this.state.instanceInfo?.smallCards, filter: this.props.embedded ? this.props.filter : this.state.filter, alive: !!this.state.alive, id: device.id, identifierLabel: this.state.instanceInfo?.identifierLabel ?? 'ID', device: device, instanceId: this.state.selectedInstance, uploadImagesToInstance: this.props.uploadImagesToInstance, deviceHandler: this.deviceHandler, controlHandler: this.controlHandler, controlStateHandler: this.controlStateHandler, socket: this.props.socket, themeName: this.props.themeName, themeType: this.props.themeType, theme: this.props.theme, isFloatComma: this.props.isFloatComma, dateFormat: this.props.dateFormat, onlyUpdatable: this.state.onlyUpdatable, onlyBatteryProblem: this.state.onlyBatteryProblem, filterField: this.props.embedded ? undefined : this.getEffectiveFilterField(), onModel: this.reportModel })));
683
+ const hiddenIndicators = this.getHiddenIndicators();
684
+ list = filteredDevices.map(device => (React.createElement(DeviceCard, { key: JSON.stringify(device.id), smallCards: this.props.smallCards ?? this.state.instanceInfo?.smallCards, filter: this.props.embedded ? this.props.filter : this.state.filter, alive: !!this.state.alive, id: device.id, identifierLabel: this.state.instanceInfo?.identifierLabel ?? 'ID', device: device, instanceId: this.state.selectedInstance, uploadImagesToInstance: this.props.uploadImagesToInstance, deviceHandler: this.deviceHandler, controlHandler: this.controlHandler, controlStateHandler: this.controlStateHandler, socket: this.props.socket, themeName: this.props.themeName, themeType: this.props.themeType, theme: this.props.theme, isFloatComma: this.props.isFloatComma, dateFormat: this.props.dateFormat, onlyUpdatable: this.state.onlyUpdatable, onlyBatteryProblem: this.state.onlyBatteryProblem, filterField: this.props.embedded ? undefined : this.getEffectiveFilterField(), hiddenIndicators: hiddenIndicators, onModel: this.reportModel })));
568
685
  if (this.state.loading) {
569
686
  const skeletons = (this.state.totalDevices ?? list.length + 1) - list.length;
570
687
  for (let i = 0; i < skeletons; i++) {
@@ -619,7 +736,8 @@ export default class DeviceList extends Communication {
619
736
  React.createElement("span", null,
620
737
  React.createElement(IconButton, { onClick: () => this.loadAllData(), disabled: !this.state.alive || this.state.apiVersionError, size: "small" },
621
738
  React.createElement(Refresh, null))))) : null,
622
- !this.state.apiVersionError && this.state.alive && this.state.instanceInfo?.actions?.length ? (React.createElement("div", { style: { marginLeft: 20 } }, this.state.instanceInfo.actions.map(action => (React.createElement(InstanceActionButton, { key: action.id, action: action, instanceHandler: this.instanceHandler }))))) : null,
739
+ !this.state.apiVersionError && this.state.alive && this.renderInstanceActions(),
740
+ !this.state.apiVersionError && this.state.alive && this.state.instanceInfo?.indicators?.length ? (React.createElement(StatusIndicators, { indicators: this.state.instanceInfo.indicators.filter(indicator => this.isIndicatorVisible(indicator)), theme: this.props.theme, stateOrObjectHandler: this.stateOrObjectHandler, resolveAction: this.resolveInstanceIndicatorAction, defaultColor: "#fff", style: { marginLeft: 20 } })) : null,
623
741
  React.createElement("div", { style: { flexGrow: 1 } }),
624
742
  !this.state.apiVersionError && this.renderGroups(deviceGroups),
625
743
  !this.state.apiVersionError &&
@@ -640,6 +758,7 @@ export default class DeviceList extends Communication {
640
758
  window.localStorage.setItem('dm_onlyBatteryProblem', onlyBatteryProblem ? 'true' : 'false');
641
759
  }, size: "small" },
642
760
  React.createElement(BatteryAlert, null)))) : null,
761
+ !this.state.apiVersionError && this.state.alive ? this.renderIndicatorSettings() : null,
643
762
  !this.state.apiVersionError && this.state.alive ? (React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' } },
644
763
  React.createElement(FilterAlt, { style: { color: '#fff' } }),
645
764
  this.renderFilterFields(),