9 Commits

Author SHA1 Message Date
Mose Müller
8b1f1ef1b1 updates to version v0.7.2 2024-03-04 17:46:44 +01:00
Mose Müller
698db4881b Merge pull request #106 from tiqi-group/fix/enum_sio_callback
fixes sio callback when attribute changes to an enum which was not present before
2024-03-04 17:38:33 +01:00
Mose Müller
d709d43d75 ignores complexity of sio_server setup (will be changed anyway soon 2024-03-04 17:36:09 +01:00
Mose Müller
691bf809cb fixes sio callback when attribute changes to an enum which was not present before 2024-03-04 17:32:45 +01:00
Mose Müller
86ccdd77f1 updates to version v0.7.1 2024-03-04 11:52:06 +01:00
Mose Müller
f29fb87054 Merge pull request #105 from tiqi-group/fix/enum_rendering
Fix/enum rendering
2024-03-04 11:51:31 +01:00
Mose Müller
cf5bc1e4e6 npm run build 2024-03-04 11:48:22 +01:00
Mose Müller
af36ed6c43 changes rendering of enums 2024-03-04 11:48:01 +01:00
Mose Müller
853472be94 updates enumValue when backend value changes 2024-03-04 11:47:51 +01:00
9 changed files with 19 additions and 12 deletions

View File

@@ -53,6 +53,9 @@ export const EnumComponent = React.memo((props: EnumComponentProps) => {
});
useEffect(() => {
setEnumValue(() => {
return props.value;
});
addNotification(`${fullAccessPath} changed to ${value}.`);
}, [props.value]);
@@ -70,7 +73,7 @@ export const EnumComponent = React.memo((props: EnumComponentProps) => {
{readOnly ? (
// Display the Form.Control when readOnly is true
<Form.Control value={enumValue} name={name} disabled={true} />
<Form.Control value={enumDict[enumValue]} name={name} disabled={true} />
) : (
// Display the Form.Select when readOnly is false
<Form.Select
@@ -80,7 +83,7 @@ export const EnumComponent = React.memo((props: EnumComponentProps) => {
onChange={(event) => changeCallback(event.target.value)}>
{Object.entries(enumDict).map(([key, val]) => (
<option key={key} value={key}>
{key} - {val}
{val}
</option>
))}
</Form.Select>

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "pydase"
version = "0.7.0"
version = "0.7.2"
description = "A flexible and robust Python library for creating, managing, and interacting with data services, with built-in support for web and RPC servers, and customizable features for diverse use cases."
authors = ["Mose Mueller <mosmuell@ethz.ch>"]
readme = "README.md"

View File

@@ -1,13 +1,13 @@
{
"files": {
"main.css": "/static/css/main.7ef670d5.css",
"main.js": "/static/js/main.ce19efa0.js",
"main.js": "/static/js/main.6d1d080e.js",
"index.html": "/index.html",
"main.7ef670d5.css.map": "/static/css/main.7ef670d5.css.map",
"main.ce19efa0.js.map": "/static/js/main.ce19efa0.js.map"
"main.6d1d080e.js.map": "/static/js/main.6d1d080e.js.map"
},
"entrypoints": [
"static/css/main.7ef670d5.css",
"static/js/main.ce19efa0.js"
"static/js/main.6d1d080e.js"
]
}

View File

@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site displaying a pydase UI."/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>pydase App</title><script defer="defer" src="/static/js/main.ce19efa0.js"></script><link href="/static/css/main.7ef670d5.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site displaying a pydase UI."/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>pydase App</title><script defer="defer" src="/static/js/main.6d1d080e.js"></script><link href="/static/css/main.7ef670d5.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -62,7 +62,7 @@ class RunMethodDict(TypedDict):
kwargs: dict[str, Any]
def setup_sio_server(
def setup_sio_server( # noqa: C901
observer: DataServiceObserver,
enable_cors: bool,
loop: asyncio.AbstractEventLoop,
@@ -103,6 +103,10 @@ def setup_sio_server(
cached_value_dict["value"] = serialized_value["value"]
# Check if the serialized value contains an "enum" key, and if so, copy it
if "enum" in serialized_value:
cached_value_dict["enum"] = serialized_value["enum"]
async def notify() -> None:
try:
await sio.emit(