(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( |
no test coverage detected