-
Notifications
You must be signed in to change notification settings - Fork 0
/
documentation.py
75 lines (55 loc) · 3.19 KB
/
documentation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import inspect
import importlib_resources
from nicegui import ui, app
from common import *
from functions import *
import steps
class Help(ui.dialog):
def __init__(self) -> None:
super().__init__()
with self, ui.card().classes("w-full place-items-center grow"):
with ui.expansion(
TITLE,
icon="info",
caption="Core to Edge end to end pipeline processing using Ezmeral Data Fabric",
group="help",
).classes("w-full").classes("text-bold"):
ui.markdown(DEMO["description"]).classes("font-normal")
ui.image(importlib_resources.files("main").joinpath(DEMO["image"])).classes(
"object-scale-down g-10"
)
ui.separator()
# Prepare
with ui.expansion("Demo Preparations", icon="engineering", caption="Need to create volumes and streams before demo", group="help").classes("w-full text-bold"):
ui.label("Create the volumes, topics and tables at the HQ cluster.")
ui.code(inspect.getsource(prepare_core)).classes("w-full")
ui.button("Run", on_click=lambda: run_command_with_dialog(prepare_core()))
ui.space()
ui.label("Create the volumes at the Edge cluster.")
ui.code(inspect.getsource(prepare_edge)).classes("w-full")
ui.button("Run", on_click=lambda: run_command_with_dialog(prepare_edge()))
ui.space()
ui.label("We need to establish bi-directional communication between HQ and Edge. Let's first enable the replication of broadcast stream so we can get intelligence data from HQ.")
ui.code(inspect.getsource(stream_replica_setup)).classes("w-full")
ui.button("Run", on_click=lambda:
stream_replica_setup(
hqhost=app.storage.user["HQ_HOST"],
user=app.storage.user["MAPR_USER"],
password=app.storage.user["MAPR_PASS"],
))
ui.separator()
# Demo Flow
with ui.expansion("Demo Flow for HQ", icon="fa-solid fa-gears", caption="Let's start the demo at the HQ Dashboard!", group="help").classes("w-full text-bold"):
for step in steps.FLOW[HQ]:
ui.label(step["title"])
ui.markdown(step["description"])
ui.code(inspect.getsource(step["code"])).classes("w-full")
# ui.button("Run", on_click=lambda: run_command_with_dialog(step["code"]()))
ui.separator()
with ui.expansion("Demo Flow for Edge", icon="fa-solid fa-truck-field", caption="Continue the demo at the Edge Dashboard!", group="help").classes("w-full text-bold"):
for step in steps.FLOW[EDGE]:
ui.label(step["title"])
ui.markdown(step["description"])
ui.code(inspect.getsource(step["code"])).classes("w-full")
# ui.button("Run", on_click=lambda: run_command_with_dialog(step["code"]()))
ui.button('Close', on_click=self.close)