Skip to content
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
9 changes: 0 additions & 9 deletions miner_objects/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,9 @@ def get_next_unused_port(self, start, stop):
for port in range(start, stop):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
if s.connect_ex(("127.0.0.1", port)) != 0:
self.write_env_file(port)
return port # found a free port
raise OSError(f"All ports from [{start}, {stop}) in use. Aborting dashboard.")

def write_env_file(self, api_port):
"""
write the miner_url to the miner_dashboard .env file
"""
env_file_path = MinerConfig.BASE_DIR + "/miner_objects/miner_dashboard/.env"
with open(env_file_path, 'w') as env_file:
env_file.write(f'VITE_MINER_URL=http://127.0.0.1:{api_port}\n')

def run(self):
uvicorn.run(self.app, host="127.0.0.1", port=self.port)

Expand Down
24 changes: 0 additions & 24 deletions miner_objects/miner_dashboard/.gitignore

This file was deleted.

28 changes: 0 additions & 28 deletions miner_objects/miner_dashboard/eslint.config.js

This file was deleted.

13 changes: 0 additions & 13 deletions miner_objects/miner_dashboard/index.html

This file was deleted.

57 changes: 0 additions & 57 deletions miner_objects/miner_dashboard/package.json

This file was deleted.

Loading