feat(networks): enhance network management and UI components

- Added functionality for assigning Docker networks to services, allowing users to manage network associations directly from the UI.
- Introduced new components for assigning networks to both individual services and compose files, improving user experience and flexibility.
- Updated existing components to integrate network assignment features, ensuring seamless interaction within the dashboard.
- Enhanced the database schema to support new network-related fields, including `networkIds` and `detachDokployNetwork`, for better service configuration.
- Improved the layout and responsiveness of various UI elements to accommodate new features and enhance usability.
This commit is contained in:
Mauricio Siu
2026-07-25 03:09:54 -06:00
parent 8a37626636
commit 97885ee44a
57 changed files with 1382 additions and 307 deletions

View File

@@ -48,19 +48,60 @@ export const createProject = async (
};
export const findProjectById = async (projectId: string) => {
const serviceColumns = {
name: true,
description: true,
appName: true,
createdAt: true,
serverId: true,
applicationStatus: true,
} as const;
const project = await db.query.projects.findFirst({
where: eq(projects.projectId, projectId),
with: {
environments: {
with: {
applications: true,
compose: true,
libsql: true,
mariadb: true,
mongo: true,
mysql: true,
postgres: true,
redis: true,
applications: {
columns: {
...serviceColumns,
applicationId: true,
icon: true,
},
with: { server: { columns: { name: true } } },
},
compose: {
columns: {
...serviceColumns,
composeId: true,
composeStatus: true,
},
with: { server: { columns: { name: true } } },
},
libsql: {
columns: { ...serviceColumns, libsqlId: true },
with: { server: { columns: { name: true } } },
},
mariadb: {
columns: { ...serviceColumns, mariadbId: true },
with: { server: { columns: { name: true } } },
},
mongo: {
columns: { ...serviceColumns, mongoId: true },
with: { server: { columns: { name: true } } },
},
mysql: {
columns: { ...serviceColumns, mysqlId: true },
with: { server: { columns: { name: true } } },
},
postgres: {
columns: { ...serviceColumns, postgresId: true },
with: { server: { columns: { name: true } } },
},
redis: {
columns: { ...serviceColumns, redisId: true },
with: { server: { columns: { name: true } } },
},
},
},
projectTags: {
@@ -107,27 +148,49 @@ export const updateProjectById = async (
export const validUniqueServerAppName = async (appName: string) => {
const query = await db.query.environments.findMany({
columns: { environmentId: true },
with: {
applications: {
where: eq(applications.appName, appName),
columns: {
appName: true,
},
},
libsql: {
where: eq(libsql.appName, appName),
columns: {
appName: true,
},
},
mariadb: {
where: eq(mariadb.appName, appName),
columns: {
appName: true,
},
},
mongo: {
where: eq(mongo.appName, appName),
columns: {
appName: true,
},
},
mysql: {
where: eq(mysql.appName, appName),
columns: {
appName: true,
},
},
postgres: {
where: eq(postgres.appName, appName),
columns: {
appName: true,
},
},
redis: {
where: eq(redis.appName, appName),
columns: {
appName: true,
},
},
},
});