Now with external links
This commit is contained in:
parent
2d79cc68aa
commit
b8160b3a55
3 changed files with 35 additions and 2 deletions
|
|
@ -306,6 +306,15 @@ const config : Config = {
|
||||||
},
|
},
|
||||||
icon: "radio",
|
icon: "radio",
|
||||||
enableCondition: (a, b, state) => state.onkyo_inputs == "netzwerk"
|
enableCondition: (a, b, state) => state.onkyo_inputs == "netzwerk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "section",
|
||||||
|
text: "External"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "link",
|
||||||
|
link: "http://mpd.rzl/mpd/player/index.php",
|
||||||
|
text: "Open MPD Interface"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -328,7 +337,13 @@ const config : Config = {
|
||||||
position: [455,350],
|
position: [455,350],
|
||||||
icon: "swap_vert",
|
icon: "swap_vert",
|
||||||
iconColor: state => state.door_status == "on" ? "#00FF00" : "#FF0000",
|
iconColor: state => state.door_status == "on" ? "#00FF00" : "#FF0000",
|
||||||
ui: []
|
ui: [
|
||||||
|
{
|
||||||
|
type: "link",
|
||||||
|
link: "http://s.rzl.so",
|
||||||
|
text: "Open Status Page"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
infoscreen: {
|
infoscreen: {
|
||||||
name: "Infoscreen",
|
name: "Infoscreen",
|
||||||
|
|
@ -341,6 +356,11 @@ const config : Config = {
|
||||||
text: "Infoscreen",
|
text: "Infoscreen",
|
||||||
topic: "infoscreen",
|
topic: "infoscreen",
|
||||||
icon: "power_settings_new"
|
icon: "power_settings_new"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "link",
|
||||||
|
link: "http://cashdesk.rzl:3030/rzl",
|
||||||
|
text: "Open Infoscreen"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ import List, {
|
||||||
ListItemText,
|
ListItemText,
|
||||||
ListSubheader,
|
ListSubheader,
|
||||||
} from 'material-ui/List';
|
} from 'material-ui/List';
|
||||||
|
import Button from 'material-ui/Button';
|
||||||
|
import withStyles from 'material-ui/styles/withStyles';
|
||||||
|
|
||||||
const enabled = (props: ControlUI, state: State) => {
|
const enabled = (props: ControlUI, state: State) => {
|
||||||
if (props.enableCondition == null) return true;
|
if (props.enableCondition == null) return true;
|
||||||
|
|
@ -122,3 +124,11 @@ export const slider = (state: State, props: ControlUI) => (
|
||||||
export const section = (state: State, props: ControlUI) => (
|
export const section = (state: State, props: ControlUI) => (
|
||||||
<ListSubheader>{props.text}</ListSubheader>
|
<ListSubheader>{props.text}</ListSubheader>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const link = (state: State, props: ControlUI) => (
|
||||||
|
<ListItem>
|
||||||
|
<Button raised onClick={() => window.open(props.link, '_blank')} color="primary">
|
||||||
|
{props.text}
|
||||||
|
</Button>
|
||||||
|
</ListItem>
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@ declare type ControlUI = {
|
||||||
|
|
||||||
enableCondition?: (internal: string, actual: any) => boolean,
|
enableCondition?: (internal: string, actual: any) => boolean,
|
||||||
|
|
||||||
|
// LINK optiona properties
|
||||||
|
link?: string,
|
||||||
|
|
||||||
// TOGGLE optional properties
|
// TOGGLE optional properties
|
||||||
on?: string, // on override for toggle
|
on?: string, // on override for toggle
|
||||||
off?: string, // off override for toggle
|
off?: string, // off override for toggle
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue