diff --git a/.gitignore b/.gitignore index 7216a168..e3ee2e4b 100644 --- a/.gitignore +++ b/.gitignore @@ -159,6 +159,7 @@ cython_debug/ #.idea/ .vscode/launch.json +.vscode/settings.json chirps/erl_crash.dump *.dump diff --git a/chirps/target/providers/redis.py b/chirps/target/providers/redis.py index 9a1f7a47..5f8c9229 100644 --- a/chirps/target/providers/redis.py +++ b/chirps/target/providers/redis.py @@ -2,6 +2,7 @@ from logging import getLogger from django.db import models +from redis import Redis from target.models import BaseTarget logger = getLogger(__name__) @@ -28,5 +29,11 @@ def search(self, query: str, max_results: int) -> str: def test_connection(self) -> bool: """Ensure that the Redis target can be connected to.""" - logger.error('RedisTarget search not implemented') - raise NotImplementedError + client = Redis( + host=self.host, + port=self.port, + db=self.database_name, + password=self.password, + username=self.username, + ) + return client.ping() diff --git a/chirps/target/templates/target/dashboard.html b/chirps/target/templates/target/dashboard.html index 54c2699e..3da2977f 100644 --- a/chirps/target/templates/target/dashboard.html +++ b/chirps/target/templates/target/dashboard.html @@ -9,54 +9,97 @@
-
- {% if target.html_name == 'Mantium' %}
- Application ID: {{ target.app_id }}
- {% elif target.html_name == 'Redis' %}
- Host: {{ target.host }}
- Port: {{ target.port }}
- Database Name: {{ target.database_name }}
- Username: {{ target.username }}
- {% endif %}
- {% if target.html_name == 'Pinecone' %}
- API Key: {{ target.decrypted_api_key }}
- Environment: {{ target.environment }}
- Index Name: {{ target.index_name }}
- Project Name: {{ target.project_name }}
- {% endif %}
-
+ {% if target.html_name == 'Mantium' %}
+ Application ID: {{ target.app_id }}
+ {% elif target.html_name == 'Redis' %}
+ Host: {{ target.host }}
+ Port: {{ target.port }}
+ Database Name: {{ target.database_name }}
+ Username: {{ target.username }}
+ {% endif %}
+ {% if target.html_name == 'Pinecone' %}
+ API Key: {{ target.decrypted_api_key }}
+ Environment: {{ target.environment }}
+ Index Name: {{ target.index_name }}
+ Project Name: {{ target.project_name }}
+ {% endif %}
+