0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-12-22 11:03:48 +01:00

Add status request to sketch api.

Keep sketch directory over upgrades.
This commit is contained in:
Wouter R 2013-10-28 19:38:53 +01:00
parent 628f05b682
commit 0c79a51083
2 changed files with 11 additions and 2 deletions

View File

@ -67,6 +67,9 @@ if [ $? -gt 0 ]; then
EOM EOM
fi fi
#preserve saved sketches during firmware update
echo "/root/sketches" >> /etc/sysupgrade.conf
### Finally make sure basic configuration is set correctly ### Finally make sure basic configuration is set correctly
$IPKG_INSTROOT/etc/init.d/wifibox enable $IPKG_INSTROOT/etc/init.d/wifibox enable

View File

@ -140,10 +140,16 @@ function M._global_POST(request, response)
response:setSuccess() response:setSuccess()
end end
-- get info on number of sketches, used space, free space (and reserved space for printserver?) -- TODO: return total space used by sketches? (createSketchList() could just as well collect size info too...see lfs.attributes)
function M.status(request, response) function M.status(request, response)
if not createSketchDirectory(request, response) then return end if not createSketchDirectory(request, response) then return end
--return amount of sketches, free space (and space used by sketches?) local sketches = createSketchList()
local listSize = table.getn(sketches)
response:addData('number_of_sketches', table.getn(sketches))
response:addData('available', getFreeDiskSpace())
response:addData('reserved', M.MIN_FREE_SPACE)
response:setSuccess() response:setSuccess()
end end