MCPcopy Index your code
hub / github.com/flet-dev/flet / show_dashboard

Function show_dashboard

sdk/python/examples/community/mind_queue/main.py:110–237  ·  view source on GitHub ↗
(e=None)

Source from the content-addressed store, hash-verified

108 # ---------- Dashboard ----------
109
110 def show_dashboard(e=None):
111 nonlocal current_system
112 current_system = None
113
114 page.appbar = None
115 page.clean()
116
117 title = ft.Row(
118 [ft.Text(APP_NAME, size=32, weight=ft.FontWeight.BOLD)],
119 alignment=ft.MainAxisAlignment.CENTER,
120 )
121
122 systems_list: list[ft.Control] = []
123
124 def open_system(system_name: str):
125 show_system(system_name)
126
127 def open_system_actions(system_name: str):
128 def do_open(e):
129 close_current_dialog()
130 show_system(system_name)
131
132 async def do_clone(e):
133 close_current_dialog()
134 clone_system(system_name)
135 await asyncio.sleep(0)
136 show_dashboard()
137
138 dlg = ft.AlertDialog(
139 modal=True,
140 title=ft.Text(system_name),
141 actions=[
142 # ft.TextButton("Open", on_click=do_open),
143 ft.TextButton(
144 "Clone",
145 icon=ft.Icons.CONTENT_COPY,
146 on_click=do_clone,
147 ),
148 ft.TextButton(
149 "Delete",
150 icon=ft.Icons.DELETE_OUTLINE,
151 icon_color=ft.Colors.RED,
152 disabled=len(data) == 1,
153 on_click=lambda e: confirm_delete_system(system_name),
154 ),
155 ft.TextButton("Cancel", on_click=lambda e: close_current_dialog()),
156 ],
157 actions_alignment=ft.MainAxisAlignment.END,
158 )
159 open_dialog(dlg)
160
161 for system_name in data:
162 gesture = ft.GestureDetector(
163 content=ft.Container(
164 ft.Row(
165 [ft.Text(system_name, size=18, weight=ft.FontWeight.W_600)],
166 ),
167 padding=10,

Callers 5

handle_keyboard_eventFunction · 0.85
delete_systemFunction · 0.85
do_cloneFunction · 0.85
on_addFunction · 0.85
mainFunction · 0.85

Calls 7

open_systemFunction · 0.85
open_system_actionsFunction · 0.85
cleanMethod · 0.80
appendMethod · 0.80
onlyMethod · 0.45
addMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected