Add Hackerspace Config
This commit is contained in:
parent
a9619536d4
commit
b2f1e2b07c
3 changed files with 16 additions and 3 deletions
|
|
@ -2,6 +2,10 @@
|
|||
import * as utils from './utils';
|
||||
|
||||
const config : Config = {
|
||||
space: {
|
||||
name: "RZL",
|
||||
color: "orange"
|
||||
},
|
||||
topics: {
|
||||
led_stahltraeger: {
|
||||
state: "/service/openhab/out/pca301_ledstrips/state",
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import SpaceMap from "./map.js";
|
|||
import R from "ramda";
|
||||
import Config from "./config";
|
||||
import Toolbar from "material-ui/Toolbar";
|
||||
import orange from 'material-ui/colors/orange';
|
||||
import * as colors from 'material-ui/colors';
|
||||
import Typography from 'material-ui/Typography';
|
||||
import List, { ListSubheader } from 'material-ui/List';
|
||||
import IconButton from 'material-ui/IconButton';
|
||||
|
|
@ -24,6 +24,8 @@ import AppBar from 'material-ui/AppBar';
|
|||
|
||||
injectTapEventPlugin();
|
||||
|
||||
document.title = `${Config.space.name} Map`;
|
||||
|
||||
const UiItem = (state) => (props : ControlUI) =>
|
||||
UiItems[props.type](state, props);
|
||||
|
||||
|
|
@ -33,7 +35,7 @@ const renderUi = (state: State, key: ?string) =>
|
|||
|
||||
const theme = createMuiTheme({
|
||||
palette: {
|
||||
primary: orange
|
||||
primary: colors[Config.space.color]
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -52,7 +54,7 @@ class app extends React.Component<{state: State, classes: Object}> {
|
|||
<div>
|
||||
<MuiThemeProvider theme={theme}>
|
||||
<div>
|
||||
<SpaceMapBar title="RZL Map" {...state} />
|
||||
<SpaceMapBar title={`${Config.space.name} Map`} {...state} />
|
||||
<Drawer open={state.uiOpened != null}
|
||||
anchor="right"
|
||||
onRequestClose={() => store.dispatch({type: Actions.CHANGE_UI})}
|
||||
|
|
|
|||
|
|
@ -45,11 +45,18 @@ declare type Control = {
|
|||
declare type Controls = Map<string,Control>;
|
||||
|
||||
declare type Config = {
|
||||
space: Space,
|
||||
topics: Topics,
|
||||
controls: Controls,
|
||||
layers: Array<Layer>
|
||||
};
|
||||
|
||||
declare type Space = {
|
||||
name: string,
|
||||
color: "red"|"pink"|"purple"|"deepPurple"|"indigo"|"blue"|"lightBlue"|"cyan"|"teal"|
|
||||
"green"|"lightgreen"|"lime"|"yellow"|"amber"|"orange"|"deepOrange"|"brown"|"grey"|"blueGrey"
|
||||
};
|
||||
|
||||
declare type State = {
|
||||
mqtt: ?any,
|
||||
uiOpened: ?string,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue