Loading openflexure_microscope/api/static/main_v1.js +11 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,17 @@ function deleteCapture(capture_id) { } } function deleteAllCaptures() { function deleteAllCapturesCallback(response, status) { console.log(status); getCaptures(); } var r = confirm("Warning! This will delete all copies of all captures from the Raspberry Pi. Click OK to proceed."); if (r == true) { safeRequest("DELETE", baseURI+"/capture/", null, deleteAllCapturesCallback, false) } } function getCaptures() { function updateCapturesCallback(response, status) { console.log(status); Loading openflexure_microscope/api/templates/index_v1.html +1 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ <h2>Captures</h2> <button type="button" onclick="getCaptures();">Update</button> <button type="button" onclick="deleteAllCaptures();">Delete all</button> <div id="captures"></div> </div> Loading openflexure_microscope/api/v1.py +6 −1 Original line number Diff line number Diff line Loading @@ -307,7 +307,12 @@ class CaptureListAPI(MicroscopeView): .. :quickref: Capture collection; Delete all captures """ return jsonify({"error": "not yet implemented"}) for image in self.microscope.camera.images: image.delete() captures = [image.metadata for image in self.microscope.camera.images] return jsonify(captures) def post(self): """ Loading Loading
openflexure_microscope/api/static/main_v1.js +11 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,17 @@ function deleteCapture(capture_id) { } } function deleteAllCaptures() { function deleteAllCapturesCallback(response, status) { console.log(status); getCaptures(); } var r = confirm("Warning! This will delete all copies of all captures from the Raspberry Pi. Click OK to proceed."); if (r == true) { safeRequest("DELETE", baseURI+"/capture/", null, deleteAllCapturesCallback, false) } } function getCaptures() { function updateCapturesCallback(response, status) { console.log(status); Loading
openflexure_microscope/api/templates/index_v1.html +1 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ <h2>Captures</h2> <button type="button" onclick="getCaptures();">Update</button> <button type="button" onclick="deleteAllCaptures();">Delete all</button> <div id="captures"></div> </div> Loading
openflexure_microscope/api/v1.py +6 −1 Original line number Diff line number Diff line Loading @@ -307,7 +307,12 @@ class CaptureListAPI(MicroscopeView): .. :quickref: Capture collection; Delete all captures """ return jsonify({"error": "not yet implemented"}) for image in self.microscope.camera.images: image.delete() captures = [image.metadata for image in self.microscope.camera.images] return jsonify(captures) def post(self): """ Loading