refactor(ui): consolidate container and database management under projects
This commit is contained in:
1 parent
742cae643e
commit
dbefb42725
26 files changed
+4
-3018
No files matched your search
+1057
File diff suppressed because it is too large.
Load diff
+46
@@ -0,0 +1,46 @@
|
||||
export const DB_APPS = ["postgres", "mysql", "mongodb", "redis"] as const;
|
||||
export type DbType = (typeof DB_APPS)[number];
|
||||
export type DatabaseKind = DbType | "mariadb";
|
||||
|
||||
export const DB_META: Record<
|
||||
DatabaseKind,
|
||||
{ label: string; color: string; port: string; passEnv: string }
|
||||
> = {
|
||||
postgres: {
|
||||
label: "PostgreSQL",
|
||||
color: "#3b82f6",
|
||||
port: "5432:5432",
|
||||
passEnv: "POSTGRES_PASSWORD",
|
||||
},
|
||||
mysql: {
|
||||
label: "MySQL",
|
||||
color: "#f59e0b",
|
||||
port: "3306:3306",
|
||||
passEnv: "MYSQL_ROOT_PASSWORD",
|
||||
},
|
||||
mongodb: {
|
||||
label: "MongoDB",
|
||||
color: "#10b981",
|
||||
port: "27017:27017",
|
||||
passEnv: "MONGO_INITDB_ROOT_PASSWORD",
|
||||
},
|
||||
mariadb: {
|
||||
label: "MariaDB",
|
||||
color: "#fb7185",
|
||||
port: "3306:3306",
|
||||
passEnv: "MARIADB_ROOT_PASSWORD",
|
||||
},
|
||||
redis: { label: "Redis", color: "#ef4444", port: "6379:6379", passEnv: "" },
|
||||
};
|
||||
|
||||
export const typeColors: Record<string, string> = {
|
||||
PostgreSQL: "#3b82f6",
|
||||
MySQL: "#f59e0b",
|
||||
MongoDB: "#10b981",
|
||||
Redis: "#ef4444",
|
||||
postgres: "#3b82f6",
|
||||
mysql: "#f59e0b",
|
||||
mongodb: "#10b981",
|
||||
mariadb: "#fb7185",
|
||||
redis: "#ef4444",
|
||||
};
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { Container, Server } from "@/lib/api";
|
||||
import type { DatabaseKind } from "./database-constants";
|
||||
|
||||
export type DatabaseContainer = Container & {
|
||||
databaseType: DatabaseKind;
|
||||
databaseLabel: string;
|
||||
databaseColor: string;
|
||||
exposedPort: string;
|
||||
};
|
||||
|
||||
export interface AddDatabaseModalProps {
|
||||
serverList: Server[];
|
||||
initialServerId?: string;
|
||||
initialEnvironmentId?: string;
|
||||
lockServerSelection?: boolean;
|
||||
onClose: () => void;
|
||||
onAdded: () => void;
|
||||
}
|
||||
+1
-1
@@ -22,7 +22,7 @@ import {
|
||||
type ProjectEnvironmentRecord,
|
||||
type ProjectRecord,
|
||||
} from "@/lib/api";
|
||||
import ContainerFileManagerModal from "@/app/containers/components/modals/ContainerFileManagerModal";
|
||||
import ContainerFileManagerModal from "@/components/containers/modals/ContainerFileManagerModal";
|
||||
import AdvancedTabPanel from "./components/advanced/AdvancedTabPanel";
|
||||
import DeploymentsTabPanel from "./components/deployments/DeploymentsTabPanel";
|
||||
import EnvironmentTabPanel from "./components/environment/EnvironmentTabPanel";
|
||||
|
||||
@@ -18,8 +18,8 @@ import {
|
||||
type ProjectRecord,
|
||||
type Server,
|
||||
} from "@/lib/api";
|
||||
import DeployContainerModal from "@/app/containers/components/modals/DeployContainerModal";
|
||||
import AddDatabaseModal from "@/app/databases/components/AddDatabaseModal";
|
||||
import DeployContainerModal from "@/components/containers/modals/DeployContainerModal";
|
||||
import AddDatabaseModal from "./components/database/AddDatabaseModal";
|
||||
import EnvironmentContainersTable from "./components/containers/EnvironmentContainersTable";
|
||||
import EnvironmentHeader from "./components/header/EnvironmentHeader";
|
||||
import ImportFromSyncModal from "./components/import/ImportFromSyncModal";
|
||||
|
||||
Reference in new issue
Block a user