mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix type errors
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
d173e45177
commit
b96e115e17
4 files changed
+12
-11
No files matched your search
@@ -3,6 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import FormData from "form-data";
|
||||
import type { Cluster } from "../common/cluster/cluster";
|
||||
import type { RequestMetricsParams } from "../common/k8s-api/endpoints/metrics.api/request-metrics.injectable";
|
||||
import k8sRequestInjectable from "./k8s-request.injectable";
|
||||
@@ -22,13 +23,16 @@ const getMetricsInjectable = getInjectable({
|
||||
) => {
|
||||
const prometheusPrefix = cluster.preferences.prometheus?.prefix || "";
|
||||
const metricsPath = `/api/v1/namespaces/${prometheusPath}/proxy${prometheusPrefix}/api/v1/query_range`;
|
||||
const body = new FormData();
|
||||
|
||||
for (const [key, value] of Object.entries(queryParams)) {
|
||||
body.append(key, value);
|
||||
}
|
||||
|
||||
return k8sRequest(cluster, metricsPath, {
|
||||
timeout: 0,
|
||||
resolveWithFullResponse: false,
|
||||
json: true,
|
||||
method: "POST",
|
||||
form: queryParams,
|
||||
body,
|
||||
});
|
||||
};
|
||||
},
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { beforeQuitOfBackEndInjectionToken } from "../start-main-application/runnable-tokens/before-quit-of-back-end-injection-token";
|
||||
import stopSettingUpLensProxyInjectable from "../start-main-application/runnables/lens-proxy/teardown.injectable";
|
||||
import lensProxyInjectable from "./lens-proxy.injectable";
|
||||
|
||||
const stopLensProxyOnQuitInjectable = getInjectable({
|
||||
@@ -13,9 +14,8 @@ const stopLensProxyOnQuitInjectable = getInjectable({
|
||||
|
||||
return {
|
||||
id: "stop-lens-proxy",
|
||||
run: () => {
|
||||
lensProxy.close();
|
||||
},
|
||||
run: () => void lensProxy.close(),
|
||||
runAfter: di.inject(stopSettingUpLensProxyInjectable),
|
||||
};
|
||||
},
|
||||
injectionToken: beforeQuitOfBackEndInjectionToken,
|
||||
|
||||
@@ -13,9 +13,7 @@ const stopSettingUpLensProxyInjectable = getInjectable({
|
||||
|
||||
return {
|
||||
id: "stop-setting-up-lens-proxy",
|
||||
run: () => {
|
||||
setupLensProxyStartableStoppable.stop();
|
||||
},
|
||||
run: () => void setupLensProxyStartableStoppable.stop(),
|
||||
};
|
||||
},
|
||||
injectionToken: beforeQuitOfBackEndInjectionToken,
|
||||
|
||||
Reference in new issue
Block a user