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:
parent
628f05b682
commit
0c79a51083
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user