Initial commit, 90% there
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
|
||||
with open('/home/mdares/.node-red/flows.json', 'r') as f:
|
||||
flows = json.load(f)
|
||||
|
||||
for node in flows:
|
||||
if node.get('id') == 'f3a4b5c6d7e8f9a0' and node.get('name') == 'Graphs Template':
|
||||
template = node.get('format', '')
|
||||
|
||||
# Fix: Make variable name consistent - use selectedRange everywhere
|
||||
template = template.replace(
|
||||
"var currentFilter = scope.currentFilter || '24h';",
|
||||
"var currentFilter = scope.selectedRange || '24h';"
|
||||
)
|
||||
|
||||
node['format'] = template
|
||||
print("✓ Fixed Graphs Template variable consistency (currentFilter → selectedRange)")
|
||||
break
|
||||
|
||||
with open('/home/mdares/.node-red/flows.json', 'w') as f:
|
||||
json.dump(flows, f, indent=4)
|
||||
|
||||
print("✓ flows.json updated")
|
||||
Reference in New Issue
Block a user