diff --git a/frontend/src/app/components/connect-db/connect-db.component.html b/frontend/src/app/components/connect-db/connect-db.component.html index bb8f90288..28513afa8 100644 --- a/frontend/src/app/components/connect-db/connect-db.component.html +++ b/frontend/src/app/components/connect-db/connect-db.component.html @@ -165,6 +165,20 @@

(masterKeyChange)="handleMasterKeyChange($event)"> + + + + Hostname + + + E.g. mongodb+srv://my-test-db.8a8grvb.mongoconnection.net
+ Connections from internal IPs (e.g. localhost) are not supported +
+ + + To connect a database to an internal IP, use something like Pinggy + (here's a guide), + or to connect through an agent + + Hostname is invalid + + + + Port + + Port should not be empty + + + + Password + + To keep password the same keep this field blank + Password needed due to hostname/port change + + + + + + Advanced settings + + + +
+ + + + + Username + + Username should not be empty + + + + Database name + + Name should not be empty + + + + Use SSH tunnel + + + + Private SSH key + + Private SSH key should not be empty + + + + SSH host + + SSH host should not be empty + + + + SSH port + + SSH port should not be empty + + + + SSH username + + SSH username should not be empty + + + + Check SSL certificate + + + + SSL certificate + + SSL certificate should not be empty + +
+
\ No newline at end of file diff --git a/frontend/src/app/components/connect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.spec.ts b/frontend/src/app/components/connect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.spec.ts new file mode 100644 index 000000000..ae83b4871 --- /dev/null +++ b/frontend/src/app/components/connect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.spec.ts @@ -0,0 +1,61 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Angulartics2Module } from 'angulartics2'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { FormsModule } from '@angular/forms'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { RedisCredentialsFormComponent } from './redis-credentials-form.component'; +import { provideHttpClient } from '@angular/common/http'; + +describe('RedisCredentialsFormComponent', () => { + let component: RedisCredentialsFormComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ + FormsModule, + MatCheckboxModule, + BrowserAnimationsModule, + Angulartics2Module.forRoot({}), + RedisCredentialsFormComponent + ], + providers: [provideHttpClient()] +}) + .compileComponents(); + + fixture = TestBed.createComponent(RedisCredentialsFormComponent); + component = fixture.componentInstance; + + component.connection = { + id: "12345678" + } as any; + + // component.connection = { + // "title": "Test connection via SSH tunnel to mySQL", + // "masterEncryption": false, + // "type": DBtype.MySQL, + // "host": "database-2.cvfuxe8nltiq.us-east-2.rds.amazonaws.com", + // "port": "3306", + // "username": "admin", + // "database": "testDB", + // "schema": null, + // "sid": null, + // "id": "9d5f6d0f-9516-4598-91c4-e4fe6330b4d4", + // "ssh": true, + // "sshHost": "3.134.99.192", + // "sshPort": '22', + // "sshUsername": "ubuntu", + // "ssl": false, + // "cert": null, + // "connectionType": ConnectionType.Direct, + // "azure_encryption": false, + // "signing_key": '' + // }; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/components/connect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.ts b/frontend/src/app/components/connect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.ts new file mode 100644 index 000000000..fff5c7836 --- /dev/null +++ b/frontend/src/app/components/connect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.ts @@ -0,0 +1,31 @@ +import { Angulartics2Module } from 'angulartics2'; +import { BaseCredentialsFormComponent } from '../base-credentials-form/base-credentials-form.component'; +import { Component } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { HostnameValidationDirective } from 'src/app/directives/hostnameValidator.directive'; +import { MasterEncryptionPasswordComponent } from '../../master-encryption-password/master-encryption-password.component'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatExpansionModule } from '@angular/material/expansion'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { NgIf } from '@angular/common'; + +@Component({ + selector: 'app-redis-credentials-form', + templateUrl: './redis-credentials-form.component.html', + styleUrls: ['../base-credentials-form/base-credentials-form.component.css', './redis-credentials-form.component.css'], + imports: [ + NgIf, + FormsModule, + MatFormFieldModule, + MatInputModule, + MatCheckboxModule, + MatExpansionModule, + HostnameValidationDirective, + MasterEncryptionPasswordComponent, + Angulartics2Module + ] +}) +export class RedisCredentialsFormComponent extends BaseCredentialsFormComponent { + +} diff --git a/frontend/src/app/consts/databases.ts b/frontend/src/app/consts/databases.ts index a422ba9bf..deab3d674 100644 --- a/frontend/src/app/consts/databases.ts +++ b/frontend/src/app/consts/databases.ts @@ -6,6 +6,7 @@ export const supportedOrderedDatabases = [ "cassandra", "oracledb", "mssql", + "redis", "ibmdb2" ] @@ -17,5 +18,6 @@ export const supportedDatabasesTitles = { cassandra: "Cassandra", oracledb: "OracleDB", mssql: "SQL Server", + redis: "Redis", ibmdb2: "IBM DB2" } \ No newline at end of file diff --git a/frontend/src/app/consts/record-edit-types.ts b/frontend/src/app/consts/record-edit-types.ts index ba6fabe41..81f791998 100644 --- a/frontend/src/app/consts/record-edit-types.ts +++ b/frontend/src/app/consts/record-edit-types.ts @@ -308,5 +308,13 @@ export const recordEditTypes = { list: JsonEditorEditComponent, map: JsonEditorEditComponent, set: JsonEditorEditComponent, + }, + redis: { + string: TextEditComponent, + integer: NumberEditComponent, + decimal: NumberEditComponent, + boolean: BooleanEditComponent, + array: JsonEditorEditComponent, + json: JsonEditorEditComponent, } } diff --git a/frontend/src/app/consts/record-view-types.ts b/frontend/src/app/consts/record-view-types.ts index 13553a5b9..ed5ddf714 100644 --- a/frontend/src/app/consts/record-view-types.ts +++ b/frontend/src/app/consts/record-view-types.ts @@ -302,4 +302,12 @@ export const recordViewFieldTypes = { map: JsonEditorRecordViewComponent, set: JsonEditorRecordViewComponent, }, + redis: { + string: TextRecordViewComponent, + integer: NumberRecordViewComponent, + decimal: NumberRecordViewComponent, + boolean: BooleanRecordViewComponent, + array: JsonEditorRecordViewComponent, + json: JsonEditorRecordViewComponent, + } } diff --git a/frontend/src/app/consts/table-display-types.ts b/frontend/src/app/consts/table-display-types.ts index e640d660a..417ff3771 100644 --- a/frontend/src/app/consts/table-display-types.ts +++ b/frontend/src/app/consts/table-display-types.ts @@ -302,4 +302,12 @@ export const tableDisplayTypes = { map: JsonEditorDisplayComponent, set: JsonEditorDisplayComponent, }, + redis: { + string: TextDisplayComponent, + integer: NumberDisplayComponent, + decimal: NumberDisplayComponent, + boolean: BooleanDisplayComponent, + array: JsonEditorDisplayComponent, + json: JsonEditorDisplayComponent, + } } diff --git a/frontend/src/app/models/connection.ts b/frontend/src/app/models/connection.ts index dba124abb..79ec97fcd 100644 --- a/frontend/src/app/models/connection.ts +++ b/frontend/src/app/models/connection.ts @@ -8,6 +8,7 @@ export enum DBtype { Mongo = 'mongodb', Dynamo = 'dynamodb', Cassandra = 'cassandra', + Redis = 'redis', DB2 = 'ibmdb2' }