mirror of
https://github.com/portainer/portainer.git
synced 2025-08-09 15:55:23 +02:00
refactor(edge): move edge codebase to react (#7781)
This commit is contained in:
parent
75f40fe485
commit
1e4c4e2616
54 changed files with 254 additions and 187 deletions
|
@ -2,7 +2,7 @@ import { useStatus } from '@/portainer/services/api/status.service';
|
|||
import { useSettings } from '@/react/portainer/settings/queries';
|
||||
|
||||
export function useAgentDetails() {
|
||||
const settingsQuery = useSettings((settings) => settings.AgentSecret);
|
||||
const settingsQuery = useSettings();
|
||||
|
||||
const versionQuery = useStatus((status) => status.Version);
|
||||
|
||||
|
@ -11,7 +11,10 @@ export function useAgentDetails() {
|
|||
}
|
||||
|
||||
const agentVersion = versionQuery.data;
|
||||
const agentSecret = settingsQuery.data;
|
||||
|
||||
return { agentVersion, agentSecret };
|
||||
return {
|
||||
agentVersion,
|
||||
agentSecret: settingsQuery.data.AgentSecret,
|
||||
useEdgeAsyncMode: settingsQuery.data.Edge.AsyncMode,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ export function isUnassociatedEdgeEnvironment(env: Environment) {
|
|||
return isEdgeEnvironment(env.Type) && !env.EdgeID;
|
||||
}
|
||||
|
||||
export function getRoute(environment: Environment) {
|
||||
export function getDashboardRoute(environment: Environment) {
|
||||
if (isEdgeEnvironment(environment.Type) && !environment.EdgeID) {
|
||||
return 'portainer.endpoints.endpoint';
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Formik, Form } from 'formik';
|
|||
import { Environment } from '@/react/portainer/environments/types';
|
||||
import { useCreateEdgeAgentEnvironmentMutation } from '@/react/portainer/environments/queries/useCreateEnvironmentMutation';
|
||||
import { baseHref } from '@/portainer/helpers/pathHelper';
|
||||
import { EdgeCheckinIntervalField } from '@/edge/components/EdgeCheckInIntervalField';
|
||||
import { EdgeCheckinIntervalField } from '@/react/edge/components/EdgeCheckInIntervalField';
|
||||
import { useCreateEdgeDeviceParam } from '@/react/portainer/environments/wizard/hooks/useCreateEdgeDeviceParam';
|
||||
|
||||
import { FormSection } from '@@/form-components/FormSection';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Form, Formik } from 'formik';
|
||||
import { useReducer } from 'react';
|
||||
|
||||
import { EdgeCheckinIntervalField } from '@/edge/components/EdgeCheckInIntervalField';
|
||||
import { EdgeAsyncIntervalsForm } from '@/edge/components/EdgeAsyncIntervalsForm';
|
||||
import { EdgeCheckinIntervalField } from '@/react/edge/components/EdgeCheckInIntervalField';
|
||||
import { EdgeAsyncIntervalsForm } from '@/react/edge/components/EdgeAsyncIntervalsForm';
|
||||
import { notifySuccess } from '@/portainer/services/notifications';
|
||||
|
||||
import { FormControl } from '@@/form-components/FormControl';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { boolean, number, object, SchemaOf } from 'yup';
|
||||
|
||||
import { options as asyncIntervalOptions } from '@/edge/components/EdgeAsyncIntervalsForm';
|
||||
import { options as asyncIntervalOptions } from '@/react/edge/components/EdgeAsyncIntervalsForm';
|
||||
|
||||
import { FormValues } from './types';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Formik, Form } from 'formik';
|
||||
|
||||
import { EdgeCheckinIntervalField } from '@/edge/components/EdgeCheckInIntervalField';
|
||||
import { EdgeCheckinIntervalField } from '@/react/edge/components/EdgeCheckInIntervalField';
|
||||
|
||||
import { Switch } from '@@/form-components/SwitchField/Switch';
|
||||
import { FormControl } from '@@/form-components/FormControl';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue