refactor(environments): move environments ts code to react [EE-3443] (#7747)

pull/7917/head
Chaim Lev-Ari 2022-10-23 09:53:25 +03:00 committed by GitHub
parent 1b12cc9f31
commit e48ceb15e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
154 changed files with 195 additions and 179 deletions

View File

@ -1,7 +1,7 @@
import angular from 'angular';
import { StateRegistry, StateService } from '@uirouter/angularjs';
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import { notifyError } from '@/portainer/services/notifications';
import { EndpointProvider, StateManager } from '@/portainer/services/types';

View File

@ -1,6 +1,6 @@
import angular from 'angular';
import { EnvironmentStatus } from '@/portainer/environments/types';
import { EnvironmentStatus } from '@/react/portainer/environments/types';
import { reactModule } from './react';

View File

@ -1,6 +1,6 @@
import { useQuery } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import axios, { parseAxiosError } from '@/portainer/services/axios';
export interface VersionResponse {

View File

@ -3,7 +3,7 @@ import { usePagination, useTable } from 'react-table';
import { Device } from '@/portainer/hostmanagement/open-amt/model';
import { useAMTDevices } from '@/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/useAMTDevices';
import { RowProvider } from '@/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/columns/RowContext';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import PortainerError from '@/portainer/error';
import { InnerDatatable } from '@@/datatables/InnerDatatable';

View File

@ -1,6 +1,6 @@
import { PropsWithChildren, useMemo, useReducer } from 'react';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { createRowContext } from '@@/datatables/RowContext';

View File

@ -2,7 +2,7 @@ import { useEffect, useMemo } from 'react';
import { useQuery } from 'react-query';
import { getDevices } from '@/portainer/hostmanagement/open-amt/open-amt.service';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import PortainerError from '@/portainer/error';
import * as notifications from '@/portainer/services/notifications';

View File

@ -2,7 +2,7 @@ import { useTable, useExpanded, useSortBy, useFilters } from 'react-table';
import { useRowSelectColumn } from '@lineup-lite/hooks';
import _ from 'lodash';
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import { AMTDevicesDatatable } from '@/edge/EdgeDevices/EdgeDevicesView/AMTDevicesDatatable/AMTDevicesDatatable';
import { EnvironmentGroup } from '@/portainer/environment-groups/types';

View File

@ -1,6 +1,6 @@
import { useRouter } from '@uirouter/react';
import type { Environment } from '@/portainer/environments/types';
import type { Environment } from '@/react/portainer/environments/types';
import {
confirmAsync,
confirmDestructiveAsync,
@ -8,7 +8,7 @@ import {
import { promptAsync } from '@/portainer/services/modal.service/prompt';
import * as notifications from '@/portainer/services/notifications';
import { activateDevice } from '@/portainer/hostmanagement/open-amt/open-amt.service';
import { deleteEndpoint } from '@/portainer/environments/environment.service';
import { deleteEndpoint } from '@/react/portainer/environments/environment.service';
import { Button } from '@@/buttons';
import { Link } from '@@/Link';

View File

@ -1,7 +1,7 @@
import { useState } from 'react';
import { useEnvironmentList } from '@/portainer/environments/queries/useEnvironmentList';
import { EdgeTypes, Environment } from '@/portainer/environments/types';
import { useEnvironmentList } from '@/react/portainer/environments/queries/useEnvironmentList';
import { EdgeTypes, Environment } from '@/react/portainer/environments/types';
import { useDebounce } from '@/portainer/hooks/useDebounce';
import { useSearchBarState } from '@@/datatables/SearchBar';

View File

@ -2,10 +2,10 @@ import { CellProps, Column } from 'react-table';
import { MenuItem, MenuLink } from '@reach/menu-button';
import { useRouter, useSref } from '@uirouter/react';
import { Environment } from '@/portainer/environments/types';
import { snapshotEndpoint } from '@/portainer/environments/environment.service';
import { Environment } from '@/react/portainer/environments/types';
import { snapshotEndpoint } from '@/react/portainer/environments/environment.service';
import * as notifications from '@/portainer/services/notifications';
import { getRoute } from '@/portainer/environments/utils';
import { getRoute } from '@/react/portainer/environments/utils';
import { ActionsMenu } from '@@/datatables/ActionsMenu';

View File

@ -1,6 +1,6 @@
import { Column } from 'react-table';
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import { DefaultFilter } from '@@/datatables/Filter';

View File

@ -1,6 +1,6 @@
import { CellProps, Column } from 'react-table';
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import { EdgeIndicator } from '@/portainer/home/EnvironmentList/EnvironmentItem/EdgeIndicator';
export const heartbeat: Column<Environment> = {

View File

@ -1,6 +1,6 @@
import { CellProps, Column } from 'react-table';
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import { Link } from '@@/Link';
import { ExpandingCell } from '@@/datatables/ExpandingCell';

View File

@ -8,7 +8,7 @@ import {
} from 'react-table';
import { useRowSelectColumn } from '@lineup-lite/hooks';
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import { notifySuccess } from '@/portainer/services/notifications';
import { Button } from '@@/buttons';

View File

@ -1,7 +1,7 @@
import { useRouter } from '@uirouter/react';
import { useEnvironmentList } from '@/portainer/environments/queries/useEnvironmentList';
import { EdgeTypes } from '@/portainer/environments/types';
import { useEnvironmentList } from '@/react/portainer/environments/queries/useEnvironmentList';
import { EdgeTypes } from '@/react/portainer/environments/types';
import { InformationPanel } from '@@/InformationPanel';
import { TextTip } from '@@/Tip/TextTip';

View File

@ -1,6 +1,6 @@
import { useMutation, useQueryClient } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { promiseSequence } from '@/portainer/helpers/promise-utils';

View File

@ -1,7 +1,7 @@
import _ from 'lodash-es';
import { confirmDestructiveAsync } from '@/portainer/services/modal.service/confirm';
import { EdgeTypes } from '@/portainer/environments/types';
import { getEnvironments } from '@/portainer/environments/environment.service';
import { EdgeTypes } from '@/react/portainer/environments/types';
import { getEnvironments } from '@/react/portainer/environments/environment.service';
export class EdgeGroupFormController {
/* @ngInject */

View File

@ -1,5 +1,5 @@
import _ from 'lodash-es';
import { getEnvironments } from '@/portainer/environments/environment.service';
import { getEnvironments } from '@/react/portainer/environments/environment.service';
export class EdgeJobController {
/* @ngInject */

View File

@ -1,5 +1,5 @@
import _ from 'lodash-es';
import { getEnvironments } from '@/portainer/environments/environment.service';
import { getEnvironments } from '@/react/portainer/environments/environment.service';
export class EditEdgeStackViewController {
/* @ngInject */

View File

@ -1,6 +1,6 @@
import { useQuery, useMutation, useQueryClient } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import {
mutationOptions,
withError,

View File

@ -1,5 +1,5 @@
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { Ingress, DeleteIngressesRequest, IngressController } from './types';

View File

@ -1,6 +1,6 @@
import { useQuery } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { error as notifyError } from '@/portainer/services/notifications';
import { getServices } from './service';

View File

@ -1,5 +1,5 @@
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { Service } from './types';

View File

@ -1,7 +1,7 @@
import { saveAs } from 'file-saver';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
const baseUrl = 'kubernetes';

View File

@ -1,8 +1,8 @@
import angular from 'angular';
import _ from 'lodash-es';
import { EdgeTypes } from '@/portainer/environments/types';
import { getEnvironments } from '@/portainer/environments/environment.service';
import { EdgeTypes } from '@/react/portainer/environments/types';
import { getEnvironments } from '@/react/portainer/environments/environment.service';
import { getTags } from '@/portainer/tags/tags.service';
class AssoicatedEndpointsSelectorController {

View File

@ -1,6 +1,6 @@
import _ from 'lodash-es';
import angular from 'angular';
import { endpointsByGroup } from '@/portainer/environments/environment.service';
import { endpointsByGroup } from '@/react/portainer/environments/environment.service';
import { notifyError } from '@/portainer/services/notifications';
class GroupFormController {

View File

@ -1,10 +1,10 @@
import { Zap } from 'react-feather';
import { EnvironmentType } from '@/portainer/environments/types';
import { EnvironmentType } from '@/react/portainer/environments/types';
import {
isAgentEnvironment,
isEdgeEnvironment,
} from '@/portainer/environments/utils';
} from '@/react/portainer/environments/utils';
interface Props {
type: EnvironmentType;

View File

@ -1,7 +1,7 @@
import clsx from 'clsx';
import { isoDateFromTimestamp } from '@/portainer/filters/filters';
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import { usePublicSettings } from '@/react/portainer/settings/queries';
import { PublicSettingsViewModel } from '@/portainer/models/settings';

View File

@ -4,7 +4,7 @@ import { environmentTypeIcon } from '@/portainer/filters/filters';
import dockerEdge from '@/assets/images/edge_endpoint.png';
import kube from '@/assets/images/kubernetes_endpoint.png';
import kubeEdge from '@/assets/images/kubernetes_edge_endpoint.png';
import { EnvironmentType } from '@/portainer/environments/types';
import { EnvironmentType } from '@/react/portainer/environments/types';
import azure from '@/assets/ico/vendor/azure.svg';
import docker from '@/assets/ico/vendor/docker.svg';

View File

@ -4,7 +4,7 @@ import {
Environment,
EnvironmentStatus,
EnvironmentType,
} from '@/portainer/environments/types';
} from '@/react/portainer/environments/types';
import { createMockEnvironment } from '@/react-tools/test-mocks';
import { EnvironmentItem } from './EnvironmentItem';

View File

@ -2,7 +2,7 @@ import {
EnvironmentGroup,
EnvironmentGroupId,
} from '@/portainer/environment-groups/types';
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import { UserContext } from '@/portainer/hooks/useUser';
import { UserViewModel } from '@/portainer/models/user';
import { Tag } from '@/portainer/tags/types';

View File

@ -7,12 +7,15 @@ import {
humanize,
stripProtocol,
} from '@/portainer/filters/filters';
import { type Environment, PlatformType } from '@/portainer/environments/types';
import {
type Environment,
PlatformType,
} from '@/react/portainer/environments/types';
import {
getPlatformType,
isDockerEnvironment,
isEdgeEnvironment,
} from '@/portainer/environments/utils';
} from '@/react/portainer/environments/utils';
import type { TagId } from '@/portainer/tags/types';
import { useTags } from '@/portainer/tags/queries';
import { useUser } from '@/portainer/hooks/useUser';

View File

@ -1,5 +1,8 @@
import { Environment, PlatformType } from '@/portainer/environments/types';
import { getPlatformType } from '@/portainer/environments/utils';
import {
Environment,
PlatformType,
} from '@/react/portainer/environments/types';
import { getPlatformType } from '@/react/portainer/environments/utils';
import { EnvironmentStatsDocker } from './EnvironmentStatsDocker';
import { EnvironmentStatsKubernetes } from './EnvironmentStatsKubernetes';

View File

@ -1,7 +1,7 @@
import {
DockerSnapshot,
EnvironmentType,
} from '@/portainer/environments/types';
} from '@/react/portainer/environments/types';
import { addPlural } from '@/portainer/helpers/strings';
import { AgentVersionTag } from './AgentVersionTag';

View File

@ -1,7 +1,7 @@
import {
EnvironmentType,
KubernetesSnapshot,
} from '@/portainer/environments/types';
} from '@/react/portainer/environments/types';
import { humanize } from '@/portainer/filters/filters';
import { addPlural } from '@/portainer/helpers/strings';

View File

@ -1,6 +1,6 @@
import clsx from 'clsx';
import { EnvironmentStatus } from '@/portainer/environments/types';
import { EnvironmentStatus } from '@/react/portainer/environments/types';
interface Props {
status: EnvironmentStatus;

View File

@ -1,4 +1,4 @@
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import { UserContext } from '@/portainer/hooks/useUser';
import { UserViewModel } from '@/portainer/models/user';
import { renderWithQueryClient } from '@/react-tools/test-utils';

View File

@ -10,7 +10,7 @@ import {
EnvironmentStatus,
PlatformType,
EdgeTypes,
} from '@/portainer/environments/types';
} from '@/react/portainer/environments/types';
import { EnvironmentGroupId } from '@/portainer/environment-groups/types';
import {
HomepageFilter,
@ -20,12 +20,12 @@ import { useDebounce } from '@/portainer/hooks/useDebounce';
import {
refetchIfAnyOffline,
useEnvironmentList,
} from '@/portainer/environments/queries/useEnvironmentList';
} from '@/react/portainer/environments/queries/useEnvironmentList';
import { useGroups } from '@/portainer/environment-groups/queries';
import { useTags } from '@/portainer/tags/queries';
import { Filter } from '@/portainer/home/types';
import { useAgentVersionsList } from '@/portainer/environments/queries/useAgentVersionsList';
import { EnvironmentsQueryParams } from '@/portainer/environments/environment.service';
import { useAgentVersionsList } from '@/react/portainer/environments/queries/useAgentVersionsList';
import { EnvironmentsQueryParams } from '@/react/portainer/environments/environment.service';
import { useUser } from '@/portainer/hooks/useUser';
import { TableFooter } from '@@/datatables/TableFooter';

View File

@ -1,10 +1,10 @@
import { useState } from 'react';
import { Download } from 'react-feather';
import { Environment } from '@/portainer/environments/types';
import { isKubernetesEnvironment } from '@/portainer/environments/utils';
import { Environment } from '@/react/portainer/environments/types';
import { isKubernetesEnvironment } from '@/react/portainer/environments/utils';
import { trackEvent } from '@/angulartics.matomo/analytics-services';
import { Query } from '@/portainer/environments/queries/useEnvironmentList';
import { Query } from '@/react/portainer/environments/queries/useEnvironmentList';
import { Button } from '@@/buttons';

View File

@ -5,13 +5,13 @@ import { DialogOverlay } from '@reach/dialog';
import * as kcService from '@/kubernetes/services/kubeconfig.service';
import * as notifications from '@/portainer/services/notifications';
import { EnvironmentType } from '@/portainer/environments/types';
import { EnvironmentType } from '@/react/portainer/environments/types';
import { usePaginationLimitState } from '@/portainer/hooks/usePaginationLimitState';
import { usePublicSettings } from '@/react/portainer/settings/queries';
import {
Query,
useEnvironmentList,
} from '@/portainer/environments/queries/useEnvironmentList';
} from '@/react/portainer/environments/queries/useEnvironmentList';
import { PaginationControls } from '@@/PaginationControls';
import { Checkbox } from '@@/form-components/Checkbox';

View File

@ -1,6 +1,6 @@
import { useState } from 'react';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
export function useSelection() {
const [selection, setSelection] = useState<Record<EnvironmentId, boolean>>(

View File

@ -1,12 +1,13 @@
import { useRouter } from '@uirouter/react';
import { useState } from 'react';
import { Environment } from '@/react/portainer/environments/types';
import { snapshotEndpoints } from '@/react/portainer/environments/environment.service';
import { isEdgeEnvironment } from '@/react/portainer/environments/utils';
import { PageHeader } from '@@/PageHeader';
import * as notifications from '../services/notifications';
import { Environment } from '../environments/types';
import { snapshotEndpoints } from '../environments/environment.service';
import { isEdgeEnvironment } from '../environments/utils';
import { confirmAsync } from '../services/modal.service/confirm';
import { buildTitle } from '../services/modal.service/utils';

View File

@ -1,4 +1,4 @@
import { useEnvironment } from '../environments/queries/useEnvironment';
import { useEnvironment } from '@/react/portainer/environments/queries/useEnvironment';
import { useEnvironmentId } from './useEnvironmentId';

View File

@ -11,10 +11,10 @@ import {
} from 'react';
import { isAdmin } from '@/portainer/users/user.helpers';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { getUser } from '../users/user.service';
import { User, UserId } from '../users/types';
import { EnvironmentId } from '../environments/types';
import { useLocalStorage } from './useLocalStorage';

View File

@ -1,5 +1,5 @@
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import {
OpenAMTConfiguration,

View File

@ -1,7 +1,7 @@
import _ from 'lodash-es';
import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service';
import { getEnvironments } from '@/portainer/environments/environment.service';
import { getEnvironments } from '@/react/portainer/environments/environment.service';
import AccessViewerPolicyModel from '../../models/access';
export default class AccessViewerController {

View File

@ -1,5 +1,5 @@
import angular from 'angular';
import { getEnvironments } from '../environments/environment.service';
import { getEnvironments } from '@/react/portainer/environments/environment.service';
angular.module('portainer.app').factory('NameValidator', NameValidatorFactory);
/* @ngInject */

View File

@ -1,4 +1,4 @@
import { Environment } from '../environments/types';
import { Environment } from '@/react/portainer/environments/types';
export interface EndpointProvider {
setEndpointID(id: Environment['Id']): void;

View File

@ -1,4 +1,4 @@
import { EnvironmentId } from '../environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
export type UserId = number;

View File

@ -1,6 +1,6 @@
import angular from 'angular';
import uuidv4 from 'uuid/v4';
import { getEnvironments } from '@/portainer/environments/environment.service';
import { getEnvironments } from '@/react/portainer/environments/environment.service';
class AuthenticationController {
/* @ngInject */

View File

@ -6,7 +6,7 @@ import { EndpointSecurityFormData } from '@/portainer/components/endpointSecurit
import EndpointHelper from '@/portainer/helpers/endpointHelper';
import { getAMTInfo } from 'Portainer/hostmanagement/open-amt/open-amt.service';
import { confirmDestructiveAsync } from '@/portainer/services/modal.service/confirm';
import { isEdgeEnvironment } from '@/portainer/environments/utils';
import { isEdgeEnvironment } from '@/react/portainer/environments/utils';
import { commandsTabs } from '@/react/edge/components/EdgeScriptForm/scripts';
import { GpusListAngular } from '@/react/portainer/environments/wizard/EnvironmentsCreationView/shared/Hardware/GpusList';

View File

@ -1,6 +1,6 @@
import { map } from 'lodash';
import EndpointHelper from '@/portainer/helpers/endpointHelper';
import { getEnvironments } from '@/portainer/environments/environment.service';
import { getEnvironments } from '@/react/portainer/environments/environment.service';
export class EndpointsController {
/* @ngInject */

View File

@ -1,4 +1,4 @@
import { getEnvironments } from '@/portainer/environments/environment.service';
import { getEnvironments } from '@/react/portainer/environments/environment.service';
angular.module('portainer.app').controller('InitAdminController', [
'$scope',

View File

@ -1,7 +1,7 @@
import { ResourceControlType } from '@/react/portainer/access-control/types';
import { AccessControlFormData } from 'Portainer/components/accessControlForm/porAccessControlFormModel';
import { FeatureId } from 'Portainer/feature-flags/enums';
import { getEnvironments } from '@/portainer/environments/environment.service';
import { getEnvironments } from '@/react/portainer/environments/environment.service';
import { StackStatus, StackType } from '@/react/docker/stacks/types';
angular.module('portainer.app').controller('StackController', [

View File

@ -2,7 +2,7 @@ import _ from 'lodash';
import { Team } from '@/react/portainer/users/teams/types';
import { Role, User, UserId } from '@/portainer/users/types';
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
export function createMockUsers(
count: number,

View File

@ -2,7 +2,7 @@ import { useMutation, useQueryClient } from 'react-query';
import { createContainerGroup } from '@/react/azure/services/container-groups.service';
import { queryKeys } from '@/react/azure/queries/query-keys';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import PortainerError from '@/portainer/error';
import {
ContainerGroup,

View File

@ -1,4 +1,4 @@
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import {
ContainerInstanceFormValues,
ProviderViewModel,

View File

@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from 'react-query';
import { deleteContainerGroup } from '@/react/azure/services/container-groups.service';
import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId';
import { notifyError, notifySuccess } from '@/portainer/services/notifications';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { promiseSequence } from '@/portainer/helpers/promise-utils';
import { useContainerGroups } from '@/react/azure/queries/useContainerGroups';
import { useSubscriptions } from '@/react/azure/queries/useSubscriptions';

View File

@ -1,4 +1,4 @@
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
export const queryKeys = {
subscriptions: (environmentId: EnvironmentId) =>

View File

@ -1,6 +1,6 @@
import { useQuery } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { withError } from '@/react-tools/react-query';
import axios, { parseAxiosError } from '@/portainer/services/axios';

View File

@ -4,7 +4,7 @@ import { useQueries } from 'react-query';
import { withError } from '@/react-tools/react-query';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { Subscription, ContainerGroup } from '../types';

View File

@ -1,7 +1,7 @@
import _ from 'lodash';
import { useQueries } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { withError } from '@/react-tools/react-query';

View File

@ -1,6 +1,6 @@
import { useQuery } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { withError } from '@/react-tools/react-query';

View File

@ -1,7 +1,7 @@
import _ from 'lodash';
import { useQueries } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { withError } from '@/react-tools/react-query';

View File

@ -1,6 +1,6 @@
import { useQuery } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { withError } from '@/react-tools/react-query';

View File

@ -1,7 +1,7 @@
import { useQuery } from 'react-query';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { withError } from '@/react-tools/react-query';
import { azureErrorParser } from '../services/utils';

View File

@ -1,4 +1,4 @@
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
export function buildSubscriptionsUrl(
environmentId: EnvironmentId,

View File

@ -1,4 +1,4 @@
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { buildContainerGroupUrl } from '../queries/utils';

View File

@ -1,6 +1,6 @@
import _ from 'lodash';
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import type { DockerContainer } from '@/react/docker/containers/types';
import { useShowGPUsColumn } from '@/react/docker/containers/utils';

View File

@ -27,7 +27,7 @@ import {
startContainer,
stopContainer,
} from '@/react/docker/containers/containers.service';
import type { EnvironmentId } from '@/portainer/environments/types';
import type { EnvironmentId } from '@/react/portainer/environments/types';
import { Link } from '@@/Link';
import { ButtonGroup, Button } from '@@/buttons';

View File

@ -1,4 +1,4 @@
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import { createRowContext } from '@@/datatables/RowContext';

View File

@ -1,6 +1,6 @@
import { useInfo } from '@/docker/services/system.service';
import { Environment } from '@/portainer/environments/types';
import { isAgentEnvironment } from '@/portainer/environments/utils';
import { Environment } from '@/react/portainer/environments/types';
import { isAgentEnvironment } from '@/react/portainer/environments/utils';
import { PageHeader } from '@@/PageHeader';

View File

@ -1,4 +1,4 @@
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import PortainerError from '@/portainer/error';
import axios from '@/portainer/services/axios';
import { genericHandler } from '@/docker/rest/response/handlers';

View File

@ -1,6 +1,6 @@
import { useQuery } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { urlBuilder } from '../containers.service';

View File

@ -1,6 +1,6 @@
import { useQuery } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { queryKeys } from './query-keys';

View File

@ -1,4 +1,4 @@
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { queryKeys as dockerQueryKeys } from '../../queries/utils';

View File

@ -1,7 +1,7 @@
import _ from 'lodash';
import { useInfo } from '@/docker/services/system.service';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { ResourceControlViewModel } from '@/react/portainer/access-control/models/ResourceControlViewModel';
import { DockerContainer, ContainerStatus } from './types';

View File

@ -1,5 +1,5 @@
import { Authorized } from '@/portainer/hooks/useUser';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { Icon } from '@/react/components/Icon';
import { Table, TableContainer, TableTitle } from '@@/datatables';

View File

@ -1,6 +1,6 @@
import { ContainerId } from '@/react/docker/containers/types';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { NetworkId, DockerNetwork } from './types';

View File

@ -1,6 +1,6 @@
import { useQuery, useMutation, useQueryClient } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import {
error as notifyError,
success as notifySuccess,

View File

@ -1,4 +1,4 @@
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
export const queryKeys = {
root: (environmentId: EnvironmentId) => ['docker', environmentId] as const,

View File

@ -1,7 +1,7 @@
import _ from 'lodash';
import { DockerContainer } from '@/react/docker/containers/types';
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import { createStore } from '@/react/docker/containers/ListView/ContainersDatatable/datatable-store';
import { useColumns } from '@/react/docker/containers/ListView/ContainersDatatable/columns';
import { ContainersDatatableActions } from '@/react/docker/containers/ListView/ContainersDatatable/ContainersDatatableActions';

View File

@ -1,6 +1,6 @@
import { useEffect } from 'react';
import { useAgentDetails } from '@/portainer/environments/queries/useAgentDetails';
import { useAgentDetails } from '@/react/portainer/environments/queries/useAgentDetails';
import { Code } from '@@/Code';
import { CopyButton } from '@@/buttons/CopyButton';

View File

@ -1,4 +1,4 @@
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { TagId } from '@/portainer/tags/types';
export interface EdgeGroup {

View File

@ -1,4 +1,4 @@
import { Environment } from '@/portainer/environments/types';
import { Environment } from '@/react/portainer/environments/types';
import { createRowContext } from '@@/datatables/RowContext';

View File

@ -1,5 +1,5 @@
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import {
KubernetesApiListResponse,
V1IngressClass,

View File

@ -1,4 +1,4 @@
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import PortainerError from '@/portainer/error';
import axios from '@/portainer/services/axios';

View File

@ -1,6 +1,6 @@
import { useQuery } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { error as notifyError } from '@/portainer/services/notifications';
import { getConfigMaps } from './service';

View File

@ -1,5 +1,5 @@
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { Configuration } from './types';

View File

@ -1,4 +1,4 @@
import { Registry } from '@/portainer/environments/environment.service/registries';
import { Registry } from '@/react/portainer/environments/environment.service/registries';
import { Select } from '@@/form-components/ReactSelect';

View File

@ -1,6 +1,6 @@
import { useQuery } from 'react-query';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { error as notifyError } from '@/portainer/services/notifications';
import { getNamespaces, getNamespace } from './service';

View File

@ -1,5 +1,5 @@
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { Namespaces } from './types';

View File

@ -4,7 +4,7 @@ import { useUser } from '@/portainer/hooks/useUser';
import { Icon } from '@/react/components/Icon';
import { TeamMembership, TeamRole } from '@/react/portainer/users/teams/types';
import { useUserMembership } from '@/portainer/users/queries';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { TableContainer, TableTitle } from '@@/datatables';
import { Button } from '@@/buttons';

View File

@ -6,7 +6,7 @@ import { object } from 'yup';
import { useUser } from '@/portainer/hooks/useUser';
import { confirmAsync } from '@/portainer/services/modal.service/confirm';
import { notifySuccess } from '@/portainer/services/notifications';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { Button } from '@@/buttons';
import { LoadingButton } from '@@/buttons/LoadingButton';

View File

@ -2,7 +2,7 @@ import { useCallback } from 'react';
import { FormikErrors } from 'formik';
import { useUser } from '@/portainer/hooks/useUser';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { BoxSelector } from '@@/BoxSelector';
import { FormError } from '@@/form-components/FormError';

View File

@ -1,6 +1,6 @@
import { useTeams } from '@/react/portainer/users/teams/queries';
import { useUsers } from '@/portainer/users/queries';
import { EnvironmentId } from '@/portainer/environments/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
export function useLoadState(environmentId?: EnvironmentId) {
const teams = useTeams(false, environmentId);

Some files were not shown because too many files have changed in this diff Show More