preload pods/events on nodes page

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen committed 2021-05-25 21:09:55 +03:00
1 parent ac95c1e862
commit 4467400cad
1 file changed
+8 -1
+8 -1
View File
@@ -21,7 +21,7 @@
import "./nodes.scss"; import "./nodes.scss";
import React from "react"; import React from "react";
import { observer } from "mobx-react"; import { disposeOnUnmount, observer } from "mobx-react";
import type { RouteComponentProps } from "react-router"; import type { RouteComponentProps } from "react-router";
import { cssNames, interval } from "../../utils"; import { cssNames, interval } from "../../utils";
import { TabLayout } from "../layout/tab-layout"; import { TabLayout } from "../layout/tab-layout";
@@ -37,6 +37,8 @@ import kebabCase from "lodash/kebabCase";
import upperFirst from "lodash/upperFirst"; import upperFirst from "lodash/upperFirst";
import { KubeObjectStatusIcon } from "../kube-object-status-icon"; import { KubeObjectStatusIcon } from "../kube-object-status-icon";
import { Badge } from "../badge/badge"; import { Badge } from "../badge/badge";
import { kubeWatchApi } from "../../api/kube-watch-api";
import { eventStore } from "../+events/event.store";
enum columnId { enum columnId {
name = "name", name = "name",
@@ -60,6 +62,11 @@ export class Nodes extends React.Component<Props> {
componentDidMount() { componentDidMount() {
this.metricsWatcher.start(true); this.metricsWatcher.start(true);
disposeOnUnmount(this, [
kubeWatchApi.subscribeStores([nodesStore, podsStore, eventStore], {
preload: true,
})
]);
} }
componentWillUnmount() { componentWillUnmount() {