-
- {
- try {
- setLoading(true);
- if (checked) {
- await Toast.fromAction(() => deployDbGate(app.id), 'DB Gate is now activated', 'Activating DB Gate...');
- } else {
- await Toast.fromAction(() => deleteDbGatDeploymentForAppIfExists(app.id), 'DB Gate has been deactivated', 'Deactivating DB Gate...');
- }
- await loadIsDbGateActive(app.id);
- } finally {
- setLoading(false);
- }
- }} />
-
-
- {isDbGateActive && <>
-
+ {isDbGateActive === undefined ?
:
+
+ {
+ try {
+ setLoading(true);
+ if (checked) {
+ await Toast.fromAction(() => deployDbTool(app.id, 'dbgate'), 'DB Gate is now activated', 'Activating DB Gate...');
+ } else {
+ await Toast.fromAction(() => deleteDbToolDeploymentForAppIfExists(app.id, 'dbgate'), 'DB Gate has been deactivated', 'Deactivating DB Gate...');
+ }
+ await loadIsDbGateActive(app.id);
+ } finally {
+ setLoading(false);
+ }
+ }} />
+
+
+ {isDbGateActive && <>
+
-
-
-
-
-
-
- Download the "Files" folder from DB Gate.
-
-
-
- >}
- {loading &&
}
-
}
-
-
+
+
+
+
+
+
+ Download the "Files" folder from DB Gate.
+
+
+
+ >}
+ {loading &&
}
+
}
>;
}
diff --git a/src/app/project/app/[appId]/credentials/db-tools.tsx b/src/app/project/app/[appId]/credentials/db-tools.tsx
new file mode 100644
index 0000000..4aa40d9
--- /dev/null
+++ b/src/app/project/app/[appId]/credentials/db-tools.tsx
@@ -0,0 +1,22 @@
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
+import { AppExtendedModel } from "@/shared/model/app-extended.model";
+import DbGateDbTool from "./db-gate";
+
+export default function DbToolsCard({
+ app
+}: {
+ app: AppExtendedModel;
+}) {
+
+ return <>
+