Skip to content

Commit

Permalink
fix(style) update formatting with updated eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
edlerd committed Oct 18, 2023
1 parent 7a059f0 commit e2708df
Show file tree
Hide file tree
Showing 158 changed files with 525 additions and 519 deletions.
16 changes: 8 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,35 @@ const Settings = lazy(() => import("pages/settings/Settings"));
const InstanceDetail = lazy(() => import("pages/instances/InstanceDetail"));
const Storage = lazy(() => import("pages/storage/Storage"));
const StorageVolumeCreate = lazy(
() => import("pages/storage/forms/StorageVolumeCreate")
() => import("pages/storage/forms/StorageVolumeCreate"),
);
const ProfileDetail = lazy(() => import("pages/profiles/ProfileDetail"));
const OperationList = lazy(() => import("pages/operations/OperationList"));
const CertificateAdd = lazy(() => import("pages/login/CertificateAdd"));
const CertificateGenerate = lazy(
() => import("pages/login/CertificateGenerate")
() => import("pages/login/CertificateGenerate"),
);
const Login = lazy(() => import("pages/login/Login"));
const ProtectedRoute = lazy(() => import("components/ProtectedRoute"));
const StorageDetail = lazy(() => import("pages/storage/StorageDetail"));
const StorageVolumeDetail = lazy(
() => import("pages/storage/StorageVolumeDetail")
() => import("pages/storage/StorageVolumeDetail"),
);
const NetworkMap = lazy(() => import("pages/networks/NetworkMap"));
const CreateInstanceForm = lazy(
() => import("pages/instances/CreateInstanceForm")
() => import("pages/instances/CreateInstanceForm"),
);
const CreateProfileForm = lazy(
() => import("pages/profiles/CreateProfileForm")
() => import("pages/profiles/CreateProfileForm"),
);
const CreateProjectForm = lazy(
() => import("pages/projects/CreateProjectForm")
() => import("pages/projects/CreateProjectForm"),
);
const ProjectConfiguration = lazy(
() => import("pages/projects/ProjectConfiguration")
() => import("pages/projects/ProjectConfiguration"),
);
const CreateClusterGroup = lazy(
() => import("pages/cluster/CreateClusterGroup")
() => import("pages/cluster/CreateClusterGroup"),
);
const EditClusterGroup = lazy(() => import("pages/cluster/EditClusterGroup"));

Expand Down
10 changes: 5 additions & 5 deletions src/api/cluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ export const fetchClusterMembers = (): Promise<LxdClusterMember[]> => {
fetch("/1.0/cluster/members?recursion=2")
.then(handleResponse)
.then((data: LxdApiResponse<LxdClusterMember[]>) =>
resolve(data.metadata)
resolve(data.metadata),
)
.catch(reject);
});
};

export const postClusterMemberState = (
member: LxdClusterMember,
action: LxdClusterMemberAction
action: LxdClusterMemberAction,
): Promise<LxdClusterMember[]> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/cluster/members/${member.server_name}/state`, {
Expand All @@ -31,7 +31,7 @@ export const postClusterMemberState = (
})
.then(handleResponse)
.then((data: LxdApiResponse<LxdClusterMember[]>) =>
resolve(data.metadata)
resolve(data.metadata),
)
.catch(reject);
});
Expand All @@ -56,7 +56,7 @@ export const fetchClusterGroup = (group: string): Promise<LxdClusterGroup> => {
};

export const updateClusterGroup = (
group: LxdClusterGroup
group: LxdClusterGroup,
): Promise<LxdApiResponse<null>> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/cluster/groups/${group.name}`, {
Expand All @@ -70,7 +70,7 @@ export const updateClusterGroup = (
};

export const createClusterGroup = (
group: LxdClusterGroup
group: LxdClusterGroup,
): Promise<LxdApiResponse<null>> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/cluster/groups`, {
Expand Down
2 changes: 1 addition & 1 deletion src/api/images.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { LxdOperationResponse } from "types/operation";

export const fetchImage = (
image: string,
project: string
project: string,
): Promise<LxdImage> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/images/${image}?project=${project}`)
Expand Down
42 changes: 21 additions & 21 deletions src/api/instances.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { EventQueue } from "context/eventQueue";
export const fetchInstance = (
name: string,
project: string,
recursion = 2
recursion = 2,
): Promise<LxdInstance> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances/${name}?project=${project}&recursion=${recursion}`)
Expand All @@ -34,7 +34,7 @@ export const fetchInstances = (project: string): Promise<LxdInstance[]> => {
export const createInstance = (
body: string,
project: string,
target?: string
target?: string,
): Promise<LxdOperationResponse> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances?project=${project}&target=${target ?? ""}`, {
Expand All @@ -49,7 +49,7 @@ export const createInstance = (

export const updateInstance = (
instance: LxdInstance,
project: string
project: string,
): Promise<LxdOperationResponse> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances/${instance.name}?project=${project}`, {
Expand All @@ -68,7 +68,7 @@ export const updateInstance = (
export const renameInstance = (
oldName: string,
newName: string,
project: string
project: string,
): Promise<LxdOperationResponse> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances/${oldName}?project=${project}`, {
Expand All @@ -86,7 +86,7 @@ export const renameInstance = (
export const migrateInstance = (
name: string,
project: string,
target: string
target: string,
): Promise<LxdOperationResponse> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances/${name}?project=${project}&target=${target}`, {
Expand Down Expand Up @@ -125,7 +125,7 @@ const putInstanceAction = (
instance: string,
project: string,
action: LxdInstanceAction,
isForce?: boolean
isForce?: boolean,
): Promise<LxdOperationResponse> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances/${instance}/state?project=${project}`, {
Expand All @@ -150,7 +150,7 @@ export interface InstanceBulkAction {
export const updateInstanceBulkAction = (
actions: InstanceBulkAction[],
isForce: boolean,
eventQueue: EventQueue
eventQueue: EventQueue,
): Promise<PromiseSettledResult<void>[]> => {
let remainingResults = actions.length;
const results: PromiseSettledResult<void>[] = [];
Expand Down Expand Up @@ -178,17 +178,17 @@ export const updateInstanceBulkAction = (
if (remainingResults === 0) {
resolve(results);
}
}
},
);
}
},
);
})
}),
);
});
};

export const deleteInstance = (
instance: LxdInstance
instance: LxdInstance,
): Promise<LxdOperationResponse> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances/${instance.name}?project=${instance.project}`, {
Expand All @@ -202,7 +202,7 @@ export const deleteInstance = (

export const deleteInstanceBulk = (
instances: LxdInstance[],
eventQueue: EventQueue
eventQueue: EventQueue,
): Promise<PromiseSettledResult<void>[]> => {
let remainingResults = instances.length;
const results: PromiseSettledResult<void>[] = [];
Expand All @@ -229,18 +229,18 @@ export const deleteInstanceBulk = (
if (remainingResults === 0) {
resolve(results);
}
}
},
);
});
})
}),
);
});
};

export const connectInstanceExec = (
name: string,
project: string,
payload: TerminalConnectPayload
payload: TerminalConnectPayload,
): Promise<LxdTerminal> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances/${name}/exec?project=${project}&wait=10`, {
Expand All @@ -250,7 +250,7 @@ export const connectInstanceExec = (
"wait-for-websocket": true,
environment: payload.environment.reduce(
(a, v) => ({ ...a, [v.key]: v.value }),
{}
{},
),
interactive: true,
group: payload.group,
Expand All @@ -265,7 +265,7 @@ export const connectInstanceExec = (

export const connectInstanceVga = (
name: string,
project: string
project: string,
): Promise<LxdTerminal> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances/${name}/console?project=${project}&wait=10`, {
Expand All @@ -284,7 +284,7 @@ export const connectInstanceVga = (

export const connectInstanceConsole = (
name: string,
project: string
project: string,
): Promise<LxdTerminal> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances/${name}/console?project=${project}&wait=10`, {
Expand All @@ -302,7 +302,7 @@ export const connectInstanceConsole = (

export const fetchInstanceConsoleBuffer = (
name: string,
project: string
project: string,
): Promise<string> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances/${name}/console?project=${project}`, {
Expand All @@ -316,7 +316,7 @@ export const fetchInstanceConsoleBuffer = (

export const fetchInstanceLogs = (
name: string,
project: string
project: string,
): Promise<string[]> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances/${name}/logs?project=${project}`, {
Expand All @@ -331,7 +331,7 @@ export const fetchInstanceLogs = (
export const fetchInstanceLogFile = (
name: string,
project: string,
file: string
file: string,
): Promise<string> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/instances/${name}/logs/${file}?project=${project}`, {
Expand Down
14 changes: 7 additions & 7 deletions src/api/networks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const fetchNetworks = (project: string): Promise<LxdNetwork[]> => {

export const fetchNetwork = (
name: string,
project: string
project: string,
): Promise<LxdNetwork> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/networks/${name}?project=${project}`)
Expand All @@ -26,7 +26,7 @@ export const fetchNetwork = (

export const fetchNetworkState = (
name: string,
project: string
project: string,
): Promise<LxdNetworkState> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/networks/${name}/state?project=${project}`)
Expand All @@ -39,7 +39,7 @@ export const fetchNetworkState = (
export const createClusterBridge = (
network: Partial<LxdNetwork>,
project: string,
clusterMembers: LxdClusterMember[]
clusterMembers: LxdClusterMember[],
) => {
return new Promise((resolve, reject) => {
const memberNetwork = {
Expand All @@ -51,7 +51,7 @@ export const createClusterBridge = (
void Promise.allSettled(
clusterMembers.map(async (member) => {
await createNetwork(memberNetwork, project, member.server_name);
})
}),
)
.then((results) => {
const error = (
Expand All @@ -73,7 +73,7 @@ export const createClusterBridge = (
export const createNetwork = (
network: Partial<LxdNetwork>,
project: string,
target?: string
target?: string,
) => {
return new Promise((resolve, reject) => {
const targetParam = target ? `&target=${target}` : "";
Expand All @@ -89,7 +89,7 @@ export const createNetwork = (

export const updateNetwork = (
network: Partial<LxdNetwork>,
project: string
project: string,
) => {
return new Promise((resolve, reject) => {
fetch(`/1.0/networks/${network.name ?? ""}?project=${project}`, {
Expand All @@ -108,7 +108,7 @@ export const updateNetwork = (
export const renameNetwork = (
oldName: string,
newName: string,
project: string
project: string,
) => {
return new Promise((resolve, reject) => {
fetch(`/1.0/networks/${oldName}?project=${project}`, {
Expand Down
4 changes: 2 additions & 2 deletions src/api/operations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const TIMEOUT_10 = 10;

export const watchOperation = (
operationUrl: string,
timeout = TIMEOUT_10
timeout = TIMEOUT_10,
): Promise<LxdOperationResponse> => {
return new Promise((resolve, reject) => {
const operationParts = operationUrl.split("?");
Expand All @@ -27,7 +27,7 @@ export const watchOperation = (
}
if (data.metadata.status === "Running") {
throw Error(
"Timeout while waiting for the operation to succeed. Watched operation continues in the background."
"Timeout while waiting for the operation to succeed. Watched operation continues in the background.",
);
} else if (data.metadata.status === "Cancelled") {
throw new Error("Cancelled");
Expand Down
4 changes: 2 additions & 2 deletions src/api/profiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { LxdApiResponse } from "types/apiResponse";

export const fetchProfile = (
name: string,
project: string
project: string,
): Promise<LxdProfile> => {
return new Promise((resolve, reject) => {
fetch(`/1.0/profiles/${name}?project=${project}&recursion=1`)
Expand Down Expand Up @@ -53,7 +53,7 @@ export const updateProfile = (profile: LxdProfile, project: string) => {
export const renameProfile = (
oldName: string,
newName: string,
project: string
project: string,
) => {
return new Promise((resolve, reject) => {
fetch(`/1.0/profiles/${oldName}?project=${project}`, {
Expand Down
Loading

0 comments on commit e2708df

Please sign in to comment.