Make the imports easier to use
This commit is contained in:
parent
a00fee5516
commit
5b5e3f26f4
19 changed files with 133 additions and 115 deletions
|
@ -1,7 +1,6 @@
|
||||||
import useSWR, { SWRConfiguration, SWRResponse } from 'swr';
|
import useSWR, { SWRConfiguration, SWRResponse } from 'swr';
|
||||||
import http, { FractalResponseList } from '@/api/http';
|
import http, { FractalResponseList } from '@/api/http';
|
||||||
import Transformers from '@definitions/user/transformers';
|
import { Transformers, PersonalAccessToken } from '@definitions/user';
|
||||||
import { PersonalAccessToken } from '@definitions/user/models';
|
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import useUserSWRContextKey from '@/plugins/useUserSWRContextKey';
|
import useUserSWRContextKey from '@/plugins/useUserSWRContextKey';
|
||||||
|
|
||||||
|
@ -22,7 +21,7 @@ const useAPIKeys = (
|
||||||
const createAPIKey = async (description: string): Promise<[ PersonalAccessToken, string ]> => {
|
const createAPIKey = async (description: string): Promise<[ PersonalAccessToken, string ]> => {
|
||||||
const { data } = await http.post('/api/client/account/api-keys', { description });
|
const { data } = await http.post('/api/client/account/api-keys', { description });
|
||||||
|
|
||||||
const token = Transformers.toPersonalAccessToken(data.attributes);
|
const token = Transformers.toPersonalAccessToken(data);
|
||||||
|
|
||||||
return [ token, data.meta?.secret_token || '' ];
|
return [ token, data.meta?.secret_token || '' ];
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import useSWR, { SWRConfiguration, SWRResponse } from 'swr';
|
import useSWR, { SWRConfiguration, SWRResponse } from 'swr';
|
||||||
import http, { FractalResponseList } from '@/api/http';
|
import http, { FractalResponseList } from '@/api/http';
|
||||||
import Transformers from '@definitions/user/transformers';
|
import { Transformers, SecurityKey } from '@definitions/user';
|
||||||
import { SecurityKey } from '@definitions/user/models';
|
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import { base64Decode, bufferDecode, bufferEncode, decodeSecurityKeyCredentials } from '@/helpers';
|
import { base64Decode, bufferDecode, bufferEncode, decodeSecurityKeyCredentials } from '@/helpers';
|
||||||
import { LoginResponse } from '@/api/auth/login';
|
import { LoginResponse } from '@/api/auth/login';
|
||||||
|
@ -15,7 +14,7 @@ const useSecurityKeys = (config?: SWRConfiguration<SecurityKey[], AxiosError>):
|
||||||
async (): Promise<SecurityKey[]> => {
|
async (): Promise<SecurityKey[]> => {
|
||||||
const { data } = await http.get('/api/client/account/security-keys');
|
const { data } = await http.get('/api/client/account/security-keys');
|
||||||
|
|
||||||
return (data as FractalResponseList).data.map((datum) => Transformers.toSecurityKey(datum.attributes));
|
return (data as FractalResponseList).data.map(Transformers.toSecurityKey);
|
||||||
},
|
},
|
||||||
config,
|
config,
|
||||||
);
|
);
|
||||||
|
@ -40,7 +39,7 @@ const registerCredentialForAccount = async (name: string, tokenId: string, crede
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return Transformers.toSecurityKey(data.attributes);
|
return Transformers.toSecurityKey(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
const registerSecurityKey = async (name: string): Promise<SecurityKey> => {
|
const registerSecurityKey = async (name: string): Promise<SecurityKey> => {
|
||||||
|
|
|
@ -3,9 +3,8 @@ import { AxiosError } from 'axios';
|
||||||
import { useRouteMatch } from 'react-router-dom';
|
import { useRouteMatch } from 'react-router-dom';
|
||||||
import http from '@/api/http';
|
import http from '@/api/http';
|
||||||
import { Model, UUID, withRelationships, WithRelationships } from '@/api/admin/index';
|
import { Model, UUID, withRelationships, WithRelationships } from '@/api/admin/index';
|
||||||
import Transformers from '@definitions/admin/transformers';
|
|
||||||
import { Allocation, Node } from '@/api/admin/node';
|
import { Allocation, Node } from '@/api/admin/node';
|
||||||
import { User } from '@definitions/admin/models';
|
import { Transformers, User } from '@definitions/admin';
|
||||||
import { Egg, EggVariable } from '@/api/admin/egg';
|
import { Egg, EggVariable } from '@/api/admin/egg';
|
||||||
import { Nest } from '@/api/admin/nest';
|
import { Nest } from '@/api/admin/nest';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import http, { QueryBuilderParams, withQueryBuilderParams } from '@/api/http';
|
import http, { QueryBuilderParams, withQueryBuilderParams } from '@/api/http';
|
||||||
import Transformers from '@definitions/admin/transformers';
|
import { Transformers, User } from '@definitions/admin';
|
||||||
import { User } from '@definitions/admin/models';
|
|
||||||
|
|
||||||
export const getUser = async (id: string | number): Promise<User> => {
|
export const getUser = async (id: string | number): Promise<User> => {
|
||||||
const { data } = await http.get(`/api/application/users/${id}`);
|
const { data } = await http.get(`/api/application/users/${id}`);
|
||||||
|
|
2
resources/scripts/api/definitions/admin/index.ts
Normal file
2
resources/scripts/api/definitions/admin/index.ts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
export * from './models.d';
|
||||||
|
export { default as Transformers } from './transformers';
|
2
resources/scripts/api/definitions/user/index.ts
Normal file
2
resources/scripts/api/definitions/user/index.ts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
export * from './models.d';
|
||||||
|
export { default as Transformers } from './transformers';
|
|
@ -1,4 +1,5 @@
|
||||||
import { Model, UUID } from '@/api/definitions';
|
import { Model, UUID } from '@/api/definitions';
|
||||||
|
import { ServerEggVariable, ServerStatus } from '@/api/server/types';
|
||||||
|
|
||||||
interface SecurityKey extends Model {
|
interface SecurityKey extends Model {
|
||||||
uuid: UUID;
|
uuid: UUID;
|
||||||
|
@ -16,3 +17,46 @@ interface PersonalAccessToken extends Model {
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
lastUsedAt: Date | null;
|
lastUsedAt: Date | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface Allocation extends Model {
|
||||||
|
id: number;
|
||||||
|
ip: string;
|
||||||
|
alias: string | null;
|
||||||
|
port: number;
|
||||||
|
notes: string | null;
|
||||||
|
isDefault: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Server extends Model {
|
||||||
|
id: string;
|
||||||
|
internalId: number | string;
|
||||||
|
uuid: UUID;
|
||||||
|
name: string;
|
||||||
|
node: string;
|
||||||
|
status: ServerStatus;
|
||||||
|
sftpDetails: {
|
||||||
|
ip: string;
|
||||||
|
port: number;
|
||||||
|
};
|
||||||
|
invocation: string;
|
||||||
|
dockerImage: string;
|
||||||
|
description: string;
|
||||||
|
limits: {
|
||||||
|
memory: number;
|
||||||
|
swap: number;
|
||||||
|
disk: number;
|
||||||
|
io: number;
|
||||||
|
cpu: number;
|
||||||
|
threads: string;
|
||||||
|
};
|
||||||
|
eggFeatures: string[];
|
||||||
|
featureLimits: {
|
||||||
|
databases: number;
|
||||||
|
allocations: number;
|
||||||
|
backups: number;
|
||||||
|
};
|
||||||
|
isInstalling: boolean;
|
||||||
|
isTransferring: boolean;
|
||||||
|
variables: ServerEggVariable[];
|
||||||
|
allocations: Allocation[];
|
||||||
|
}
|
||||||
|
|
|
@ -1,24 +1,62 @@
|
||||||
import * as Models from './models';
|
import * as Models from './models';
|
||||||
|
import { FractalResponseData, FractalResponseList } from '@/api/http';
|
||||||
|
import { rawDataToServerEggVariable } from '@/api/transformers';
|
||||||
|
|
||||||
export default class Transformers {
|
export default class Transformers {
|
||||||
static toSecurityKey (data: Record<string, any>): Models.SecurityKey {
|
static toSecurityKey ({ attributes }: FractalResponseData): Models.SecurityKey {
|
||||||
return {
|
return {
|
||||||
uuid: data.uuid,
|
uuid: attributes.uuid,
|
||||||
name: data.name,
|
name: attributes.name,
|
||||||
type: data.type,
|
type: attributes.type,
|
||||||
publicKeyId: data.public_key_id,
|
publicKeyId: attributes.public_key_id,
|
||||||
createdAt: new Date(data.created_at),
|
createdAt: new Date(attributes.created_at),
|
||||||
updatedAt: new Date(data.updated_at),
|
updatedAt: new Date(attributes.updated_at),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static toPersonalAccessToken (data: Record<string, any>): Models.PersonalAccessToken {
|
static toPersonalAccessToken ({ attributes }: FractalResponseData): Models.PersonalAccessToken {
|
||||||
return {
|
return {
|
||||||
identifier: data.token_id,
|
identifier: attributes.token_id,
|
||||||
description: data.description,
|
description: attributes.description,
|
||||||
createdAt: new Date(data.created_at),
|
createdAt: new Date(attributes.created_at),
|
||||||
updatedAt: new Date(data.updated_at),
|
updatedAt: new Date(attributes.updated_at),
|
||||||
lastUsedAt: data.last_used_at ? new Date(data.last_used_at) : null,
|
lastUsedAt: attributes.last_used_at ? new Date(attributes.last_used_at) : null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static toServerAllocation ({ attributes }: FractalResponseData): Models.Allocation {
|
||||||
|
return {
|
||||||
|
id: attributes.id,
|
||||||
|
ip: attributes.ip,
|
||||||
|
alias: attributes.ip_alias,
|
||||||
|
port: attributes.port,
|
||||||
|
notes: attributes.notes,
|
||||||
|
isDefault: attributes.is_default,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static toServer ({ attributes }: FractalResponseData): Models.Server {
|
||||||
|
return {
|
||||||
|
id: attributes.identifier,
|
||||||
|
internalId: attributes.internal_id,
|
||||||
|
uuid: attributes.uuid,
|
||||||
|
name: attributes.name,
|
||||||
|
node: attributes.node,
|
||||||
|
status: attributes.status,
|
||||||
|
invocation: attributes.invocation,
|
||||||
|
dockerImage: attributes.docker_image,
|
||||||
|
sftpDetails: {
|
||||||
|
ip: attributes.sftp_details.ip,
|
||||||
|
port: attributes.sftp_details.port,
|
||||||
|
},
|
||||||
|
description: attributes.description ? ((attributes.description.length > 0) ? attributes.description : null) : null,
|
||||||
|
limits: { ...attributes.limits },
|
||||||
|
eggFeatures: attributes.egg_features || [],
|
||||||
|
featureLimits: { ...attributes.feature_limits },
|
||||||
|
isInstalling: attributes.status === 'installing' || attributes.status === 'install_failed',
|
||||||
|
isTransferring: attributes.is_transferring,
|
||||||
|
variables: ((attributes.relationships?.variables as FractalResponseList | undefined)?.data || []).map(rawDataToServerEggVariable),
|
||||||
|
allocations: ((attributes.relationships?.allocations as FractalResponseList | undefined)?.data || []).map(this.toServerAllocation),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { rawDataToServerObject, Server } from '@/api/server/getServer';
|
|
||||||
import http, { getPaginationSet, PaginatedResult } from '@/api/http';
|
import http, { getPaginationSet, PaginatedResult } from '@/api/http';
|
||||||
|
import { Transformers, Server } from '@definitions/user';
|
||||||
|
|
||||||
interface QueryParams {
|
interface QueryParams {
|
||||||
query?: string;
|
query?: string;
|
||||||
|
@ -16,7 +16,7 @@ export default ({ query, ...params }: QueryParams): Promise<PaginatedResult<Serv
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(({ data }) => resolve({
|
.then(({ data }) => resolve({
|
||||||
items: (data.data || []).map((datum: any) => rawDataToServerObject(datum)),
|
items: (data.data || []).map(Transformers.toServer),
|
||||||
pagination: getPaginationSet(data.meta.pagination),
|
pagination: getPaginationSet(data.meta.pagination),
|
||||||
}))
|
}))
|
||||||
.catch(reject);
|
.catch(reject);
|
||||||
|
|
|
@ -1,81 +1,3 @@
|
||||||
import http, { FractalResponseData, FractalResponseList } from '@/api/http';
|
import * as Models from '@definitions/user/models';
|
||||||
import { rawDataToServerAllocation, rawDataToServerEggVariable } from '@/api/transformers';
|
|
||||||
import { ServerEggVariable, ServerStatus } from '@/api/server/types';
|
|
||||||
|
|
||||||
export interface Allocation {
|
export type Allocation = Models.Allocation;
|
||||||
id: number;
|
|
||||||
ip: string;
|
|
||||||
alias: string | null;
|
|
||||||
port: number;
|
|
||||||
notes: string | null;
|
|
||||||
isDefault: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Server {
|
|
||||||
id: string;
|
|
||||||
internalId: number | string;
|
|
||||||
uuid: string;
|
|
||||||
name: string;
|
|
||||||
node: string;
|
|
||||||
status: ServerStatus;
|
|
||||||
sftpDetails: {
|
|
||||||
ip: string;
|
|
||||||
port: number;
|
|
||||||
};
|
|
||||||
invocation: string;
|
|
||||||
dockerImage: string;
|
|
||||||
description: string;
|
|
||||||
limits: {
|
|
||||||
memory: number;
|
|
||||||
swap: number;
|
|
||||||
disk: number;
|
|
||||||
io: number;
|
|
||||||
cpu: number;
|
|
||||||
threads: string;
|
|
||||||
};
|
|
||||||
eggFeatures: string[];
|
|
||||||
featureLimits: {
|
|
||||||
databases: number;
|
|
||||||
allocations: number;
|
|
||||||
backups: number;
|
|
||||||
};
|
|
||||||
isInstalling: boolean;
|
|
||||||
isTransferring: boolean;
|
|
||||||
variables: ServerEggVariable[];
|
|
||||||
allocations: Allocation[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export const rawDataToServerObject = ({ attributes: data }: FractalResponseData): Server => ({
|
|
||||||
id: data.identifier,
|
|
||||||
internalId: data.internal_id,
|
|
||||||
uuid: data.uuid,
|
|
||||||
name: data.name,
|
|
||||||
node: data.node,
|
|
||||||
status: data.status,
|
|
||||||
invocation: data.invocation,
|
|
||||||
dockerImage: data.docker_image,
|
|
||||||
sftpDetails: {
|
|
||||||
ip: data.sftp_details.ip,
|
|
||||||
port: data.sftp_details.port,
|
|
||||||
},
|
|
||||||
description: data.description ? ((data.description.length > 0) ? data.description : null) : null,
|
|
||||||
limits: { ...data.limits },
|
|
||||||
eggFeatures: data.egg_features || [],
|
|
||||||
featureLimits: { ...data.feature_limits },
|
|
||||||
isInstalling: data.status === 'installing' || data.status === 'install_failed',
|
|
||||||
isTransferring: data.is_transferring,
|
|
||||||
variables: ((data.relationships?.variables as FractalResponseList | undefined)?.data || []).map(rawDataToServerEggVariable),
|
|
||||||
allocations: ((data.relationships?.allocations as FractalResponseList | undefined)?.data || []).map(rawDataToServerAllocation),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default (uuid: string): Promise<[ Server, string[] ]> => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
http.get(`/api/client/servers/${uuid}`)
|
|
||||||
.then(({ data }) => resolve([
|
|
||||||
rawDataToServerObject(data),
|
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
data.meta?.is_server_owner ? [ '*' ] : (data.meta?.user_permissions || []),
|
|
||||||
]))
|
|
||||||
.catch(reject);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
14
resources/scripts/api/server/index.ts
Normal file
14
resources/scripts/api/server/index.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import http from '@/api/http';
|
||||||
|
import { Transformers, Server } from '@definitions/user';
|
||||||
|
|
||||||
|
const getServer = async (uuid: string): Promise<[ Server, string[] ]> => {
|
||||||
|
const { data } = await http.get(`/api/client/servers/${uuid}`);
|
||||||
|
|
||||||
|
return [
|
||||||
|
Transformers.toServer(data),
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
data.meta?.is_server_owner ? [ '*' ] : (data.meta?.user_permissions || []),
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
export { getServer };
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useFormikContext } from 'formik';
|
import { useFormikContext } from 'formik';
|
||||||
import SearchableSelect, { Option } from '@/components/elements/SearchableSelect';
|
import SearchableSelect, { Option } from '@/components/elements/SearchableSelect';
|
||||||
import { User } from '@definitions/admin/models';
|
import { User } from '@definitions/admin';
|
||||||
import { searchUserAccounts } from '@/api/admin/user';
|
import { searchUserAccounts } from '@/api/admin/user';
|
||||||
|
|
||||||
export default ({ selected }: { selected?: User }) => {
|
export default ({ selected }: { selected?: User }) => {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Checkbox } from '@/components/elements/inputs';
|
||||||
import { Dropdown } from '@/components/elements/dropdown';
|
import { Dropdown } from '@/components/elements/dropdown';
|
||||||
import { BanIcon, DotsVerticalIcon, LockOpenIcon, PencilIcon, SupportIcon, TrashIcon } from '@heroicons/react/solid';
|
import { BanIcon, DotsVerticalIcon, LockOpenIcon, PencilIcon, SupportIcon, TrashIcon } from '@heroicons/react/solid';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { User } from '@definitions/admin/models';
|
import { User } from '@definitions/admin';
|
||||||
import { Dialog } from '@/components/elements/dialog';
|
import { Dialog } from '@/components/elements/dialog';
|
||||||
import { Button } from '@/components/elements/button/index';
|
import { Button } from '@/components/elements/button/index';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import http from '@/api/http';
|
import http from '@/api/http';
|
||||||
import { User } from '@definitions/admin/models';
|
import { Transformers, User } from '@definitions/admin';
|
||||||
import Transformers from '@definitions/admin/transformers';
|
|
||||||
import { LockOpenIcon, PlusIcon, SupportIcon, TrashIcon } from '@heroicons/react/solid';
|
import { LockOpenIcon, PlusIcon, SupportIcon, TrashIcon } from '@heroicons/react/solid';
|
||||||
import { Button } from '@/components/elements/button/index';
|
import { Button } from '@/components/elements/button/index';
|
||||||
import { Checkbox, InputField } from '@/components/elements/inputs';
|
import { Checkbox, InputField } from '@/components/elements/inputs';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Server } from '@/api/server/getServer';
|
import { Server } from '@definitions/user';
|
||||||
import getServers from '@/api/getServers';
|
import getServers from '@/api/getServers';
|
||||||
import ServerRow from '@/components/dashboard/ServerRow';
|
import ServerRow from '@/components/dashboard/ServerRow';
|
||||||
import Spinner from '@/components/elements/Spinner';
|
import Spinner from '@/components/elements/Spinner';
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { memo, useEffect, useRef, useState } from 'react';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { faEthernet, faHdd, faMemory, faMicrochip, faServer } from '@fortawesome/free-solid-svg-icons';
|
import { faEthernet, faHdd, faMemory, faMicrochip, faServer } from '@fortawesome/free-solid-svg-icons';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { Server } from '@/api/server/getServer';
|
import { Server } from '@definitions/user';
|
||||||
import getServerResourceUsage, { ServerPowerState, ServerStats } from '@/api/server/getServerResourceUsage';
|
import getServerResourceUsage, { ServerPowerState, ServerStats } from '@/api/server/getServerResourceUsage';
|
||||||
import { bytesToHuman, megabytesToHuman, formatIp } from '@/helpers';
|
import { bytesToHuman, megabytesToHuman, formatIp } from '@/helpers';
|
||||||
import tw, { styled } from 'twin.macro';
|
import tw, { styled } from 'twin.macro';
|
||||||
|
|
|
@ -7,7 +7,7 @@ import debounce from 'debounce';
|
||||||
import FormikFieldWrapper from '@/components/elements/FormikFieldWrapper';
|
import FormikFieldWrapper from '@/components/elements/FormikFieldWrapper';
|
||||||
import InputSpinner from '@/components/elements/InputSpinner';
|
import InputSpinner from '@/components/elements/InputSpinner';
|
||||||
import getServers from '@/api/getServers';
|
import getServers from '@/api/getServers';
|
||||||
import { Server } from '@/api/server/getServer';
|
import { Server } from '@definitions/user';
|
||||||
import { ApplicationStore } from '@/state';
|
import { ApplicationStore } from '@/state';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import tw, { styled } from 'twin.macro';
|
import tw, { styled } from 'twin.macro';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { SecurityKey } from '@definitions/user/models';
|
import { SecurityKey } from '@definitions/user';
|
||||||
import { useFlashKey } from '@/plugins/useFlash';
|
import { useFlashKey } from '@/plugins/useFlash';
|
||||||
import { Form, Formik, FormikHelpers } from 'formik';
|
import { Form, Formik, FormikHelpers } from 'formik';
|
||||||
import { registerSecurityKey } from '@/api/account/security-keys';
|
import { registerSecurityKey } from '@/api/account/security-keys';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import getServer, { Server } from '@/api/server/getServer';
|
import { getServer } from '@/api/server';
|
||||||
import { action, Action, computed, Computed, createContextStore, thunk, Thunk } from 'easy-peasy';
|
import { action, Action, computed, Computed, createContextStore, thunk, Thunk } from 'easy-peasy';
|
||||||
import socket, { SocketStore } from './socket';
|
import socket, { SocketStore } from './socket';
|
||||||
import files, { ServerFileStore } from '@/state/server/files';
|
import files, { ServerFileStore } from '@/state/server/files';
|
||||||
|
@ -7,6 +7,7 @@ import { composeWithDevTools } from 'redux-devtools-extension';
|
||||||
import schedules, { ServerScheduleStore } from '@/state/server/schedules';
|
import schedules, { ServerScheduleStore } from '@/state/server/schedules';
|
||||||
import databases, { ServerDatabaseStore } from '@/state/server/databases';
|
import databases, { ServerDatabaseStore } from '@/state/server/databases';
|
||||||
import isEqual from 'react-fast-compare';
|
import isEqual from 'react-fast-compare';
|
||||||
|
import { Server } from '@definitions/user';
|
||||||
|
|
||||||
export type ServerStatus = 'offline' | 'starting' | 'stopping' | 'running' | null;
|
export type ServerStatus = 'offline' | 'starting' | 'stopping' | 'running' | null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue