minor changes

Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
Julius Volz 2019-11-24 14:50:53 +01:00
parent 77da5e7ab4
commit cfb70cbf1a

View file

@ -24,8 +24,10 @@ class PanelList extends Component<RouteComponentProps & PathPrefixProps, PanelLi
constructor(props: PathPrefixProps) { constructor(props: PathPrefixProps) {
super(props); super(props);
const urlPanels = decodePanelOptionsFromQueryString(window.location.search);
this.state = { this.state = {
panels: decodePanelOptionsFromQueryString(window.location.search), panels: urlPanels,
pastQueries: [], pastQueries: [],
metricNames: [], metricNames: [],
fetchMetricsError: null, fetchMetricsError: null,
@ -34,7 +36,7 @@ class PanelList extends Component<RouteComponentProps & PathPrefixProps, PanelLi
} }
componentDidMount() { componentDidMount() {
!this.state.panels.length && this.addPanel() !this.state.panels.length && this.addPanel();
fetch(`${this.props.pathPrefix}/api/v1/label/__name__/values`, { cache: 'no-store' }) fetch(`${this.props.pathPrefix}/api/v1/label/__name__/values`, { cache: 'no-store' })
.then(resp => { .then(resp => {
if (resp.ok) { if (resp.ok) {