summaryrefslogtreecommitdiff
path: root/ui/app/components/panel_switcher.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/panel_switcher.js')
-rw-r--r--ui/app/components/panel_switcher.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/ui/app/components/panel_switcher.js b/ui/app/components/panel_switcher.js
index d707a602..9a06b49f 100644
--- a/ui/app/components/panel_switcher.js
+++ b/ui/app/components/panel_switcher.js
@@ -19,17 +19,31 @@ export default class PanelSwitcher extends React.Component {
this.state = {
panel: null,
panel_properties: null,
- debug: true
+ debug: true,
+ error: null
}
App.switcher = this
}
+ showError(error) {
+ this.setState({error: error})
+ }
+
+ hideError() {
+ this.setState({error: null})
+ }
+
show(component_name, properties={}) {
this.setState({panel: component_name, panel_properties: properties})
}
render() {
let elems = []
+ if (this.state.error) {
+ elems.push(
+ <ErrorPanel error={this.state.error} key="error" />
+ )
+ }
if (this.panelExist(this.state.panel)) {
elems.push(
this.panelRender(this.state.panel, this.state.panel_properties)