feat(networks): add network configuration viewer and enhance network actions

- Introduced a new ShowNetworkConfig component for displaying detailed Docker network configuration.
- Integrated ShowNetworkConfig into the ShowNetworks component, allowing users to view network details directly.
- Updated the layout of network actions for improved user experience and accessibility.
- Enhanced the API to support network inspection functionality, providing necessary data for the new component.
This commit is contained in:
Mauricio Siu
2026-07-21 22:28:00 -06:00
parent 94ddbf8ba5
commit c578c18500
5 changed files with 149 additions and 36 deletions

View File

@@ -97,6 +97,24 @@ export const createNetwork = async (
return created;
};
export const inspectNetwork = async (networkId: string) => {
const row = await findNetworkById(networkId);
const docker = await getRemoteDocker(row.serverId ?? null);
try {
return await docker.getNetwork(row.name).inspect();
} catch (error) {
throw new TRPCError({
code: "BAD_REQUEST",
message:
error instanceof Error
? error.message
: "Failed to inspect Docker network",
cause: error,
});
}
};
// Docker networks are immutable: there is no update, only create and remove.
export const removeNetwork = async (networkId: string) => {
const row = await findNetworkById(networkId);