add importing configuration from miners
This commit is contained in:
@@ -4,7 +4,7 @@ import sys
|
||||
from tools.cfg_util.cfg_util_qt.imgs import FAULT_LIGHT, TkImages
|
||||
from tools.cfg_util.cfg_util_qt.scan import btn_scan
|
||||
from tools.cfg_util.cfg_util_qt.commands import btn_light
|
||||
from tools.cfg_util.cfg_util_qt.configure import generate_config_ui
|
||||
from tools.cfg_util.cfg_util_qt.configure import generate_config_ui, btn_import
|
||||
from tools.cfg_util.cfg_util_qt.layout import window
|
||||
from tools.cfg_util.cfg_util_qt.general import btn_all, btn_web, btn_refresh
|
||||
from tools.cfg_util.cfg_util_qt.tables import TableManager
|
||||
@@ -72,6 +72,9 @@ async def main():
|
||||
btn_web(_table, value[_table])
|
||||
if event == "cfg_generate":
|
||||
await generate_config_ui()
|
||||
if event == "cfg_import":
|
||||
_table = "cfg_table"
|
||||
await btn_import(_table, value[_table])
|
||||
|
||||
# commands tab
|
||||
if event == "cmd_all":
|
||||
|
||||
@@ -2,6 +2,19 @@ import PySimpleGUI as sg
|
||||
from config.bos import bos_config_convert
|
||||
import time
|
||||
from tools.cfg_util.cfg_util_qt.layout import window
|
||||
from tools.cfg_util.cfg_util_qt.decorators import disable_buttons
|
||||
from miners.miner_factory import MinerFactory
|
||||
|
||||
|
||||
@disable_buttons
|
||||
async def btn_import(table, selected):
|
||||
if not len(selected) > 0:
|
||||
return
|
||||
ip = [window[table].Values[row][0] for row in selected][0]
|
||||
miner = await MinerFactory().get_miner(ip)
|
||||
await miner.get_config()
|
||||
config = miner.config
|
||||
window["cfg_config_txt"].update(config)
|
||||
|
||||
|
||||
def generate_config(username: str, workername: str, v2_allowed: bool):
|
||||
|
||||
Reference in New Issue
Block a user