mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
refactor(edge/groups): migrate view to react [EE-4683] (#10592)
This commit is contained in:
parent
1f2f4525e3
commit
99b39da03d
18 changed files with 199 additions and 228 deletions
|
@ -1,3 +1,10 @@
|
|||
export function buildUrl() {
|
||||
return '/edge_groups';
|
||||
import { EdgeGroup } from '../types';
|
||||
|
||||
export function buildUrl({
|
||||
action,
|
||||
id,
|
||||
}: { id?: EdgeGroup['Id']; action?: string } = {}) {
|
||||
const baseUrl = '/edge_groups';
|
||||
const url = id ? `${baseUrl}/${id}` : baseUrl;
|
||||
return action ? `${url}/${action}` : url;
|
||||
}
|
||||
|
|
|
@ -1,15 +1,22 @@
|
|||
import { useQuery } from 'react-query';
|
||||
|
||||
import axios, { parseAxiosError } from '@/portainer/services/axios';
|
||||
import { EnvironmentType } from '@/react/portainer/environments/types';
|
||||
import {
|
||||
EnvironmentId,
|
||||
EnvironmentType,
|
||||
} from '@/react/portainer/environments/types';
|
||||
|
||||
import { EdgeGroup } from '../types';
|
||||
|
||||
import { queryKeys } from './query-keys';
|
||||
import { buildUrl } from './build-url';
|
||||
|
||||
interface EdgeGroupListItemResponse extends EdgeGroup {
|
||||
export interface EdgeGroupListItemResponse extends EdgeGroup {
|
||||
EndpointTypes: Array<EnvironmentType>;
|
||||
HasEdgeStack?: boolean;
|
||||
HasEdgeJob?: boolean;
|
||||
HasEdgeConfig?: boolean;
|
||||
TrustedEndpoints: Array<EnvironmentId>;
|
||||
}
|
||||
|
||||
async function getEdgeGroups() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue