Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connector refactor #42

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ services:
- ../..:/workspaces:cached
# Overrides default command so things don't shut down after the process ends.
entrypoint: /usr/local/share/docker-init.sh
command: sleep infinity
command: sleep infinity
redis:
hostname: redis
image: redis
command: redis-server --include /usr/local/etc/redis/redis.conf
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
ports:
- "6379:6379"
zookeeper:
image: wurstmeister/zookeeper
ports:
Expand Down
178 changes: 167 additions & 11 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-graph-vis": "^1.0.7",
"redis": "^4.6.8",
"uuidv4": "^6.2.13"
},
"devDependencies": {
"typescript": "5.0.2",
"prettier": "^2.8.8",
"@types/node": "18.15.5",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11"
"@types/react-dom": "18.0.11",
"prettier": "^2.8.8",
"typescript": "5.0.2"
}
}
8 changes: 6 additions & 2 deletions client/src/components/connectors-table.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Connector } from '@/models/connector';
import { Connector, KafkaConnector, RedisConnector } from '@/models/connector';
import { Accordion } from '@mantine/core';

interface TableProps {
Expand All @@ -19,7 +19,11 @@ export default function PipelinesTable({ connector }: TableProps) {
<Accordion.Item value="customization" key={connector.name}>
<Accordion.Control>Connector</Accordion.Control>
<Accordion.Panel>
{connector.name} ({connector.type}), {connector.brokers} | {connector.group_id}
{connector.name} ({connector.type}),
{connector.type == 'kafka' ?
`${(connector as KafkaConnector).brokers} | ${(connector as KafkaConnector).group_id}`
: `${(connector as RedisConnector).host} | ${(connector as RedisConnector).port}`
}
</Accordion.Panel>
</Accordion.Item>
</Accordion>
Expand Down
10 changes: 9 additions & 1 deletion client/src/models/connector.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
export interface Connector {
name: string;
type: string;
type: 'kafka' | 'redis';
}

export interface KafkaConnector extends Connector {
brokers: string;
group_id: string;
}

export interface RedisConnector extends Connector {
host: string;
port: number
}
4 changes: 2 additions & 2 deletions client/src/models/pipeline-list.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Connector } from './connector';
import { KafkaConnector, RedisConnector } from './connector';
import { Pipeline } from './pipeline';

export interface PipelineList {
name: string;
pipelines: Pipeline[];
connector: Connector;
connector: RedisConnector | KafkaConnector;
}
Loading
Loading