mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Load all pods regardless selected namespace
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
5dd9a5c6bc
commit
91ccaf2ca9
@ -544,320 +544,6 @@ exports[`<PodDetailsList /> when few pods passed when metrics max values passed
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`<PodDetailsList /> when few pods passed when metrics max values passed sort table by name 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="PodDetailsList flex column"
|
||||
>
|
||||
<div
|
||||
class="DrawerTitle title"
|
||||
>
|
||||
Pods
|
||||
</div>
|
||||
<div
|
||||
class="Table flex column box grow selectable sortable autoSize"
|
||||
>
|
||||
<div
|
||||
class="TableHead sticky"
|
||||
>
|
||||
<div
|
||||
class="TableCell name sorting"
|
||||
>
|
||||
Name
|
||||
<i
|
||||
class="Icon sortIcon enabled material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
data-icon-name="arrow_drop_down"
|
||||
>
|
||||
arrow_drop_down
|
||||
</span>
|
||||
</i>
|
||||
</div>
|
||||
<div
|
||||
class="TableCell warning"
|
||||
/>
|
||||
<div
|
||||
class="TableCell node sorting"
|
||||
>
|
||||
Node
|
||||
<i
|
||||
class="Icon sortIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
data-icon-name="arrow_drop_down"
|
||||
>
|
||||
arrow_drop_down
|
||||
</span>
|
||||
</i>
|
||||
</div>
|
||||
<div
|
||||
class="TableCell namespace sorting"
|
||||
>
|
||||
Namespace
|
||||
<i
|
||||
class="Icon sortIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
data-icon-name="arrow_drop_down"
|
||||
>
|
||||
arrow_drop_down
|
||||
</span>
|
||||
</i>
|
||||
</div>
|
||||
<div
|
||||
class="TableCell ready"
|
||||
>
|
||||
Ready
|
||||
</div>
|
||||
<div
|
||||
class="TableCell cpu sorting"
|
||||
>
|
||||
CPU
|
||||
<i
|
||||
class="Icon sortIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
data-icon-name="arrow_drop_down"
|
||||
>
|
||||
arrow_drop_down
|
||||
</span>
|
||||
</i>
|
||||
</div>
|
||||
<div
|
||||
class="TableCell memory sorting"
|
||||
>
|
||||
Memory
|
||||
<i
|
||||
class="Icon sortIcon material focusable"
|
||||
>
|
||||
<span
|
||||
class="icon"
|
||||
data-icon-name="arrow_drop_down"
|
||||
>
|
||||
arrow_drop_down
|
||||
</span>
|
||||
</i>
|
||||
</div>
|
||||
<div
|
||||
class="TableCell status"
|
||||
>
|
||||
Status
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="TableRow nowrap"
|
||||
>
|
||||
<div
|
||||
class="TableCell name"
|
||||
>
|
||||
foobar-pending
|
||||
</div>
|
||||
<div
|
||||
class="TableCell warning"
|
||||
/>
|
||||
<div
|
||||
class="TableCell node"
|
||||
/>
|
||||
<div
|
||||
class="TableCell namespace"
|
||||
>
|
||||
default
|
||||
</div>
|
||||
<div
|
||||
class="TableCell ready"
|
||||
>
|
||||
0 / 0
|
||||
</div>
|
||||
<div
|
||||
class="TableCell cpu"
|
||||
>
|
||||
<div
|
||||
class="LineProgress"
|
||||
>
|
||||
<div
|
||||
class="line"
|
||||
style="width: 50.00%;"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
CPU: 50%
|
||||
<br />
|
||||
0.500
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="TableCell memory"
|
||||
>
|
||||
<div
|
||||
class="LineProgress"
|
||||
>
|
||||
<div
|
||||
class="line"
|
||||
style="width: 12.50%;"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
Memory: 13%
|
||||
<br />
|
||||
256.000B
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="TableCell status waiting"
|
||||
>
|
||||
Waiting
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="TableRow nowrap"
|
||||
>
|
||||
<div
|
||||
class="TableCell name"
|
||||
>
|
||||
foobar-failed
|
||||
</div>
|
||||
<div
|
||||
class="TableCell warning"
|
||||
/>
|
||||
<div
|
||||
class="TableCell node"
|
||||
/>
|
||||
<div
|
||||
class="TableCell namespace"
|
||||
>
|
||||
kube-system
|
||||
</div>
|
||||
<div
|
||||
class="TableCell ready"
|
||||
>
|
||||
0 / 0
|
||||
</div>
|
||||
<div
|
||||
class="TableCell cpu"
|
||||
>
|
||||
<div
|
||||
class="LineProgress"
|
||||
>
|
||||
<div
|
||||
class="line"
|
||||
style="width: 40.00%;"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
CPU: 40%
|
||||
<br />
|
||||
0.400
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="TableCell memory"
|
||||
>
|
||||
<div
|
||||
class="LineProgress"
|
||||
>
|
||||
<div
|
||||
class="line"
|
||||
style="width: 50.00%;"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
Memory: 50%
|
||||
<br />
|
||||
1.000KiB
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="TableCell status failed"
|
||||
>
|
||||
Failed
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="TableRow nowrap"
|
||||
>
|
||||
<div
|
||||
class="TableCell name"
|
||||
>
|
||||
foobar
|
||||
</div>
|
||||
<div
|
||||
class="TableCell warning"
|
||||
/>
|
||||
<div
|
||||
class="TableCell node"
|
||||
/>
|
||||
<div
|
||||
class="TableCell namespace"
|
||||
>
|
||||
default
|
||||
</div>
|
||||
<div
|
||||
class="TableCell ready"
|
||||
>
|
||||
0 / 0
|
||||
</div>
|
||||
<div
|
||||
class="TableCell cpu"
|
||||
>
|
||||
<div
|
||||
class="LineProgress"
|
||||
>
|
||||
<div
|
||||
class="line"
|
||||
style="width: 20.00%;"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
CPU: 20%
|
||||
<br />
|
||||
0.200
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="TableCell memory"
|
||||
>
|
||||
<div
|
||||
class="LineProgress"
|
||||
>
|
||||
<div
|
||||
class="line"
|
||||
style="width: 6.25%;"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
Memory: 7%
|
||||
<br />
|
||||
128.000B
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="TableCell status running"
|
||||
>
|
||||
Running
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`<PodDetailsList /> when few pods passed when metrics max values passed sorts table by cpu 1`] = `
|
||||
<div>
|
||||
<div
|
||||
|
||||
@ -21,6 +21,10 @@ import { Spinner } from "../spinner";
|
||||
import { Table, TableCell, TableHead, TableRow } from "../table";
|
||||
import type { PodStore } from "./store";
|
||||
import podStoreInjectable from "./store.injectable";
|
||||
import namespaceStoreInjectable from "../+namespaces/store.injectable";
|
||||
import type { NamespaceStore } from "../+namespaces/store";
|
||||
import showErrorNotificationInjectable from "../notifications/show-error-notification.injectable";
|
||||
import type { ShowNotification } from "../notifications/notifications";
|
||||
|
||||
enum sortBy {
|
||||
name = "name",
|
||||
@ -39,6 +43,8 @@ export interface PodDetailsListProps {
|
||||
interface Dependencies {
|
||||
getDetailsUrl: GetDetailsUrl;
|
||||
podStore: PodStore;
|
||||
namespaceStore: NamespaceStore;
|
||||
showErrorNotification: ShowNotification;
|
||||
}
|
||||
|
||||
@observer
|
||||
@ -52,6 +58,14 @@ export class NonInjectedPodDetailsList extends React.Component<PodDetailsListPro
|
||||
disposeOnUnmount(this, [
|
||||
reaction(() => this.props.pods[0]?.getNs(), () => this.metricsWatcher.restart(true)),
|
||||
]);
|
||||
|
||||
this.props.podStore.loadAll({
|
||||
namespaces: [
|
||||
...this.props.namespaceStore.getItems().map(ns => ns.getName())
|
||||
],
|
||||
onLoadFailure: error =>
|
||||
this.props.showErrorNotification(`Can not load Pods. ${String(error)}`)
|
||||
});
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@ -208,5 +222,7 @@ export const PodDetailsList = withInjectables<Dependencies, PodDetailsListProps>
|
||||
...props,
|
||||
getDetailsUrl: di.inject(getDetailsUrlInjectable),
|
||||
podStore: di.inject(podStoreInjectable),
|
||||
namespaceStore: di.inject(namespaceStoreInjectable),
|
||||
showErrorNotification: di.inject(showErrorNotificationInjectable)
|
||||
}),
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user