mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
- Pod logs are now independent of the namespace select filter - The logs list now shows a spinner while loading Signed-off-by: Sebastian Malton <sebastian@malton.name>
29 lines
983 B
TypeScript
29 lines
983 B
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
|
import type { IComputedValue } from "mobx";
|
|
import type { Pod } from "../../../../common/k8s-api/endpoints";
|
|
import { bind } from "../../../utils";
|
|
import type { LogStore } from "./store";
|
|
import logStoreInjectable from "./store.injectable";
|
|
import type { LogTabData } from "./tab-store";
|
|
|
|
interface Dependencies {
|
|
logStore: LogStore;
|
|
}
|
|
|
|
function loadLogs({ logStore }: Dependencies, tabId: string, pod: IComputedValue<Pod | undefined>, logTabData: IComputedValue<LogTabData>): Promise<void> {
|
|
return logStore.load(tabId, pod, logTabData);
|
|
}
|
|
|
|
const loadLogsInjectable = getInjectable({
|
|
instantiate: (di) => bind(loadLogs, null, {
|
|
logStore: di.inject(logStoreInjectable),
|
|
}),
|
|
lifecycle: lifecycleEnum.singleton,
|
|
});
|
|
|
|
export default loadLogsInjectable;
|