mirror of
https://github.com/unraid/api.git
synced 2026-01-01 22:20:05 -06:00
feat: remove dashboard types
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
[api]
|
||||
version="3.8.1+a2784ae9"
|
||||
version="3.8.1+01fd578c"
|
||||
extraOrigins="https://google.com,https://test.com"
|
||||
[local]
|
||||
[notifier]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[api]
|
||||
version="3.8.1+a2784ae9"
|
||||
version="3.8.1+01fd578c"
|
||||
extraOrigins="https://google.com,https://test.com"
|
||||
[local]
|
||||
[notifier]
|
||||
@@ -21,4 +21,4 @@ dynamicRemoteAccessType="DISABLED"
|
||||
[upc]
|
||||
apikey="unupc_fab6ff6ffe51040595c6d9ffb63a353ba16cc2ad7d93f813a2e80a5810"
|
||||
[connectionStatus]
|
||||
minigraph="PRE_INIT"
|
||||
minigraph="CONNECTED"
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
import { ConnectListAllDomainsFlags } from '@vmngr/libvirt';
|
||||
import { getHypervisor } from '@app/core/utils/vms/get-hypervisor';
|
||||
import { getUnraidVersion } from '@app/common/dashboard/get-unraid-version';
|
||||
import { bootTimestamp } from '@app/common/dashboard/boot-timestamp';
|
||||
import { getters, store } from '@app/store';
|
||||
|
||||
import { API_VERSION } from '@app/environment';
|
||||
import { DynamicRemoteAccessType } from '@app/remoteAccess/types';
|
||||
import {
|
||||
DashboardService,
|
||||
Dashboard,
|
||||
DashboardArray,
|
||||
ArrayState,
|
||||
} from '@app/graphql/generated/api/types';
|
||||
import convert from 'convert';
|
||||
import { getArrayData } from '@app/core/modules/array/get-array-data';
|
||||
import { hostname } from 'os';
|
||||
|
||||
const getVmSummary = async (): Promise<Dashboard['vms']> => {
|
||||
try {
|
||||
const hypervisor = await getHypervisor();
|
||||
if (!hypervisor) {
|
||||
return {
|
||||
installed: 0,
|
||||
started: 0,
|
||||
};
|
||||
}
|
||||
|
||||
const activeDomains = (await hypervisor.connectListAllDomains(
|
||||
ConnectListAllDomainsFlags.ACTIVE
|
||||
)) as unknown[];
|
||||
const inactiveDomains = (await hypervisor.connectListAllDomains(
|
||||
ConnectListAllDomainsFlags.INACTIVE
|
||||
)) as unknown[];
|
||||
return {
|
||||
installed: activeDomains.length + inactiveDomains.length,
|
||||
started: activeDomains.length,
|
||||
};
|
||||
} catch {
|
||||
return {
|
||||
installed: 0,
|
||||
started: 0,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const getDynamicRemoteAccessService = (): DashboardService | null => {
|
||||
const { config, dynamicRemoteAccess } = store.getState();
|
||||
const enabledStatus = config.remote.dynamicRemoteAccessType;
|
||||
|
||||
return {
|
||||
name: 'dynamic-remote-access',
|
||||
online: enabledStatus !== DynamicRemoteAccessType.DISABLED,
|
||||
version: dynamicRemoteAccess.runningType,
|
||||
uptime: {
|
||||
timestamp: bootTimestamp.toISOString(),
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const services = (): Dashboard['services'] => {
|
||||
const dynamicRemoteAccess = getDynamicRemoteAccessService();
|
||||
return [
|
||||
{
|
||||
name: 'unraid-api',
|
||||
online: true,
|
||||
uptime: {
|
||||
timestamp: bootTimestamp.toISOString(),
|
||||
},
|
||||
version: API_VERSION,
|
||||
},
|
||||
...(dynamicRemoteAccess ? [dynamicRemoteAccess] : []),
|
||||
];
|
||||
};
|
||||
|
||||
const KBToB = (kb: number | string): number =>
|
||||
convert(Number(kb), 'KB').to('B');
|
||||
|
||||
export const getArray = (): DashboardArray => {
|
||||
const array = getArrayData();
|
||||
if (!array) {
|
||||
return {
|
||||
state: ArrayState.STOPPED,
|
||||
capacity: {
|
||||
bytes: { free: 0, used: 0, total: 0 },
|
||||
disks: { free: '0', used: '0', total: '0' },
|
||||
kilobytes: { free: '0', used: '0', total: '0' },
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
state: array.state ?? ArrayState.STOPPED,
|
||||
capacity: array.capacity,
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Provides a way to get dashboard data from the GraphQL client without the need for publishing to mothership
|
||||
* @returns Dashboard data
|
||||
*/
|
||||
export const dashboardDataServer = async (): Promise<Dashboard> => {
|
||||
const emhttp = getters.emhttp();
|
||||
const docker = getters.docker();
|
||||
const config = getters.config()
|
||||
return {
|
||||
id: `${config.remote.apikey ?? config.upc.apikey}-${hostname() ?? 'unknown-hostname'}`,
|
||||
lastPublish: new Date().toISOString(),
|
||||
vars: {
|
||||
regState: emhttp.var.regState,
|
||||
regTy: emhttp.var.regTy,
|
||||
flashGuid: emhttp.var.flashGuid,
|
||||
serverName: emhttp.var.name,
|
||||
serverDescription: emhttp.var.comment,
|
||||
},
|
||||
apps: {
|
||||
installed: docker.installed ?? 0,
|
||||
started: docker.running ?? 0,
|
||||
},
|
||||
versions: {
|
||||
unraid: await getUnraidVersion(),
|
||||
},
|
||||
os: {
|
||||
hostname: emhttp.var.name,
|
||||
uptime: bootTimestamp.toISOString(),
|
||||
},
|
||||
vms: await getVmSummary(),
|
||||
array: getArray(),
|
||||
services: services(),
|
||||
display: {
|
||||
case: {
|
||||
url: '',
|
||||
icon: '',
|
||||
error: '',
|
||||
base64: '',
|
||||
},
|
||||
},
|
||||
config: emhttp.var.configValid
|
||||
? { valid: true }
|
||||
: {
|
||||
valid: false,
|
||||
error:
|
||||
{
|
||||
error: 'UNKNOWN_ERROR',
|
||||
invalid: 'INVALID',
|
||||
nokeyserver: 'NO_KEY_SERVER',
|
||||
withdrawn: 'WITHDRAWN',
|
||||
}[emhttp.var.configState] ?? 'UNKNOWN_ERROR',
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -2,7 +2,7 @@
|
||||
import * as Types from '@app/graphql/generated/api/types';
|
||||
|
||||
import { z } from 'zod'
|
||||
import { AccessUrl, AllowedOriginInput, ApiKey, ApiKeyResponse, ArrayType, ArrayCapacity, ArrayCapacityBytes, ArrayDisk, ArrayDiskFsColor, ArrayDiskStatus, ArrayDiskType, ArrayPendingState, ArrayState, Baseboard, Capacity, Case, Cloud, CloudResponse, Config, ConfigErrorState, ConnectSignInInput, ConnectUserInfoInput, ContainerHostConfig, ContainerMount, ContainerPort, ContainerPortType, ContainerState, Dashboard, DashboardApps, DashboardArray, DashboardCase, DashboardConfig, DashboardDisplay, DashboardOs, DashboardService, DashboardServiceInput, DashboardServiceUptime, DashboardServiceUptimeInput, DashboardTwoFactor, DashboardTwoFactorLocal, DashboardTwoFactorRemote, DashboardVars, DashboardVersions, DashboardVms, Devices, Disk, DiskFsType, DiskInterfaceType, DiskPartition, DiskSmartStatus, Display, Docker, DockerContainer, DockerNetwork, Flash, Gpu, Importance, Info, InfoApps, InfoCpu, InfoMemory, KeyFile, Me, MemoryFormFactor, MemoryLayout, MemoryType, MinigraphStatus, MinigraphqlResponse, Mount, Network, Node, Notification, NotificationFilter, NotificationInput, NotificationType, Os, Owner, ParityCheck, Partition, Pci, ProfileModel, Registration, RegistrationState, RelayResponse, RemoteAccess, Server, ServerStatus, Service, SetupRemoteAccessInput, Share, System, Temperature, Theme, URL_TYPE, UnassignedDevice, Uptime, Usb, User, UserAccount, Vars, Versions, VmDomain, VmState, Vms, WAN_ACCESS_TYPE, WAN_FORWARD_TYPE, Welcome, addApiKeyInput, addUserInput, arrayDiskInput, authenticateInput, deleteUserInput, mdState, registrationType, updateApikeyInput, usersInput } from '@app/graphql/generated/api/types'
|
||||
import { AccessUrl, AllowedOriginInput, ApiKey, ApiKeyResponse, ArrayType, ArrayCapacity, ArrayDisk, ArrayDiskFsColor, ArrayDiskStatus, ArrayDiskType, ArrayPendingState, ArrayState, Baseboard, Capacity, Case, Cloud, CloudResponse, Config, ConfigErrorState, ConnectSignInInput, ConnectUserInfoInput, ContainerHostConfig, ContainerMount, ContainerPort, ContainerPortType, ContainerState, Devices, Disk, DiskFsType, DiskInterfaceType, DiskPartition, DiskSmartStatus, Display, Docker, DockerContainer, DockerNetwork, Flash, Gpu, Importance, Info, InfoApps, InfoCpu, InfoMemory, KeyFile, Me, MemoryFormFactor, MemoryLayout, MemoryType, MinigraphStatus, MinigraphqlResponse, Mount, Network, Node, Notification, NotificationFilter, NotificationInput, NotificationType, Os, Owner, ParityCheck, Partition, Pci, ProfileModel, Registration, RegistrationState, RelayResponse, RemoteAccess, Server, ServerStatus, Service, SetupRemoteAccessInput, Share, System, Temperature, Theme, URL_TYPE, UnassignedDevice, Uptime, Usb, User, UserAccount, Vars, Versions, VmDomain, VmState, Vms, WAN_ACCESS_TYPE, WAN_FORWARD_TYPE, Welcome, addApiKeyInput, addUserInput, arrayDiskInput, authenticateInput, deleteUserInput, mdState, registrationType, updateApikeyInput, usersInput } from '@app/graphql/generated/api/types'
|
||||
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
||||
|
||||
type Properties<T> = Required<{
|
||||
@@ -120,21 +120,11 @@ export function ArrayTypeSchema(): z.ZodObject<Properties<ArrayType>> {
|
||||
export function ArrayCapacitySchema(): z.ZodObject<Properties<ArrayCapacity>> {
|
||||
return z.object({
|
||||
__typename: z.literal('ArrayCapacity').optional(),
|
||||
bytes: ArrayCapacityBytesSchema().nullish(),
|
||||
disks: CapacitySchema(),
|
||||
kilobytes: CapacitySchema()
|
||||
})
|
||||
}
|
||||
|
||||
export function ArrayCapacityBytesSchema(): z.ZodObject<Properties<ArrayCapacityBytes>> {
|
||||
return z.object({
|
||||
__typename: z.literal('ArrayCapacityBytes').optional(),
|
||||
free: z.number().nullish(),
|
||||
total: z.number().nullish(),
|
||||
used: z.number().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function ArrayDiskSchema(): z.ZodObject<Properties<ArrayDisk>> {
|
||||
return z.object({
|
||||
__typename: z.literal('ArrayDisk').optional(),
|
||||
@@ -271,155 +261,6 @@ export function ContainerPortSchema(): z.ZodObject<Properties<ContainerPort>> {
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardSchema(): z.ZodObject<Properties<Dashboard>> {
|
||||
return z.object({
|
||||
__typename: z.literal('Dashboard').optional(),
|
||||
apps: DashboardAppsSchema().nullish(),
|
||||
array: DashboardArraySchema().nullish(),
|
||||
config: DashboardConfigSchema().nullish(),
|
||||
display: DashboardDisplaySchema().nullish(),
|
||||
id: z.string(),
|
||||
lastPublish: z.string().nullish(),
|
||||
network: NetworkSchema().nullish(),
|
||||
online: z.boolean().nullish(),
|
||||
os: DashboardOsSchema().nullish(),
|
||||
services: z.array(DashboardServiceSchema().nullable()).nullish(),
|
||||
twoFactor: DashboardTwoFactorSchema().nullish(),
|
||||
vars: DashboardVarsSchema().nullish(),
|
||||
versions: DashboardVersionsSchema().nullish(),
|
||||
vms: DashboardVmsSchema().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardAppsSchema(): z.ZodObject<Properties<DashboardApps>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardApps').optional(),
|
||||
installed: z.number().nullish(),
|
||||
started: z.number().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardArraySchema(): z.ZodObject<Properties<DashboardArray>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardArray').optional(),
|
||||
capacity: ArrayCapacitySchema().nullish(),
|
||||
state: z.string().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardCaseSchema(): z.ZodObject<Properties<DashboardCase>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardCase').optional(),
|
||||
base64: z.string().nullish(),
|
||||
error: z.string().nullish(),
|
||||
icon: z.string().nullish(),
|
||||
url: z.string().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardConfigSchema(): z.ZodObject<Properties<DashboardConfig>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardConfig').optional(),
|
||||
error: z.string().nullish(),
|
||||
valid: z.boolean().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardDisplaySchema(): z.ZodObject<Properties<DashboardDisplay>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardDisplay').optional(),
|
||||
case: DashboardCaseSchema().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardOsSchema(): z.ZodObject<Properties<DashboardOs>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardOs').optional(),
|
||||
hostname: z.string().nullish(),
|
||||
uptime: z.string().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardServiceSchema(): z.ZodObject<Properties<DashboardService>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardService').optional(),
|
||||
name: z.string().nullish(),
|
||||
online: z.boolean().nullish(),
|
||||
uptime: DashboardServiceUptimeSchema().nullish(),
|
||||
version: z.string().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardServiceInputSchema(): z.ZodObject<Properties<DashboardServiceInput>> {
|
||||
return z.object({
|
||||
name: z.string(),
|
||||
online: z.boolean(),
|
||||
uptime: z.lazy(() => DashboardServiceUptimeInputSchema().nullish()),
|
||||
version: z.string()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardServiceUptimeSchema(): z.ZodObject<Properties<DashboardServiceUptime>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardServiceUptime').optional(),
|
||||
timestamp: z.string().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardServiceUptimeInputSchema(): z.ZodObject<Properties<DashboardServiceUptimeInput>> {
|
||||
return z.object({
|
||||
timestamp: z.string()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardTwoFactorSchema(): z.ZodObject<Properties<DashboardTwoFactor>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardTwoFactor').optional(),
|
||||
local: DashboardTwoFactorLocalSchema().nullish(),
|
||||
remote: DashboardTwoFactorRemoteSchema().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardTwoFactorLocalSchema(): z.ZodObject<Properties<DashboardTwoFactorLocal>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardTwoFactorLocal').optional(),
|
||||
enabled: z.boolean().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardTwoFactorRemoteSchema(): z.ZodObject<Properties<DashboardTwoFactorRemote>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardTwoFactorRemote').optional(),
|
||||
enabled: z.boolean().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardVarsSchema(): z.ZodObject<Properties<DashboardVars>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardVars').optional(),
|
||||
flashGuid: z.string().nullish(),
|
||||
regState: z.string().nullish(),
|
||||
regTy: z.string().nullish(),
|
||||
serverDescription: z.string().nullish(),
|
||||
serverName: z.string().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardVersionsSchema(): z.ZodObject<Properties<DashboardVersions>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardVersions').optional(),
|
||||
unraid: z.string().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardVmsSchema(): z.ZodObject<Properties<DashboardVms>> {
|
||||
return z.object({
|
||||
__typename: z.literal('DashboardVms').optional(),
|
||||
installed: z.number().nullish(),
|
||||
started: z.number().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function DevicesSchema(): z.ZodObject<Properties<Devices>> {
|
||||
return z.object({
|
||||
__typename: z.literal('Devices').optional(),
|
||||
|
||||
@@ -74,18 +74,10 @@ export type ArrayType = Node & {
|
||||
|
||||
export type ArrayCapacity = {
|
||||
__typename?: 'ArrayCapacity';
|
||||
bytes?: Maybe<ArrayCapacityBytes>;
|
||||
disks: Capacity;
|
||||
kilobytes: Capacity;
|
||||
};
|
||||
|
||||
export type ArrayCapacityBytes = {
|
||||
__typename?: 'ArrayCapacityBytes';
|
||||
free?: Maybe<Scalars['Long']['output']>;
|
||||
total?: Maybe<Scalars['Long']['output']>;
|
||||
used?: Maybe<Scalars['Long']['output']>;
|
||||
};
|
||||
|
||||
export type ArrayDisk = {
|
||||
__typename?: 'ArrayDisk';
|
||||
/** User comment on disk */
|
||||
@@ -312,123 +304,6 @@ export enum ContainerState {
|
||||
RUNNING = 'RUNNING'
|
||||
}
|
||||
|
||||
export type Dashboard = {
|
||||
__typename?: 'Dashboard';
|
||||
apps?: Maybe<DashboardApps>;
|
||||
array?: Maybe<DashboardArray>;
|
||||
config?: Maybe<DashboardConfig>;
|
||||
display?: Maybe<DashboardDisplay>;
|
||||
id: Scalars['ID']['output'];
|
||||
lastPublish?: Maybe<Scalars['DateTime']['output']>;
|
||||
network?: Maybe<Network>;
|
||||
online?: Maybe<Scalars['Boolean']['output']>;
|
||||
os?: Maybe<DashboardOs>;
|
||||
services?: Maybe<Array<Maybe<DashboardService>>>;
|
||||
twoFactor?: Maybe<DashboardTwoFactor>;
|
||||
vars?: Maybe<DashboardVars>;
|
||||
versions?: Maybe<DashboardVersions>;
|
||||
vms?: Maybe<DashboardVms>;
|
||||
};
|
||||
|
||||
export type DashboardApps = {
|
||||
__typename?: 'DashboardApps';
|
||||
installed?: Maybe<Scalars['Int']['output']>;
|
||||
started?: Maybe<Scalars['Int']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardArray = {
|
||||
__typename?: 'DashboardArray';
|
||||
/** Current array capacity */
|
||||
capacity?: Maybe<ArrayCapacity>;
|
||||
/** Current array state */
|
||||
state?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardCase = {
|
||||
__typename?: 'DashboardCase';
|
||||
base64?: Maybe<Scalars['String']['output']>;
|
||||
error?: Maybe<Scalars['String']['output']>;
|
||||
icon?: Maybe<Scalars['String']['output']>;
|
||||
url?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardConfig = {
|
||||
__typename?: 'DashboardConfig';
|
||||
error?: Maybe<Scalars['String']['output']>;
|
||||
valid?: Maybe<Scalars['Boolean']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardDisplay = {
|
||||
__typename?: 'DashboardDisplay';
|
||||
case?: Maybe<DashboardCase>;
|
||||
};
|
||||
|
||||
export type DashboardOs = {
|
||||
__typename?: 'DashboardOs';
|
||||
hostname?: Maybe<Scalars['String']['output']>;
|
||||
uptime?: Maybe<Scalars['DateTime']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardService = {
|
||||
__typename?: 'DashboardService';
|
||||
name?: Maybe<Scalars['String']['output']>;
|
||||
online?: Maybe<Scalars['Boolean']['output']>;
|
||||
uptime?: Maybe<DashboardServiceUptime>;
|
||||
version?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardServiceInput = {
|
||||
name: Scalars['String']['input'];
|
||||
online: Scalars['Boolean']['input'];
|
||||
uptime?: InputMaybe<DashboardServiceUptimeInput>;
|
||||
version: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type DashboardServiceUptime = {
|
||||
__typename?: 'DashboardServiceUptime';
|
||||
timestamp?: Maybe<Scalars['DateTime']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardServiceUptimeInput = {
|
||||
timestamp: Scalars['DateTime']['input'];
|
||||
};
|
||||
|
||||
export type DashboardTwoFactor = {
|
||||
__typename?: 'DashboardTwoFactor';
|
||||
local?: Maybe<DashboardTwoFactorLocal>;
|
||||
remote?: Maybe<DashboardTwoFactorRemote>;
|
||||
};
|
||||
|
||||
export type DashboardTwoFactorLocal = {
|
||||
__typename?: 'DashboardTwoFactorLocal';
|
||||
enabled?: Maybe<Scalars['Boolean']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardTwoFactorRemote = {
|
||||
__typename?: 'DashboardTwoFactorRemote';
|
||||
enabled?: Maybe<Scalars['Boolean']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardVars = {
|
||||
__typename?: 'DashboardVars';
|
||||
flashGuid?: Maybe<Scalars['String']['output']>;
|
||||
regState?: Maybe<Scalars['String']['output']>;
|
||||
regTy?: Maybe<Scalars['String']['output']>;
|
||||
serverDescription?: Maybe<Scalars['String']['output']>;
|
||||
serverName?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardVersions = {
|
||||
__typename?: 'DashboardVersions';
|
||||
unraid?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardVms = {
|
||||
__typename?: 'DashboardVms';
|
||||
installed?: Maybe<Scalars['Int']['output']>;
|
||||
started?: Maybe<Scalars['Int']['output']>;
|
||||
};
|
||||
|
||||
export type Devices = {
|
||||
__typename?: 'Devices';
|
||||
gpu?: Maybe<Array<Maybe<Gpu>>>;
|
||||
@@ -1031,8 +906,6 @@ export type Query = {
|
||||
registration?: Maybe<Registration>;
|
||||
remoteAccess: RemoteAccess;
|
||||
server?: Maybe<Server>;
|
||||
/** Temporary Type to Enable Swapping Dashboard over in Connect without major changes */
|
||||
serverDashboard: Dashboard;
|
||||
servers: Array<Server>;
|
||||
services: Array<Service>;
|
||||
/** Network Shares */
|
||||
@@ -1746,7 +1619,6 @@ export type ResolversTypes = ResolversObject<{
|
||||
ApiKeyResponse: ResolverTypeWrapper<ApiKeyResponse>;
|
||||
Array: ResolverTypeWrapper<ArrayType>;
|
||||
ArrayCapacity: ResolverTypeWrapper<ArrayCapacity>;
|
||||
ArrayCapacityBytes: ResolverTypeWrapper<ArrayCapacityBytes>;
|
||||
ArrayDisk: ResolverTypeWrapper<ArrayDisk>;
|
||||
ArrayDiskFsColor: ArrayDiskFsColor;
|
||||
ArrayDiskStatus: ArrayDiskStatus;
|
||||
@@ -1768,23 +1640,6 @@ export type ResolversTypes = ResolversObject<{
|
||||
ContainerPort: ResolverTypeWrapper<ContainerPort>;
|
||||
ContainerPortType: ContainerPortType;
|
||||
ContainerState: ContainerState;
|
||||
Dashboard: ResolverTypeWrapper<Dashboard>;
|
||||
DashboardApps: ResolverTypeWrapper<DashboardApps>;
|
||||
DashboardArray: ResolverTypeWrapper<DashboardArray>;
|
||||
DashboardCase: ResolverTypeWrapper<DashboardCase>;
|
||||
DashboardConfig: ResolverTypeWrapper<DashboardConfig>;
|
||||
DashboardDisplay: ResolverTypeWrapper<DashboardDisplay>;
|
||||
DashboardOs: ResolverTypeWrapper<DashboardOs>;
|
||||
DashboardService: ResolverTypeWrapper<DashboardService>;
|
||||
DashboardServiceInput: DashboardServiceInput;
|
||||
DashboardServiceUptime: ResolverTypeWrapper<DashboardServiceUptime>;
|
||||
DashboardServiceUptimeInput: DashboardServiceUptimeInput;
|
||||
DashboardTwoFactor: ResolverTypeWrapper<DashboardTwoFactor>;
|
||||
DashboardTwoFactorLocal: ResolverTypeWrapper<DashboardTwoFactorLocal>;
|
||||
DashboardTwoFactorRemote: ResolverTypeWrapper<DashboardTwoFactorRemote>;
|
||||
DashboardVars: ResolverTypeWrapper<DashboardVars>;
|
||||
DashboardVersions: ResolverTypeWrapper<DashboardVersions>;
|
||||
DashboardVms: ResolverTypeWrapper<DashboardVms>;
|
||||
DateTime: ResolverTypeWrapper<Scalars['DateTime']['output']>;
|
||||
Devices: ResolverTypeWrapper<Devices>;
|
||||
Disk: ResolverTypeWrapper<Disk>;
|
||||
@@ -1880,7 +1735,6 @@ export type ResolversParentTypes = ResolversObject<{
|
||||
ApiKeyResponse: ApiKeyResponse;
|
||||
Array: ArrayType;
|
||||
ArrayCapacity: ArrayCapacity;
|
||||
ArrayCapacityBytes: ArrayCapacityBytes;
|
||||
ArrayDisk: ArrayDisk;
|
||||
Baseboard: Baseboard;
|
||||
Boolean: Scalars['Boolean']['output'];
|
||||
@@ -1894,23 +1748,6 @@ export type ResolversParentTypes = ResolversObject<{
|
||||
ContainerHostConfig: ContainerHostConfig;
|
||||
ContainerMount: ContainerMount;
|
||||
ContainerPort: ContainerPort;
|
||||
Dashboard: Dashboard;
|
||||
DashboardApps: DashboardApps;
|
||||
DashboardArray: DashboardArray;
|
||||
DashboardCase: DashboardCase;
|
||||
DashboardConfig: DashboardConfig;
|
||||
DashboardDisplay: DashboardDisplay;
|
||||
DashboardOs: DashboardOs;
|
||||
DashboardService: DashboardService;
|
||||
DashboardServiceInput: DashboardServiceInput;
|
||||
DashboardServiceUptime: DashboardServiceUptime;
|
||||
DashboardServiceUptimeInput: DashboardServiceUptimeInput;
|
||||
DashboardTwoFactor: DashboardTwoFactor;
|
||||
DashboardTwoFactorLocal: DashboardTwoFactorLocal;
|
||||
DashboardTwoFactorRemote: DashboardTwoFactorRemote;
|
||||
DashboardVars: DashboardVars;
|
||||
DashboardVersions: DashboardVersions;
|
||||
DashboardVms: DashboardVms;
|
||||
DateTime: Scalars['DateTime']['output'];
|
||||
Devices: Devices;
|
||||
Disk: Disk;
|
||||
@@ -2017,19 +1854,11 @@ export type ArrayResolvers<ContextType = Context, ParentType extends ResolversPa
|
||||
}>;
|
||||
|
||||
export type ArrayCapacityResolvers<ContextType = Context, ParentType extends ResolversParentTypes['ArrayCapacity'] = ResolversParentTypes['ArrayCapacity']> = ResolversObject<{
|
||||
bytes?: Resolver<Maybe<ResolversTypes['ArrayCapacityBytes']>, ParentType, ContextType>;
|
||||
disks?: Resolver<ResolversTypes['Capacity'], ParentType, ContextType>;
|
||||
kilobytes?: Resolver<ResolversTypes['Capacity'], ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type ArrayCapacityBytesResolvers<ContextType = Context, ParentType extends ResolversParentTypes['ArrayCapacityBytes'] = ResolversParentTypes['ArrayCapacityBytes']> = ResolversObject<{
|
||||
free?: Resolver<Maybe<ResolversTypes['Long']>, ParentType, ContextType>;
|
||||
total?: Resolver<Maybe<ResolversTypes['Long']>, ParentType, ContextType>;
|
||||
used?: Resolver<Maybe<ResolversTypes['Long']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type ArrayDiskResolvers<ContextType = Context, ParentType extends ResolversParentTypes['ArrayDisk'] = ResolversParentTypes['ArrayDisk']> = ResolversObject<{
|
||||
comment?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
critical?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;
|
||||
@@ -2128,110 +1957,6 @@ export type ContainerPortResolvers<ContextType = Context, ParentType extends Res
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardResolvers<ContextType = Context, ParentType extends ResolversParentTypes['Dashboard'] = ResolversParentTypes['Dashboard']> = ResolversObject<{
|
||||
apps?: Resolver<Maybe<ResolversTypes['DashboardApps']>, ParentType, ContextType>;
|
||||
array?: Resolver<Maybe<ResolversTypes['DashboardArray']>, ParentType, ContextType>;
|
||||
config?: Resolver<Maybe<ResolversTypes['DashboardConfig']>, ParentType, ContextType>;
|
||||
display?: Resolver<Maybe<ResolversTypes['DashboardDisplay']>, ParentType, ContextType>;
|
||||
id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
|
||||
lastPublish?: Resolver<Maybe<ResolversTypes['DateTime']>, ParentType, ContextType>;
|
||||
network?: Resolver<Maybe<ResolversTypes['Network']>, ParentType, ContextType>;
|
||||
online?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
||||
os?: Resolver<Maybe<ResolversTypes['DashboardOs']>, ParentType, ContextType>;
|
||||
services?: Resolver<Maybe<Array<Maybe<ResolversTypes['DashboardService']>>>, ParentType, ContextType>;
|
||||
twoFactor?: Resolver<Maybe<ResolversTypes['DashboardTwoFactor']>, ParentType, ContextType>;
|
||||
vars?: Resolver<Maybe<ResolversTypes['DashboardVars']>, ParentType, ContextType>;
|
||||
versions?: Resolver<Maybe<ResolversTypes['DashboardVersions']>, ParentType, ContextType>;
|
||||
vms?: Resolver<Maybe<ResolversTypes['DashboardVms']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardAppsResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardApps'] = ResolversParentTypes['DashboardApps']> = ResolversObject<{
|
||||
installed?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;
|
||||
started?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardArrayResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardArray'] = ResolversParentTypes['DashboardArray']> = ResolversObject<{
|
||||
capacity?: Resolver<Maybe<ResolversTypes['ArrayCapacity']>, ParentType, ContextType>;
|
||||
state?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardCaseResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardCase'] = ResolversParentTypes['DashboardCase']> = ResolversObject<{
|
||||
base64?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
error?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
icon?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
url?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardConfigResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardConfig'] = ResolversParentTypes['DashboardConfig']> = ResolversObject<{
|
||||
error?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
valid?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardDisplayResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardDisplay'] = ResolversParentTypes['DashboardDisplay']> = ResolversObject<{
|
||||
case?: Resolver<Maybe<ResolversTypes['DashboardCase']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardOsResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardOs'] = ResolversParentTypes['DashboardOs']> = ResolversObject<{
|
||||
hostname?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
uptime?: Resolver<Maybe<ResolversTypes['DateTime']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardServiceResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardService'] = ResolversParentTypes['DashboardService']> = ResolversObject<{
|
||||
name?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
online?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
||||
uptime?: Resolver<Maybe<ResolversTypes['DashboardServiceUptime']>, ParentType, ContextType>;
|
||||
version?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardServiceUptimeResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardServiceUptime'] = ResolversParentTypes['DashboardServiceUptime']> = ResolversObject<{
|
||||
timestamp?: Resolver<Maybe<ResolversTypes['DateTime']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardTwoFactorResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardTwoFactor'] = ResolversParentTypes['DashboardTwoFactor']> = ResolversObject<{
|
||||
local?: Resolver<Maybe<ResolversTypes['DashboardTwoFactorLocal']>, ParentType, ContextType>;
|
||||
remote?: Resolver<Maybe<ResolversTypes['DashboardTwoFactorRemote']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardTwoFactorLocalResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardTwoFactorLocal'] = ResolversParentTypes['DashboardTwoFactorLocal']> = ResolversObject<{
|
||||
enabled?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardTwoFactorRemoteResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardTwoFactorRemote'] = ResolversParentTypes['DashboardTwoFactorRemote']> = ResolversObject<{
|
||||
enabled?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardVarsResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardVars'] = ResolversParentTypes['DashboardVars']> = ResolversObject<{
|
||||
flashGuid?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
regState?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
regTy?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
serverDescription?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
serverName?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardVersionsResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardVersions'] = ResolversParentTypes['DashboardVersions']> = ResolversObject<{
|
||||
unraid?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export type DashboardVmsResolvers<ContextType = Context, ParentType extends ResolversParentTypes['DashboardVms'] = ResolversParentTypes['DashboardVms']> = ResolversObject<{
|
||||
installed?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;
|
||||
started?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
}>;
|
||||
|
||||
export interface DateTimeScalarConfig extends GraphQLScalarTypeConfig<ResolversTypes['DateTime'], any> {
|
||||
name: 'DateTime';
|
||||
}
|
||||
@@ -2674,7 +2399,6 @@ export type QueryResolvers<ContextType = Context, ParentType extends ResolversPa
|
||||
registration?: Resolver<Maybe<ResolversTypes['Registration']>, ParentType, ContextType>;
|
||||
remoteAccess?: Resolver<ResolversTypes['RemoteAccess'], ParentType, ContextType>;
|
||||
server?: Resolver<Maybe<ResolversTypes['Server']>, ParentType, ContextType>;
|
||||
serverDashboard?: Resolver<ResolversTypes['Dashboard'], ParentType, ContextType>;
|
||||
servers?: Resolver<Array<ResolversTypes['Server']>, ParentType, ContextType>;
|
||||
services?: Resolver<Array<ResolversTypes['Service']>, ParentType, ContextType>;
|
||||
shares?: Resolver<Maybe<Array<Maybe<ResolversTypes['Share']>>>, ParentType, ContextType>;
|
||||
@@ -3079,7 +2803,6 @@ export type Resolvers<ContextType = Context> = ResolversObject<{
|
||||
ApiKeyResponse?: ApiKeyResponseResolvers<ContextType>;
|
||||
Array?: ArrayResolvers<ContextType>;
|
||||
ArrayCapacity?: ArrayCapacityResolvers<ContextType>;
|
||||
ArrayCapacityBytes?: ArrayCapacityBytesResolvers<ContextType>;
|
||||
ArrayDisk?: ArrayDiskResolvers<ContextType>;
|
||||
Baseboard?: BaseboardResolvers<ContextType>;
|
||||
Capacity?: CapacityResolvers<ContextType>;
|
||||
@@ -3090,21 +2813,6 @@ export type Resolvers<ContextType = Context> = ResolversObject<{
|
||||
ContainerHostConfig?: ContainerHostConfigResolvers<ContextType>;
|
||||
ContainerMount?: ContainerMountResolvers<ContextType>;
|
||||
ContainerPort?: ContainerPortResolvers<ContextType>;
|
||||
Dashboard?: DashboardResolvers<ContextType>;
|
||||
DashboardApps?: DashboardAppsResolvers<ContextType>;
|
||||
DashboardArray?: DashboardArrayResolvers<ContextType>;
|
||||
DashboardCase?: DashboardCaseResolvers<ContextType>;
|
||||
DashboardConfig?: DashboardConfigResolvers<ContextType>;
|
||||
DashboardDisplay?: DashboardDisplayResolvers<ContextType>;
|
||||
DashboardOs?: DashboardOsResolvers<ContextType>;
|
||||
DashboardService?: DashboardServiceResolvers<ContextType>;
|
||||
DashboardServiceUptime?: DashboardServiceUptimeResolvers<ContextType>;
|
||||
DashboardTwoFactor?: DashboardTwoFactorResolvers<ContextType>;
|
||||
DashboardTwoFactorLocal?: DashboardTwoFactorLocalResolvers<ContextType>;
|
||||
DashboardTwoFactorRemote?: DashboardTwoFactorRemoteResolvers<ContextType>;
|
||||
DashboardVars?: DashboardVarsResolvers<ContextType>;
|
||||
DashboardVersions?: DashboardVersionsResolvers<ContextType>;
|
||||
DashboardVms?: DashboardVmsResolvers<ContextType>;
|
||||
DateTime?: GraphQLScalarType;
|
||||
Devices?: DevicesResolvers<ContextType>;
|
||||
Disk?: DiskResolvers<ContextType>;
|
||||
|
||||
@@ -42,8 +42,6 @@ input SetupRemoteAccessInput {
|
||||
type Query {
|
||||
remoteAccess: RemoteAccess!
|
||||
extraAllowedOrigins: [String!]!
|
||||
""" Temporary Type to Enable Swapping Dashboard over in Connect without major changes """
|
||||
serverDashboard: Dashboard!
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
type DashboardApps {
|
||||
installed: Int
|
||||
started: Int
|
||||
}
|
||||
|
||||
type DashboardVersions {
|
||||
unraid: String
|
||||
}
|
||||
|
||||
type DashboardOs {
|
||||
hostname: String
|
||||
uptime: DateTime
|
||||
}
|
||||
|
||||
type DashboardVms {
|
||||
installed: Int
|
||||
started: Int
|
||||
}
|
||||
|
||||
type ArrayCapacityBytes {
|
||||
free: Long
|
||||
used: Long
|
||||
total: Long
|
||||
}
|
||||
|
||||
type ArrayCapacity {
|
||||
bytes: ArrayCapacityBytes
|
||||
}
|
||||
|
||||
type DashboardArray {
|
||||
"""
|
||||
Current array state
|
||||
"""
|
||||
state: String
|
||||
"""
|
||||
Current array capacity
|
||||
"""
|
||||
capacity: ArrayCapacity
|
||||
}
|
||||
|
||||
type DashboardCase {
|
||||
icon: String
|
||||
url: String
|
||||
error: String
|
||||
base64: String
|
||||
}
|
||||
|
||||
type DashboardDisplay {
|
||||
case: DashboardCase
|
||||
}
|
||||
|
||||
type DashboardConfig {
|
||||
valid: Boolean
|
||||
error: String
|
||||
}
|
||||
|
||||
type DashboardVars {
|
||||
regState: String
|
||||
regTy: String
|
||||
flashGuid: String
|
||||
serverName: String
|
||||
serverDescription: String
|
||||
}
|
||||
|
||||
type DashboardTwoFactorRemote {
|
||||
enabled: Boolean
|
||||
}
|
||||
|
||||
type DashboardTwoFactorLocal {
|
||||
enabled: Boolean
|
||||
}
|
||||
|
||||
type DashboardTwoFactor {
|
||||
remote: DashboardTwoFactorRemote
|
||||
local: DashboardTwoFactorLocal
|
||||
}
|
||||
|
||||
type Dashboard {
|
||||
id: ID!
|
||||
lastPublish: DateTime
|
||||
online: Boolean
|
||||
apps: DashboardApps
|
||||
versions: DashboardVersions
|
||||
os: DashboardOs
|
||||
vms: DashboardVms
|
||||
array: DashboardArray
|
||||
services: [DashboardService]
|
||||
display: DashboardDisplay
|
||||
config: DashboardConfig
|
||||
vars: DashboardVars
|
||||
twoFactor: DashboardTwoFactor
|
||||
network: Network
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
type DashboardServiceUptime {
|
||||
timestamp: DateTime
|
||||
}
|
||||
|
||||
type DashboardService {
|
||||
name: String
|
||||
online: Boolean
|
||||
uptime: DashboardServiceUptime
|
||||
version: String
|
||||
}
|
||||
|
||||
input DashboardServiceUptimeInput {
|
||||
timestamp: DateTime!
|
||||
}
|
||||
|
||||
input DashboardServiceInput {
|
||||
name: String!
|
||||
online: Boolean!
|
||||
uptime: DashboardServiceUptimeInput
|
||||
version: String!
|
||||
}
|
||||
Reference in New Issue
Block a user