Fixed GUI building
This commit is contained in:
parent
ab08f18ff0
commit
0f16c5c894
1 changed files with 6 additions and 3 deletions
|
|
@ -5,7 +5,7 @@ from openflexure_microscope.common.flask_labthings.decorators import (
|
||||||
ThingProperty,
|
ThingProperty,
|
||||||
)
|
)
|
||||||
|
|
||||||
from openflexure_microscope.api.utilities.gui import expand_routes
|
from openflexure_microscope.api.utilities.gui import build_gui
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
@ -17,6 +17,7 @@ val_int = 0
|
||||||
|
|
||||||
|
|
||||||
def dynamic_form():
|
def dynamic_form():
|
||||||
|
global val_int
|
||||||
return {
|
return {
|
||||||
"id": "test-plugin",
|
"id": "test-plugin",
|
||||||
"icon": "pets",
|
"icon": "pets",
|
||||||
|
|
@ -34,6 +35,7 @@ def dynamic_form():
|
||||||
"name": "val_int",
|
"name": "val_int",
|
||||||
"label": "Number value",
|
"label": "Number value",
|
||||||
"minValue": 0,
|
"minValue": 0,
|
||||||
|
"value": val_int
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldType": "htmlBlock",
|
"fieldType": "htmlBlock",
|
||||||
|
|
@ -64,6 +66,7 @@ static_form = {
|
||||||
"name": "val_int",
|
"name": "val_int",
|
||||||
"label": "Number value",
|
"label": "Number value",
|
||||||
"minValue": 0,
|
"minValue": 0,
|
||||||
|
"default": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldType": "htmlBlock",
|
"fieldType": "htmlBlock",
|
||||||
|
|
@ -102,7 +105,7 @@ dynamic_test_extension_v2.add_view(
|
||||||
)
|
)
|
||||||
|
|
||||||
dynamic_test_extension_v2.add_meta(
|
dynamic_test_extension_v2.add_meta(
|
||||||
"gui", expand_routes(dynamic_form, dynamic_test_extension_v2)
|
"gui", build_gui(dynamic_form, dynamic_test_extension_v2)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -115,5 +118,5 @@ static_test_extension_v2.add_view(
|
||||||
TestDoAPIView, "/do", endpoint="static_test_extension_do"
|
TestDoAPIView, "/do", endpoint="static_test_extension_do"
|
||||||
)
|
)
|
||||||
static_test_extension_v2.add_meta(
|
static_test_extension_v2.add_meta(
|
||||||
"gui", expand_routes(static_form, static_test_extension_v2)
|
"gui", build_gui(static_form, static_test_extension_v2)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue