From 03a15dd9ee670a0f7ace5682eed294abde9c4dc9 Mon Sep 17 00:00:00 2001 From: mvoelkel Date: Wed, 9 Nov 2016 14:34:32 +0100 Subject: [PATCH] System settings page fixes 1. System.html Don't submit when nothing has changed. 2. sync the file system after writing system settings. --- octoserve/var/www/system.html | 6 +++++- octoserve/var/www/systemsettings.lua | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/octoserve/var/www/system.html b/octoserve/var/www/system.html index d93494d..00c6c41 100644 --- a/octoserve/var/www/system.html +++ b/octoserve/var/www/system.html @@ -106,7 +106,11 @@ function SaveSettings() param += "strict=" + (NewSettings.strictEnabled?"1":"0"); } - location.replace('/systemsettings.lua?'+param); + document.getElementById("SetButton").disabled = true; + if( param != "" ) + { + location.replace('/systemsettings.lua?'+param); + } } } diff --git a/octoserve/var/www/systemsettings.lua b/octoserve/var/www/systemsettings.lua index 8ce66c0..5b48097 100644 --- a/octoserve/var/www/systemsettings.lua +++ b/octoserve/var/www/systemsettings.lua @@ -165,6 +165,7 @@ if query ~= "" then if name == "strict" then restart = 1 end end end + os.execute("/bin/sync >/dev/null 2>&1"); if restart == 1 then os.execute("/etc/init.d/S99octo restartoctonet > /dev/null 2>&1 &") nextloc = "wait.html?10"