switched to a monospace font in the cfg tool, padded the hashrates to appear as decimal centered, and left justified hostnames for better readability.
This commit is contained in:
@@ -39,13 +39,13 @@ async def export_csv(file_location, ip_list_selected):
|
|||||||
async with aiofiles.open(file_location, mode='w') as file:
|
async with aiofiles.open(file_location, mode='w') as file:
|
||||||
for item in ip_list_selected:
|
for item in ip_list_selected:
|
||||||
await file.write(str(
|
await file.write(str(
|
||||||
", ".join([str(part) for part in item])
|
", ".join([str(part).rstrip().lstrip() for part in item])
|
||||||
) + "\n")
|
) + "\n")
|
||||||
else:
|
else:
|
||||||
async with aiofiles.open(file_location, mode='w') as file:
|
async with aiofiles.open(file_location, mode='w') as file:
|
||||||
for item in window['ip_table'].Values:
|
for item in window['ip_table'].Values:
|
||||||
await file.write(str(
|
await file.write(str(
|
||||||
", ".join([str(part) for part in item])
|
", ".join([str(part).rstrip().lstrip() for part in item])
|
||||||
) + "\n")
|
) + "\n")
|
||||||
await update_ui_with_data("status", "")
|
await update_ui_with_data("status", "")
|
||||||
|
|
||||||
|
|||||||
@@ -323,14 +323,14 @@ async def get_formatted_data(ip: ipaddress.ip_address):
|
|||||||
if "Temperature" in miner_data['summary'][0]['SUMMARY'][0].keys():
|
if "Temperature" in miner_data['summary'][0]['SUMMARY'][0].keys():
|
||||||
if not round(miner_data['summary'][0]['SUMMARY'][0]["Temperature"]) == 0:
|
if not round(miner_data['summary'][0]['SUMMARY'][0]["Temperature"]) == 0:
|
||||||
temps = miner_data['summary'][0]['SUMMARY'][0]["Temperature"]
|
temps = miner_data['summary'][0]['SUMMARY'][0]["Temperature"]
|
||||||
# hashrate data, this is the only place to get this for most miners as far as I know
|
# hashrate data
|
||||||
if 'MHS av' in miner_data['summary'][0]['SUMMARY'][0].keys():
|
if 'MHS av' in miner_data['summary'][0]['SUMMARY'][0].keys():
|
||||||
th5s = round(await safe_parse_api_data(miner_data, 'summary', 0, 'SUMMARY', 0, 'MHS av') / 1000000, 2)
|
th5s = format(round(await safe_parse_api_data(miner_data, 'summary', 0, 'SUMMARY', 0, 'MHS av') / 1000000, 2), ".2f").rjust(6, " ")
|
||||||
elif 'GHS av' in miner_data['summary'][0]['SUMMARY'][0].keys():
|
elif 'GHS av' in miner_data['summary'][0]['SUMMARY'][0].keys():
|
||||||
if not miner_data['summary'][0]['SUMMARY'][0]['GHS av'] == "":
|
if not miner_data['summary'][0]['SUMMARY'][0]['GHS av'] == "":
|
||||||
th5s = round(
|
th5s = format(round(
|
||||||
float(await safe_parse_api_data(miner_data, 'summary', 0, 'SUMMARY', 0, 'GHS av')) / 1000,
|
float(await safe_parse_api_data(miner_data, 'summary', 0, 'SUMMARY', 0, 'GHS av')) / 1000,
|
||||||
2)
|
2), ".2f").rjust(6, " ")
|
||||||
|
|
||||||
# alternate temperature data, for BraiinsOS
|
# alternate temperature data, for BraiinsOS
|
||||||
if "temps" in miner_data.keys():
|
if "temps" in miner_data.keys():
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ async def set_progress_bar_len(amount):
|
|||||||
|
|
||||||
|
|
||||||
async def sort_data(index: int or str):
|
async def sort_data(index: int or str):
|
||||||
if window["scan"].disabled:
|
if window["scan"].Disabled:
|
||||||
print("disabled")
|
print("disabled")
|
||||||
return
|
return
|
||||||
await update_ui_with_data("status", "Sorting Data")
|
await update_ui_with_data("status", "Sorting Data")
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
import sys
|
||||||
import PySimpleGUI as sg
|
import PySimpleGUI as sg
|
||||||
|
import tkinter as tk
|
||||||
|
|
||||||
from tools.cfg_util.cfg_util_sg.layout import window, generate_config_layout
|
from tools.cfg_util.cfg_util_sg.layout import window, generate_config_layout
|
||||||
from tools.cfg_util.cfg_util_sg.func.miners import send_config, miner_light, refresh_data, generate_config, import_config, \
|
from tools.cfg_util.cfg_util_sg.func.miners import send_config, miner_light, refresh_data, generate_config, import_config, \
|
||||||
@@ -18,6 +19,8 @@ async def ui():
|
|||||||
window.read(timeout=0)
|
window.read(timeout=0)
|
||||||
table = window["ip_table"].Widget
|
table = window["ip_table"].Widget
|
||||||
table.bind("<Control-Key-c>", lambda x: copy_from_table(table))
|
table.bind("<Control-Key-c>", lambda x: copy_from_table(table))
|
||||||
|
# left justify the hostnames
|
||||||
|
table.column(2, anchor=tk.W)
|
||||||
while True:
|
while True:
|
||||||
event, value = window.read(timeout=10)
|
event, value = window.read(timeout=10)
|
||||||
if event in (None, 'Close', sg.WIN_CLOSED):
|
if event in (None, 'Close', sg.WIN_CLOSED):
|
||||||
|
|||||||
Reference in New Issue
Block a user