reformatted file structure and reformatted for phones, as well as fixed web sockets for remote devices
This commit is contained in:
16
tools/web_monitor/miner/remove.py
Normal file
16
tools/web_monitor/miner/remove.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from fastapi import Request
|
||||
from fastapi.responses import RedirectResponse
|
||||
|
||||
from tools.web_monitor.app import app
|
||||
from tools.web_monitor.func import get_current_miner_list
|
||||
|
||||
|
||||
@app.get("/{miner_ip}/remove")
|
||||
def get_miner(request: Request, miner_ip):
|
||||
miners = get_current_miner_list()
|
||||
miners.remove(miner_ip)
|
||||
with open("miner_list.txt", "w") as file:
|
||||
for miner_ip in miners:
|
||||
file.write(miner_ip + "\n")
|
||||
|
||||
return RedirectResponse(request.url_for('dashboard'))
|
||||
Reference in New Issue
Block a user