From 597e940bf193cd98ab59e50eba0919425c6386b3 Mon Sep 17 00:00:00 2001 From: David Escalona Date: Tue, 5 Jul 2022 17:54:54 +0200 Subject: [PATCH] connectcore-demo-example: add mechanism to remove available demo sections While on it, remove multimedia section for the 'ccimx6ulsbc'. Signed-off-by: David Escalona --- connectcore-demo-example/demoserver.py | 14 +++++++- connectcore-demo-example/index.html | 9 ++++-- connectcore-demo-example/management.html | 9 ++++-- connectcore-demo-example/multimedia.html | 9 ++++-- connectcore-demo-example/static/js/common.js | 34 ++++++++++++++++++++ 5 files changed, 65 insertions(+), 10 deletions(-) diff --git a/connectcore-demo-example/demoserver.py b/connectcore-demo-example/demoserver.py index 9f90277..5bf475f 100755 --- a/connectcore-demo-example/demoserver.py +++ b/connectcore-demo-example/demoserver.py @@ -90,7 +90,19 @@ class RequestHandler(http.server.SimpleHTTPRequestHandler): """ Override. """ - if re.search("/ajax/get_device_info", self.path) is not None: + if re.search("/ajax/get_device_type", self.path) is not None: + # Set the response headers. + self._set_headers(200) + + log.debug("Get device info") + + info = { + "device_type": read_proc_file("/proc/device-tree/digi,machine,name") + } + + # Send the JSON value. + self.wfile.write(json.dumps(info).encode(encoding="utf_8")) + elif re.search("/ajax/get_device_info", self.path) is not None: # Set the response headers. self._set_headers(200) diff --git a/connectcore-demo-example/index.html b/connectcore-demo-example/index.html index d239de6..0d2504d 100644 --- a/connectcore-demo-example/index.html +++ b/connectcore-demo-example/index.html @@ -53,7 +53,7 @@ Digi Demo - Dashboard