mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 13:02:59 +00:00
added shutdown to actions tab, enabled some more displays, changed baseball to non-priority
This commit is contained in:
@@ -317,7 +317,7 @@
|
||||
},
|
||||
"mlb": {
|
||||
"enabled": true,
|
||||
"live_priority": true,
|
||||
"live_priority": false,
|
||||
"live_game_duration": 30,
|
||||
"show_odds": true,
|
||||
"test_mode": false,
|
||||
@@ -412,13 +412,13 @@
|
||||
}
|
||||
},
|
||||
"music": {
|
||||
"enabled": false,
|
||||
"enabled": true,
|
||||
"preferred_source": "ytm",
|
||||
"YTM_COMPANION_URL": "http://192.168.86.12:9863",
|
||||
"POLLING_INTERVAL_SECONDS": 1
|
||||
},
|
||||
"of_the_day": {
|
||||
"enabled": false,
|
||||
"enabled": true,
|
||||
"display_rotate_interval": 20,
|
||||
"update_interval": 3600,
|
||||
"subtitle_rotate_interval": 10,
|
||||
|
||||
@@ -750,12 +750,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="display-controls">
|
||||
<button class="btn btn-success" onclick="startDisplay()">
|
||||
<i class="fas fa-play"></i> Start Display
|
||||
</button>
|
||||
<button class="btn btn-danger" onclick="stopDisplay()">
|
||||
<i class="fas fa-stop"></i> Stop Display
|
||||
</button>
|
||||
<button class="btn btn-warning" onclick="toggleEditorMode()">
|
||||
<i class="fas fa-edit"></i>
|
||||
{{ 'Exit Editor' if editor_mode else 'Enter Editor' }}
|
||||
@@ -1684,6 +1678,9 @@
|
||||
<button type="button" class="btn btn-danger" onclick="runAction('reboot_system')" onclick="return confirm('Are you sure you want to reboot?')">
|
||||
<i class="fas fa-power-off"></i> Reboot System
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger" onclick="confirmShutdown()">
|
||||
<i class="fas fa-power-off"></i> Shutdown System
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<h4>Action Output</h4>
|
||||
@@ -2772,6 +2769,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
function confirmShutdown(){
|
||||
if (!confirm('Are you sure you want to shut down the system? This will power off the Raspberry Pi.')) return;
|
||||
runAction('shutdown_system');
|
||||
}
|
||||
|
||||
async function fetchLogs() {
|
||||
const logContent = document.getElementById('log-content');
|
||||
logContent.textContent = 'Loading logs...';
|
||||
|
||||
@@ -432,6 +432,9 @@ def system_action():
|
||||
elif action == 'reboot_system':
|
||||
result = subprocess.run(['sudo', '-n', 'reboot'],
|
||||
capture_output=True, text=True)
|
||||
elif action == 'shutdown_system':
|
||||
result = subprocess.run(['sudo', '-n', 'poweroff'],
|
||||
capture_output=True, text=True)
|
||||
elif action == 'git_pull':
|
||||
# Run git pull from the repository directory where this file lives
|
||||
repo_dir = Path(__file__).resolve().parent
|
||||
@@ -601,6 +604,9 @@ def run_action_route():
|
||||
elif action == 'reboot_system':
|
||||
result = subprocess.run(['sudo', '-n', 'reboot'],
|
||||
capture_output=True, text=True)
|
||||
elif action == 'shutdown_system':
|
||||
result = subprocess.run(['sudo', '-n', 'poweroff'],
|
||||
capture_output=True, text=True)
|
||||
elif action == 'git_pull':
|
||||
repo_dir = Path(__file__).resolve().parent
|
||||
if not (repo_dir / '.git').exists():
|
||||
|
||||
Reference in New Issue
Block a user