mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Migrating Vue components to React and stores refactoring (#585)
Signed-off-by: Roman <ixrock@gmail.com> Co-authored-by: Sebastian Malton <sebastian@malton.name> Co-authored-by: Sebastian Malton <smalton@mirantis.com> Co-authored-by: Lauri Nevala <lauri.nevala@gmail.com> Co-authored-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
297 files changed
+8186
-9103
No files matched your search
@@ -6,14 +6,15 @@ import { observer } from "mobx-react";
|
||||
import jsYaml from "js-yaml";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { AceEditor } from "../ace-editor";
|
||||
import { kubeConfigApi, ServiceAccount } from "../../api/endpoints";
|
||||
import { copyToClipboard, downloadFile, cssNames } from "../../utils";
|
||||
import { ServiceAccount } from "../../api/endpoints";
|
||||
import { copyToClipboard, cssNames, downloadFile } from "../../utils";
|
||||
import { Button } from "../button";
|
||||
import { Dialog, DialogProps } from "../dialog";
|
||||
import { Icon } from "../icon";
|
||||
import { Notifications } from "../notifications";
|
||||
import { Wizard, WizardStep } from "../wizard";
|
||||
import { themeStore } from "../../theme.store";
|
||||
import { apiBase } from "../../api";
|
||||
|
||||
interface IKubeconfigDialogData {
|
||||
title?: React.ReactNode;
|
||||
@@ -111,19 +112,11 @@ export class KubeConfigDialog extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export function openUserKubeConfig() {
|
||||
KubeConfigDialog.open({
|
||||
loader: () => kubeConfigApi.getUserConfig()
|
||||
})
|
||||
}
|
||||
|
||||
export function openServiceAccountKubeConfig(account: ServiceAccount) {
|
||||
const accountName = account.getName()
|
||||
const namespace = account.getNs()
|
||||
KubeConfigDialog.open({
|
||||
title: <Trans>{accountName} kubeconfig</Trans>,
|
||||
loader: () => {
|
||||
return kubeConfigApi.getServiceAccountConfig(accountName, namespace)
|
||||
}
|
||||
loader: () => apiBase.get(`/kubeconfig/service-account/${namespace}/${account}`)
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user