1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(kubernetes): edit yaml support EE-2855 (#8016)

This commit is contained in:
Prabhat Khera 2022-11-22 09:40:44 +13:00 committed by GitHub
parent 7006c17ce4
commit 0f0513c684
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 195 additions and 0 deletions

View file

@ -4,6 +4,7 @@ import { r2a } from '@/react-tools/react2angular';
import { withCurrentUser } from '@/react-tools/withCurrentUser';
import { withReactQuery } from '@/react-tools/withReactQuery';
import { withUIRouter } from '@/react-tools/withUIRouter';
import { YAMLReplace } from '@/kubernetes/react/views/yamlReplace';
import { IngressesDatatableView } from '@/react/kubernetes/ingresses/IngressDatatable';
import { CreateIngressView } from '@/react/kubernetes/ingresses/CreateIngressView';
@ -19,4 +20,10 @@ export const viewsModule = angular
.component(
'kubernetesIngressesCreateView',
r2a(withUIRouter(withReactQuery(withCurrentUser(CreateIngressView))), [])
)
.component(
'yamlReplace',
r2a(withUIRouter(withReactQuery(withCurrentUser(YAMLReplace))), [
'featureId',
])
).name;

View file

@ -0,0 +1,28 @@
import { FeatureId } from '@/react/portainer/feature-flags/enums';
import { Button } from '@@/buttons';
import { TooltipWithChildren } from '@@/Tip/TooltipWithChildren';
interface Props {
featureId: FeatureId;
}
export function YAMLReplace({ featureId }: Props) {
return (
<TooltipWithChildren
className="float-right"
heading="Apply YAML changes"
BEFeatureID={featureId}
message="Applies any changes that you make in the YAML editor by calling the Kubernetes API to patch the relevant resources. Any resource removals or unexpected resource additions that you make in the YAML will be ignored. Note that editing is disabled for resources in namespaces marked as system."
>
<Button
type="button"
color="warninglight"
size="small"
onClick={() => {}}
disabled
>
Apply changes
</Button>
</TooltipWithChildren>
);
}