From 886d354f63199a5568f9a9a62d77f60867d11fac Mon Sep 17 00:00:00 2001 From: Guy Davis Date: Sat, 15 Nov 2025 09:17:45 -0700 Subject: [PATCH] Fix for harvester log parsing and latest JS libs. --- api/commands/plotman_cli.py | 2 +- api/models/log.py | 11 ++++++++++- scripts/pull_3rd_party_libs.sh | 12 ++++++------ web/templates/settings/plotting.html | 2 +- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/api/commands/plotman_cli.py b/api/commands/plotman_cli.py index 85196c77..231bfc5b 100644 --- a/api/commands/plotman_cli.py +++ b/api/commands/plotman_cli.py @@ -335,7 +335,7 @@ def load_schedule(): return json.dumps(json.loads(open(PLOTTING_SCHEDULES,'r').read())) except Exception as ex: app.logger.error("Failed to read plotting schedule from {0} due to {1}.".format(PLOTTING_SCHEDULES, str(ex))) - return [] # Return an empty schedule response if not present. + return "[]" # Return an empty schedule response if not present. # A reference to the scheduler saved_scheduler = None diff --git a/api/models/log.py b/api/models/log.py index 8743b8e2..71030f40 100644 --- a/api/models/log.py +++ b/api/models/log.py @@ -25,7 +25,16 @@ def __init__(self, cli_stdout, blockchain): 'time_taken': str(re.search(r'took ([0-9]+\.?[0-9]*(?:[Ee]\ *-?\ *[0-9]+)?) sec', line, re.IGNORECASE).group(1)) + ' secs', 'created_at': line[:19] # example at line start: 2022-01-25 10:14:33 }) - else: # All Chia forks + elif blockchain == 'chia': + self.rows.append({ + 'challenge_id': re.search(r'challenge_hash: (\w{10})', line, re.IGNORECASE).group(1) + '...', + 'plots_past_filter': str(re.search(r'(\d+) plots were eligible', line, re.IGNORECASE).group(1)) + \ + '/' + str(re.search(r'Total (\d+) plots', line, re.IGNORECASE).group(1)), + 'proofs_found': int(re.search(r'Found (\d+) V1 proofs', line, re.IGNORECASE).group(1)), + 'time_taken': str(re.search(r'Time: (\d+\.?\d*) s.', line, re.IGNORECASE).group(1)) + ' secs', + 'created_at': line.split()[0].replace('T', ' ') + }) + else: # All legacy Chia forks self.rows.append({ 'challenge_id': re.search(r'eligible for farming (\w+)', line, re.IGNORECASE).group(1) + '...', 'plots_past_filter': str(re.search(r'INFO\s*(\d+) plots were eligible', line, re.IGNORECASE).group(1)) + \ diff --git a/scripts/pull_3rd_party_libs.sh b/scripts/pull_3rd_party_libs.sh index 99f25382..a352e513 100644 --- a/scripts/pull_3rd_party_libs.sh +++ b/scripts/pull_3rd_party_libs.sh @@ -13,15 +13,15 @@ LEAFLET_VERSION=1.9.4 # List of other css/js links LIST=" -https://cdn.datatables.net/2.3.0/css/dataTables.bootstrap5.css -https://cdn.datatables.net/2.3.0/js/dataTables.bootstrap5.js -https://cdn.datatables.net/2.3.0/js/dataTables.min.js -https://cdn.jsdelivr.net/npm/chart.js@4.4.9/dist/chart.umd.js.map -https://cdn.jsdelivr.net/npm/chart.js@4.4.9/dist/chart.umd.min.js +https://cdn.datatables.net/2.3.5/css/dataTables.bootstrap5.css +https://cdn.datatables.net/2.3.5/js/dataTables.bootstrap5.js +https://cdn.datatables.net/2.3.5/js/dataTables.min.js +https://cdn.jsdelivr.net/npm/chart.js@4.5.1/dist/chart.umd.js.map +https://cdn.jsdelivr.net/npm/chart.js@4.5.1/dist/chart.umd.min.js https://cdn.jsdelivr.net/npm/chartjs-adapter-luxon@1.3.1/dist/chartjs-adapter-luxon.umd.min.js https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2.2.0/dist/chartjs-plugin-datalabels.min.js https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js -https://cdn.jsdelivr.net/npm/luxon@3.6.1/build/global/luxon.min.js" +https://cdn.jsdelivr.net/npm/luxon@3.7.2/build/global/luxon.min.js" mkdir -p $BASEPATH for url in $LIST ; do diff --git a/web/templates/settings/plotting.html b/web/templates/settings/plotting.html index aa01bec5..d49ad64b 100644 --- a/web/templates/settings/plotting.html +++ b/web/templates/settings/plotting.html @@ -12,7 +12,7 @@