More minor changes

Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
Julius Volz 2019-11-24 15:23:46 +01:00
parent 56b101e958
commit 096ba25ba9

View file

@ -20,6 +20,12 @@ interface PanelListState {
timeDriftError: string | null;
}
const initialPanel = {
id: generateID(),
key: '0',
options: PanelDefaultOptions,
};
class PanelList extends Component<RouteComponentProps & PathPrefixProps, PanelListState> {
constructor(props: PathPrefixProps) {
super(props);
@ -27,7 +33,7 @@ class PanelList extends Component<RouteComponentProps & PathPrefixProps, PanelLi
const urlPanels = decodePanelOptionsFromQueryString(window.location.search);
this.state = {
panels: urlPanels.length ? urlPanels : [],
panels: urlPanels.length ? urlPanels : [initialPanel],
pastQueries: [],
metricNames: [],
fetchMetricsError: null,