diff --git a/app/sovran_systemsos_web/server.py b/app/sovran_systemsos_web/server.py index 7b1b842..63eb587 100644 --- a/app/sovran_systemsos_web/server.py +++ b/app/sovran_systemsos_web/server.py @@ -2978,7 +2978,7 @@ async def api_service_restart(unit: str): try: proc = await asyncio.create_subprocess_exec( "systemctl", "restart", unit, - stdout=asyncio.subprocess.PIPE, + stdout=asyncio.subprocess.DEVNULL, stderr=asyncio.subprocess.PIPE, ) _, stderr = await proc.communicate() diff --git a/app/sovran_systemsos_web/static/js/service-detail.js b/app/sovran_systemsos_web/static/js/service-detail.js index 0320556..ccce67f 100644 --- a/app/sovran_systemsos_web/static/js/service-detail.js +++ b/app/sovran_systemsos_web/static/js/service-detail.js @@ -308,6 +308,7 @@ async function openServiceDetailModal(unit, name, icon) { var restartBtn = document.getElementById("svc-detail-restart-btn"); var restartResult = document.getElementById("svc-detail-restart-result"); if (restartBtn && restartResult) { + var RESTART_REFRESH_DELAY_MS = 3000; restartBtn.addEventListener("click", async function() { restartBtn.disabled = true; restartBtn.textContent = "Restarting…"; @@ -322,7 +323,7 @@ async function openServiceDetailModal(unit, name, icon) { restartBtn.textContent = "🔄 Restart Service"; setTimeout(function() { openServiceDetailModal(unit, name, icon); - }, 3000); + }, RESTART_REFRESH_DELAY_MS); } catch (e) { restartResult.classList.add("error"); restartResult.textContent = e && e.message ? e.message : "Failed to restart service.";