Farmbot-Web-App/frontend/logs/interfaces.ts

56 lines
1.5 KiB
TypeScript
Raw Normal View History

import { TaggedLog, ConfigurationName, ALLOWED_MESSAGE_TYPES } from "farmbot";
2019-08-23 15:19:22 -06:00
import { SourceFbosConfig, ShouldDisplay } from "../devices/interfaces";
2018-08-27 14:09:27 -06:00
import { GetWebAppConfigValue } from "../config_storage/actions";
2019-04-09 23:17:03 -06:00
import { TimeSettings } from "../interfaces";
2017-11-07 18:16:38 -07:00
export interface LogsProps {
2017-12-01 21:47:57 -07:00
logs: TaggedLog[];
2019-04-09 23:17:03 -06:00
timeSettings: TimeSettings;
2018-01-27 02:29:13 -07:00
dispatch: Function;
sourceFbosConfig: SourceFbosConfig;
2018-08-27 14:09:27 -06:00
getConfigValue: GetWebAppConfigValue;
2019-08-23 15:19:22 -06:00
shouldDisplay: ShouldDisplay;
2017-11-07 18:16:38 -07:00
}
2018-05-17 14:12:33 -06:00
export type Filters = Record<ALLOWED_MESSAGE_TYPES, number>;
2017-11-07 18:16:38 -07:00
2017-11-08 15:51:46 -07:00
export interface LogsState extends Filters {
autoscroll: boolean;
2020-02-26 11:10:59 -07:00
searchTerm: string;
2019-09-16 15:22:20 -06:00
markdown: boolean;
2017-11-08 15:51:46 -07:00
}
2017-11-07 18:16:38 -07:00
export interface LogsTableProps {
2017-11-14 15:44:31 -07:00
logs: TaggedLog[];
2019-08-26 12:20:46 -06:00
dispatch: Function;
2017-11-07 18:16:38 -07:00
state: LogsState;
2019-04-09 23:17:03 -06:00
timeSettings: TimeSettings;
2017-11-07 18:16:38 -07:00
}
type ToggleEventHandler = (e: React.MouseEvent<HTMLButtonElement>) => void;
2017-12-11 04:50:41 -07:00
type SetNumSetting = (property: keyof LogsState) => (value: number) => void;
2017-11-07 18:16:38 -07:00
export interface LogsFilterMenuProps {
toggle: (property: keyof LogsState) => ToggleEventHandler;
state: LogsState;
2017-12-11 04:50:41 -07:00
setFilterLevel: SetNumSetting;
2019-08-23 15:19:22 -06:00
shouldDisplay: ShouldDisplay;
2017-11-07 18:16:38 -07:00
}
2017-12-01 22:22:06 -07:00
export interface LogSettingProps {
label: string;
setting: ConfigurationName;
toolTip: string;
2017-12-11 04:50:41 -07:00
setFilterLevel: SetNumSetting;
2018-01-27 02:29:13 -07:00
dispatch: Function;
sourceFbosConfig: SourceFbosConfig;
2018-08-27 14:09:27 -06:00
getConfigValue: GetWebAppConfigValue;
2017-12-11 04:50:41 -07:00
}
export interface LogsSettingsMenuProps {
setFilterLevel: SetNumSetting;
2018-01-27 02:29:13 -07:00
dispatch: Function;
sourceFbosConfig: SourceFbosConfig;
2018-08-27 14:09:27 -06:00
getConfigValue: GetWebAppConfigValue;
2017-12-01 22:22:06 -07:00
}