mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
refactor(kubernetes): move react codebase [EE-3349] (#7953)
This commit is contained in:
parent
2868da296a
commit
77c29ff87e
33 changed files with 18 additions and 21 deletions
|
@ -1,7 +1,7 @@
|
||||||
import { KubernetesService, KubernetesServicePort, KubernetesServiceTypes } from 'Kubernetes/models/service/models';
|
import { KubernetesService, KubernetesServicePort, KubernetesServiceTypes } from '@/kubernetes/models/service/models';
|
||||||
import { KubernetesApplicationPublishingTypes } from 'Kubernetes/models/application/models/constants';
|
import { KubernetesApplicationPublishingTypes } from '@/kubernetes/models/application/models/constants';
|
||||||
import { getServices } from 'Kubernetes/react/views/networks/services/service';
|
|
||||||
import { notifyError } from '@/portainer/services/notifications';
|
import { notifyError } from '@/portainer/services/notifications';
|
||||||
|
import { getServices } from '@/react/kubernetes/networks/services/service';
|
||||||
|
|
||||||
export default class KubeServicesViewController {
|
export default class KubeServicesViewController {
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
|
|
||||||
import { r2a } from '@/react-tools/react2angular';
|
import { r2a } from '@/react-tools/react2angular';
|
||||||
import { IngressesDatatableView } from '@/kubernetes/react/views/networks/ingresses/IngressDatatable';
|
|
||||||
import { CreateIngressView } from '@/kubernetes/react/views/networks/ingresses/CreateIngressView';
|
|
||||||
import { withCurrentUser } from '@/react-tools/withCurrentUser';
|
import { withCurrentUser } from '@/react-tools/withCurrentUser';
|
||||||
import { withReactQuery } from '@/react-tools/withReactQuery';
|
import { withReactQuery } from '@/react-tools/withReactQuery';
|
||||||
import { withUIRouter } from '@/react-tools/withUIRouter';
|
import { withUIRouter } from '@/react-tools/withUIRouter';
|
||||||
|
import { IngressesDatatableView } from '@/react/kubernetes/ingresses/IngressDatatable';
|
||||||
|
import { CreateIngressView } from '@/react/kubernetes/ingresses/CreateIngressView';
|
||||||
|
|
||||||
export const viewsModule = angular
|
export const viewsModule = angular
|
||||||
.module('portainer.kubernetes.react.views', [])
|
.module('portainer.kubernetes.react.views', [])
|
||||||
|
|
|
@ -32,7 +32,7 @@ import KubernetesApplicationHelper from 'Kubernetes/helpers/application/index';
|
||||||
import KubernetesVolumeHelper from 'Kubernetes/helpers/volumeHelper';
|
import KubernetesVolumeHelper from 'Kubernetes/helpers/volumeHelper';
|
||||||
import KubernetesNamespaceHelper from 'Kubernetes/helpers/namespaceHelper';
|
import KubernetesNamespaceHelper from 'Kubernetes/helpers/namespaceHelper';
|
||||||
import { KubernetesNodeHelper } from 'Kubernetes/node/helper';
|
import { KubernetesNodeHelper } from 'Kubernetes/node/helper';
|
||||||
import { updateIngress, getIngresses } from '@/kubernetes/react/views/networks/ingresses/service';
|
import { updateIngress, getIngresses } from '@/react/kubernetes/ingresses/service';
|
||||||
import { confirmUpdateAppIngress } from '@/portainer/services/modal.service/prompt';
|
import { confirmUpdateAppIngress } from '@/portainer/services/modal.service/prompt';
|
||||||
|
|
||||||
class KubernetesCreateApplicationController {
|
class KubernetesCreateApplicationController {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import clsx from 'clsx';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { DialogOverlay } from '@reach/dialog';
|
import { DialogOverlay } from '@reach/dialog';
|
||||||
|
|
||||||
import * as kcService from '@/kubernetes/services/kubeconfig.service';
|
import { downloadKubeconfigFile } from '@/react/kubernetes/services/kubeconfig.service';
|
||||||
import * as notifications from '@/portainer/services/notifications';
|
import * as notifications from '@/portainer/services/notifications';
|
||||||
import { EnvironmentType } from '@/react/portainer/environments/types';
|
import { EnvironmentType } from '@/react/portainer/environments/types';
|
||||||
import { usePaginationLimitState } from '@/portainer/hooks/usePaginationLimitState';
|
import { usePaginationLimitState } from '@/portainer/hooks/usePaginationLimitState';
|
||||||
|
@ -144,9 +144,7 @@ export function KubeconfigPrompt({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await kcService.downloadKubeconfigFile(
|
await downloadKubeconfigFile(Object.keys(selection).map(Number));
|
||||||
Object.keys(selection).map(Number)
|
|
||||||
);
|
|
||||||
onClose();
|
onClose();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
notifications.error('Failed downloading kubeconfig file', e as Error);
|
notifications.error('Failed downloading kubeconfig file', e as Error);
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { EnvironmentId } from '@/react/portainer/environments/types';
|
||||||
import {
|
import {
|
||||||
KubernetesApiListResponse,
|
KubernetesApiListResponse,
|
||||||
V1IngressClass,
|
V1IngressClass,
|
||||||
} from '@/react/kubernetes/services/kubernetes/types';
|
} from '@/react/kubernetes/services/types';
|
||||||
|
|
||||||
export async function getAllIngressClasses(environmentId: EnvironmentId) {
|
export async function getAllIngressClasses(environmentId: EnvironmentId) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -5,8 +5,7 @@ import { v4 as uuidv4 } from 'uuid';
|
||||||
import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId';
|
import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId';
|
||||||
import { useConfigurations } from '@/react/kubernetes/configs/queries';
|
import { useConfigurations } from '@/react/kubernetes/configs/queries';
|
||||||
import { useNamespaces } from '@/react/kubernetes/namespaces/queries';
|
import { useNamespaces } from '@/react/kubernetes/namespaces/queries';
|
||||||
import { Annotation } from '@/kubernetes/react/views/networks/ingresses/components/annotations/types';
|
import { useServices } from '@/react/kubernetes/networks/services/queries';
|
||||||
import { useServices } from '@/kubernetes/react/views/networks/services/queries';
|
|
||||||
import { notifySuccess } from '@/portainer/services/notifications';
|
import { notifySuccess } from '@/portainer/services/notifications';
|
||||||
|
|
||||||
import { Link } from '@@/Link';
|
import { Link } from '@@/Link';
|
||||||
|
@ -22,6 +21,7 @@ import {
|
||||||
useIngressControllers,
|
useIngressControllers,
|
||||||
} from '../queries';
|
} from '../queries';
|
||||||
|
|
||||||
|
import { Annotation } from './Annotations/types';
|
||||||
import { Rule, Path, Host } from './types';
|
import { Rule, Path, Host } from './types';
|
||||||
import { IngressForm } from './IngressForm';
|
import { IngressForm } from './IngressForm';
|
||||||
import {
|
import {
|
|
@ -1,8 +1,6 @@
|
||||||
import { ChangeEvent, ReactNode } from 'react';
|
import { ChangeEvent, ReactNode } from 'react';
|
||||||
import { Plus, RefreshCw, Trash2 } from 'react-feather';
|
import { Plus, RefreshCw, Trash2 } from 'react-feather';
|
||||||
|
|
||||||
import { Annotations } from '@/kubernetes/react/views/networks/ingresses/components/annotations';
|
|
||||||
|
|
||||||
import { Link } from '@@/Link';
|
import { Link } from '@@/Link';
|
||||||
import { Icon } from '@@/Icon';
|
import { Icon } from '@@/Icon';
|
||||||
import { Select, Option } from '@@/form-components/Input/Select';
|
import { Select, Option } from '@@/form-components/Input/Select';
|
||||||
|
@ -11,6 +9,7 @@ import { Widget, WidgetBody, WidgetTitle } from '@@/Widget';
|
||||||
import { Tooltip } from '@@/Tip/Tooltip';
|
import { Tooltip } from '@@/Tip/Tooltip';
|
||||||
import { Button } from '@@/buttons';
|
import { Button } from '@@/buttons';
|
||||||
|
|
||||||
|
import { Annotations } from './Annotations';
|
||||||
import { Rule, ServicePorts } from './types';
|
import { Rule, ServicePorts } from './types';
|
||||||
|
|
||||||
import '../style.css';
|
import '../style.css';
|
|
@ -1,7 +1,7 @@
|
||||||
import { Annotation } from '@/kubernetes/react/views/networks/ingresses/components/annotations/types';
|
|
||||||
|
|
||||||
import { Option } from '@@/form-components/Input/Select';
|
import { Option } from '@@/form-components/Input/Select';
|
||||||
|
|
||||||
|
import { Annotation } from './Annotations/types';
|
||||||
|
|
||||||
export interface Path {
|
export interface Path {
|
||||||
Key: string;
|
Key: string;
|
||||||
Route: string;
|
Route: string;
|
|
@ -1,10 +1,10 @@
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
|
||||||
import { Annotation } from '@/kubernetes/react/views/networks/ingresses/components/annotations/types';
|
|
||||||
import { SupportedIngControllerTypes } from '@/react/kubernetes/cluster/ingressClass/types';
|
import { SupportedIngControllerTypes } from '@/react/kubernetes/cluster/ingressClass/types';
|
||||||
|
|
||||||
import { TLS, Ingress } from '../types';
|
import { TLS, Ingress } from '../types';
|
||||||
|
|
||||||
|
import { Annotation } from './Annotations/types';
|
||||||
import { Host, Rule } from './types';
|
import { Host, Rule } from './types';
|
||||||
|
|
||||||
const ignoreAnnotationsForEdit = [
|
const ignoreAnnotationsForEdit = [
|
|
@ -6,8 +6,7 @@ import {
|
||||||
withError,
|
withError,
|
||||||
withInvalidate,
|
withInvalidate,
|
||||||
} from '@/react-tools/react-query';
|
} from '@/react-tools/react-query';
|
||||||
|
import { getServices } from '@/react/kubernetes/networks/services/service';
|
||||||
import { getServices } from '../services/service';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getIngresses,
|
getIngresses,
|
|
@ -2,7 +2,8 @@ import { useQuery } from 'react-query';
|
||||||
|
|
||||||
import { EnvironmentId } from '@/react/portainer/environments/types';
|
import { EnvironmentId } from '@/react/portainer/environments/types';
|
||||||
import { error as notifyError } from '@/portainer/services/notifications';
|
import { error as notifyError } from '@/portainer/services/notifications';
|
||||||
import { getIngresses } from '@/kubernetes/react/views/networks/ingresses/service';
|
|
||||||
|
import { getIngresses } from '../ingresses/service';
|
||||||
|
|
||||||
import { getNamespaces, getNamespace } from './service';
|
import { getNamespaces, getNamespace } from './service';
|
||||||
import { Namespaces } from './types';
|
import { Namespaces } from './types';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue