1 import { createExternal,IExternalTableState } from '../../../../framework/src/components/material-table/utilities';
2 import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch';
4 import { ConnectionStatusLogType } from '../models/connectionStatusLog';
5 export interface IConnectionStatusLogState extends IExternalTableState<ConnectionStatusLogType> { }
7 // create eleactic search material data fetch handler
8 const connectionStatusLogSearchHandler = createSearchDataHandler<{ event: ConnectionStatusLogType }, ConnectionStatusLogType>('sdnevents_v1/eventlog', null,
11 timeStamp: event._source.event.timeStamp,
12 objectId: event._source.event.objectId,
13 type: event._source.event.type,
14 elementStatus: event._source.event.type === 'ObjectCreationNotificationXml'
16 : event._source.event.type === 'ObjectDeletionNotificationXml'
18 : event._source.event.type === 'AttributeValueChangedNotificationXml'
19 ? event._source.event.newValue
24 (name) => `event.${ name }`);
27 actionHandler: connectionStatusLogActionHandler,
28 createActions: createConnectionStatusLogActions,
29 createProperties: createConnectionStatusLogProperties,
30 reloadAction: connectionStatusLogReloadAction,
32 // set value action, to change a value
33 } = createExternal<ConnectionStatusLogType>(connectionStatusLogSearchHandler, appState => appState.connect.connectionStatusLog);