Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

FIX (mongodb): Fix MongoDB settings display

Rostislav Dugin5ba2c7dc379d
diff --git a/frontend/src/features/backups/ui/BackupsComponent.tsx b/frontend/src/features/backups/ui/BackupsComponent.tsx
index da2b6de9..b3708db5 100644
--- a/frontend/src/features/backups/ui/BackupsComponent.tsx
+++ b/frontend/src/features/backups/ui/BackupsComponent.tsx
@@ -394,7 +394,19 @@ export const BackupsComponent = ({ database, isCanManageDBs, scrollContainerRef
/>
</Tooltip>
- <Tooltip title="Download backup file. It can be restored manually via pg_restore (from custom format)">
+ <Tooltip
+ title={
+ database.type === DatabaseType.POSTGRES
+ ? 'Download backup file. It can be restored manually via pg_restore (from custom format)'
+ : database.type === DatabaseType.MYSQL
+ ? 'Download backup file. It can be restored manually via mysql client (from SQL dump)'
+ : database.type === DatabaseType.MARIADB
+ ? 'Download backup file. It can be restored manually via mariadb client (from SQL dump)'
+ : database.type === DatabaseType.MONGODB
+ ? 'Download backup file. It can be restored manually via mongorestore (from archive)'
+ : 'Download backup file'
+ }
+ >
{downloadingBackupId === record.id ? (
<SyncOutlined spin style={{ color: '#155dfc' }} />
) : (
diff --git a/frontend/src/features/databases/ui/show/ShowDatabaseSpecificDataComponent.tsx b/frontend/src/features/databases/ui/show/ShowDatabaseSpecificDataComponent.tsx
index 6fbfdc21..265ec472 100644
--- a/frontend/src/features/databases/ui/show/ShowDatabaseSpecificDataComponent.tsx
+++ b/frontend/src/features/databases/ui/show/ShowDatabaseSpecificDataComponent.tsx
@@ -1,5 +1,6 @@
import { type Database, DatabaseType } from '../../../../entity/databases';
import { ShowMariaDbSpecificDataComponent } from './ShowMariaDbSpecificDataComponent';
+import { ShowMongoDbSpecificDataComponent } from './ShowMongoDbSpecificDataComponent';
import { ShowMySqlSpecificDataComponent } from './ShowMySqlSpecificDataComponent';
import { ShowPostgreSqlSpecificDataComponent } from './ShowPostgreSqlSpecificDataComponent';
@@ -15,6 +16,8 @@ export const ShowDatabaseSpecificDataComponent = ({ database }: Props) => {
return <ShowMySqlSpecificDataComponent database={database} />;
case DatabaseType.MARIADB:
return <ShowMariaDbSpecificDataComponent database={database} />;
+ case DatabaseType.MONGODB:
+ return <ShowMongoDbSpecificDataComponent database={database} />;
default:
return null;
}
diff --git a/frontend/src/features/databases/ui/show/ShowMongoDbSpecificDataComponent.tsx b/frontend/src/features/databases/ui/show/ShowMongoDbSpecificDataComponent.tsx
new file mode 100644
index 00000000..09ff3953
--- /dev/null
+++ b/frontend/src/features/databases/ui/show/ShowMongoDbSpecificDataComponent.tsx
@@ -0,0 +1,48 @@
+import { type Database } from '../../../../entity/databases';
+
+interface Props {
+ database: Database;
+}
+
+export const ShowMongoDbSpecificDataComponent = ({ database }: Props) => {
+ return (
+ <div>
+ <div className="mb-1 flex w-full items-center">
+ <div className="min-w-[150px] break-all">Host</div>
+ <div>{database.mongodb?.host || ''}</div>
+ </div>
+
+ <div className="mb-1 flex w-full items-center">
+ <div className="min-w-[150px]">Port</div>
+ <div>{database.mongodb?.port || ''}</div>
+ </div>
+
+ <div className="mb-1 flex w-full items-center">
+ <div className="min-w-[150px]">Username</div>
+ <div>{database.mongodb?.username || ''}</div>
+ </div>
+
+ <div className="mb-1 flex w-full items-center">
+ <div className="min-w-[150px]">Password</div>
+ <div>{'*************'}</div>
+ </div>
+
+ <div className="mb-1 flex w-full items-center">
+ <div className="min-w-[150px]">DB name</div>
+ <div>{database.mongodb?.database || ''}</div>
+ </div>
+
+ <div className="mb-1 flex w-full items-center">
+ <div className="min-w-[150px]">Use TLS</div>
+ <div>{database.mongodb?.useTls ? 'Yes' : 'No'}</div>
+ </div>
+
+ {database.mongodb?.authDatabase && (
+ <div className="mb-1 flex w-full items-center">
+ <div className="min-w-[150px]">Auth database</div>
+ <div>{database.mongodb.authDatabase}</div>
+ </div>
+ )}
+ </div>
+ );
+};