Added example dynamic form
This commit is contained in:
parent
45e7bcb167
commit
1db88548c8
3 changed files with 78 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
from openflexure_microscope.devel import (
|
||||
MicroscopeViewPlugin,
|
||||
JsonResponse,
|
||||
request,
|
||||
jsonify,
|
||||
taskify,
|
||||
)
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
class DoAPI(MicroscopeViewPlugin):
|
||||
"""
|
||||
A dynamic example API plugin
|
||||
"""
|
||||
|
||||
def get(self):
|
||||
values = {"val_int": self.plugin.val_int}
|
||||
return jsonify(values)
|
||||
|
||||
def post(self):
|
||||
self.plugin.val_int += 1
|
||||
|
||||
return jsonify({"response": "completed"})
|
||||
Loading…
Add table
Add a link
Reference in a new issue